Skip to content

Commit 417c804

Browse files
committed
Merge branch 'hns-fixes'
Peng Li says: ==================== net: hns: code optimizations & bugfixes for HNS driver This patchset includes bugfixes and code optimizations for the HNS ethernet controller driver ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 3da15ad + cec8abb commit 417c804

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

drivers/net/ethernet/hisilicon/hns/hns_enet.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2418,6 +2418,8 @@ static int hns_nic_dev_probe(struct platform_device *pdev)
24182418
out_notify_fail:
24192419
(void)cancel_work_sync(&priv->service_task);
24202420
out_read_prop_fail:
2421+
/* safe for ACPI FW */
2422+
of_node_put(to_of_node(priv->fwnode));
24212423
free_netdev(ndev);
24222424
return ret;
24232425
}
@@ -2447,6 +2449,9 @@ static int hns_nic_dev_remove(struct platform_device *pdev)
24472449
set_bit(NIC_STATE_REMOVING, &priv->state);
24482450
(void)cancel_work_sync(&priv->service_task);
24492451

2452+
/* safe for ACPI FW */
2453+
of_node_put(to_of_node(priv->fwnode));
2454+
24502455
free_netdev(ndev);
24512456
return 0;
24522457
}

drivers/net/ethernet/hisilicon/hns/hns_ethtool.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,16 +1157,18 @@ static int hns_get_regs_len(struct net_device *net_dev)
11571157
*/
11581158
static int hns_nic_nway_reset(struct net_device *netdev)
11591159
{
1160-
int ret = 0;
11611160
struct phy_device *phy = netdev->phydev;
11621161

1163-
if (netif_running(netdev)) {
1164-
/* if autoneg is disabled, don't restart auto-negotiation */
1165-
if (phy && phy->autoneg == AUTONEG_ENABLE)
1166-
ret = genphy_restart_aneg(phy);
1167-
}
1162+
if (!netif_running(netdev))
1163+
return 0;
11681164

1169-
return ret;
1165+
if (!phy)
1166+
return -EOPNOTSUPP;
1167+
1168+
if (phy->autoneg != AUTONEG_ENABLE)
1169+
return -EINVAL;
1170+
1171+
return genphy_restart_aneg(phy);
11701172
}
11711173

11721174
static u32

drivers/net/ethernet/hisilicon/hns_mdio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ static int hns_mdio_read(struct mii_bus *bus, int phy_id, int regnum)
321321
}
322322

323323
hns_mdio_cmd_write(mdio_dev, is_c45,
324-
MDIO_C45_WRITE_ADDR, phy_id, devad);
324+
MDIO_C45_READ, phy_id, devad);
325325
}
326326

327327
/* Step 5: waitting for MDIO_COMMAND_REG 's mdio_start==0,*/

0 commit comments

Comments
 (0)