From patchwork Mon Aug 24 10:15:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 7063231 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0F0C29F305 for ; Mon, 24 Aug 2015 10:16:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EAA392064E for ; Mon, 24 Aug 2015 10:16:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 102E72047B for ; Mon, 24 Aug 2015 10:16:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753804AbbHXKP3 (ORCPT ); Mon, 24 Aug 2015 06:15:29 -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 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id t7OAFMj8012847; Mon, 24 Aug 2015 05:15:22 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t7OAFLjI021709; Mon, 24 Aug 2015 05:15:21 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.224.2; Mon, 24 Aug 2015 05:15:21 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id t7OAFIUJ026925; Mon, 24 Aug 2015 05:15:19 -0500 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 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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;