hwmon: max6639: Fix CONFIG_PM compile option
PATCH 1/1 hwmon: max6639: Fix CONFIG_PM compile option
This patch fixes a compiler warning in case CONFIG_PM is not defined
---
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(+)
drivers/hwmon/max6639.c +5 -0
@@ -596,6 +596,7 @@ static int max6639_remove(struct i2c_clireturn 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 devicereturn 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
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 16 lines · Roland Stigge
This patch fixes a compiler warning in case
CONFIG_PMis not definedSigned-off-by Roland Stigge <[email protected]>---
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(+)
drivers/hwmon/max6639.c static int max6639_remove(struct i2c_cli · line 599
Quoted 4 lines
drivers/hwmon/max6639.c +1
-0@@ -596,6 +596,7 @@ static int max6639_remove(struct i2c_clireturn 0 ; } +#ifdef CONFIG_PM
Looking into other drivers, I think that should be CONFIG_PM_SLEEP
drivers/hwmon/max6639.c static int max6639_resume(struct device · line 625
Quoted 12 lines
drivers/hwmon/max6639.c +4
-0static int max6639_suspend (struct device *dev) {struct i2c_client *client =to_i2c_client (dev);@@ -617,6 +618,10 @@ static int max6639_resume(struct devicereturn 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
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi,
Quoted 9 lines · Guenter Roeck
drivers/hwmon/max6639.c static int max6639_remove(struct i2c_cli · line 599
Quoted 7 lines
drivers/hwmon/max6639.c +1
-0@@ -596,6 +596,7 @@ static int max6639_remove(struct i2c_clireturn 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.cabituguru3.cexynos4_tmu.cgpio-fan.cjc42.clm75.ctmp102.c
?
Quoted 6 lines
drivers/hwmon/max6639.c static int max6639_resume(struct device · line 624
Quoted 5 lines
drivers/hwmon/max6639.c +4
-0+#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
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 25 lines · Roland Stigge
Hi,
Quoted 9 lines · Guenter Roeck
drivers/hwmon/max6639.c static int max6639_remove(struct i2c_cli · line 599
Quoted 7 lines
drivers/hwmon/max6639.c +1
-0@@ -596,6 +596,7 @@ static int max6639_remove(struct i2c_clireturn 0 ; } +#ifdef CONFIG_PM Looking into other drivers, I think that should be
CONFIG_PM_SLEEPWhich other drivers did you mean?
What about those drivers that all handle it via
CONFIG_PM:
abituguru.cabituguru3.cexynos4_tmu.cgpio-fan.cjc42.clm75.ctmp102.c
Quoted 1 line
?
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.
Quoted 8 lines
Quoted 7 lines
drivers/hwmon/max6639.c static int max6639_resume(struct device · line 624
Quoted 6 lines
drivers/hwmon/max6639.c +4
-0+#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
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 18 lines · Guenter Roeck
Quoted 8 lines · Roland Stigge
Quoted 3 lines
Quoted 1 line
+#ifdef
CONFIG_PMLooking into other drivers, I think that should be
CONFIG_PM_SLEEPWhich other drivers did you mean?
What about those drivers that all handle it via
CONFIG_PM:Quoted 7 lines
abituguru.cabituguru3.cexynos4_tmu.cgpio-fan.cjc42.clm75.ctmp102.c
Quoted 2 lines
Those drivers don't use
SET_SYSTEM_SLEEP_PM_OPS. I checked several drivers which do useSET_SYSTEM_SLEEP_PM_OPS, and they all useCONFIG_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).
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors