Skip to contentSkip to conversation

iio: common: ssp_sensors: Protect PM-only functions to kill warning

PATCH Applied Geert Uytterhoeven 3 participants 3 messages Feb 18, 2015 – Feb 22, 2015 IIO

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 iio: common: ssp_sensors: Protect PM-only functions to kill warning

If CONFIG_PM_SLEEP=n:

drivers/iio/common/ssp_sensors/ssp_dev.c:644: warning: ‘ssp_suspend’ defined but not used drivers/iio/common/ssp_sensors/ssp_dev.c:669: warning: ‘ssp_resume’ defined but not used

Protect the unused functions by #ifdef CONFIG_PM_SLEEP to fix this.

---
v2:
- Fix driver name in one-line summary

---
 drivers/iio/common/ssp_sensors/ssp_dev.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/iio/common/ssp_sensors/ssp_dev.c +2 -0
index 52d70435f5a11c55..55a90082a29bd484 100644
@@ -640,6 +640,7 @@ static int ssp_remove(struct spi_device *spi)
 	return 0;
 }
 
+#ifdef CONFIG_PM_SLEEP
 static int ssp_suspend(struct device *dev)
 {
 	int ret;
@@ -688,6 +689,7 @@ static int ssp_resume(struct device *dev)
 
 	return 0;
 }
+#endif /* CONFIG_PM_SLEEP */
 
 static const struct dev_pm_ops ssp_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(ssp_suspend, ssp_resume)
Signature · 1 line
1.9.1
Acked-by on v2 1/1
#1 lore raw
Quoted 29 lines · Geert Uytterhoeven

If CONFIG_PM_SLEEP=n:

drivers/iio/common/ssp_sensors/ssp_dev.c:644: warning: ‘ssp_suspend’ defined but not used drivers/iio/common/ssp_sensors/ssp_dev.c:669: warning: ‘ssp_resume’ defined but not used

Protect the unused functions by #ifdef CONFIG_PM_SLEEP to fix this.

---
v2:
- Fix driver name in one-line summary

---
 drivers/iio/common/ssp_sensors/ssp_dev.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/iio/common/ssp_sensors/ssp_dev.c +1 -0
index 52d70435f5a11c55..55a90082a29bd484 100644
@@ -640,6 +640,7 @@ static int ssp_remove(struct spi_device *spi)
 	return 0;
 }
 
+#ifdef CONFIG_PM_SLEEP
 static int ssp_suspend(struct device *dev)
 {
 	int ret;

drivers/iio/common/ssp_sensors/ssp_dev.c static int ssp_resume(struct device *dev) · line 695

Quoted 7 lines
drivers/iio/common/ssp_sensors/ssp_dev.c +1 -0
@@ -688,6 +689,7 @@ static int ssp_resume(struct device *dev)
 
 	return 0;
 }
+#endif /* CONFIG_PM_SLEEP */
 
 static const struct dev_pm_ops ssp_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(ssp_suspend, ssp_resume)

Thanks for doing that.
Karol

maintainer Applied
#2 lore raw
Quoted 34 lines · Karol Wrona
Quoted 33 lines · Geert Uytterhoeven

If CONFIG_PM_SLEEP=n:

drivers/iio/common/ssp_sensors/ssp_dev.c:644: warning: ‘ssp_suspend’ defined but not used drivers/iio/common/ssp_sensors/ssp_dev.c:669: warning: ‘ssp_resume’ defined but not used

Protect the unused functions by #ifdef CONFIG_PM_SLEEP to fix this.

---
v2:
- Fix driver name in one-line summary

---
 drivers/iio/common/ssp_sensors/ssp_dev.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/iio/common/ssp_sensors/ssp_dev.c +2 -0
index 52d70435f5a11c55..55a90082a29bd484 100644
@@ -640,6 +640,7 @@ static int ssp_remove(struct spi_device *spi)
 	return 0;
 }
 
+#ifdef CONFIG_PM_SLEEP
 static int ssp_suspend(struct device *dev)
 {
 	int ret;
@@ -688,6 +689,7 @@ static int ssp_resume(struct device *dev)
 
 	return 0;
 }
+#endif /* CONFIG_PM_SLEEP */
 
Quoted 5 lines

drivers/iio/common/ssp_sensors/ssp_dev.c static int ssp_resume(struct device *dev) · line 695

Quoted 3 lines
drivers/iio/common/ssp_sensors/ssp_dev.c +0 -0
 static const struct dev_pm_ops ssp_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(ssp_suspend, ssp_resume)

Applied to the fixes-post-3.20-rc1 branch which I'll sort out once rc1 is tagged.

Thanks,

Jonathan

Quoted 8 lines

Thanks for doing that.
Karol
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html