xtsonic: add missing platform_set_drvdata() in xtsonic_probe()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 11 Nov 2013 06:17:17 +0000 (14:17 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 11 Nov 2013 19:02:08 +0000 (14:02 -0500)
Add missing platform_set_drvdata() in xtsonic_probe(), otherwise
calling platform_get_drvdata() in xtsonic_device_remove() may
returns NULL.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/natsemi/xtsonic.c

index 4da172ac55991bd69b50037501c3fc886728dc08..7007d212f3e4ef6c574fb4d39b59f349d85bc3e7 100644 (file)
@@ -264,6 +264,7 @@ int xtsonic_probe(struct platform_device *pdev)
 
        lp = netdev_priv(dev);
        lp->device = &pdev->dev;
+       platform_set_drvdata(pdev, dev);
        SET_NETDEV_DEV(dev, &pdev->dev);
        netdev_boot_setup_check(dev);