X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fnet%2Fmacmace.c;h=13ba8f4afb7e6712f34bca4203e1f5e36b058373;hb=47871889c601d8199c51a4086f77eebd77c29b0b;hp=4e4eac0ba1763577c075005aac9aebee118c6f4f;hpb=c16cc0b464b8876cfd57ce1c1dbcb6f9a6a0bce3;p=safe%2Fjmp%2Flinux-2.6 diff --git a/drivers/net/macmace.c b/drivers/net/macmace.c index 4e4eac0..13ba8f4 100644 --- a/drivers/net/macmace.c +++ b/drivers/net/macmace.c @@ -39,7 +39,6 @@ #include "mace.h" static char mac_mace_string[] = "macmace"; -static struct platform_device *mac_mace_device; #define N_TX_BUFF_ORDER 0 #define N_TX_RING (1 << N_TX_BUFF_ORDER) @@ -752,6 +751,7 @@ static irqreturn_t mace_dma_intr(int irq, void *dev_id) MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Macintosh MACE ethernet driver"); +MODULE_ALIAS("platform:macmace"); static int __devexit mac_mace_device_remove (struct platform_device *pdev) { @@ -777,47 +777,22 @@ static struct platform_driver mac_mace_driver = { .probe = mace_probe, .remove = __devexit_p(mac_mace_device_remove), .driver = { - .name = mac_mace_string, + .name = mac_mace_string, + .owner = THIS_MODULE, }, }; static int __init mac_mace_init_module(void) { - int err; - if (!MACH_IS_MAC) return -ENODEV; - if ((err = platform_driver_register(&mac_mace_driver))) { - printk(KERN_ERR "Driver registration failed\n"); - return err; - } - - mac_mace_device = platform_device_alloc(mac_mace_string, 0); - if (!mac_mace_device) - goto out_unregister; - - if (platform_device_add(mac_mace_device)) { - platform_device_put(mac_mace_device); - mac_mace_device = NULL; - } - - return 0; - -out_unregister: - platform_driver_unregister(&mac_mace_driver); - - return -ENOMEM; + return platform_driver_register(&mac_mace_driver); } static void __exit mac_mace_cleanup_module(void) { platform_driver_unregister(&mac_mace_driver); - - if (mac_mace_device) { - platform_device_unregister(mac_mace_device); - mac_mace_device = NULL; - } } module_init(mac_mace_init_module);