macsonic, jazzsonic: fix oops on module unload
authorFinn Thain <fthain@telegraphics.com.au>
Tue, 21 Jul 2009 19:21:49 +0000 (12:21 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Jul 2009 19:21:49 +0000 (12:21 -0700)
Set the driver data before using it. Fixes an oops when doing rmmod.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/jazzsonic.c
drivers/net/macsonic.c

index d12106b..2f28609 100644 (file)
@@ -229,6 +229,7 @@ static int __init jazz_sonic_probe(struct platform_device *pdev)
        lp = netdev_priv(dev);
        lp->device = &pdev->dev;
        SET_NETDEV_DEV(dev, &pdev->dev);
+       platform_set_drvdata(pdev, dev);
 
        netdev_boot_setup_check(dev);
 
index 8f492c7..61eabca 100644 (file)
@@ -575,6 +575,7 @@ static int __devinit mac_sonic_probe(struct platform_device *pdev)
        lp = netdev_priv(dev);
        lp->device = &pdev->dev;
        SET_NETDEV_DEV(dev, &pdev->dev);
+       platform_set_drvdata(pdev, dev);
 
        /* This will catch fatal stuff like -ENOMEM as well as success */
        err = mac_onboard_sonic_probe(dev);