aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2009-07-21 15:21:49 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-21 15:21:49 -0400
commit4564cba71637d3b4ea3730f5637b21a9eb3c8999 (patch)
tree1b33d48ab32e9b69c850e250eef27620c513c8a7 /drivers/net
parent25177476675142d3ebd60849e0cebc46bd1eef8e (diff)
macsonic, jazzsonic: fix oops on module unload
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>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/jazzsonic.c1
-rw-r--r--drivers/net/macsonic.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/jazzsonic.c b/drivers/net/jazzsonic.c
index d12106b47bf..2f286091394 100644
--- a/drivers/net/jazzsonic.c
+++ b/drivers/net/jazzsonic.c
@@ -229,6 +229,7 @@ static int __init jazz_sonic_probe(struct platform_device *pdev)
229 lp = netdev_priv(dev); 229 lp = netdev_priv(dev);
230 lp->device = &pdev->dev; 230 lp->device = &pdev->dev;
231 SET_NETDEV_DEV(dev, &pdev->dev); 231 SET_NETDEV_DEV(dev, &pdev->dev);
232 platform_set_drvdata(pdev, dev);
232 233
233 netdev_boot_setup_check(dev); 234 netdev_boot_setup_check(dev);
234 235
diff --git a/drivers/net/macsonic.c b/drivers/net/macsonic.c
index 8f492c7b809..61eabcac734 100644
--- a/drivers/net/macsonic.c
+++ b/drivers/net/macsonic.c
@@ -575,6 +575,7 @@ static int __devinit mac_sonic_probe(struct platform_device *pdev)
575 lp = netdev_priv(dev); 575 lp = netdev_priv(dev);
576 lp->device = &pdev->dev; 576 lp->device = &pdev->dev;
577 SET_NETDEV_DEV(dev, &pdev->dev); 577 SET_NETDEV_DEV(dev, &pdev->dev);
578 platform_set_drvdata(pdev, dev);
578 579
579 /* This will catch fatal stuff like -ENOMEM as well as success */ 580 /* This will catch fatal stuff like -ENOMEM as well as success */
580 err = mac_onboard_sonic_probe(dev); 581 err = mac_onboard_sonic_probe(dev);