From patchwork Fri Nov 24 16:24:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 119616 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2448099qgn; Fri, 24 Nov 2017 08:31:22 -0800 (PST) X-Google-Smtp-Source: AGs4zMbr8R2R6e/q2QP8LrU9EHoL4O/GV+4s7sdTVeTOn9hfHeL7DpoyOIhiJVPi0wsPDa3mBH5c X-Received: by 10.98.102.74 with SMTP id a71mr27695587pfc.23.1511541081935; Fri, 24 Nov 2017 08:31:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511541081; cv=none; d=google.com; s=arc-20160816; b=Hg0ujkoJEuH37XUVL28RW/kZa5iCYrhedCO80Krs8BqdWCNTOQlC8auv7RPp8Ms7s7 nXVQGTx0qYVhyEpv3hU7yPP1YHpaw0XM4oiQ123ofk3RueL6x15g45SVNZOY7WKI70Iw j+jIlBQ+6sE4SOx5SjSgpYkrks4bHFn0tsFh7jo6IETRRBH1+1tse/aB/9mozDtow4aP 8w4ITbmtiGKPS3K2uWxnBEWMVj6ms3xobHdxh+bsT9wRL8FMoVSHwoReYKeCPxC9HGTW oGjgWAMsmixzx94imw6W2j9Ea23gimkH7JuePw9qts8xn0p3drCqipH52M8JXbxTtaN9 lvgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=1MjOQc6LJz4qeVkDan9o6Zoel3TDGLSfm1z9vpfriYc=; b=npHfjSlKcLnPGXwPICWKOGUriJy4T7OhYKVHjIGIJriGfPAv8n61ul25TA1Ji3C3M0 3LFLGip83KGw/McE2oCBEU04LzCVKkQ6U2LzkgMMVFkeyh9I8M7vsU6xyiO2oXkxkdin Cr4oyPYCyzfFDvx11R0PyuxBVWuhnoVJURxgxHsvksCt6ssGuk5l36HdIRQRKUxHln/z mIJllRq+kIgmEZyFIuPDd7J0vbOhLAqap9I9KdmRCndRSSCBuvsQBcKY13xbZPFzLGq5 S4niR9wDUasX2buCUwE//9hBCuROg4GpC4VgUrD4ALohztG8HKc28TXtPDdK1OcHg50s xTpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=B6UxH+fR; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 97si18810273plc.450.2017.11.24.08.31.21; Fri, 24 Nov 2017 08:31:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=B6UxH+fR; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753952AbdKXQbT (ORCPT + 6 others); Fri, 24 Nov 2017 11:31:19 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:61433 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753620AbdKXQZ6 (ORCPT ); Fri, 24 Nov 2017 11:25:58 -0500 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-11.nifty.com with ESMTP id vAOGP9Vo007100; Sat, 25 Nov 2017 01:25:12 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com vAOGP9Vo007100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1511540713; bh=Gcp+WVgzrlSinByi/iVwiNBrfwgOLlXbPUAzKCLR33Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B6UxH+fRaJd+P9OWhdOrYHVDy/YQgXFoOKhB3eIoFreIr1ZErOab2LkNw/RUxZ93O kgcgISFi7XkBsjAXHzWmc4U1xwc0j1nxxmPeDqgjYYAE+G/8br5oHt8Cu9gGI8wPcO yRlY3q/fNZHr7vtc3dbAhBNJ43tm1TGlPI9dzF2awHIIsVIXxiMIF8TuatgGXjOZ4n GrAc+QI0ljA4vprBiL4xakl8cbHv8/V4R+o4ncUU5azhshd9IhNdrmOFxsJivv0ZCf FypH6JYPKlLir2v6FDTz8AGaMeNA3UUcpo7ng5D4Y7ua5unsD+OZSJcl2giQ1R4Ku1 qFsviqdQ1VaoQ== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-mmc@vger.kernel.org, Wolfram Sang Cc: Simon Horman , Yoshihiro Shimoda , linux-renesas-soc@vger.kernel.org, Masahiro Yamada , linux-kernel@vger.kernel.org, Ulf Hansson Subject: [PATCH v2 04/22] mmc: tmio: set tmio_mmc_host to driver data Date: Sat, 25 Nov 2017 01:24:39 +0900 Message-Id: <1511540697-27387-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511540697-27387-1-git-send-email-yamada.masahiro@socionext.com> References: <1511540697-27387-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org The remove, suspend, resume hooks need to get tmio_mmc_host. It is tedious to call mmc_priv() to convert mmc_host to tmio_mmc_host. We can directly set tmio_mmc_host to driver data. Signed-off-by: Masahiro Yamada Acked-by: Wolfram Sang --- Changes in v2: None drivers/mmc/host/renesas_sdhi_core.c | 3 +-- drivers/mmc/host/tmio_mmc.c | 12 ++++-------- drivers/mmc/host/tmio_mmc_core.c | 8 +++----- 3 files changed, 8 insertions(+), 15 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c index 0590ae0..9baf4d1 100644 --- a/drivers/mmc/host/renesas_sdhi_core.c +++ b/drivers/mmc/host/renesas_sdhi_core.c @@ -657,8 +657,7 @@ EXPORT_SYMBOL_GPL(renesas_sdhi_probe); int renesas_sdhi_remove(struct platform_device *pdev) { - struct mmc_host *mmc = platform_get_drvdata(pdev); - struct tmio_mmc_host *host = mmc_priv(mmc); + struct tmio_mmc_host *host = platform_get_drvdata(pdev); tmio_mmc_host_remove(host); diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c index 64b7e9f..ccfbc15 100644 --- a/drivers/mmc/host/tmio_mmc.c +++ b/drivers/mmc/host/tmio_mmc.c @@ -128,15 +128,11 @@ static int tmio_mmc_probe(struct platform_device *pdev) static int tmio_mmc_remove(struct platform_device *pdev) { const struct mfd_cell *cell = mfd_get_cell(pdev); - struct mmc_host *mmc = platform_get_drvdata(pdev); + struct tmio_mmc_host *host = platform_get_drvdata(pdev); - if (mmc) { - struct tmio_mmc_host *host = mmc_priv(mmc); - - tmio_mmc_host_remove(host); - if (cell->disable) - cell->disable(pdev); - } + tmio_mmc_host_remove(host); + if (cell->disable) + cell->disable(pdev); return 0; } diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c index 583bf32..12df338 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -1193,7 +1193,7 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host, return ret; _host->pdata = pdata; - platform_set_drvdata(pdev, mmc); + platform_set_drvdata(pdev, _host); _host->set_pwr = pdata->set_pwr; _host->set_clk_div = pdata->set_clk_div; @@ -1351,8 +1351,7 @@ EXPORT_SYMBOL_GPL(tmio_mmc_host_remove); #ifdef CONFIG_PM int tmio_mmc_host_runtime_suspend(struct device *dev) { - struct mmc_host *mmc = dev_get_drvdata(dev); - struct tmio_mmc_host *host = mmc_priv(mmc); + struct tmio_mmc_host *host = dev_get_drvdata(dev); tmio_mmc_disable_mmc_irqs(host, TMIO_MASK_ALL); @@ -1372,8 +1371,7 @@ static bool tmio_mmc_can_retune(struct tmio_mmc_host *host) int tmio_mmc_host_runtime_resume(struct device *dev) { - struct mmc_host *mmc = dev_get_drvdata(dev); - struct tmio_mmc_host *host = mmc_priv(mmc); + struct tmio_mmc_host *host = dev_get_drvdata(dev); tmio_mmc_reset(host); tmio_mmc_clk_enable(host);