mmc: core: Move mmc_flush_cache() from core.c to mmc_ops.c
authorUlf Hansson <ulf.hansson@linaro.org>
Thu, 8 Jun 2017 13:27:40 +0000 (15:27 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 20 Jun 2017 08:30:44 +0000 (10:30 +0200)
The mmc_flush_cache() is a eMMC specific function, let's move it to
mmc_ops.c to make that clear.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
drivers/mmc/core/core.c
drivers/mmc/core/mmc_ops.c

index de31f304f94afe6193e186fc2d84ed26d5c92ba1..d40697fae911a6b96340876b63170b1b05172e72 100644 (file)
@@ -2729,27 +2729,6 @@ int mmc_power_restore_host(struct mmc_host *host)
 }
 EXPORT_SYMBOL(mmc_power_restore_host);
 
-/*
- * Flush the cache to the non-volatile storage.
- */
-int mmc_flush_cache(struct mmc_card *card)
-{
-       int err = 0;
-
-       if (mmc_card_mmc(card) &&
-                       (card->ext_csd.cache_size > 0) &&
-                       (card->ext_csd.cache_ctrl & 1)) {
-               err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
-                               EXT_CSD_FLUSH_CACHE, 1, 0);
-               if (err)
-                       pr_err("%s: cache flush error %d\n",
-                                       mmc_hostname(card->host), err);
-       }
-
-       return err;
-}
-EXPORT_SYMBOL(mmc_flush_cache);
-
 #ifdef CONFIG_PM_SLEEP
 /* Do the card removal on suspend if card is assumed removeable
  * Do that in pm notifier while userspace isn't yet frozen, so we will be able
index 26760e76e924e98f2f82d2d40a30f8d353e26179..d28434f26f9ae5148bca06c9857c3629a8db963a 100644 (file)
@@ -1022,6 +1022,27 @@ out:
        mmc_release_host(card->host);
 }
 
+/*
+ * Flush the cache to the non-volatile storage.
+ */
+int mmc_flush_cache(struct mmc_card *card)
+{
+       int err = 0;
+
+       if (mmc_card_mmc(card) &&
+                       (card->ext_csd.cache_size > 0) &&
+                       (card->ext_csd.cache_ctrl & 1)) {
+               err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
+                               EXT_CSD_FLUSH_CACHE, 1, 0);
+               if (err)
+                       pr_err("%s: cache flush error %d\n",
+                                       mmc_hostname(card->host), err);
+       }
+
+       return err;
+}
+EXPORT_SYMBOL(mmc_flush_cache);
+
 static int mmc_cmdq_switch(struct mmc_card *card, bool enable)
 {
        u8 val = enable ? EXT_CSD_CMDQ_MODE_ENABLED : 0;