From: Bing Zhao Date: Thu, 15 Nov 2012 21:48:19 +0000 (-0800) Subject: UPSTREAM: mwifiex: report error to MMC core if we cannot suspend X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=e0f25053d60ba55f8dfa2c364cc8efab17c11e40;p=people%2Faperard%2Flinux-chromebook.git UPSTREAM: mwifiex: report error to MMC core if we cannot suspend When host_sleep_config command fails we should return error to MMC core to indicate the failure for our device. The misspelled variable is also removed as it's redundant. Cc: "3.0+" Signed-off-by: Bing Zhao Signed-off-by: Paul Stewart BUG=chrome-os-partner:15129 TEST=Boot, associate, speed test, suspend, resume Change-Id: I9d53425b29050274840030e63f95969601ee622f Reviewed-on: https://gerrit.chromium.org/gerrit/38285 Reviewed-by: Bing Zhao Reviewed-by: mukesh agrawal Commit-Ready: Paul Stewart Tested-by: Paul Stewart --- diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c index 8306fb21e3810..28a8e99658621 100644 --- a/drivers/net/wireless/mwifiex/sdio.c +++ b/drivers/net/wireless/mwifiex/sdio.c @@ -161,7 +161,6 @@ static int mwifiex_sdio_suspend(struct device *dev) struct sdio_mmc_card *card; struct mwifiex_adapter *adapter; mmc_pm_flag_t pm_flag = 0; - int hs_actived = 0; int i; int ret = 0; @@ -188,12 +187,14 @@ static int mwifiex_sdio_suspend(struct device *dev) adapter = card->adapter; /* Enable the Host Sleep */ - hs_actived = mwifiex_enable_hs(adapter); - if (hs_actived) { - pr_debug("cmd: suspend with MMC_PM_KEEP_POWER\n"); - ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER); + if (!mwifiex_enable_hs(adapter)) { + dev_err(adapter->dev, "cmd: failed to suspend\n"); + return -EFAULT; } + dev_dbg(adapter->dev, "cmd: suspend with MMC_PM_KEEP_POWER\n"); + ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER); + /* Indicate device suspended */ adapter->is_suspended = true;