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 d12106b47bf2a6cbd9130c9f5840a4322108f5d2..2f286091394d3241bc0bff2cef271ee79c141c00 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 8f492c7b8093aa4478e0549f7122419c9d2da8c6..61eabcac734cdbce1de299924867858740a92ac3 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);