From patchwork Tue Nov 7 08:09:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 118122 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3686628qgn; Tue, 7 Nov 2017 00:12:04 -0800 (PST) X-Google-Smtp-Source: ABhQp+Q/ldOMfAjSYFtFiOWwOUY0lq5tgO6hUPPR1pSv5V7yRmWd+KUkMJJqluIYwED/iCLyGvRS X-Received: by 10.101.64.4 with SMTP id f4mr17302516pgp.301.1510042323938; Tue, 07 Nov 2017 00:12:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510042323; cv=none; d=google.com; s=arc-20160816; b=i/XTcTspBsMH0x3ljcXYfjN54a60lBWyF7T/b1IVoVE53K9hxNwmZP7ie7P+XHnQc5 /4vIp6O8RC9tQm88U/AS+RZkCmaYIY8Pfjyf+Cf9gKvc/Rvq5p9/XfIPRWVajGOC8tHz wbusL2Iz6ztYbv0NkxJlMjMilug5KRH1R7XYP8uFxrBZBdnm6pAfMb/gtimSv30yJZpL 2d1NLysnF3nW/40GFvfTfjGSc6yrtCjzL/6YUXq7V3cbXLza20S5Ni2540Twc2vWxq0n xffCs/1AJFnIIBIld2SDq1LCM5sSdZs02s1yb38MjQcOZgJaznJtsCA/OHz90KxGlez2 jEpQ== 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=oXpf4fbokra2HwEAvGacn/pqpJ9IAyemMLdBG18fbBE=; b=Xlck9Bmh9ftZlS/xGIoJ91hxR7lof6gGrcegBwJ0m4Pto9fJVhwaf4mTAynvyFYdU1 3ph6P6ZB3Bxt7Rxyro8o4t8fgKxam+UyRcS25u8DhxK+osnLnU0vhr6bcWvtUhnHscOJ I4H9CWaQkMBSsplPt22MXJj5jD9crKdQjOUOjNWbGXDBQ+OC1TG7eT+Zd95RKzOkkduu jBfUwRe6ZqaVfFW/WeAd1Bi1meGxRnI8X87VAv5h+W0oQDnYeA633HuVeq2c4D5xKIGe VcWwtVhPFheTfkJSpll+0K2QKn+tu6Eb47f+58nBFgECCzJuvj0A4FgRZjuxnzAlMtCV d4Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Ru++cUWG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 u15si584270plm.722.2017.11.07.00.12.03; Tue, 07 Nov 2017 00:12:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Ru++cUWG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932769AbdKGIMB (ORCPT + 26 others); Tue, 7 Nov 2017 03:12:01 -0500 Received: from conuserg-09.nifty.com ([210.131.2.76]:24876 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932517AbdKGIKx (ORCPT ); Tue, 7 Nov 2017 03:10:53 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id vA789u4K027191; Tue, 7 Nov 2017 17:09:58 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com vA789u4K027191 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1510042198; bh=oXpf4fbokra2HwEAvGacn/pqpJ9IAyemMLdBG18fbBE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ru++cUWG8eQpF04nKUjK0x4QkRLPRy/OmX+XveocTTaY/qnsDQZTi/GQvSysV4elK fx5ImZ+i0Ur6qLilqyfSHVhXNqI97lcPp2vX4rNldLt80wLnduRwELkiNOQqpu4WHk vlPO5vIxIizfuGia5yyQxjzwDBUFSfupwen21vo7uFKCKFyZkJeJWaXg/xp/gVWqsS Kd/8VkD9lvMhzv+pwgBHbOPowvapi+kvJYhh+R84p30ytHgMQ9tfDDQyumxmkmikGX p3mU0n64LJB1P+GKuCQJ3H75iJBKFDqAtHtuFlZ3yJHOI6DAoUe2ABkmd6BoEEwQg5 1ClLorU+s3m4A== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Wolfram Sang , linux-mmc@vger.kernel.org Cc: Simon Horman , Yoshihiro Shimoda , Masahiro Yamada , linux-kernel@vger.kernel.org, Ulf Hansson Subject: [PATCH 2/6] mmc: tmio: set tmio_mmc_host to driver data Date: Tue, 7 Nov 2017 17:09:28 +0900 Message-Id: <1510042172-27220-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510042172-27220-1-git-send-email-yamada.masahiro@socionext.com> References: <1510042172-27220-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The remove, suspend, resume hooks need tmio_mmc_host. It is tedious to get mmc_host from the driver_data and pass it to mmc_priv(). We can directly set tmio_mmc_host to driver data to clean up the code. Signed-off-by: Masahiro Yamada --- 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 diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c index 4b7a4e2..23c250e 100644 --- a/drivers/mmc/host/renesas_sdhi_core.c +++ b/drivers/mmc/host/renesas_sdhi_core.c @@ -656,8 +656,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 9c4e619..9b8ef73 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -1190,7 +1190,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; @@ -1347,8 +1347,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); @@ -1368,8 +1367,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);