linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 1/2] mmc: core: sdio: move mmc_sdio_init_card to a separate function
@ 2015-08-24 10:15 Kishon Vijay Abraham I
  2015-08-24 10:15 ` [RFC PATCH 2/2] mmc: core: sdio: claim host before power up or power off Kishon Vijay Abraham I
  0 siblings, 1 reply; 4+ messages in thread
From: Kishon Vijay Abraham I @ 2015-08-24 10:15 UTC (permalink / raw)
  To: ulf.hansson, linux-mmc, linux-kernel, nsekhar
  Cc: adrian.hunter, neilb, zhonghui.fu, afenkart, kishon

No functional change. Move mmc_sdio_init_card to a separate
function (_mmc_sdio_power_restore) and invoke it from
mmc_sdio_power_restore. This is in preparation to invoke
_mmc_sdio_power_restore from mmc_sdio_runtime_resume so that
mmc_claim_host can be invoked before mmc_power_up.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 drivers/mmc/core/sdio.c |   22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index b91abed..0cbbfb8 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -970,15 +970,10 @@ static int mmc_sdio_resume(struct mmc_host *host)
 	return err;
 }
 
-static int mmc_sdio_power_restore(struct mmc_host *host)
+static int _mmc_sdio_power_restore(struct mmc_host *host)
 {
 	int ret;
 
-	BUG_ON(!host);
-	BUG_ON(!host->card);
-
-	mmc_claim_host(host);
-
 	/*
 	 * Reset the card by performing the same steps that are taken by
 	 * mmc_rescan_try_freq() and mmc_attach_sdio() during a "normal" probe.
@@ -1002,14 +997,25 @@ static int mmc_sdio_power_restore(struct mmc_host *host)
 
 	ret = mmc_send_io_op_cond(host, 0, NULL);
 	if (ret)
-		goto out;
+		return ret;
 
 	ret = mmc_sdio_init_card(host, host->card->ocr, host->card,
 				mmc_card_keep_power(host));
 	if (!ret && host->sdio_irqs)
 		mmc_signal_sdio_irq(host);
 
-out:
+	return 0;
+}
+
+static int mmc_sdio_power_restore(struct mmc_host *host)
+{
+	int ret;
+
+	BUG_ON(!host);
+	BUG_ON(!host->card);
+
+	mmc_claim_host(host);
+	ret = _mmc_sdio_power_restore(host);
 	mmc_release_host(host);
 
 	return ret;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-09-11 13:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-24 10:15 [RFC PATCH 1/2] mmc: core: sdio: move mmc_sdio_init_card to a separate function Kishon Vijay Abraham I
2015-08-24 10:15 ` [RFC PATCH 2/2] mmc: core: sdio: claim host before power up or power off Kishon Vijay Abraham I
2015-09-11 12:45   ` Ulf Hansson
2015-09-11 13:17     ` Kishon Vijay Abraham I

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).