diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-11-09 17:32:44 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-11-09 17:32:44 -0500 |
commit | 3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 (patch) | |
tree | d8825be54cefb6ad6707478d719c8e30605bee7b /drivers/char/tb0219.c | |
parent | 00d3dcdd96646be6059cc21f2efa94c4edc1eda5 (diff) |
[DRIVER MODEL] Convert platform drivers to use struct platform_driver
This allows us to eliminate the casts in the drivers, and eventually
remove the use of the device_driver function pointer methods for
platform device drivers.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/char/tb0219.c')
-rw-r--r-- | drivers/char/tb0219.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/char/tb0219.c b/drivers/char/tb0219.c index 24355b23b2ca..b3d411a756fe 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 | ||
286 | static int tb0219_probe(struct device *dev) | 286 | static int 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 device *dev) | |||
319 | return 0; | 319 | return 0; |
320 | } | 320 | } |
321 | 321 | ||
322 | static int tb0219_remove(struct device *dev) | 322 | static int tb0219_remove(struct platform_device *dev) |
323 | { | 323 | { |
324 | _machine_restart = old_machine_restart; | 324 | _machine_restart = old_machine_restart; |
325 | 325 | ||
@@ -333,11 +333,12 @@ static int tb0219_remove(struct device *dev) | |||
333 | 333 | ||
334 | static struct platform_device *tb0219_platform_device; | 334 | static struct platform_device *tb0219_platform_device; |
335 | 335 | ||
336 | static struct device_driver tb0219_device_driver = { | 336 | static struct platform_driver tb0219_device_driver = { |
337 | .name = "TB0219", | ||
338 | .bus = &platform_bus_type, | ||
339 | .probe = tb0219_probe, | 337 | .probe = tb0219_probe, |
340 | .remove = tb0219_remove, | 338 | .remove = tb0219_remove, |
339 | .driver = { | ||
340 | .name = "TB0219", | ||
341 | }, | ||
341 | }; | 342 | }; |
342 | 343 | ||
343 | static int __devinit tanbac_tb0219_init(void) | 344 | static int __devinit tanbac_tb0219_init(void) |
@@ -348,7 +349,7 @@ static int __devinit tanbac_tb0219_init(void) | |||
348 | if (IS_ERR(tb0219_platform_device)) | 349 | if (IS_ERR(tb0219_platform_device)) |
349 | return PTR_ERR(tb0219_platform_device); | 350 | return PTR_ERR(tb0219_platform_device); |
350 | 351 | ||
351 | retval = driver_register(&tb0219_device_driver); | 352 | retval = platform_driver_register(&tb0219_device_driver); |
352 | if (retval < 0) | 353 | if (retval < 0) |
353 | platform_device_unregister(tb0219_platform_device); | 354 | platform_device_unregister(tb0219_platform_device); |
354 | 355 | ||
@@ -357,7 +358,7 @@ static int __devinit tanbac_tb0219_init(void) | |||
357 | 358 | ||
358 | static void __devexit tanbac_tb0219_exit(void) | 359 | static void __devexit tanbac_tb0219_exit(void) |
359 | { | 360 | { |
360 | driver_unregister(&tb0219_device_driver); | 361 | platform_driver_unregister(&tb0219_device_driver); |
361 | 362 | ||
362 | platform_device_unregister(tb0219_platform_device); | 363 | platform_device_unregister(tb0219_platform_device); |
363 | } | 364 | } |