From patchwork Sun Mar 20 23:58:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Fenkart X-Patchwork-Id: 8628851 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C8818C0553 for ; Sun, 20 Mar 2016 23:58:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B163F20268 for ; Sun, 20 Mar 2016 23:58:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AD69920254 for ; Sun, 20 Mar 2016 23:58:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751348AbcCTX6R (ORCPT ); Sun, 20 Mar 2016 19:58:17 -0400 Received: from mail-wm0-f52.google.com ([74.125.82.52]:34007 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751232AbcCTX6Q (ORCPT ); Sun, 20 Mar 2016 19:58:16 -0400 Received: by mail-wm0-f52.google.com with SMTP id p65so133233776wmp.1 for ; Sun, 20 Mar 2016 16:58:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=QMhUmywk5xMDwn7J08+C/MzYCsm2BqDQu3mf8PTj3h0=; b=GlznNk6liW283Lmh3+0sgvsCi0V3URzES/tVZT/17JwZGxn2UvWfEcgk6zP5cekq7J MQZGpa7wjwYEO3jiDU97hS1lX3UrJ/8P4QaFh1FshrE4LUZGsojvBscu2KkH/8qfVq+h FCGrSWoJ4+j8Ndqvylukpzpmv3fzOw711MjC57zJM1HH3UGmTzyQIYWP1HIFmtJa+WzC 1mRJmR8idtvxRh51PTHMcQl2FIvbqKdL94bEcR0DurzaXq22FuDDy7Nha9jQk88tcVYr py+lkLFftx7Mls0dcv+tjabnl7ftMIpJ4Yhwqnok0T1oj1LxVDvmncQNEZljp8fvDU6s 8iuA== 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; bh=QMhUmywk5xMDwn7J08+C/MzYCsm2BqDQu3mf8PTj3h0=; b=IYZb0VSRtAZ9E5iJug+P39w1pAsFX/Rvndk6FlVzrmobb2U7GT4Zgrm0DTAjklt9eb cEVfq4L2ZjjYSmlgvLxErGI8Fs3ovLX8DLN137Ztu551o5HDBPt4Ll/uvhsBIFhkjfwA 7gSlNPz1FjSHwyU05TYTxE8b+4tF2I3znWIKAM+KQaM4l8EeKdY9QAGsRQQzxQhd/0AV 6rxyqKBQ0UIBLk2K8t12hrmmNvxZ8uKoXIyMc4nMNSPqVUX0TrNtLHeq/jW9bW7LJ4wp PKMoCe0sL3WJQOabVuKB+UQbIyPtWZ9A7lxuPWmm6O94HEy+W1tt/1q8HReMaI7//Aif f0RA== X-Gm-Message-State: AD7BkJLuQi6141IusGEkRrgG0OHqlTHxidXkW0ibR1EXl8GKrB7Q/4fK2e0KWf62qfhxhA== X-Received: by 10.194.174.231 with SMTP id bv7mr27222852wjc.17.1458518294890; Sun, 20 Mar 2016 16:58:14 -0700 (PDT) Received: from localhost (ip-89-176-167-254.net.upcbroadband.cz. [89.176.167.254]) by smtp.gmail.com with ESMTPSA id q139sm9904540wmd.2.2016.03.20.16.58.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Mar 2016 16:58:13 -0700 (PDT) From: Andreas Fenkart To: linux-mmc@vger.kernel.org Cc: Andreas Fenkart Subject: [PATCH] mmc: omap_hsmmc: pass omap_hsmmc_host pointer directly Date: Mon, 21 Mar 2016 00:58:08 +0100 Message-Id: <1458518288-22774-1-git-send-email-afenkart@gmail.com> X-Mailer: git-send-email 2.7.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=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 unnecessary indirection via 'struct device' back to omap_hsmmc_host Signed-off-by: Andreas Fenkart --- drivers/mmc/host/omap_hsmmc.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index d2b2525..898878d 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -357,15 +357,14 @@ static int omap_hsmmc_set_pbias(struct omap_hsmmc_host *host, bool power_on, return 0; } -static int omap_hsmmc_set_power(struct device *dev, int power_on, int vdd) +static int omap_hsmmc_set_power(struct omap_hsmmc_host *host, int power_on, + int vdd) { - struct omap_hsmmc_host *host = - platform_get_drvdata(to_platform_device(dev)); struct mmc_host *mmc = host->mmc; int ret = 0; if (mmc_pdata(host)->set_power) - return mmc_pdata(host)->set_power(dev, power_on, vdd); + return mmc_pdata(host)->set_power(host->dev, power_on, vdd); /* * If we don't see a Vcc regulator, assume it's a fixed @@ -375,7 +374,7 @@ static int omap_hsmmc_set_power(struct device *dev, int power_on, int vdd) return 0; if (mmc_pdata(host)->before_set_reg) - mmc_pdata(host)->before_set_reg(dev, power_on, vdd); + mmc_pdata(host)->before_set_reg(host->dev, power_on, vdd); ret = omap_hsmmc_set_pbias(host, false, 0); if (ret) @@ -409,7 +408,7 @@ static int omap_hsmmc_set_power(struct device *dev, int power_on, int vdd) } if (mmc_pdata(host)->after_set_reg) - mmc_pdata(host)->after_set_reg(dev, power_on, vdd); + mmc_pdata(host)->after_set_reg(host->dev, power_on, vdd); return 0; @@ -1278,11 +1277,11 @@ static int omap_hsmmc_switch_opcond(struct omap_hsmmc_host *host, int vdd) clk_disable_unprepare(host->dbclk); /* Turn the power off */ - ret = omap_hsmmc_set_power(host->dev, 0, 0); + ret = omap_hsmmc_set_power(host, 0, 0); /* Turn the power ON with given VDD 1.8 or 3.0v */ if (!ret) - ret = omap_hsmmc_set_power(host->dev, 1, vdd); + ret = omap_hsmmc_set_power(host, 1, vdd); pm_runtime_get_sync(host->dev); if (host->dbclk) clk_prepare_enable(host->dbclk); @@ -1722,10 +1721,10 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) if (ios->power_mode != host->power_mode) { switch (ios->power_mode) { case MMC_POWER_OFF: - omap_hsmmc_set_power(host->dev, 0, 0); + omap_hsmmc_set_power(host, 0, 0); break; case MMC_POWER_UP: - omap_hsmmc_set_power(host->dev, 1, ios->vdd); + omap_hsmmc_set_power(host, 1, ios->vdd); break; case MMC_POWER_ON: do_send_init_stream = 1;