Skip to contentSkip to conversation

mmc: core: check PM_SLEEP for mmc_bus_suspend/resume callbacks

PATCH In review Chuanxiao Dong 2 participants 2 messages Apr 23, 2012 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: core: check PM_SLEEP for mmc_bus_suspend/resume callbacks

If PM_SLEEP is not enabled, mmc.c will give warnning since mmc_bus_suspend/ mmc_bus_resume functions are defined but not used. This patch can fix this warnning.

---
 drivers/mmc/core/bus.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/mmc/core/bus.c +2 -0
index c60cee9..9b68933 100644
@@ -122,6 +122,7 @@ static int mmc_bus_remove(struct device *dev)
 	return 0;
 }
 
+#ifdef CONFIG_PM_SLEEP
 static int mmc_bus_suspend(struct device *dev)
 {
 	struct mmc_driver *drv = to_mmc_driver(dev->driver);
@@ -143,6 +144,7 @@ static int mmc_bus_resume(struct device *dev)
 		ret = drv->resume(card);
 	return ret;
 }
+#endif
 
 #ifdef CONFIG_PM_RUNTIME
 
Signature · 1 line
1.7.1
#1 lore raw

Hi,

Quoted 23 lines · Chuanxiao Dong

If PM_SLEEP is not enabled, mmc.c will give warnning since mmc_bus_suspend/ mmc_bus_resume functions are defined but not used. This patch can fix this warnning.

---
 drivers/mmc/core/bus.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/mmc/core/bus.c +1 -0
index c60cee9..9b68933 100644
@@ -122,6 +122,7 @@ static int mmc_bus_remove(struct device *dev)
 	return 0;
 }
 
+#ifdef CONFIG_PM_SLEEP
 static int mmc_bus_suspend(struct device *dev)
 {
 	struct mmc_driver *drv = to_mmc_driver(dev->driver);

drivers/mmc/core/bus.c static int mmc_bus_resume(struct device *dev) · line 149

Quoted 6 lines
drivers/mmc/core/bus.c +1 -0
@@ -143,6 +144,7 @@ static int mmc_bus_resume(struct device *dev)
 		ret = drv->resume(card);
 	return ret;
 }
+#endif
 
 #ifdef CONFIG_PM_RUNTIME

Thanks, pushed to mmc-next for 3.5.

- Chris.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child