All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] [PATCH] hwmon: max6639: Fix CONFIG_PM compile option
@ 2012-03-24 18:36 Roland Stigge
  2012-03-24 19:12 ` Guenter Roeck
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Roland Stigge @ 2012-03-24 18:36 UTC (permalink / raw)
  To: lm-sensors

This patch fixes a compiler warning in case CONFIG_PM is not defined

Signed-off-by: Roland Stigge <stigge@antcom.de>

---

 This solves the issue recently encountered by Kurt Roeck in the nightly build.

 The solution with #ifdef's is done as in all the other drivers.

 drivers/hwmon/max6639.c |    5 +++++
 1 file changed, 5 insertions(+)

--- linux-2.6.orig/drivers/hwmon/max6639.c
+++ linux-2.6/drivers/hwmon/max6639.c
@@ -596,6 +596,7 @@ static int max6639_remove(struct i2c_cli
 	return 0;
 }
 
+#ifdef CONFIG_PM
 static int max6639_suspend(struct device *dev)
 {
 	struct i2c_client *client = to_i2c_client(dev);
@@ -617,6 +618,10 @@ static int max6639_resume(struct device
 	return i2c_smbus_write_byte_data(client,
 			MAX6639_REG_GCONFIG, data & ~MAX6639_GCONFIG_STANDBY);
 }
+#else
+#define max6639_suspend NULL
+#define max6639_resume NULL
+#endif
 
 static const struct i2c_device_id max6639_id[] = {
 	{"max6639", 0},

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [lm-sensors] [PATCH] hwmon: max6639: Fix CONFIG_PM compile option
  2012-03-24 18:36 [lm-sensors] [PATCH] hwmon: max6639: Fix CONFIG_PM compile option Roland Stigge
@ 2012-03-24 19:12 ` Guenter Roeck
  2012-03-24 19:45 ` Roland Stigge
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2012-03-24 19:12 UTC (permalink / raw)
  To: lm-sensors

On Sat, Mar 24, 2012 at 02:36:08PM -0400, Roland Stigge wrote:
> This patch fixes a compiler warning in case CONFIG_PM is not defined
> 
> Signed-off-by: Roland Stigge <stigge@antcom.de>
> 
> ---
> 
>  This solves the issue recently encountered by Kurt Roeck in the nightly build.
> 
>  The solution with #ifdef's is done as in all the other drivers.
> 
>  drivers/hwmon/max6639.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> --- linux-2.6.orig/drivers/hwmon/max6639.c
> +++ linux-2.6/drivers/hwmon/max6639.c
> @@ -596,6 +596,7 @@ static int max6639_remove(struct i2c_cli
>  	return 0;
>  }
>  
> +#ifdef CONFIG_PM

Looking into other drivers, I think that should be CONFIG_PM_SLEEP

>  static int max6639_suspend(struct device *dev)
>  {
>  	struct i2c_client *client = to_i2c_client(dev);
> @@ -617,6 +618,10 @@ static int max6639_resume(struct device
>  	return i2c_smbus_write_byte_data(client,
>  			MAX6639_REG_GCONFIG, data & ~MAX6639_GCONFIG_STANDBY);
>  }
> +#else
> +#define max6639_suspend NULL
> +#define max6639_resume NULL
> +#endif
>  
... and that else case should not be necessary.

Oh well, now I ended up looking into it anyway ... so I just added the missing #ifdef to Mark's patch.

Thanks,
Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [lm-sensors] [PATCH] hwmon: max6639: Fix CONFIG_PM compile option
  2012-03-24 18:36 [lm-sensors] [PATCH] hwmon: max6639: Fix CONFIG_PM compile option Roland Stigge
  2012-03-24 19:12 ` Guenter Roeck
@ 2012-03-24 19:45 ` Roland Stigge
  2012-03-24 22:52 ` Guenter Roeck
  2012-03-26 10:37 ` Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Roland Stigge @ 2012-03-24 19:45 UTC (permalink / raw)
  To: lm-sensors

Hi,

On 24/03/12 20:12, Guenter Roeck wrote:
>> --- linux-2.6.orig/drivers/hwmon/max6639.c
>> +++ linux-2.6/drivers/hwmon/max6639.c
>> @@ -596,6 +596,7 @@ static int max6639_remove(struct i2c_cli
>>  	return 0;
>>  }
>>  
>> +#ifdef CONFIG_PM
> 
> Looking into other drivers, I think that should be CONFIG_PM_SLEEP

Which other drivers did you mean?

What about those drivers that all handle it via CONFIG_PM:

abituguru.c
abituguru3.c
exynos4_tmu.c
gpio-fan.c
jc42.c
lm75.c
tmp102.c

?

>> +#else
>> +#define max6639_suspend NULL
>> +#define max6639_resume NULL
>> +#endif
>>  
> ... and that else case should not be necessary.

According to the compiler warning, right. :-)

Thanks,

Roland

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [lm-sensors] [PATCH] hwmon: max6639: Fix CONFIG_PM compile option
  2012-03-24 18:36 [lm-sensors] [PATCH] hwmon: max6639: Fix CONFIG_PM compile option Roland Stigge
  2012-03-24 19:12 ` Guenter Roeck
  2012-03-24 19:45 ` Roland Stigge
@ 2012-03-24 22:52 ` Guenter Roeck
  2012-03-26 10:37 ` Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2012-03-24 22:52 UTC (permalink / raw)
  To: lm-sensors

On Sat, Mar 24, 2012 at 03:45:43PM -0400, Roland Stigge wrote:
> Hi,
> 
> On 24/03/12 20:12, Guenter Roeck wrote:
> >> --- linux-2.6.orig/drivers/hwmon/max6639.c
> >> +++ linux-2.6/drivers/hwmon/max6639.c
> >> @@ -596,6 +596,7 @@ static int max6639_remove(struct i2c_cli
> >>  	return 0;
> >>  }
> >>  
> >> +#ifdef CONFIG_PM
> > 
> > Looking into other drivers, I think that should be CONFIG_PM_SLEEP
> 
> Which other drivers did you mean?
> 
> What about those drivers that all handle it via CONFIG_PM:
> 
> abituguru.c
> abituguru3.c
> exynos4_tmu.c
> gpio-fan.c
> jc42.c
> lm75.c
> tmp102.c
> 
> ?

Those drivers don't use SET_SYSTEM_SLEEP_PM_OPS. I checked several drivers
which do use SET_SYSTEM_SLEEP_PM_OPS, and they all use CONFIG_PM_SLEEP.

> 
> >> +#else
> >> +#define max6639_suspend NULL
> >> +#define max6639_resume NULL
> >> +#endif
> >>  
> > ... and that else case should not be necessary.
> 
The drivers using SET_SYSTEM_SLEEP_PM_OPS don't define the else case.

Thanks,
Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

* Re: [lm-sensors] [PATCH] hwmon: max6639: Fix CONFIG_PM compile option
  2012-03-24 18:36 [lm-sensors] [PATCH] hwmon: max6639: Fix CONFIG_PM compile option Roland Stigge
                   ` (2 preceding siblings ...)
  2012-03-24 22:52 ` Guenter Roeck
@ 2012-03-26 10:37 ` Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2012-03-26 10:37 UTC (permalink / raw)
  To: lm-sensors


[-- Attachment #1.1: Type: text/plain, Size: 1006 bytes --]

On Sat, Mar 24, 2012 at 03:52:38PM -0700, Guenter Roeck wrote:
> On Sat, Mar 24, 2012 at 03:45:43PM -0400, Roland Stigge wrote:

> > >> +#ifdef CONFIG_PM

> > > Looking into other drivers, I think that should be CONFIG_PM_SLEEP

> > Which other drivers did you mean?

> > What about those drivers that all handle it via CONFIG_PM:

> > abituguru.c
> > abituguru3.c
> > exynos4_tmu.c
> > gpio-fan.c
> > jc42.c
> > lm75.c
> > tmp102.c

> Those drivers don't use SET_SYSTEM_SLEEP_PM_OPS. I checked several drivers
> which do use SET_SYSTEM_SLEEP_PM_OPS, and they all use CONFIG_PM_SLEEP.

It's nothing to do with SET_SYSTEM_SLEEP_PM_OPS - it's more about
drivers that are following current best practice (which includes using
the SET_ macros).  A modern driver should be using CONFIG_PM_SLEEP for
system sleep operations and CONFIG_PM_RUNTIME for runtime PM operations
since they can be enabled independently.  CONFIG_PM should only control
having dev_pm_ops at all (if you want to bother with the ifdefery).

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

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

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

end of thread, other threads:[~2012-03-26 10:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-24 18:36 [lm-sensors] [PATCH] hwmon: max6639: Fix CONFIG_PM compile option Roland Stigge
2012-03-24 19:12 ` Guenter Roeck
2012-03-24 19:45 ` Roland Stigge
2012-03-24 22:52 ` Guenter Roeck
2012-03-26 10:37 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.