Commit 4564cba7 authored by Finn Thain's avatar Finn Thain Committed by David S. Miller

macsonic, jazzsonic: fix oops on module unload

Set the driver data before using it. Fixes an oops when doing rmmod.
Signed-off-by: default avatarFinn Thain <fthain@telegraphics.com.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 25177476
...@@ -229,6 +229,7 @@ static int __init jazz_sonic_probe(struct platform_device *pdev) ...@@ -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);
......
...@@ -575,6 +575,7 @@ static int __devinit mac_sonic_probe(struct platform_device *pdev) ...@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment