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>
This commit is contained in:
Finn Thain 2009-07-21 12:21:49 -07:00 committed by David S. Miller
parent 2517747667
commit 4564cba716
2 changed files with 2 additions and 0 deletions

View File

@ -229,6 +229,7 @@ static int __init jazz_sonic_probe(struct platform_device *pdev)
lp = netdev_priv(dev); lp = netdev_priv(dev);
lp->device = &pdev->dev; lp->device = &pdev->dev;
SET_NETDEV_DEV(dev, &pdev->dev); SET_NETDEV_DEV(dev, &pdev->dev);
platform_set_drvdata(pdev, dev);
netdev_boot_setup_check(dev); netdev_boot_setup_check(dev);

View File

@ -575,6 +575,7 @@ static int __devinit mac_sonic_probe(struct platform_device *pdev)
lp = netdev_priv(dev); lp = netdev_priv(dev);
lp->device = &pdev->dev; lp->device = &pdev->dev;
SET_NETDEV_DEV(dev, &pdev->dev); SET_NETDEV_DEV(dev, &pdev->dev);
platform_set_drvdata(pdev, dev);
/* This will catch fatal stuff like -ENOMEM as well as success */ /* This will catch fatal stuff like -ENOMEM as well as success */
err = mac_onboard_sonic_probe(dev); err = mac_onboard_sonic_probe(dev);