diff options
author | Dongpo Li <lidongpo@hisilicon.com> | 2016-12-12 20:03:43 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-12-16 13:29:35 -0500 |
commit | 8cd1f70f205a1c684037f06906566ddb3066d659 (patch) | |
tree | 4be808deee2e6c332c049996ba73b8e1225cd484 /drivers/net/ethernet/hisilicon/hip04_eth.c | |
parent | 2087d421a5a1af4883e3cf0afb93823b7e12132a (diff) | |
download | linux-stable-8cd1f70f205a1c684037f06906566ddb3066d659.tar.gz linux-stable-8cd1f70f205a1c684037f06906566ddb3066d659.tar.bz2 linux-stable-8cd1f70f205a1c684037f06906566ddb3066d659.zip |
net: ethernet: hip04: Call SET_NETDEV_DEV()
The hip04 driver calls into PHYLIB which now checks for
net_device->dev.parent, so make sure we do set it before calling into
any MDIO/PHYLIB related function.
Fixes: ec988ad78ed6 ("phy: Don't increment MDIO bus refcount unless it's a different owner")
Signed-off-by: Dongpo Li <lidongpo@hisilicon.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hip04_eth.c')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hip04_eth.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/hisilicon/hip04_eth.c b/drivers/net/ethernet/hisilicon/hip04_eth.c index 854befde0a08..97b184774784 100644 --- a/drivers/net/ethernet/hisilicon/hip04_eth.c +++ b/drivers/net/ethernet/hisilicon/hip04_eth.c @@ -828,6 +828,7 @@ static int hip04_mac_probe(struct platform_device *pdev) priv = netdev_priv(ndev); priv->ndev = ndev; platform_set_drvdata(pdev, ndev); + SET_NETDEV_DEV(ndev, &pdev->dev); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); priv->base = devm_ioremap_resource(d, res); @@ -903,7 +904,6 @@ static int hip04_mac_probe(struct platform_device *pdev) ndev->priv_flags |= IFF_UNICAST_FLT; ndev->irq = irq; netif_napi_add(ndev, &priv->napi, hip04_rx_poll, NAPI_POLL_WEIGHT); - SET_NETDEV_DEV(ndev, &pdev->dev); hip04_reset_ppe(priv); if (priv->phy_mode == PHY_INTERFACE_MODE_MII) |