|
@@ -127,10 +127,16 @@ static int mmc_bus_suspend(struct device *dev)
|
|
{
|
|
{
|
|
struct mmc_driver *drv = to_mmc_driver(dev->driver);
|
|
struct mmc_driver *drv = to_mmc_driver(dev->driver);
|
|
struct mmc_card *card = mmc_dev_to_card(dev);
|
|
struct mmc_card *card = mmc_dev_to_card(dev);
|
|
- int ret = 0;
|
|
|
|
|
|
+ struct mmc_host *host = card->host;
|
|
|
|
+ int ret;
|
|
|
|
|
|
- if (dev->driver && drv->suspend)
|
|
|
|
|
|
+ if (dev->driver && drv->suspend) {
|
|
ret = drv->suspend(card);
|
|
ret = drv->suspend(card);
|
|
|
|
+ if (ret)
|
|
|
|
+ return ret;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ret = host->bus_ops->suspend(host);
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -138,10 +144,17 @@ static int mmc_bus_resume(struct device *dev)
|
|
{
|
|
{
|
|
struct mmc_driver *drv = to_mmc_driver(dev->driver);
|
|
struct mmc_driver *drv = to_mmc_driver(dev->driver);
|
|
struct mmc_card *card = mmc_dev_to_card(dev);
|
|
struct mmc_card *card = mmc_dev_to_card(dev);
|
|
- int ret = 0;
|
|
|
|
|
|
+ struct mmc_host *host = card->host;
|
|
|
|
+ int ret;
|
|
|
|
+
|
|
|
|
+ ret = host->bus_ops->resume(host);
|
|
|
|
+ if (ret)
|
|
|
|
+ pr_warn("%s: error %d during resume (card was removed?)\n",
|
|
|
|
+ mmc_hostname(host), ret);
|
|
|
|
|
|
if (dev->driver && drv->resume)
|
|
if (dev->driver && drv->resume)
|
|
ret = drv->resume(card);
|
|
ret = drv->resume(card);
|
|
|
|
+
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|