diff options
Diffstat (limited to 'drivers/net/macmace.c')
-rw-r--r-- | drivers/net/macmace.c | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/drivers/net/macmace.c b/drivers/net/macmace.c index 44f3c2896f20..79408c377875 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 | ||
41 | static char mac_mace_string[] = "macmace"; | 41 | static char mac_mace_string[] = "macmace"; |
42 | static 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 | ||
753 | MODULE_LICENSE("GPL"); | 752 | MODULE_LICENSE("GPL"); |
754 | MODULE_DESCRIPTION("Macintosh MACE ethernet driver"); | 753 | MODULE_DESCRIPTION("Macintosh MACE ethernet driver"); |
754 | MODULE_ALIAS("platform:macmace"); | ||
755 | 755 | ||
756 | static int __devexit mac_mace_device_remove (struct platform_device *pdev) | 756 | static 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 | ||
784 | static int __init mac_mace_init_module(void) | 785 | static 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 | |||
807 | out_unregister: | ||
808 | platform_driver_unregister(&mac_mace_driver); | ||
809 | |||
810 | return -ENOMEM; | ||
811 | } | 791 | } |
812 | 792 | ||
813 | static void __exit mac_mace_cleanup_module(void) | 793 | static 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 | ||
823 | module_init(mac_mace_init_module); | 798 | module_init(mac_mace_init_module); |