diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-08-12 18:49:00 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-08-12 18:49:00 +0200 |
commit | 38343be0bf9a7d7ef0d160da5f2db887a0e29b62 (patch) | |
tree | 81ee2ffc1ef64cc9c7757d65d32242d5a6b05911 /drivers/net/usb/sr9700.c | |
parent | 25f51b76f90f10f9bf2fbc05fc51cf685da7ccad (diff) | |
parent | 7c626ce4bae1ac14f60076d00eafe71af30450ba (diff) |
Merge 6.11-rc3 into usb-next
We need the usb fixes in here as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/usb/sr9700.c')
-rw-r--r-- | drivers/net/usb/sr9700.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/usb/sr9700.c b/drivers/net/usb/sr9700.c index 0a662e42ed96..cb7d2f798fb4 100644 --- a/drivers/net/usb/sr9700.c +++ b/drivers/net/usb/sr9700.c @@ -179,6 +179,7 @@ static int sr_mdio_read(struct net_device *netdev, int phy_id, int loc) struct usbnet *dev = netdev_priv(netdev); __le16 res; int rc = 0; + int err; if (phy_id) { netdev_dbg(netdev, "Only internal phy supported\n"); @@ -189,11 +190,17 @@ static int sr_mdio_read(struct net_device *netdev, int phy_id, int loc) if (loc == MII_BMSR) { u8 value; - sr_read_reg(dev, SR_NSR, &value); + err = sr_read_reg(dev, SR_NSR, &value); + if (err < 0) + return err; + if (value & NSR_LINKST) rc = 1; } - sr_share_read_word(dev, 1, loc, &res); + err = sr_share_read_word(dev, 1, loc, &res); + if (err < 0) + return err; + if (rc == 1) res = le16_to_cpu(res) | BMSR_LSTATUS; else |