* [PATCH] input: fix misc/twl6040-vibra.c warning
@ 2011-08-29 19:50 Randy Dunlap
2011-08-30 6:59 ` Dmitry Torokhov
0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2011-08-29 19:50 UTC (permalink / raw)
To: lkml, Geert Uytterhoeven; +Cc: Dmitry Torokhov, linux-input
From: Randy Dunlap <rdunlap@xenotime.net>
Fix warning from Geert's build summary emails by changing "if" to
"ifdef". Also handle the case of CONFIG_PM_SLEEP not enabled.
drivers/input/misc/twl6040-vibra.c:231:5: warning: "CONFIG_PM_SLEEP" is not defined
Builds cleanly with CONFIG_PM_SLEEP enabled or disabled.
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
---
drivers/input/misc/twl6040-vibra.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
--- linux-next-20110829.orig/drivers/input/misc/twl6040-vibra.c
+++ linux-next-20110829/drivers/input/misc/twl6040-vibra.c
@@ -228,7 +228,7 @@ static void twl6040_vibra_close(struct i
mutex_unlock(&info->mutex);
}
-#if CONFIG_PM_SLEEP
+#ifdef CONFIG_PM_SLEEP
static int twl6040_vibra_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
@@ -244,10 +244,13 @@ static int twl6040_vibra_suspend(struct
return 0;
}
-#endif
-
static SIMPLE_DEV_PM_OPS(twl6040_vibra_pm_ops, twl6040_vibra_suspend, NULL);
+#define TWL6040_VIBRA_PM_OPS (&twl6040_vibra_pm_ops)
+#else
+#define TWL6040_VIBRA_PM_OPS NULL
+#endif
+
static int __devinit twl6040_vibra_probe(struct platform_device *pdev)
{
struct twl4030_vibra_data *pdata = pdev->dev.platform_data;
@@ -400,7 +403,7 @@ static struct platform_driver twl6040_vi
.driver = {
.name = "twl6040-vibra",
.owner = THIS_MODULE,
- .pm = &twl6040_vibra_pm_ops,
+ .pm = TWL6040_VIBRA_PM_OPS,
},
};
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] input: fix misc/twl6040-vibra.c warning
2011-08-29 19:50 [PATCH] input: fix misc/twl6040-vibra.c warning Randy Dunlap
@ 2011-08-30 6:59 ` Dmitry Torokhov
2011-08-30 21:07 ` Randy Dunlap
0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2011-08-30 6:59 UTC (permalink / raw)
To: Randy Dunlap; +Cc: lkml, Geert Uytterhoeven, linux-input
Hi Randy,
On Mon, Aug 29, 2011 at 12:50:17PM -0700, Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap@xenotime.net>
>
> Fix warning from Geert's build summary emails by changing "if" to
> "ifdef". Also handle the case of CONFIG_PM_SLEEP not enabled.
>
> drivers/input/misc/twl6040-vibra.c:231:5: warning: "CONFIG_PM_SLEEP" is not defined
>
> Builds cleanly with CONFIG_PM_SLEEP enabled or disabled.
>
> Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
> ---
> drivers/input/misc/twl6040-vibra.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> --- linux-next-20110829.orig/drivers/input/misc/twl6040-vibra.c
> +++ linux-next-20110829/drivers/input/misc/twl6040-vibra.c
> @@ -228,7 +228,7 @@ static void twl6040_vibra_close(struct i
> mutex_unlock(&info->mutex);
> }
>
> -#if CONFIG_PM_SLEEP
> +#ifdef CONFIG_PM_SLEEP
This is actually the only change that is needed. In case when
CONFIG_PM_SLEEP is not defined SIMPLE_DEV_PM_OPS() produces empty
'struct dev_pm_ops' so no additional #ifdef-ing is needed.
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] input: fix misc/twl6040-vibra.c warning
2011-08-30 6:59 ` Dmitry Torokhov
@ 2011-08-30 21:07 ` Randy Dunlap
2011-08-30 21:23 ` Dmitry Torokhov
0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2011-08-30 21:07 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: lkml, Geert Uytterhoeven, linux-input
On Mon, 29 Aug 2011 23:59:31 -0700 Dmitry Torokhov wrote:
> Hi Randy,
>
> On Mon, Aug 29, 2011 at 12:50:17PM -0700, Randy Dunlap wrote:
> > From: Randy Dunlap <rdunlap@xenotime.net>
> >
> > Fix warning from Geert's build summary emails by changing "if" to
> > "ifdef". Also handle the case of CONFIG_PM_SLEEP not enabled.
> >
> > drivers/input/misc/twl6040-vibra.c:231:5: warning: "CONFIG_PM_SLEEP" is not defined
> >
> > Builds cleanly with CONFIG_PM_SLEEP enabled or disabled.
> >
> > Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
> > ---
> > drivers/input/misc/twl6040-vibra.c | 11 +++++++----
> > 1 file changed, 7 insertions(+), 4 deletions(-)
> >
> > --- linux-next-20110829.orig/drivers/input/misc/twl6040-vibra.c
> > +++ linux-next-20110829/drivers/input/misc/twl6040-vibra.c
> > @@ -228,7 +228,7 @@ static void twl6040_vibra_close(struct i
> > mutex_unlock(&info->mutex);
> > }
> >
> > -#if CONFIG_PM_SLEEP
> > +#ifdef CONFIG_PM_SLEEP
>
> This is actually the only change that is needed. In case when
> CONFIG_PM_SLEEP is not defined SIMPLE_DEV_PM_OPS() produces empty
> 'struct dev_pm_ops' so no additional #ifdef-ing is needed.
Ah, I see. Thanks for the info.
Do I need to resend the patch?
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] input: fix misc/twl6040-vibra.c warning
2011-08-30 21:07 ` Randy Dunlap
@ 2011-08-30 21:23 ` Dmitry Torokhov
0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Torokhov @ 2011-08-30 21:23 UTC (permalink / raw)
To: Randy Dunlap; +Cc: lkml, Geert Uytterhoeven, linux-input
On Tue, Aug 30, 2011 at 02:07:13PM -0700, Randy Dunlap wrote:
> On Mon, 29 Aug 2011 23:59:31 -0700 Dmitry Torokhov wrote:
>
> > Hi Randy,
> >
> > On Mon, Aug 29, 2011 at 12:50:17PM -0700, Randy Dunlap wrote:
> > > From: Randy Dunlap <rdunlap@xenotime.net>
> > >
> > > Fix warning from Geert's build summary emails by changing "if" to
> > > "ifdef". Also handle the case of CONFIG_PM_SLEEP not enabled.
> > >
> > > drivers/input/misc/twl6040-vibra.c:231:5: warning: "CONFIG_PM_SLEEP" is not defined
> > >
> > > Builds cleanly with CONFIG_PM_SLEEP enabled or disabled.
> > >
> > > Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
> > > ---
> > > drivers/input/misc/twl6040-vibra.c | 11 +++++++----
> > > 1 file changed, 7 insertions(+), 4 deletions(-)
> > >
> > > --- linux-next-20110829.orig/drivers/input/misc/twl6040-vibra.c
> > > +++ linux-next-20110829/drivers/input/misc/twl6040-vibra.c
> > > @@ -228,7 +228,7 @@ static void twl6040_vibra_close(struct i
> > > mutex_unlock(&info->mutex);
> > > }
> > >
> > > -#if CONFIG_PM_SLEEP
> > > +#ifdef CONFIG_PM_SLEEP
> >
> > This is actually the only change that is needed. In case when
> > CONFIG_PM_SLEEP is not defined SIMPLE_DEV_PM_OPS() produces empty
> > 'struct dev_pm_ops' so no additional #ifdef-ing is needed.
>
> Ah, I see. Thanks for the info.
> Do I need to resend the patch?
Nah, I got it, thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-08-30 21:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-29 19:50 [PATCH] input: fix misc/twl6040-vibra.c warning Randy Dunlap
2011-08-30 6:59 ` Dmitry Torokhov
2011-08-30 21:07 ` Randy Dunlap
2011-08-30 21:23 ` Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).