From patchwork Thu Feb 11 12:59:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 61756 Delivered-To: patches@linaro.org Received: by 10.112.43.199 with SMTP id y7csp175099lbl; Thu, 11 Feb 2016 05:00:17 -0800 (PST) X-Received: by 10.112.138.166 with SMTP id qr6mr9665372lbb.106.1455195613808; Thu, 11 Feb 2016 05:00:13 -0800 (PST) Return-Path: Received: from mail-lf0-x22a.google.com (mail-lf0-x22a.google.com. [2a00:1450:4010:c07::22a]) by mx.google.com with ESMTPS id b135si4212023lfe.231.2016.02.11.05.00.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Feb 2016 05:00:13 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::22a as permitted sender) client-ip=2a00:1450:4010:c07::22a; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::22a as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dkim=pass header.i=@linaro.org Received: by mail-lf0-x22a.google.com with SMTP id j78so30991427lfb.1 for ; Thu, 11 Feb 2016 05:00:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZxOvD3SqPwC9ouHkx3WXQMOArd97YlOWZ3ABZxR9Vgk=; b=fmrWpk3K7LLuDIDV65aphaH6TdCsWVTu3fXeKicY5Fdo/JvoTQrReY42g5JJo5V72O PMz05pvOrIHEZQZDAs+VuKRX0cwjVB/rEnMmKrOLMPHmLdqnq+VGcMiVLUSrlIDrcC9N rwHa497KsvBCSmQZZY33kYC4vy6UqimT/ga7U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZxOvD3SqPwC9ouHkx3WXQMOArd97YlOWZ3ABZxR9Vgk=; b=kDw75SgZazQ6otaQLozFG7zY3HW+VRYHeMLimyUpbPoIawRnTAwhFYmHU+7ZCIGceo K38BFAXyuGK6/1AuJy3Xnc9GnZuBgjzsNpPfd4BZMoGumDUmHS8j7SeoU1chv8H9JXXj wiizWhqM43lqn5LwzDe1DYqHG1k9AMA6jxh60Yl0cI3PqloKEPjOIp/gurMbO8bKNzUX 3mqJUdMBOl07wpLinqoFx9tlTaSzpXFU9StLcTlB3nXt6bXblaMp2DuH1oVcsh4yNnSb pfLTmSv8PP6B70Lc6r5q2T13x1sNF9qJI+0DzAivJkgQ+l4kaKSpR4aX2YmvTrSYR6qC Ex8A== X-Gm-Message-State: AG10YOTal4tBnmPRWRLKw3tFHeUAgToM2dZoC7qwHzTlHuhVFE7rJHOrTg6JXvjd5TiqdmtIQlo= X-Received: by 10.25.213.196 with SMTP id m187mr13922554lfg.67.1455195613245; Thu, 11 Feb 2016 05:00:13 -0800 (PST) Return-Path: Received: from uffe-Latitude-E6430s.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id dm7sm1179635lbc.32.2016.02.11.05.00.12 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 11 Feb 2016 05:00:12 -0800 (PST) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Kuninori Morimoto , Geert Uytterhoeven , Nguyen Viet Dung , Magnus Damm , Simon Horman , Laurent Pinchart Subject: [PATCH 3/3] mmc: sh_mmci: Get rid of wrapper function for regulators Date: Thu, 11 Feb 2016 13:59:55 +0100 Message-Id: <1455195595-5121-3-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1455195595-5121-1-git-send-email-ulf.hansson@linaro.org> References: <1455195595-5121-1-git-send-email-ulf.hansson@linaro.org> As there are two callers of sh_mmcif_set_power() and because its only additional action is to check for a valid regulator, let's just remove it. Signed-off-by: Ulf Hansson --- drivers/mmc/host/sh_mmcif.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) -- 1.9.1 diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c index 1c84c62..e0328b4 100644 --- a/drivers/mmc/host/sh_mmcif.c +++ b/drivers/mmc/host/sh_mmcif.c @@ -1063,16 +1063,6 @@ static void sh_mmcif_clk_setup(struct sh_mmcif_host *host) host->mmc->f_max, host->mmc->f_min); } -static void sh_mmcif_set_power(struct sh_mmcif_host *host, struct mmc_ios *ios) -{ - struct mmc_host *mmc = host->mmc; - - if (!IS_ERR(mmc->supply.vmmc)) - /* Errors ignored... */ - mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, - ios->power_mode ? ios->vdd : 0); -} - static void sh_mmcif_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) { struct sh_mmcif_host *host = mmc_priv(mmc); @@ -1092,7 +1082,8 @@ static void sh_mmcif_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) switch (ios->power_mode) { case MMC_POWER_UP: - sh_mmcif_set_power(host, ios); + if (!IS_ERR(mmc->supply.vmmc)) + mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd); if (!host->power) { clk_prepare_enable(host->clk); pm_runtime_get_sync(dev); @@ -1102,7 +1093,8 @@ static void sh_mmcif_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) } break; case MMC_POWER_OFF: - sh_mmcif_set_power(host, ios); + if (!IS_ERR(mmc->supply.vmmc)) + mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); if (host->power) { sh_mmcif_clock_control(host, 0); sh_mmcif_release_dma(host);