smsc911x: Do not use netdev_dbg() when device is not registered
authorFabio Estevam <fabio.estevam@freescale.com>
Mon, 24 Mar 2014 15:57:25 +0000 (12:57 -0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 26 Mar 2014 19:46:15 +0000 (15:46 -0400)
With debug enabled we get the following message:

smsc911x smsc911x (unregistered net_device): couldn't get clock -2

As the device has not been registered at this point, it is better to use
dev_dbg() instead of netdev_dbg().

CC: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Suggested-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/smsc/smsc911x.c

index ed36ff48af574810acb3ff6c659b9d9baa4e573c..13b21b8855f1ca25da3f3e77a687cea892dd874b 100644 (file)
@@ -439,7 +439,8 @@ static int smsc911x_request_resources(struct platform_device *pdev)
        /* Request clock */
        pdata->clk = clk_get(&pdev->dev, NULL);
        if (IS_ERR(pdata->clk))
-               netdev_dbg(ndev, "couldn't get clock %li\n", PTR_ERR(pdata->clk));
+               dev_dbg(&pdev->dev, "couldn't get clock %li\n",
+                       PTR_ERR(pdata->clk));
 
        return ret;
 }