aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/macsonic.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/macsonic.c')
-rw-r--r--drivers/net/macsonic.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/net/macsonic.c b/drivers/net/macsonic.c
index 9ef4592aca03..02d5c6822733 100644
--- a/drivers/net/macsonic.c
+++ b/drivers/net/macsonic.c
@@ -525,7 +525,7 @@ int __init mac_nubus_sonic_probe(struct net_device* dev)
525 return macsonic_init(dev); 525 return macsonic_init(dev);
526} 526}
527 527
528static int __init mac_sonic_probe(struct device *device) 528static int __init mac_sonic_probe(struct platform_device *device)
529{ 529{
530 struct net_device *dev; 530 struct net_device *dev;
531 struct sonic_local *lp; 531 struct sonic_local *lp;
@@ -537,8 +537,8 @@ static int __init mac_sonic_probe(struct device *device)
537 return -ENOMEM; 537 return -ENOMEM;
538 538
539 lp = netdev_priv(dev); 539 lp = netdev_priv(dev);
540 lp->device = device; 540 lp->device = &device->dev;
541 SET_NETDEV_DEV(dev, device); 541 SET_NETDEV_DEV(dev, &device->dev);
542 SET_MODULE_OWNER(dev); 542 SET_MODULE_OWNER(dev);
543 543
544 /* This will catch fatal stuff like -ENOMEM as well as success */ 544 /* This will catch fatal stuff like -ENOMEM as well as success */
@@ -579,9 +579,9 @@ MODULE_PARM_DESC(sonic_debug, "macsonic debug level (1-4)");
579 579
580#include "sonic.c" 580#include "sonic.c"
581 581
582static int __devexit mac_sonic_device_remove (struct device *device) 582static int __devexit mac_sonic_device_remove (struct platform_device *device)
583{ 583{
584 struct net_device *dev = device->driver_data; 584 struct net_device *dev = platform_get_drvdata(device);
585 struct sonic_local* lp = netdev_priv(dev); 585 struct sonic_local* lp = netdev_priv(dev);
586 586
587 unregister_netdev (dev); 587 unregister_netdev (dev);
@@ -592,18 +592,19 @@ static int __devexit mac_sonic_device_remove (struct device *device)
592 return 0; 592 return 0;
593} 593}
594 594
595static struct device_driver mac_sonic_driver = { 595static struct platform_driver mac_sonic_driver = {
596 .name = mac_sonic_string,
597 .bus = &platform_bus_type,
598 .probe = mac_sonic_probe, 596 .probe = mac_sonic_probe,
599 .remove = __devexit_p(mac_sonic_device_remove), 597 .remove = __devexit_p(mac_sonic_device_remove),
598 .driver = {
599 .name = mac_sonic_string,
600 },
600}; 601};
601 602
602static int __init mac_sonic_init_module(void) 603static int __init mac_sonic_init_module(void)
603{ 604{
604 int err; 605 int err;
605 606
606 if ((err = driver_register(&mac_sonic_driver))) { 607 if ((err = platform_driver_register(&mac_sonic_driver))) {
607 printk(KERN_ERR "Driver registration failed\n"); 608 printk(KERN_ERR "Driver registration failed\n");
608 return err; 609 return err;
609 } 610 }
@@ -628,7 +629,7 @@ out_unregister:
628 629
629static void __exit mac_sonic_cleanup_module(void) 630static void __exit mac_sonic_cleanup_module(void)
630{ 631{
631 driver_unregister(&mac_sonic_driver); 632 platform_driver_unregister(&mac_sonic_driver);
632 633
633 if (mac_sonic_device) { 634 if (mac_sonic_device) {
634 platform_device_unregister(mac_sonic_device); 635 platform_device_unregister(mac_sonic_device);