atl1e: checking the status of atl1e_write_phy_reg
authorKangjie Lu <kjlu@umn.edu>
Wed, 26 Dec 2018 04:23:19 +0000 (22:23 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 14:37:50 +0000 (15:37 +0100)
[ Upstream commit ff07d48d7bc0974d4f96a85a4df14564fb09f1ef ]

atl1e_write_phy_reg() could fail. The fix issues an error message when
it fails.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/atheros/atl1e/atl1e_main.c

index 4f7e195af0bc6dff79687547b9979375b35a17d6..0d08039981b54faeec520a36ae71714016cf3664 100644 (file)
@@ -472,7 +472,9 @@ static void atl1e_mdio_write(struct net_device *netdev, int phy_id,
 {
        struct atl1e_adapter *adapter = netdev_priv(netdev);
 
-       atl1e_write_phy_reg(&adapter->hw, reg_num & MDIO_REG_ADDR_MASK, val);
+       if (atl1e_write_phy_reg(&adapter->hw,
+                               reg_num & MDIO_REG_ADDR_MASK, val))
+               netdev_err(netdev, "write phy register failed\n");
 }
 
 static int atl1e_mii_ioctl(struct net_device *netdev,