2012-08-08 14:49:15

by Arnd Bergmann

[permalink] [raw]
Subject: [PATCH 11/11] pm/drivers: fix use of SIMPLE_DEV_PM_OPS

A few drivers use a construct like

#ifdef CONFIG_PM
static int foo_suspend(struct device *pdev)
{
...
}
static int foo_resume struct device *pdev)
{
...
}
#endif
static SIMPLE_DEV_PM_OPS(foo_pm, foo_suspend, foo_resume);

which leaves the two functions unused if CONFIG_PM is enabled
but CONFIG_PM_SLEEP is disabled. I found this while building
all defconfig files on ARM. It's not clear to me if this is
the right solution, but at least it makes the code consistent
again.

Without this patch, building omap1_defconfig results in:

drivers/char/hw_random/omap-rng.c:165:12: warning: 'omap_rng_suspend' defined but not used [-Wunused-function]
drivers/char/hw_random/omap-rng.c:171:12: warning: 'omap_rng_resume' defined but not used [-Wunused-function]
sound/drivers/dummy.c:1068:12: warning: 'snd_dummy_suspend' defined but not used [-Wunused-function]
sound/drivers/dummy.c:1078:12: warning: 'snd_dummy_resume' defined but not used [-Wunused-function]

and building tegra_defconfig results in:

drivers/i2c/busses/i2c-tegra.c:716:12: warning: 'tegra_i2c_suspend' defined but not used [-Wunused-function]
drivers/i2c/busses/i2c-tegra.c:727:12: warning: 'tegra_i2c_resume' defined but not used [-Wunused-function]

Signed-off-by: Arnd Bergmann <[email protected]>
Cc: Rafael J. Wysocki <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Laxman Dewangan <[email protected]>
---
drivers/char/hw_random/omap-rng.c | 2 +-
drivers/i2c/busses/i2c-tegra.c | 2 +-
sound/drivers/dummy.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c
index d706bd0e..4fbdceb 100644
--- a/drivers/char/hw_random/omap-rng.c
+++ b/drivers/char/hw_random/omap-rng.c
@@ -160,7 +160,7 @@ static int __exit omap_rng_remove(struct platform_device *pdev)
return 0;
}

-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP

static int omap_rng_suspend(struct device *dev)
{
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index 66eb53f..9a08c57 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -712,7 +712,7 @@ static int __devexit tegra_i2c_remove(struct platform_device *pdev)
return 0;
}

-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
static int tegra_i2c_suspend(struct device *dev)
{
struct tegra_i2c_dev *i2c_dev = dev_get_drvdata(dev);
diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c
index f7d3bfc..54bb664 100644
--- a/sound/drivers/dummy.c
+++ b/sound/drivers/dummy.c
@@ -1064,7 +1064,7 @@ static int __devexit snd_dummy_remove(struct platform_device *devptr)
return 0;
}

-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
static int snd_dummy_suspend(struct device *pdev)
{
struct snd_card *card = dev_get_drvdata(pdev);
--
1.7.10


2012-08-08 15:41:03

by Stephen Warren

[permalink] [raw]
Subject: Re: [PATCH 11/11] pm/drivers: fix use of SIMPLE_DEV_PM_OPS

On 08/08/2012 08:47 AM, Arnd Bergmann wrote:
> A few drivers use a construct like
>
> #ifdef CONFIG_PM
> static int foo_suspend(struct device *pdev)
> {
> ...
> }
> static int foo_resume struct device *pdev)
> {
> ...
> }
> #endif
> static SIMPLE_DEV_PM_OPS(foo_pm, foo_suspend, foo_resume);
...
> drivers/i2c/busses/i2c-tegra.c:716:12: warning: 'tegra_i2c_suspend' defined but not used [-Wunused-function]
> drivers/i2c/busses/i2c-tegra.c:727:12: warning: 'tegra_i2c_resume' defined but not used [-Wunused-function]

Laxman already posted a patch for this, which I'm hoping will make it
into 3.6, through the I2C tree.

http://www.spinics.net/lists/linux-i2c/msg09359.html

2012-08-08 16:22:52

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 11/11] pm/drivers: fix use of SIMPLE_DEV_PM_OPS

On Wednesday 08 August 2012, Stephen Warren wrote:
> On 08/08/2012 08:47 AM, Arnd Bergmann wrote:
> > A few drivers use a construct like
> >
> > #ifdef CONFIG_PM
> > static int foo_suspend(struct device *pdev)
> > {
> > ...
> > }
> > static int foo_resume struct device *pdev)
> > {
> > ...
> > }
> > #endif
> > static SIMPLE_DEV_PM_OPS(foo_pm, foo_suspend, foo_resume);
> ...
> > drivers/i2c/busses/i2c-tegra.c:716:12: warning: 'tegra_i2c_suspend' defined but not used [-Wunused-function]
> > drivers/i2c/busses/i2c-tegra.c:727:12: warning: 'tegra_i2c_resume' defined but not used [-Wunused-function]
>
> Laxman already posted a patch for this, which I'm hoping will make it
> into 3.6, through the I2C tree.
>
> http://www.spinics.net/lists/linux-i2c/msg09359.html

Ok, dropping this one then.

Thanks,

Arnd

2012-08-08 16:43:40

by Takashi Iwai

[permalink] [raw]
Subject: Re: [PATCH 11/11] pm/drivers: fix use of SIMPLE_DEV_PM_OPS

At Wed, 8 Aug 2012 16:22:29 +0000,
Arnd Bergmann wrote:
>
> On Wednesday 08 August 2012, Stephen Warren wrote:
> > On 08/08/2012 08:47 AM, Arnd Bergmann wrote:
> > > A few drivers use a construct like
> > >
> > > #ifdef CONFIG_PM
> > > static int foo_suspend(struct device *pdev)
> > > {
> > > ...
> > > }
> > > static int foo_resume struct device *pdev)
> > > {
> > > ...
> > > }
> > > #endif
> > > static SIMPLE_DEV_PM_OPS(foo_pm, foo_suspend, foo_resume);
> > ...
> > > drivers/i2c/busses/i2c-tegra.c:716:12: warning: 'tegra_i2c_suspend' defined but not used [-Wunused-function]
> > > drivers/i2c/busses/i2c-tegra.c:727:12: warning: 'tegra_i2c_resume' defined but not used [-Wunused-function]
> >
> > Laxman already posted a patch for this, which I'm hoping will make it
> > into 3.6, through the I2C tree.
> >
> > http://www.spinics.net/lists/linux-i2c/msg09359.html
>
> Ok, dropping this one then.

I'm going to fix the similar errors in sound tree tomorrow, too.


thanks,

Takashi

2012-08-08 18:11:28

by Kevin Hilman

[permalink] [raw]
Subject: Re: [PATCH 11/11] pm/drivers: fix use of SIMPLE_DEV_PM_OPS

Arnd Bergmann <[email protected]> writes:

> A few drivers use a construct like
>
> #ifdef CONFIG_PM
> static int foo_suspend(struct device *pdev)
> {
> ...
> }
> static int foo_resume struct device *pdev)
> {
> ...
> }
> #endif
> static SIMPLE_DEV_PM_OPS(foo_pm, foo_suspend, foo_resume);
>
> which leaves the two functions unused if CONFIG_PM is enabled
> but CONFIG_PM_SLEEP is disabled. I found this while building
> all defconfig files on ARM. It's not clear to me if this is
> the right solution, but at least it makes the code consistent
> again.
>
> Without this patch, building omap1_defconfig results in:
>
> drivers/char/hw_random/omap-rng.c:165:12: warning: 'omap_rng_suspend' defined but not used [-Wunused-function]
> drivers/char/hw_random/omap-rng.c:171:12: warning: 'omap_rng_resume' defined but not used [-Wunused-function]
> sound/drivers/dummy.c:1068:12: warning: 'snd_dummy_suspend' defined but not used [-Wunused-function]
> sound/drivers/dummy.c:1078:12: warning: 'snd_dummy_resume' defined but not used [-Wunused-function]
>
> and building tegra_defconfig results in:
>
> drivers/i2c/busses/i2c-tegra.c:716:12: warning: 'tegra_i2c_suspend' defined but not used [-Wunused-function]
> drivers/i2c/busses/i2c-tegra.c:727:12: warning: 'tegra_i2c_resume' defined but not used [-Wunused-function]
>
> Signed-off-by: Arnd Bergmann <[email protected]>
> Cc: Rafael J. Wysocki <[email protected]>
> Cc: Takashi Iwai <[email protected]>
> Cc: Laxman Dewangan <[email protected]>
> ---
> drivers/char/hw_random/omap-rng.c | 2 +-

For the OMAP change,

Acked-by: Kevin Hilman <[email protected]>

2012-08-08 19:15:00

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 11/11] pm/drivers: fix use of SIMPLE_DEV_PM_OPS

On Wednesday 08 August 2012, Takashi Iwai wrote:
> At Wed, 8 Aug 2012 16:22:29 +0000,
> Arnd Bergmann wrote:
> > > Laxman already posted a patch for this, which I'm hoping will make it
> > > into 3.6, through the I2C tree.
> > >
> > > http://www.spinics.net/lists/linux-i2c/msg09359.html
> >
> > Ok, dropping this one then.
>
> I'm going to fix the similar errors in sound tree tomorrow, too.
>

Ok. this leaves the omap-rng driver, and my patch comes down to the below.
Thanks!

Arnd

8<----

>From d83e9e0e5c0e41a0ee2ba6293c8be21e54988f99 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <[email protected]>
Date: Sat, 4 Aug 2012 07:11:34 +0000
Subject: [PATCH] omap-rng: fix use of SIMPLE_DEV_PM_OPS

omap_rng_suspend and omap_rng_resume are unused if CONFIG_PM is enabled
but CONFIG_PM_SLEEP is disabled. I found this while building all defconfig
files on ARM. It's not clear to me if this is the right solution, but
at least it makes the code consistent again.

Without this patch, building omap1_defconfig results in:

drivers/char/hw_random/omap-rng.c:165:12: warning: 'omap_rng_suspend' defined but not used [-Wunused-function]
drivers/char/hw_random/omap-rng.c:171:12: warning: 'omap_rng_resume' defined but not used [-Wunused-function]

Signed-off-by: Arnd Bergmann <[email protected]>
Cc: Rafael J. Wysocki <[email protected]>
Cc: Herbert Xu <[email protected]>

diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c
index d706bd0e..4fbdceb 100644
--- a/drivers/char/hw_random/omap-rng.c
+++ b/drivers/char/hw_random/omap-rng.c
@@ -160,7 +160,7 @@ static int __exit omap_rng_remove(struct platform_device *pdev)
return 0;
}

-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP

static int omap_rng_suspend(struct device *dev)
{

2012-08-08 19:20:05

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: [PATCH 11/11] pm/drivers: fix use of SIMPLE_DEV_PM_OPS

On Wednesday, August 08, 2012, Arnd Bergmann wrote:
> On Wednesday 08 August 2012, Takashi Iwai wrote:
> > At Wed, 8 Aug 2012 16:22:29 +0000,
> > Arnd Bergmann wrote:
> > > > Laxman already posted a patch for this, which I'm hoping will make it
> > > > into 3.6, through the I2C tree.
> > > >
> > > > http://www.spinics.net/lists/linux-i2c/msg09359.html
> > >
> > > Ok, dropping this one then.
> >
> > I'm going to fix the similar errors in sound tree tomorrow, too.
> >
>
> Ok. this leaves the omap-rng driver, and my patch comes down to the below.
> Thanks!

Looks good!

Sorry for introducing those warnings in the first place, I should have been
more careful about that.

Thanks,
Rafael


> 8<----
>
> From d83e9e0e5c0e41a0ee2ba6293c8be21e54988f99 Mon Sep 17 00:00:00 2001
> From: Arnd Bergmann <[email protected]>
> Date: Sat, 4 Aug 2012 07:11:34 +0000
> Subject: [PATCH] omap-rng: fix use of SIMPLE_DEV_PM_OPS
>
> omap_rng_suspend and omap_rng_resume are unused if CONFIG_PM is enabled
> but CONFIG_PM_SLEEP is disabled. I found this while building all defconfig
> files on ARM. It's not clear to me if this is the right solution, but
> at least it makes the code consistent again.
>
> Without this patch, building omap1_defconfig results in:
>
> drivers/char/hw_random/omap-rng.c:165:12: warning: 'omap_rng_suspend' defined but not used [-Wunused-function]
> drivers/char/hw_random/omap-rng.c:171:12: warning: 'omap_rng_resume' defined but not used [-Wunused-function]
>
> Signed-off-by: Arnd Bergmann <[email protected]>
> Cc: Rafael J. Wysocki <[email protected]>
> Cc: Herbert Xu <[email protected]>
>
> diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c
> index d706bd0e..4fbdceb 100644
> --- a/drivers/char/hw_random/omap-rng.c
> +++ b/drivers/char/hw_random/omap-rng.c
> @@ -160,7 +160,7 @@ static int __exit omap_rng_remove(struct platform_device *pdev)
> return 0;
> }
>
> -#ifdef CONFIG_PM
> +#ifdef CONFIG_PM_SLEEP
>
> static int omap_rng_suspend(struct device *dev)
> {
>
>
>

2012-08-20 08:33:10

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH 11/11] pm/drivers: fix use of SIMPLE_DEV_PM_OPS

On Wed, Aug 08, 2012 at 05:26:21PM +0000, Arnd Bergmann wrote:
>
> Ok. this leaves the omap-rng driver, and my patch comes down to the below.
> Thanks!

Patch applied. Thanks Arnd.
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt