aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2009-01-13 21:20:20 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2009-01-14 00:28:39 -0500
commitd63dab00e85641515a0a060e6de93e6b7f450665 (patch)
treec077a31cfd7da7b0b58419603ba479948dfc57af /drivers/input
parent840207edfa8b5e5b46e0d268bf33efe71fecea20 (diff)
Input: omap-keypad - mark probe function as __devinit
A pointer to omap_kp_probe is passed to the core via platform_driver_register and so the function must not disappear when the .init sections are discarded. Otherwise (if also having HOTPLUG=y) unbinding and binding a device to the driver via sysfs will result in an oops as does a device being registered late. An alternative to this patch is using platform_driver_probe instead of platform_driver_register plus removing the pointer to the probe function from the struct platform_driver. [dtor@mail.ru: fixed some more section markups] Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/keyboard/omap-keypad.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/input/keyboard/omap-keypad.c b/drivers/input/keyboard/omap-keypad.c
index ec0ebee46069..23b4fd18f851 100644
--- a/drivers/input/keyboard/omap-keypad.c
+++ b/drivers/input/keyboard/omap-keypad.c
@@ -279,7 +279,7 @@ static int omap_kp_resume(struct platform_device *dev)
279#define omap_kp_resume NULL 279#define omap_kp_resume NULL
280#endif 280#endif
281 281
282static int __init omap_kp_probe(struct platform_device *pdev) 282static int __devinit omap_kp_probe(struct platform_device *pdev)
283{ 283{
284 struct omap_kp *omap_kp; 284 struct omap_kp *omap_kp;
285 struct input_dev *input_dev; 285 struct input_dev *input_dev;
@@ -422,7 +422,7 @@ err1:
422 return -EINVAL; 422 return -EINVAL;
423} 423}
424 424
425static int omap_kp_remove(struct platform_device *pdev) 425static int __devexit omap_kp_remove(struct platform_device *pdev)
426{ 426{
427 struct omap_kp *omap_kp = platform_get_drvdata(pdev); 427 struct omap_kp *omap_kp = platform_get_drvdata(pdev);
428 428
@@ -454,7 +454,7 @@ static int omap_kp_remove(struct platform_device *pdev)
454 454
455static struct platform_driver omap_kp_driver = { 455static struct platform_driver omap_kp_driver = {
456 .probe = omap_kp_probe, 456 .probe = omap_kp_probe,
457 .remove = omap_kp_remove, 457 .remove = __devexit_p(omap_kp_remove),
458 .suspend = omap_kp_suspend, 458 .suspend = omap_kp_suspend,
459 .resume = omap_kp_resume, 459 .resume = omap_kp_resume,
460 .driver = { 460 .driver = {
@@ -463,7 +463,7 @@ static struct platform_driver omap_kp_driver = {
463 }, 463 },
464}; 464};
465 465
466static int __devinit omap_kp_init(void) 466static int __init omap_kp_init(void)
467{ 467{
468 printk(KERN_INFO "OMAP Keypad Driver\n"); 468 printk(KERN_INFO "OMAP Keypad Driver\n");
469 return platform_driver_register(&omap_kp_driver); 469 return platform_driver_register(&omap_kp_driver);