aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/macsonic.c
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2007-05-01 16:33:02 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-04 20:59:08 -0400
commitd74472f0b2553e59eafb7feee0ff9558136a17e0 (patch)
tree38d85faf098e7c5b1e41dc23ea6c9044f8ae3e91 /drivers/net/macsonic.c
parent8b6aaab8c8bdbe011aac79af218dd1e657984bab (diff)
SONIC: small fix and cleanup
Fix a potential problem in the timeout handling: don't free the DMA buffers before resetting the chip. Also a trivial cleanup. Bring macsonic and jazzsonic into sync. Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/net/macsonic.c')
-rw-r--r--drivers/net/macsonic.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/net/macsonic.c b/drivers/net/macsonic.c
index a3d24a39b5f1..c78a7e2e8ba8 100644
--- a/drivers/net/macsonic.c
+++ b/drivers/net/macsonic.c
@@ -522,7 +522,7 @@ int __init mac_nubus_sonic_probe(struct net_device* dev)
522 return macsonic_init(dev); 522 return macsonic_init(dev);
523} 523}
524 524
525static int __init mac_sonic_probe(struct platform_device *device) 525static int __init mac_sonic_probe(struct platform_device *pdev)
526{ 526{
527 struct net_device *dev; 527 struct net_device *dev;
528 struct sonic_local *lp; 528 struct sonic_local *lp;
@@ -534,8 +534,8 @@ static int __init mac_sonic_probe(struct platform_device *device)
534 return -ENOMEM; 534 return -ENOMEM;
535 535
536 lp = netdev_priv(dev); 536 lp = netdev_priv(dev);
537 lp->device = &device->dev; 537 lp->device = &pdev->dev;
538 SET_NETDEV_DEV(dev, &device->dev); 538 SET_NETDEV_DEV(dev, &pdev->dev);
539 SET_MODULE_OWNER(dev); 539 SET_MODULE_OWNER(dev);
540 540
541 /* This will catch fatal stuff like -ENOMEM as well as success */ 541 /* This will catch fatal stuff like -ENOMEM as well as success */
@@ -576,15 +576,15 @@ MODULE_PARM_DESC(sonic_debug, "macsonic debug level (1-4)");
576 576
577#include "sonic.c" 577#include "sonic.c"
578 578
579static int __devexit mac_sonic_device_remove (struct platform_device *device) 579static int __devexit mac_sonic_device_remove (struct platform_device *pdev)
580{ 580{
581 struct net_device *dev = platform_get_drvdata(device); 581 struct net_device *dev = platform_get_drvdata(pdev);
582 struct sonic_local* lp = netdev_priv(dev); 582 struct sonic_local* lp = netdev_priv(dev);
583 583
584 unregister_netdev (dev); 584 unregister_netdev(dev);
585 dma_free_coherent(lp->device, SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode), 585 dma_free_coherent(lp->device, SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode),
586 lp->descriptors, lp->descriptors_laddr); 586 lp->descriptors, lp->descriptors_laddr);
587 free_netdev (dev); 587 free_netdev(dev);
588 588
589 return 0; 589 return 0;
590} 590}
@@ -607,9 +607,8 @@ static int __init mac_sonic_init_module(void)
607 } 607 }
608 608
609 mac_sonic_device = platform_device_alloc(mac_sonic_string, 0); 609 mac_sonic_device = platform_device_alloc(mac_sonic_string, 0);
610 if (!mac_sonic_device) { 610 if (!mac_sonic_device)
611 goto out_unregister; 611 goto out_unregister;
612 }
613 612
614 if (platform_device_add(mac_sonic_device)) { 613 if (platform_device_add(mac_sonic_device)) {
615 platform_device_put(mac_sonic_device); 614 platform_device_put(mac_sonic_device);