Skip to contentSkip to conversation

mfd: rk808: mark pm functions __maybe_unused

PATCH Applied Arnd Bergmann 2 participants 2 messages Jul 8, 2019 – Jul 25, 2019 Multifunction devices (MFD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: rk808: mark pm functions __maybe_unused

The newly added suspend/resume functions are only used if CONFIG_PM is enabled:

drivers/mfd/rk808.c:752:12: error: 'rk8xx_resume' defined but not used [-Werror=unused-function] drivers/mfd/rk808.c:732:12: error: 'rk8xx_suspend' defined but not used [-Werror=unused-function]

Mark them as __maybe_unused so the compiler can silently drop them when they are not needed.

Fixes 586c1b4125b3 ("mfd: rk808: Add RK817 and RK809 support")
---
 drivers/mfd/rk808.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/rk808.c +2 -2
index 601cefb5c9d8..9a9e6315ba46 100644
@@ -729,7 +729,7 @@ static int rk808_remove(struct i2c_client *client)
 	return 0;
 }
 
-static int rk8xx_suspend(struct device *dev)
+static int __maybe_unused rk8xx_suspend(struct device *dev)
 {
 	struct rk808 *rk808 = i2c_get_clientdata(rk808_i2c_client);
 	int ret = 0;
@@ -749,7 +749,7 @@ static int rk8xx_suspend(struct device *dev)
 	return ret;
 }
 
-static int rk8xx_resume(struct device *dev)
+static int __maybe_unused rk8xx_resume(struct device *dev)
 {
 	struct rk808 *rk808 = i2c_get_clientdata(rk808_i2c_client);
 	int ret = 0;
Signature · 1 line
2.20.0
Applied
#1 lore raw
Quoted 6 lines · Arnd Bergmann

The newly added suspend/resume functions are only used if CONFIG_PM is enabled:

drivers/mfd/rk808.c:752:12: error: 'rk8xx_resume' defined but not used [-Werror=unused-function] drivers/mfd/rk808.c:732:12: error: 'rk8xx_suspend' defined but not used [-Werror=unused-function]

Quoted 8 lines

Mark them as __maybe_unused so the compiler can silently drop them when they are not needed.

Fixes 586c1b4125b3 ("mfd: rk808: Add RK817 and RK809 support")
---
 drivers/mfd/rk808.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog