linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PWM backlight build warning
@ 2013-04-06 18:33 Tony Prisk
  2013-04-06 20:02 ` Mark Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Tony Prisk @ 2013-04-06 18:33 UTC (permalink / raw)
  To: thierry.reding, linux-kernel, linux-arm-kernel, linux-kernel,
	broonie, akpm

Hi Thierry,

Sorry it's taken so long to report this but I've been tied up with other 
patches recently. I noticed a build warning on the pwm_bl driver in 
3.9-rcX but I'm not sure what the correct resolution would be. This patch:

commit e2c17bc6f717a8847df2a867caec6ba4fe85f3fc
backlight: convert pwm_bl to dev_pm_ops

Should be no functional changes, mainly a reorganisation to support 
future work.

[akpm@linux-foundation.org: fix CONFIG_PM=n build]
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

has introduced a two build warnings in my config:
drivers/video/backlight/pwm_bl.c:278:12: warning: 
‘pwm_backlight_suspend’ defined but not used [-Wunused-function]
drivers/video/backlight/pwm_bl.c:292:12: warning: ‘pwm_backlight_resume’ 
defined but not used [-Wunused-function]

Although I noticed it doesn't have your acked-by ;)


Selecting "Run-time PM core functionality" without "Suspend to RAM and 
standby" causes the unused function warning.
With CONFIG_PM=n, no warnings. With CONFIG_PM=y and CONFIG_PM_SLEEP=y, 
no warnings.

The problem occurs because when CONFIG_PM=y but CONFIG_PM_SLEEP=n:

#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \
const struct dev_pm_ops name = { \
SET_SYSTEM_SLEEP_PM_OPS(syspend_fn, resume_fn) \
}

#ifdef CONFIG_PM_SLEEP
#define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
.suspend = suspend_fn, \
.resume = resume_fn, \
.freeze = suspend_fn, \
.thaw = resume_fn, \
.poweroff = suspend_fn, \
.restore = resume_fn,
#else
#define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
#endif

I guess this would be a problem on every driver that has been converted 
to SIMPLE_DEV_PM_OPS.
I don't know enough about the PM code to offer a fix, or whethermy 
chosen config is just 'invalid'.

Regards
Tony P

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PWM backlight build warning
  2013-04-06 18:33 PWM backlight build warning Tony Prisk
@ 2013-04-06 20:02 ` Mark Brown
  2013-04-06 21:10   ` Thierry Reding
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2013-04-06 20:02 UTC (permalink / raw)
  To: Tony Prisk; +Cc: thierry.reding, linux-kernel, linux-arm-kernel, akpm

[-- Attachment #1: Type: text/plain, Size: 438 bytes --]

On Sun, Apr 07, 2013 at 06:33:35AM +1200, Tony Prisk wrote:

> The problem occurs because when CONFIG_PM=y but CONFIG_PM_SLEEP=n:

> I guess this would be a problem on every driver that has been
> converted to SIMPLE_DEV_PM_OPS.
> I don't know enough about the PM code to offer a fix, or whethermy
> chosen config is just 'invalid'.

You just need to put the system suspend functions inside an ifdef
CONFIG_PM_SLEEP instead of CONFIG_PM.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PWM backlight build warning
  2013-04-06 20:02 ` Mark Brown
@ 2013-04-06 21:10   ` Thierry Reding
  2013-04-06 22:06     ` Tony Prisk
  0 siblings, 1 reply; 4+ messages in thread
From: Thierry Reding @ 2013-04-06 21:10 UTC (permalink / raw)
  To: Mark Brown; +Cc: Tony Prisk, linux-kernel, linux-arm-kernel, akpm

[-- Attachment #1: Type: text/plain, Size: 592 bytes --]

On Sat, Apr 06, 2013 at 09:02:51PM +0100, Mark Brown wrote:
> On Sun, Apr 07, 2013 at 06:33:35AM +1200, Tony Prisk wrote:
> 
> > The problem occurs because when CONFIG_PM=y but CONFIG_PM_SLEEP=n:
> 
> > I guess this would be a problem on every driver that has been
> > converted to SIMPLE_DEV_PM_OPS.
> > I don't know enough about the PM code to offer a fix, or whethermy
> > chosen config is just 'invalid'.
> 
> You just need to put the system suspend functions inside an ifdef
> CONFIG_PM_SLEEP instead of CONFIG_PM.

I carry a fix for that in my for-next branch.

Thierry

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PWM backlight build warning
  2013-04-06 21:10   ` Thierry Reding
@ 2013-04-06 22:06     ` Tony Prisk
  0 siblings, 0 replies; 4+ messages in thread
From: Tony Prisk @ 2013-04-06 22:06 UTC (permalink / raw)
  To: Thierry Reding; +Cc: Mark Brown, linux-kernel, linux-arm-kernel, akpm

On 07/04/13 09:10, Thierry Reding wrote:
> On Sat, Apr 06, 2013 at 09:02:51PM +0100, Mark Brown wrote:
>> On Sun, Apr 07, 2013 at 06:33:35AM +1200, Tony Prisk wrote:
>>
>>> The problem occurs because when CONFIG_PM=y but CONFIG_PM_SLEEP=n:
>>> I guess this would be a problem on every driver that has been
>>> converted to SIMPLE_DEV_PM_OPS.
>>> I don't know enough about the PM code to offer a fix, or whethermy
>>> chosen config is just 'invalid'.
>> You just need to put the system suspend functions inside an ifdef
>> CONFIG_PM_SLEEP instead of CONFIG_PM.
> I carry a fix for that in my for-next branch.
>
> Thierry
Ahh ok, all is good then.

Regards
Tony P

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-04-06 22:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-06 18:33 PWM backlight build warning Tony Prisk
2013-04-06 20:02 ` Mark Brown
2013-04-06 21:10   ` Thierry Reding
2013-04-06 22:06     ` Tony Prisk

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).