aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/tb0219.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/char/tb0219.c b/drivers/char/tb0219.c
index ac2a297ce37c..a80c83210872 100644
--- a/drivers/char/tb0219.c
+++ b/drivers/char/tb0219.c
@@ -283,7 +283,7 @@ static void tb0219_pci_irq_init(void)
283 vr41xx_set_irq_level(TB0219_PCI_SLOT3_PIN, IRQ_LEVEL_LOW); 283 vr41xx_set_irq_level(TB0219_PCI_SLOT3_PIN, IRQ_LEVEL_LOW);
284} 284}
285 285
286static int tb0219_probe(struct platform_device *dev) 286static int __devinit tb0219_probe(struct platform_device *dev)
287{ 287{
288 int retval; 288 int retval;
289 289
@@ -319,7 +319,7 @@ static int tb0219_probe(struct platform_device *dev)
319 return 0; 319 return 0;
320} 320}
321 321
322static int tb0219_remove(struct platform_device *dev) 322static int __devexit tb0219_remove(struct platform_device *dev)
323{ 323{
324 _machine_restart = old_machine_restart; 324 _machine_restart = old_machine_restart;
325 325
@@ -335,19 +335,26 @@ static struct platform_device *tb0219_platform_device;
335 335
336static struct platform_driver tb0219_device_driver = { 336static struct platform_driver tb0219_device_driver = {
337 .probe = tb0219_probe, 337 .probe = tb0219_probe,
338 .remove = tb0219_remove, 338 .remove = __devexit_p(tb0219_remove),
339 .driver = { 339 .driver = {
340 .name = "TB0219", 340 .name = "TB0219",
341 .owner = THIS_MODULE,
341 }, 342 },
342}; 343};
343 344
344static int __devinit tanbac_tb0219_init(void) 345static int __init tanbac_tb0219_init(void)
345{ 346{
346 int retval; 347 int retval;
347 348
348 tb0219_platform_device = platform_device_register_simple("TB0219", -1, NULL, 0); 349 tb0219_platform_device = platform_device_alloc("TB0219", -1);
349 if (IS_ERR(tb0219_platform_device)) 350 if (!tb0219_platform_device)
350 return PTR_ERR(tb0219_platform_device); 351 return -ENOMEM;
352
353 retval = platform_device_add(tb0219_platform_device);
354 if (retval < 0) {
355 platform_device_put(tb0219_platform_device);
356 return retval;
357 }
351 358
352 retval = platform_driver_register(&tb0219_device_driver); 359 retval = platform_driver_register(&tb0219_device_driver);
353 if (retval < 0) 360 if (retval < 0)
@@ -356,10 +363,9 @@ static int __devinit tanbac_tb0219_init(void)
356 return retval; 363 return retval;
357} 364}
358 365
359static void __devexit tanbac_tb0219_exit(void) 366static void __exit tanbac_tb0219_exit(void)
360{ 367{
361 platform_driver_unregister(&tb0219_device_driver); 368 platform_driver_unregister(&tb0219_device_driver);
362
363 platform_device_unregister(tb0219_platform_device); 369 platform_device_unregister(tb0219_platform_device);
364} 370}
365 371