From eeb9c182a6ad8bc130377adb0a4cd7b95dd15f49 Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Wed, 4 Nov 2009 00:42:02 +1100 Subject: mac68k: move macsonic and macmace platform devices Move platform device code from the drivers to the platform init function. Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven --- drivers/net/macmace.c | 33 ++++----------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) (limited to 'drivers/net/macmace.c') 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 @@ #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); -- cgit v1.2.2