diff options
Diffstat (limited to 'target')
-rw-r--r-- | target/linux/generic/files/drivers/net/phy/rtl8306.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8306.c b/target/linux/generic/files/drivers/net/phy/rtl8306.c index 7c70109e63..7bbac40617 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8306.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8306.c @@ -592,8 +592,12 @@ rtl_get_port_link(struct switch_dev *dev, int port, struct switch_port_link *lin if (port >= RTL8306_NUM_PORTS) return -EINVAL; + /* in case the link changes from down to up, the register is only updated on read */ link->link = rtl_get(dev, RTL_PORT_REG(port, LINK)); if (!link->link) + link->link = rtl_get(dev, RTL_PORT_REG(port, LINK)); + + if (!link->link) return 0; link->duplex = rtl_get(dev, RTL_PORT_REG(port, DUPLEX)); |