mmc: sdio: Claim host in sdio_reset_comm()
authorDmitry Shmidt <dimitrysh@google.com>
Wed, 29 Jul 2009 17:22:03 +0000 (10:22 -0700)
committerArve Hjønnevåg <arve@android.com>
Mon, 1 Jul 2013 20:40:24 +0000 (13:40 -0700)
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
drivers/mmc/core/sdio.c

index ee200e3b4865326cb8a479483c2d3c0963a8b638..922c8e5f22c63aca62db306ea78e7d5dd14e1e2b 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <linux/err.h>
+#include <linux/module.h>
 #include <linux/pm_runtime.h>
 
 #include <linux/mmc/host.h>
@@ -1251,6 +1252,8 @@ int sdio_reset_comm(struct mmc_card *card)
        int err;
 
        printk("%s():\n", __func__);
+       mmc_claim_host(host);
+
        mmc_go_idle(host);
 
        mmc_set_clock(host, host->f_min);
@@ -1291,13 +1294,12 @@ int sdio_reset_comm(struct mmc_card *card)
        err = sdio_enable_wide(card);
        if (err)
                goto err;
-
+       mmc_release_host(host);
        return 0;
- err:
+err:
        printk("%s: Error resetting SDIO communications (%d)\n",
               mmc_hostname(host), err);
+       mmc_release_host(host);
        return err;
 }
 EXPORT_SYMBOL(sdio_reset_comm);
-
-