Input: imx_keypad - Place SIMPLE_DEV_PM_OPS inside CONFIG_PM_SLEEP if block
Subsystems (3)
Fabio Estevam
reviewerPATCH 1/1 Input: imx_keypad - Place SIMPLE_DEV_PM_OPS inside CONFIG_PM_SLEEP if block
From: Fabio Estevam <[email protected]>
SIMPLE_DEV_PM_OPS should be inside the CONFIG_PM_SLEEP 'if' block because imx_kbd_suspend and imx_kbd_resume definitions are inside this block.
While at it, also add a definition for IMX_KBD_PM_OPS, which can handle the case when CONFIG_PM_SLEEP is not selected.
--- drivers/input/keyboard/imx_keypad.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/input/keyboard/imx_keypad.c +5 -3
@@ -580,15 +580,17 @@ err_clk:return ret; } -#endif - static SIMPLE_DEV_PM_OPS(imx_kbd_pm_ops, imx_kbd_suspend, imx_kbd_resume); +#define IMX_KBD_PM_OPS (&imx_kbd_pm_ops) +#else +#define IMX_KBD_PM_OPS NULL +#endif /* CONFIG_PM_SLEEP */ static struct platform_driver imx_keypad_driver = { .driver = { .name ="imx-keypad" , .owner =THIS_MODULE , - .pm = &imx_kbd_pm_ops, + .pm =IMX_KBD_PM_OPS , .of_match_table =of_match_ptr (imx_keypad_of_match), }, .probe = imx_keypad_probe,
Signature · 1 line
1.7.9.5
Dmitry Torokhov
maintainerQuoted 5 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
SIMPLE_DEV_PM_OPSshould be inside theCONFIG_PM_SLEEP'if' block becauseimx_kbd_suspendandimx_kbd_resumedefinitions are inside this block.
No, it does not. It compiles just fine if CONFIG_PM_SLEEP is not defined.
Quoted 36 lines
While at it, also add a definition for
IMX_KBD_PM_OPS, which can handle the case
whenCONFIG_PM_SLEEPis not selected.Signed-off-by Fabio Estevam <[email protected]>---
drivers/input/keyboard/imx_keypad.c| 8 +++++---1 file changed, 5 insertions(+), 3 deletions(-)drivers/input/keyboard/imx_keypad.c +5
-3@@ -580,15 +580,17 @@ err_clk:return ret; } -#endif - static SIMPLE_DEV_PM_OPS(imx_kbd_pm_ops, imx_kbd_suspend, imx_kbd_resume); +#define IMX_KBD_PM_OPS (&imx_kbd_pm_ops) +#else +#define IMX_KBD_PM_OPS NULL +#endif /* CONFIG_PM_SLEEP */ static struct platform_driver imx_keypad_driver = { .driver = { .name ="imx-keypad" , .owner =THIS_MODULE , - .pm = &imx_kbd_pm_ops, + .pm =IMX_KBD_PM_OPS , .of_match_table =of_match_ptr (imx_keypad_of_match), },
Quoted 1 line
.probe = imx_keypad_probe,
Hi Fabio,
Thanks.
Signature · 1 line
Dmitry
Dmitry Torokhov
maintainerQuoted 49 lines · Dmitry Torokhov
Quoted 5 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
SIMPLE_DEV_PM_OPSshould be inside theCONFIG_PM_SLEEP'if' block becauseimx_kbd_suspendandimx_kbd_resumedefinitions are inside this block.No, it does not. It compiles just fine if
CONFIG_PM_SLEEPis not defined.Quoted 40 lines
While at it, also add a definition for
IMX_KBD_PM_OPS, which can handle the case
whenCONFIG_PM_SLEEPis not selected.Signed-off-by Fabio Estevam <[email protected]>---
drivers/input/keyboard/imx_keypad.c| 8 +++++---1 file changed, 5 insertions(+), 3 deletions(-)drivers/input/keyboard/imx_keypad.c +5
-3@@ -580,15 +580,17 @@ err_clk:return ret; } -#endif - static SIMPLE_DEV_PM_OPS(imx_kbd_pm_ops, imx_kbd_suspend, imx_kbd_resume); +#define IMX_KBD_PM_OPS (&imx_kbd_pm_ops) +#else +#define IMX_KBD_PM_OPS NULL +#endif /* CONFIG_PM_SLEEP */ static struct platform_driver imx_keypad_driver = { .driver = { .name ="imx-keypad" , .owner =THIS_MODULE , - .pm = &imx_kbd_pm_ops, + .pm =IMX_KBD_PM_OPS ,
Quoted 7 lines
Quoted 4 lines
.of_match_table = of_match_ptr(imx_keypad_of_match), }, .probe = imx_keypad_probe,Hi Fabio,
Thanks.
Hmm, K-9's quoting style is really peculiar...
Signature · 1 line
Dmitry
Fabio Estevam
reviewerHi Dmitry,
Quoted 9 lines · Dmitry Torokhov
Quoted 5 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
SIMPLE_DEV_PM_OPSshould be inside theCONFIG_PM_SLEEP'if' block becauseimx_kbd_suspendandimx_kbd_resumedefinitions are inside this block.No, it does not. It compiles just fine if
CONFIG_PM_SLEEPis not defined.
I am not sure how to disable CONFIG_PM_SLEEP properly in the defconfig, but I did this quick test to simulate it:
drivers/input/keyboard/imx_keypad.c +1 -1
@@ -536,7 +536,7 @@ static int imx_keypad_probe(struct platform_device *pdev)return 0 ; } -#ifdef CONFIG_PM_SLEEP +#if 0 static int imx_kbd_suspend (struct device *dev) {struct platform_device *pdev =to_platform_device (dev);
and then I see:
CC drivers/input/keyboard/imx_keypad.odrivers/input/keyboard/imx_keypad.c:585: error: 'imx_kbd_suspend' undeclared here (not in a function) drivers/input/keyboard/imx_keypad.c:585: error: 'imx_kbd_resume' undeclared here (not in a function)
make[3]: *** [drivers/input/keyboard/imx_keypad.o] Error 1 make[2]: *** [drivers/input/keyboard] Error 2
Dmitry Torokhov
maintainerQuoted 21 lines · Fabio Estevam
Hi Dmitry,
Quoted 9 lines · Dmitry Torokhov
Quoted 5 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
SIMPLE_DEV_PM_OPSshould be inside theCONFIG_PM_SLEEP'if' block becauseimx_kbd_suspendandimx_kbd_resumedefinitions are inside this block.No, it does not. It compiles just fine if
CONFIG_PM_SLEEPis notdefined.
I am not sure how to disable
CONFIG_PM_SLEEPproperly in the defconfig, but I did this quick test to simulate it:
drivers/input/keyboard/imx_keypad.c static int imx_keypad_probe(struct platform_device · line 540
Quoted 6 lines
drivers/input/keyboard/imx_keypad.c +1
-1@@ -536,7 +536,7 @@ static int imx_keypad_probe(struct platform_device *pdev)return 0 ; } -#ifdef CONFIG_PM_SLEEP +#if 0
This is not the same thing as SIMPLE_DEV_PM_OPS change their definition depending on CONFIG_PM_SLEEP.
Thanks.
Signature · 1 line
Dmitry