aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-12-02 08:48:50 -0500
committerChris Ball <cjb@laptop.org>2012-12-06 13:55:04 -0500
commitb0afd8f68adf6a9b671b0420ab9116a36409ef7f (patch)
treeb73bdeb24d8ae2444480f8c0572f6c17f2f5168b /drivers/mmc
parent063f96c2230052356d8653381912e618a8ae951c (diff)
mmc: sdio: Add empty bus-level suspend/resume callbacks
Suspend methods provided by SDIO drivers are not supposed to be called by the PM core. Instead, when the SDIO core gets to suspend a device's ancestor, it calls the device driver's suspend routine. However, the PM core executes suspend callback routines directly for device drivers whose bus types don't provide suspend callbacks. In consequece, because the SDIO bus type doesn't provide a suspend callback, the SDIO drivers' suspend routines will be executed by the PM core (which shouldn't happen). To prevent this from happening, add empty system suspend/resume callbacks for the SDIO bus type. An analogous change had been made already by commit (e841a7c mmc: sdio: Use empty system suspend/resume callbacks at the bus level), but then it was reverted inadvertently by commit (d8e2ac3 mmc: sdio: Fix PM_SLEEP related build warnings) that attempted to fix build warnings introduced by commit e841a7c. Reported-by: NeilBrown <neilb@suse.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/core/sdio_bus.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c
index 6bf68799fe97..fc2d94a3b60c 100644
--- a/drivers/mmc/core/sdio_bus.c
+++ b/drivers/mmc/core/sdio_bus.c
@@ -193,7 +193,21 @@ static int sdio_bus_remove(struct device *dev)
193} 193}
194 194
195#ifdef CONFIG_PM 195#ifdef CONFIG_PM
196
197#ifdef CONFIG_PM_SLEEP
198static int pm_no_operation(struct device *dev)
199{
200 /*
201 * Prevent the PM core from calling SDIO device drivers' suspend
202 * callback routines, which it is not supposed to do, by using this
203 * empty function as the bus type suspend callaback for SDIO.
204 */
205 return 0;
206}
207#endif
208
196static const struct dev_pm_ops sdio_bus_pm_ops = { 209static const struct dev_pm_ops sdio_bus_pm_ops = {
210 SET_SYSTEM_SLEEP_PM_OPS(pm_no_operation, pm_no_operation)
197 SET_RUNTIME_PM_OPS( 211 SET_RUNTIME_PM_OPS(
198 pm_generic_runtime_suspend, 212 pm_generic_runtime_suspend,
199 pm_generic_runtime_resume, 213 pm_generic_runtime_resume,