All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: linux-mmc@vger.kernel.org, Ulf Hansson <ulf.hansson@linaro.org>
Cc: Jaehoon Chung <jh80.chung@samsung.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Linus Walleij <linus.walleij@linaro.org>
Subject: [PATCH 4/9] mmc: core: Move mmc_flush_cache() from core.c to mmc_ops.c
Date: Thu,  8 Jun 2017 15:27:40 +0200	[thread overview]
Message-ID: <1496928465-25004-5-git-send-email-ulf.hansson@linaro.org> (raw)
In-Reply-To: <1496928465-25004-1-git-send-email-ulf.hansson@linaro.org>

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>
---
 drivers/mmc/core/core.c    | 21 ---------------------
 drivers/mmc/core/mmc_ops.c | 21 +++++++++++++++++++++
 2 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index de31f30..d40697f 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -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
diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c
index 53e4da48..f79d680 100644
--- a/drivers/mmc/core/mmc_ops.c
+++ b/drivers/mmc/core/mmc_ops.c
@@ -1022,6 +1022,27 @@ void mmc_start_bkops(struct mmc_card *card, bool from_exception)
 	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;
-- 
2.7.4


  parent reply	other threads:[~2017-06-08 13:28 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-08 13:27 [PATCH 0/9] mmc: core: Some trivial re-factoring and cleanups Ulf Hansson
2017-06-08 13:27 ` [PATCH 1/9] mmc: core: Don't export some eMMC specific functions from core.c Ulf Hansson
2017-06-09 13:22   ` Linus Walleij
2017-06-09 13:32     ` Ulf Hansson
2017-06-08 13:27 ` [PATCH 2/9] mmc: core: Move mmc bkops functions from core.c to mmc_ops.c Ulf Hansson
2017-06-09 13:23   ` Linus Walleij
2017-06-09 13:34     ` Ulf Hansson
2017-06-08 13:27 ` [PATCH 3/9] mmc: core: Move mmc_interrupt_hpi() " Ulf Hansson
2017-06-09 13:24   ` Linus Walleij
2017-06-08 13:27 ` Ulf Hansson [this message]
2017-06-09 13:25   ` [PATCH 4/9] mmc: core: Move mmc_flush_cache() " Linus Walleij
2017-06-08 13:27 ` [PATCH 5/9] mmc: core: Make mmc_can_reset() static Ulf Hansson
2017-06-09 13:27   ` Linus Walleij
2017-06-08 13:27 ` [PATCH 6/9] mmc: core: Remove redundant code in mmc_send_cid() Ulf Hansson
2017-06-09 13:29   ` Linus Walleij
2017-06-08 13:27 ` [PATCH 7/9] mmc: core: Re-factor code for sending CID Ulf Hansson
2017-06-09 13:32   ` Linus Walleij
2017-06-08 13:27 ` [PATCH 8/9] mmc: core: Drop mmc_all_send_cid() and use mmc_send_cxd_native() instead Ulf Hansson
2017-06-09 13:32   ` Linus Walleij
2017-06-08 13:27 ` [PATCH 9/9] mmc: core: Clarify code for sending CSD Ulf Hansson
2017-06-09 13:33   ` Linus Walleij
2017-06-16  0:49 ` [PATCH 0/9] mmc: core: Some trivial re-factoring and cleanups Shawn Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1496928465-25004-5-git-send-email-ulf.hansson@linaro.org \
    --to=ulf.hansson@linaro.org \
    --cc=adrian.hunter@intel.com \
    --cc=jh80.chung@samsung.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-mmc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.