aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/macmace.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-02-28 22:23:06 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-28 22:23:06 -0500
commit47871889c601d8199c51a4086f77eebd77c29b0b (patch)
tree40cdcac3bff0ee40cc33dcca61d0577cdf965f77 /drivers/net/macmace.c
parentc16cc0b464b8876cfd57ce1c1dbcb6f9a6a0bce3 (diff)
parent30ff056c42c665b9ea535d8515890857ae382540 (diff)
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Conflicts: drivers/firmware/iscsi_ibft.c
Diffstat (limited to 'drivers/net/macmace.c')
-rw-r--r--drivers/net/macmace.c33
1 files changed, 4 insertions, 29 deletions
diff --git a/drivers/net/macmace.c b/drivers/net/macmace.c
index 4e4eac0ba176..13ba8f4afb7e 100644
--- a/drivers/net/macmace.c
+++ b/drivers/net/macmace.c
@@ -39,7 +39,6 @@
39#include "mace.h" 39#include "mace.h"
40 40
41static char mac_mace_string[] = "macmace"; 41static char mac_mace_string[] = "macmace";
42static struct platform_device *mac_mace_device;
43 42
44#define N_TX_BUFF_ORDER 0 43#define N_TX_BUFF_ORDER 0
45#define N_TX_RING (1 << N_TX_BUFF_ORDER) 44#define N_TX_RING (1 << N_TX_BUFF_ORDER)
@@ -752,6 +751,7 @@ static irqreturn_t mace_dma_intr(int irq, void *dev_id)
752 751
753MODULE_LICENSE("GPL"); 752MODULE_LICENSE("GPL");
754MODULE_DESCRIPTION("Macintosh MACE ethernet driver"); 753MODULE_DESCRIPTION("Macintosh MACE ethernet driver");
754MODULE_ALIAS("platform:macmace");
755 755
756static int __devexit mac_mace_device_remove (struct platform_device *pdev) 756static int __devexit mac_mace_device_remove (struct platform_device *pdev)
757{ 757{
@@ -777,47 +777,22 @@ static struct platform_driver mac_mace_driver = {
777 .probe = mace_probe, 777 .probe = mace_probe,
778 .remove = __devexit_p(mac_mace_device_remove), 778 .remove = __devexit_p(mac_mace_device_remove),
779 .driver = { 779 .driver = {
780 .name = mac_mace_string, 780 .name = mac_mace_string,
781 .owner = THIS_MODULE,
781 }, 782 },
782}; 783};
783 784
784static int __init mac_mace_init_module(void) 785static int __init mac_mace_init_module(void)
785{ 786{
786 int err;
787
788 if (!MACH_IS_MAC) 787 if (!MACH_IS_MAC)
789 return -ENODEV; 788 return -ENODEV;
790 789
791 if ((err = platform_driver_register(&mac_mace_driver))) { 790 return platform_driver_register(&mac_mace_driver);
792 printk(KERN_ERR "Driver registration failed\n");
793 return err;
794 }
795
796 mac_mace_device = platform_device_alloc(mac_mace_string, 0);
797 if (!mac_mace_device)
798 goto out_unregister;
799
800 if (platform_device_add(mac_mace_device)) {
801 platform_device_put(mac_mace_device);
802 mac_mace_device = NULL;
803 }
804
805 return 0;
806
807out_unregister:
808 platform_driver_unregister(&mac_mace_driver);
809
810 return -ENOMEM;
811} 791}
812 792
813static void __exit mac_mace_cleanup_module(void) 793static void __exit mac_mace_cleanup_module(void)
814{ 794{
815 platform_driver_unregister(&mac_mace_driver); 795 platform_driver_unregister(&mac_mace_driver);
816
817 if (mac_mace_device) {
818 platform_device_unregister(mac_mace_device);
819 mac_mace_device = NULL;
820 }
821} 796}
822 797
823module_init(mac_mace_init_module); 798module_init(mac_mace_init_module);