]> git.baikalelectronics.ru Git - kernel.git/commitdiff
sh_eth: Use platform device for printing before register_netdev()
authorGeert Uytterhoeven <geert+renesas@glider.be>
Thu, 18 May 2017 13:01:34 +0000 (15:01 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 May 2017 15:21:07 +0000 (11:21 -0400)
The MDIO initialization failure message is printed using the network
device, before it has been registered, leading to:

     (null): failed to initialise MDIO

Use the platform device instead to fix this:

    sh-eth ee700000.ethernet: failed to initialise MDIO

Fixes: abb233ca743d587d ("sh_eth: Register MDIO bus before registering the network device")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/renesas/sh_eth.c

index f68c4db656eda84691b411cee940528a01a2bb62..c85222b02754f5a701f6bab92b765136f10b7a44 100644 (file)
@@ -3220,7 +3220,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
        /* MDIO bus init */
        ret = sh_mdio_init(mdp, pd);
        if (ret) {
-               dev_err(&ndev->dev, "failed to initialise MDIO\n");
+               dev_err(&pdev->dev, "failed to initialise MDIO\n");
                goto out_release;
        }