summaryrefslogtreecommitdiffstats
path: root/drivers/net/macsonic.c
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2009-11-03 14:42:02 +0100
committerGeert Uytterhoeven <geert@linux-m68k.org>2010-02-27 18:31:11 +0100
commiteeb9c182a6ad8bc130377adb0a4cd7b95dd15f49 (patch)
treecf891a3d1dadbb867966aa3b7b1a5be58ac4155b /drivers/net/macsonic.c
parentmac68k: move mac_esp platform device (diff)
downloadlinux-eeb9c182a6ad8bc130377adb0a4cd7b95dd15f49.tar.xz
linux-eeb9c182a6ad8bc130377adb0a4cd7b95dd15f49.zip
mac68k: move macsonic and macmace platform devices
Move platform device code from the drivers to the platform init function. Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to '')
-rw-r--r--drivers/net/macsonic.c33
1 files changed, 4 insertions, 29 deletions
diff --git a/drivers/net/macsonic.c b/drivers/net/macsonic.c
index 875d361fb79d..24109c288108 100644
--- a/drivers/net/macsonic.c
+++ b/drivers/net/macsonic.c
@@ -62,7 +62,6 @@
#include <asm/mac_via.h>
static char mac_sonic_string[] = "macsonic";
-static struct platform_device *mac_sonic_device;
#include "sonic.h"
@@ -607,6 +606,7 @@ out:
MODULE_DESCRIPTION("Macintosh SONIC ethernet driver");
module_param(sonic_debug, int, 0);
MODULE_PARM_DESC(sonic_debug, "macsonic debug level (1-4)");
+MODULE_ALIAS("platform:macsonic");
#include "sonic.c"
@@ -627,44 +627,19 @@ static struct platform_driver mac_sonic_driver = {
.probe = mac_sonic_probe,
.remove = __devexit_p(mac_sonic_device_remove),
.driver = {
- .name = mac_sonic_string,
+ .name = mac_sonic_string,
+ .owner = THIS_MODULE,
},
};
static int __init mac_sonic_init_module(void)
{
- int err;
-
- if ((err = platform_driver_register(&mac_sonic_driver))) {
- printk(KERN_ERR "Driver registration failed\n");
- return err;
- }
-
- mac_sonic_device = platform_device_alloc(mac_sonic_string, 0);
- if (!mac_sonic_device)
- goto out_unregister;
-
- if (platform_device_add(mac_sonic_device)) {
- platform_device_put(mac_sonic_device);
- mac_sonic_device = NULL;
- }
-
- return 0;
-
-out_unregister:
- platform_driver_unregister(&mac_sonic_driver);
-
- return -ENOMEM;
+ return platform_driver_register(&mac_sonic_driver);
}
static void __exit mac_sonic_cleanup_module(void)
{
platform_driver_unregister(&mac_sonic_driver);
-
- if (mac_sonic_device) {
- platform_device_unregister(mac_sonic_device);
- mac_sonic_device = NULL;
- }
}
module_init(mac_sonic_init_module);