提交 8cd1f70f 编写于 作者: D Dongpo Li 提交者: David S. Miller

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: ec988ad7 ("phy: Don't increment MDIO bus refcount unless it's a different owner")
Signed-off-by: NDongpo Li <lidongpo@hisilicon.com>
Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 2087d421
...@@ -828,6 +828,7 @@ static int hip04_mac_probe(struct platform_device *pdev) ...@@ -828,6 +828,7 @@ static int hip04_mac_probe(struct platform_device *pdev)
priv = netdev_priv(ndev); priv = netdev_priv(ndev);
priv->ndev = ndev; priv->ndev = ndev;
platform_set_drvdata(pdev, ndev); platform_set_drvdata(pdev, ndev);
SET_NETDEV_DEV(ndev, &pdev->dev);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
priv->base = devm_ioremap_resource(d, res); priv->base = devm_ioremap_resource(d, res);
...@@ -903,7 +904,6 @@ static int hip04_mac_probe(struct platform_device *pdev) ...@@ -903,7 +904,6 @@ static int hip04_mac_probe(struct platform_device *pdev)
ndev->priv_flags |= IFF_UNICAST_FLT; ndev->priv_flags |= IFF_UNICAST_FLT;
ndev->irq = irq; ndev->irq = irq;
netif_napi_add(ndev, &priv->napi, hip04_rx_poll, NAPI_POLL_WEIGHT); netif_napi_add(ndev, &priv->napi, hip04_rx_poll, NAPI_POLL_WEIGHT);
SET_NETDEV_DEV(ndev, &pdev->dev);
hip04_reset_ppe(priv); hip04_reset_ppe(priv);
if (priv->phy_mode == PHY_INTERFACE_MODE_MII) if (priv->phy_mode == PHY_INTERFACE_MODE_MII)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册