From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932764AbbHXKPa (ORCPT ); Mon, 24 Aug 2015 06:15:30 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:56362 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751422AbbHXKP1 (ORCPT ); Mon, 24 Aug 2015 06:15:27 -0400 From: Kishon Vijay Abraham I To: , , , CC: , , , , Subject: [RFC PATCH 1/2] mmc: core: sdio: move mmc_sdio_init_card to a separate function Date: Mon, 24 Aug 2015 15:45:16 +0530 Message-ID: <1440411317-8813-1-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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