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:
parent
2517747667
commit
4564cba716
2 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue