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/input/keyboard/spitzkbd.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/input/keyboard/spitzkbd.c')
-rw-r--r-- | drivers/input/keyboard/spitzkbd.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/input/keyboard/spitzkbd.c b/drivers/input/keyboard/spitzkbd.c index 0fa38a559cdf..6a15fe3bc527 100644 --- a/drivers/input/keyboard/spitzkbd.c +++ b/drivers/input/keyboard/spitzkbd.c | |||
@@ -309,10 +309,10 @@ static void spitzkbd_hinge_timer(unsigned long data) | |||
309 | } | 309 | } |
310 | 310 | ||
311 | #ifdef CONFIG_PM | 311 | #ifdef CONFIG_PM |
312 | static int spitzkbd_suspend(struct device *dev, pm_message_t state) | 312 | static int spitzkbd_suspend(struct platform_device *dev, pm_message_t state) |
313 | { | 313 | { |
314 | int i; | 314 | int i; |
315 | struct spitzkbd *spitzkbd = dev_get_drvdata(dev); | 315 | struct spitzkbd *spitzkbd = platform_get_drvdata(dev); |
316 | spitzkbd->suspended = 1; | 316 | spitzkbd->suspended = 1; |
317 | 317 | ||
318 | /* Set Strobe lines as inputs - *except* strobe line 0 leave this | 318 | /* Set Strobe lines as inputs - *except* strobe line 0 leave this |
@@ -323,10 +323,10 @@ static int spitzkbd_suspend(struct device *dev, pm_message_t state) | |||
323 | return 0; | 323 | return 0; |
324 | } | 324 | } |
325 | 325 | ||
326 | static int spitzkbd_resume(struct device *dev) | 326 | static int spitzkbd_resume(struct platform_device *dev) |
327 | { | 327 | { |
328 | int i; | 328 | int i; |
329 | struct spitzkbd *spitzkbd = dev_get_drvdata(dev); | 329 | struct spitzkbd *spitzkbd = platform_get_drvdata(dev); |
330 | 330 | ||
331 | for (i = 0; i < SPITZ_KEY_STROBE_NUM; i++) | 331 | for (i = 0; i < SPITZ_KEY_STROBE_NUM; i++) |
332 | pxa_gpio_mode(spitz_strobes[i] | GPIO_OUT | GPIO_DFLT_HIGH); | 332 | pxa_gpio_mode(spitz_strobes[i] | GPIO_OUT | GPIO_DFLT_HIGH); |
@@ -342,7 +342,7 @@ static int spitzkbd_resume(struct device *dev) | |||
342 | #define spitzkbd_resume NULL | 342 | #define spitzkbd_resume NULL |
343 | #endif | 343 | #endif |
344 | 344 | ||
345 | static int __init spitzkbd_probe(struct device *dev) | 345 | static int __init spitzkbd_probe(struct platform_device *dev) |
346 | { | 346 | { |
347 | struct spitzkbd *spitzkbd; | 347 | struct spitzkbd *spitzkbd; |
348 | struct input_dev *input_dev; | 348 | struct input_dev *input_dev; |
@@ -358,7 +358,7 @@ static int __init spitzkbd_probe(struct device *dev) | |||
358 | return -ENOMEM; | 358 | return -ENOMEM; |
359 | } | 359 | } |
360 | 360 | ||
361 | dev_set_drvdata(dev, spitzkbd); | 361 | platform_set_drvdata(dev, spitzkbd); |
362 | strcpy(spitzkbd->phys, "spitzkbd/input0"); | 362 | strcpy(spitzkbd->phys, "spitzkbd/input0"); |
363 | 363 | ||
364 | spin_lock_init(&spitzkbd->lock); | 364 | spin_lock_init(&spitzkbd->lock); |
@@ -380,7 +380,7 @@ static int __init spitzkbd_probe(struct device *dev) | |||
380 | input_dev->private = spitzkbd; | 380 | input_dev->private = spitzkbd; |
381 | input_dev->name = "Spitz Keyboard"; | 381 | input_dev->name = "Spitz Keyboard"; |
382 | input_dev->phys = spitzkbd->phys; | 382 | input_dev->phys = spitzkbd->phys; |
383 | input_dev->cdev.dev = dev; | 383 | input_dev->cdev.dev = &dev->dev; |
384 | 384 | ||
385 | input_dev->id.bustype = BUS_HOST; | 385 | input_dev->id.bustype = BUS_HOST; |
386 | input_dev->id.vendor = 0x0001; | 386 | input_dev->id.vendor = 0x0001; |
@@ -437,10 +437,10 @@ static int __init spitzkbd_probe(struct device *dev) | |||
437 | return 0; | 437 | return 0; |
438 | } | 438 | } |
439 | 439 | ||
440 | static int spitzkbd_remove(struct device *dev) | 440 | static int spitzkbd_remove(struct platform_device *dev) |
441 | { | 441 | { |
442 | int i; | 442 | int i; |
443 | struct spitzkbd *spitzkbd = dev_get_drvdata(dev); | 443 | struct spitzkbd *spitzkbd = platform_get_drvdata(dev); |
444 | 444 | ||
445 | for (i = 0; i < SPITZ_KEY_SENSE_NUM; i++) | 445 | for (i = 0; i < SPITZ_KEY_SENSE_NUM; i++) |
446 | free_irq(IRQ_GPIO(spitz_senses[i]), spitzkbd); | 446 | free_irq(IRQ_GPIO(spitz_senses[i]), spitzkbd); |
@@ -460,23 +460,24 @@ static int spitzkbd_remove(struct device *dev) | |||
460 | return 0; | 460 | return 0; |
461 | } | 461 | } |
462 | 462 | ||
463 | static struct device_driver spitzkbd_driver = { | 463 | static struct platform_driver spitzkbd_driver = { |
464 | .name = "spitz-keyboard", | ||
465 | .bus = &platform_bus_type, | ||
466 | .probe = spitzkbd_probe, | 464 | .probe = spitzkbd_probe, |
467 | .remove = spitzkbd_remove, | 465 | .remove = spitzkbd_remove, |
468 | .suspend = spitzkbd_suspend, | 466 | .suspend = spitzkbd_suspend, |
469 | .resume = spitzkbd_resume, | 467 | .resume = spitzkbd_resume, |
468 | .driver = { | ||
469 | .name = "spitz-keyboard", | ||
470 | }, | ||
470 | }; | 471 | }; |
471 | 472 | ||
472 | static int __devinit spitzkbd_init(void) | 473 | static int __devinit spitzkbd_init(void) |
473 | { | 474 | { |
474 | return driver_register(&spitzkbd_driver); | 475 | return platform_driver_register(&spitzkbd_driver); |
475 | } | 476 | } |
476 | 477 | ||
477 | static void __exit spitzkbd_exit(void) | 478 | static void __exit spitzkbd_exit(void) |
478 | { | 479 | { |
479 | driver_unregister(&spitzkbd_driver); | 480 | platform_driver_unregister(&spitzkbd_driver); |
480 | } | 481 | } |
481 | 482 | ||
482 | module_init(spitzkbd_init); | 483 | module_init(spitzkbd_init); |