aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/watchdog
diff options
context:
space:
mode:
authorDale Farnsworth <dale@farnsworth.org>2007-07-24 14:07:38 -0400
committerWim Van Sebroeck <wim@iguana.be>2007-07-24 14:56:35 -0400
commit422db8d229affd429b5a7389600877aa7dea2704 (patch)
tree2cdd7aaf3519379036dafa930bcfe31488cc91db /drivers/char/watchdog
parent28dd1b0b9191ac9cd0b96fa4d09d951498bfbadb (diff)
[WATCHDOG] mv64x60_wdt: set up platform_device in platform code
The driver previously registered its platform device data in its own init function--that's bogus. Move that code to platform-specific code in arch/ppc. This is being done so that the platform code can decide at runtime whether to initialize this driver or not. Signed-off-by: Dale Farnsworth <dale@farnsworth.org> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/char/watchdog')
-rw-r--r--drivers/char/watchdog/mv64x60_wdt.c26
1 files changed, 1 insertions, 25 deletions
diff --git a/drivers/char/watchdog/mv64x60_wdt.c b/drivers/char/watchdog/mv64x60_wdt.c
index b887cdb01334..038f76e39818 100644
--- a/drivers/char/watchdog/mv64x60_wdt.c
+++ b/drivers/char/watchdog/mv64x60_wdt.c
@@ -219,40 +219,16 @@ static struct platform_driver mv64x60_wdt_driver = {
219 }, 219 },
220}; 220};
221 221
222static struct platform_device *mv64x60_wdt_dev;
223
224static int __init mv64x60_wdt_init(void) 222static int __init mv64x60_wdt_init(void)
225{ 223{
226 int ret;
227
228 printk(KERN_INFO "MV64x60 watchdog driver\n"); 224 printk(KERN_INFO "MV64x60 watchdog driver\n");
229 225
230 mv64x60_wdt_dev = platform_device_alloc(MV64x60_WDT_NAME, -1); 226 return platform_driver_register(&mv64x60_wdt_driver);
231 if (!mv64x60_wdt_dev) {
232 ret = -ENOMEM;
233 goto out;
234 }
235
236 ret = platform_device_add(mv64x60_wdt_dev);
237 if (ret) {
238 platform_device_put(mv64x60_wdt_dev);
239 goto out;
240 }
241
242 ret = platform_driver_register(&mv64x60_wdt_driver);
243 if (ret) {
244 platform_device_unregister(mv64x60_wdt_dev);
245 goto out;
246 }
247
248 out:
249 return ret;
250} 227}
251 228
252static void __exit mv64x60_wdt_exit(void) 229static void __exit mv64x60_wdt_exit(void)
253{ 230{
254 platform_driver_unregister(&mv64x60_wdt_driver); 231 platform_driver_unregister(&mv64x60_wdt_driver);
255 platform_device_unregister(mv64x60_wdt_dev);
256} 232}
257 233
258module_init(mv64x60_wdt_init); 234module_init(mv64x60_wdt_init);