Input: nomadik-ske-keypad - do not assign driver's probe() method
Subsystems (2)
Dmitry Torokhov
maintainerPATCH 1/2 Input: nomadik-ske-keypad - do not assign driver's probe() method
Because we are using platform_device_probe() to register the driver we do not need to assign driver's probe method. We also can mark ske_keypad_probe(), together with ske_keypad_chip_init(), as __init instead of __devinit.
---
drivers/input/keyboard/nomadik-ske-keypad.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/input/keyboard/nomadik-ske-keypad.c +2 -3
@@ -88,7 +88,7 @@ static void ske_keypad_set_bits(struct ske_keypad *keypad, u16 addr,* * Enable Multi key press detection, auto scan mode */ -static int __devinit ske_keypad_chip_init (struct ske_keypad *keypad) +static int __init ske_keypad_chip_init (struct ske_keypad *keypad) {u32 value;int timeout =50 ;
@@ -198,7 +198,7 @@ static irqreturn_t ske_keypad_irq(int irq, void *dev_id)return IRQ_HANDLED ; } -static int __devinit ske_keypad_probe (struct platform_device *pdev) +static int __init ske_keypad_probe (struct platform_device *pdev) {const struct ske_keypad_platform_data *plat = pdev->dev.platform_data;struct ske_keypad *keypad;
@@ -387,7 +387,6 @@ static struct platform_driver ske_keypad_driver = { .pm = &ske_keypad_dev_pm_ops,#endif }, - .probe = ske_keypad_probe, .remove = __devexit_p(ske_keypad_remove), };
Dmitry Torokhov
maintainerPATCH 2/2 Input: nomadik-ske-keypad - convert to using SIMPLE_DEV_PM_OPS
Also proper guard for system suspend/resume methods is CONFIG_PM_SLEEP, not CONFIG_PM.
---
drivers/input/keyboard/nomadik-ske-keypad.c | 12 ++++-------- 1 files changed, 4 insertions(+), 8 deletions(-)
drivers/input/keyboard/nomadik-ske-keypad.c +4 -8
@@ -344,7 +344,7 @@ static int __devexit ske_keypad_remove(struct platform_device *pdev)return 0 ; } -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP static int ske_keypad_suspend (struct device *dev) {struct platform_device *pdev =to_platform_device (dev);
@@ -372,20 +372,16 @@ static int ske_keypad_resume(struct device *dev)return 0 ; } - -static const struct dev_pm_ops ske_keypad_dev_pm_ops = { - .suspend = ske_keypad_suspend, - .resume = ske_keypad_resume, -};#endif +static SIMPLE_DEV_PM_OPS(ske_keypad_dev_pm_ops, + ske_keypad_suspend, ske_keypad_resume); +static struct platform_driver ske_keypad_driver = { .driver = { .name ="nmk-ske-keypad" , .owner =THIS_MODULE , -#ifdef CONFIG_PM .pm = &ske_keypad_dev_pm_ops, -#endif }, .remove =__devexit_p (ske_keypad_remove), };
Quoted 6 lines · Dmitry Torokhov
Because we are using
platform_device_probe()to register the driver we do not need to assign driver's probe method. We also can markske_keypad_probe(), together withske_keypad_chip_init(), as__initinstead of__devinit.Signed-off-by Dmitry Torokhov <[email protected]>
Thanks Dmitry!
Linus Walleij
Re: [PATCH 2/2] Input: nomadik-ske-keypad - convert to using SIMPLE_DEV_PM_OPS
In reply to Dmitry TorokhovQuoted 4 lines · Dmitry Torokhov
Also proper guard for system suspend/resume methods is
CONFIG_PM_SLEEP, notCONFIG_PM.Signed-off-by Dmitry Torokhov <[email protected]>
Thanks,
Linus Walleij