From patchwork Mon Apr 11 13:32:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 8801481 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 BBB379F36E for ; Mon, 11 Apr 2016 13:33:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C69AC20123 for ; Mon, 11 Apr 2016 13:33:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CA7EC201B9 for ; Mon, 11 Apr 2016 13:33:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932567AbcDKNct (ORCPT ); Mon, 11 Apr 2016 09:32:49 -0400 Received: from mail-lf0-f48.google.com ([209.85.215.48]:32892 "EHLO mail-lf0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933050AbcDKNcs (ORCPT ); Mon, 11 Apr 2016 09:32:48 -0400 Received: by mail-lf0-f48.google.com with SMTP id e190so155215119lfe.0 for ; Mon, 11 Apr 2016 06:32:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id; bh=9RCzl8jc+EPhADCfc04D1vOVFGkaEsG1eLdNf/lqmEw=; b=SimSq+Z/N2PdbD+7cvXekvkfMyuh9xorxiPNJmPuwc+66BOx/SMxMG1dALYjWIwUS8 DgBFePR8wQBlwE6Q0Ok6P1BF5lMzXJ7C72dp4KCYPy3JCm+x/5XLIxGkkG+jqoipS9dp AK08yuo7VNy/EMMlQz3588hDtGJDcrB/7yYkQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=9RCzl8jc+EPhADCfc04D1vOVFGkaEsG1eLdNf/lqmEw=; b=KFUd1O9pVw3BiUgb/FYxreQ+66fgTQoZb5m+dP36kAGzHw7SYWyHiGPEOuZKfl6PZc 7tni+B+T0UCaUtHjBH+SR1Uyk12rk99QElGn+42W0nwoNiBK4mpADBB/z5rEklHwok91 sFh5RfOd0U8Njs6ADOrBjhhaOlATygU2o5ovceULQW9Bh/sqYVavGVSLzCsTIsU92fGz tUaCyoboaLuzk+5rb7zuZULV8ab3zXqO2x0cY2RfH2qy0xVcPDmxHCRCQGZVwYKz/WY6 HEEPxPbfpx+bPtMwnuLHGtdYwRdXGHf3HJCrLMfFqTd8W/oJpLKquGCqFvTrf2CfBJH9 /kzQ== X-Gm-Message-State: AD7BkJJ21T0kfpNIkJntCM/2GbOuWIRpD/cYDgHxQQe54/WNbwvNUp762eMjmHt0AKmBlgcl X-Received: by 10.112.170.201 with SMTP id ao9mr6629449lbc.38.1460381566519; Mon, 11 Apr 2016 06:32:46 -0700 (PDT) Received: from uffe-Latitude-E6430s.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id z7sm1062766lbr.33.2016.04.11.06.32.45 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Apr 2016 06:32:45 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson , Adrian Hunter Subject: [PATCH] mmc: sdhci: Move sdhci_runtime_pm_bus_off|on() to avoid pre-definition Date: Mon, 11 Apr 2016 15:32:41 +0200 Message-Id: <1460381561-12511-1-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 There are no need to have two versions of sdhci_runtime_pm_bus_off|on(), depending on whether CONFIG_PM is set or unset. Thus it's easy to move the implementation of these functions a bit earlier to avoid the unnecessary pre-definition of them, so let's do that. Signed-off-by: Ulf Hansson Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci.c | 44 ++++++++++++++++---------------------------- 1 file changed, 16 insertions(+), 28 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 8e74e75..c6dbe65 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -55,18 +55,6 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode); static void sdhci_enable_preset_value(struct sdhci_host *host, bool enable); static int sdhci_do_get_cd(struct sdhci_host *host); -#ifdef CONFIG_PM -static void sdhci_runtime_pm_bus_on(struct sdhci_host *host); -static void sdhci_runtime_pm_bus_off(struct sdhci_host *host); -#else -static void sdhci_runtime_pm_bus_on(struct sdhci_host *host) -{ -} -static void sdhci_runtime_pm_bus_off(struct sdhci_host *host) -{ -} -#endif - static void sdhci_dumpregs(struct sdhci_host *host) { pr_debug(DRIVER_NAME ": =========== REGISTER DUMP (%s)===========\n", @@ -161,6 +149,22 @@ static void sdhci_disable_card_detection(struct sdhci_host *host) sdhci_set_card_detection(host, false); } +static void sdhci_runtime_pm_bus_on(struct sdhci_host *host) +{ + if (host->bus_on) + return; + host->bus_on = true; + pm_runtime_get_noresume(host->mmc->parent); +} + +static void sdhci_runtime_pm_bus_off(struct sdhci_host *host) +{ + if (!host->bus_on) + return; + host->bus_on = false; + pm_runtime_put_noidle(host->mmc->parent); +} + void sdhci_reset(struct sdhci_host *host, u8 mask) { unsigned long timeout; @@ -2667,22 +2671,6 @@ int sdhci_resume_host(struct sdhci_host *host) EXPORT_SYMBOL_GPL(sdhci_resume_host); -static void sdhci_runtime_pm_bus_on(struct sdhci_host *host) -{ - if (host->bus_on) - return; - host->bus_on = true; - pm_runtime_get_noresume(host->mmc->parent); -} - -static void sdhci_runtime_pm_bus_off(struct sdhci_host *host) -{ - if (!host->bus_on) - return; - host->bus_on = false; - pm_runtime_put_noidle(host->mmc->parent); -} - int sdhci_runtime_suspend_host(struct sdhci_host *host) { unsigned long flags;