Skip to contentSkip to conversation

gpio: omap: Pass __maybe_unused to the suspend()/resume() hooks

PATCH In review Fabio Estevam 2 participants 3 messages Aug 24, 2020 – Sep 9, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: omap: Pass __maybe_unused to the suspend()/resume() hooks

When building a defconfig that does not have CONFIG_PM_SLEEP selected, the following build warnings are seen:

drivers/gpio/gpio-omap.c:1531:12: warning: 'omap_gpio_resume' defined but not used [-Wunused-function] drivers/gpio/gpio-omap.c:1519:12: warning: 'omap_gpio_suspend' defined but not used [-Wunused-function]

Pass __maybe_unused to avoid these warnings.

Fixes f02a03985d06 ("gpio: omap: Add missing PM ops for suspend")
---
 drivers/gpio/gpio-omap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpio/gpio-omap.c +2 -2
index 7fbe0c9e1fc1..0ea640fb636c 100644
@@ -1516,7 +1516,7 @@ static int __maybe_unused omap_gpio_runtime_resume(struct device *dev)
 	return 0;
 }
 
-static int omap_gpio_suspend(struct device *dev)
+static int __maybe_unused omap_gpio_suspend(struct device *dev)
 {
 	struct gpio_bank *bank = dev_get_drvdata(dev);
 
@@ -1528,7 +1528,7 @@ static int omap_gpio_suspend(struct device *dev)
 	return omap_gpio_runtime_suspend(dev);
 }
 
-static int omap_gpio_resume(struct device *dev)
+static int __maybe_unused omap_gpio_resume(struct device *dev)
 {
 	struct gpio_bank *bank = dev_get_drvdata(dev);
 
Signature · 1 line
2.17.1
#1 lore raw
Quoted 29 lines · Fabio Estevam

When building a defconfig that does not have CONFIG_PM_SLEEP selected, the following build warnings are seen:

drivers/gpio/gpio-omap.c:1531:12: warning: 'omap_gpio_resume' defined but not used [-Wunused-function] drivers/gpio/gpio-omap.c:1519:12: warning: 'omap_gpio_suspend' defined but not used [-Wunused-function]

Pass __maybe_unused to avoid these warnings.

Fixes f02a03985d06 ("gpio: omap: Add missing PM ops for suspend")
---
  drivers/gpio/gpio-omap.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpio/gpio-omap.c +1 -1
index 7fbe0c9e1fc1..0ea640fb636c 100644
@@ -1516,7 +1516,7 @@ static int __maybe_unused omap_gpio_runtime_resume(struct device *dev)
  	return 0;
  }
 
-static int omap_gpio_suspend(struct device *dev)
+static int __maybe_unused omap_gpio_suspend(struct device *dev)
  {
  	struct gpio_bank *bank = dev_get_drvdata(dev);
 

drivers/gpio/gpio-omap.c static int omap_gpio_suspend(struct device *dev) · line 1534

Quoted 8 lines
drivers/gpio/gpio-omap.c +1 -1
@@ -1528,7 +1528,7 @@ static int omap_gpio_suspend(struct device *dev)
  	return omap_gpio_runtime_suspend(dev);
  }
 
-static int omap_gpio_resume(struct device *dev)
+static int __maybe_unused omap_gpio_resume(struct device *dev)
  {
  	struct gpio_bank *bank = dev_get_drvdata(dev);
 

Duplicates
https://www.spinics.net/lists/arm-kernel/msg830596.html

Signature · 2 lines
Best regards,
grygorii