From patchwork Tue Nov 7 08:09:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 118120 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3686114qgn; Tue, 7 Nov 2017 00:11:28 -0800 (PST) X-Google-Smtp-Source: ABhQp+Rn2Ah+xXFiDrtB5tsuE0IuU1eIGRCLM1Sn28FaeYgiZ2jvWKrML7XkFh1GFCKVmV6ZHheI X-Received: by 10.159.218.137 with SMTP id w9mr17542788plp.139.1510042288100; Tue, 07 Nov 2017 00:11:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510042288; cv=none; d=google.com; s=arc-20160816; b=DR4p3ZG8m8YBDSBnj7SSQQbihVTTS0VUtmqQ5prFllNvbdH9p2OYyTAzmPzuezLFgB R9YglOL0ihoOA5hdQFxkFXlVKZ5DUhiCWAcjce4NJc9InQCn1dr89GoUbhhZbOb1Zqe8 Sc8qKkvEYd1nTOLtFXbVWA3zkQg0DOc2N/J7khlbF9UuH0uswK3F7tFLbUcOoyuYsRco /v/FSAu/DEbrimrhdJPkoRwQxLISHhCs8f23/SFG4OoNfdvX+zE0IXWeUafBJObEKzA5 7ZxtAeiLGgAoa7fGsvVlRsq+vIHYFKZCJTJrIn02CuHqzjd+xg6R04rdUMfaaECL6YiI ilyA== 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=TOu8YvCmwMNxJg5/p52cQaqb3M4eDFL2Kjs5nozs9qc=; b=Y4cRz5leCh4X1IgTJwfvoeA0NRRWhf+GDsX868olbIQxTamgK9lFUfCZk/yItV4UIu Ela8Ia9GgbTvNp52sigqQTwb7mduHP+HwASpve7Olc0wDN7hkY9U24frlsCL37MD+NHp V7ANlCkOLWDsaC/0x4EmfvTcz2uFEKtUCcv8aaYsqR7Hv+m27lNAYcaxoVT5dJAWW+VK x8KLWJDYblaleonktMXI+BM/EeLJpLvA+3hwUH4o5qUHlIoABo1CbawNgfA3phybRzXf i74epb7LLPy+YVjE8bMpMMgiN6uTf42fhyJVEM2BjUdCjSfyfDCtNz0F0D7S25jrO4d4 Ivnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=rULzlUvf; 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 n73si639753pfb.254.2017.11.07.00.11.27; Tue, 07 Nov 2017 00:11:28 -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=rULzlUvf; 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 S932670AbdKGILM (ORCPT + 26 others); Tue, 7 Nov 2017 03:11:12 -0500 Received: from conuserg-09.nifty.com ([210.131.2.76]:24938 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932539AbdKGIKz (ORCPT ); Tue, 7 Nov 2017 03:10:55 -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 vA789u4J027191; Tue, 7 Nov 2017 17:09:57 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com vA789u4J027191 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1510042198; bh=TOu8YvCmwMNxJg5/p52cQaqb3M4eDFL2Kjs5nozs9qc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rULzlUvfY/k/R7p5CIyp6paOwEqOLD2NaekhTkOZAOSt5u4WvnbVJ+J6WebcHJkDp kbTmBsy8kdo30IZFvpLcK7SjioL7MCSoTpBshh9k2rjg36Um4x/40eBcWS1JQFZ5z/ DblAYJm/9eGmxSwYYxxHX4OiSHbgUE6PwRN5F1NlBSrMx6h1fBl8I1ZaqW6/+xq5aD frF9U1JcGfbozYPgzyFkIL/6qhL8PGoekkwYbP+pZ0uXffFtRgiZaZ3yEuS7SMc96I 1l+v84NN0cE8VjQ7/Sdm8tAre/E9Kkd7C5gdwjUxqsE095wAgngC1e49f6OBbNGl00 w+tvvCzFEX3wQ== 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 1/6] mmc: renesas_sdhc: remove eprobe jump label Date: Tue, 7 Nov 2017 17:09:27 +0900 Message-Id: <1510042172-27220-2-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 "goto eprobe" does nothing useful. Return directly. Signed-off-by: Masahiro Yamada --- drivers/mmc/host/renesas_sdhi_core.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) -- 2.7.4 diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c index fcf7235..4b7a4e2 100644 --- a/drivers/mmc/host/renesas_sdhi_core.c +++ b/drivers/mmc/host/renesas_sdhi_core.c @@ -495,9 +495,8 @@ int renesas_sdhi_probe(struct platform_device *pdev, priv->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(priv->clk)) { - ret = PTR_ERR(priv->clk); - dev_err(&pdev->dev, "cannot get clock: %d\n", ret); - goto eprobe; + dev_err(&pdev->dev, "cannot get clock\n"); + return PTR_ERR(priv->clk); } /* @@ -524,10 +523,8 @@ int renesas_sdhi_probe(struct platform_device *pdev, } host = tmio_mmc_host_alloc(pdev); - if (!host) { - ret = -ENOMEM; - goto eprobe; - } + if (!host) + return -ENOMEM; if (of_data) { mmc_data->flags |= of_data->tmio_flags; @@ -652,7 +649,7 @@ int renesas_sdhi_probe(struct platform_device *pdev, tmio_mmc_host_remove(host); efree: tmio_mmc_host_free(host); -eprobe: + return ret; } EXPORT_SYMBOL_GPL(renesas_sdhi_probe); 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); From patchwork Tue Nov 7 08:09:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 118118 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3685692qgn; Tue, 7 Nov 2017 00:10:58 -0800 (PST) X-Google-Smtp-Source: ABhQp+TIpDobsne/QfU4WMjBMOJeusOod3W5u52jkwj/KrJ9lytjY5lte8+nSE5y/LS/c9CkClcP X-Received: by 10.84.140.129 with SMTP id 1mr17279431plt.281.1510042258722; Tue, 07 Nov 2017 00:10:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510042258; cv=none; d=google.com; s=arc-20160816; b=mjf3A1HGnwmCcAqyUK6Zyre+7KpFWxXKo8SLTDaVOIK/y9cs1AB/8BzbLmqX0R5XnY 8SyGUwtAm97RHoUfvx9IE01hg7UC9m9okVD3O86rYcFus7XwzAUSHKtp08SLPvCpvNWQ pLWjIKZoET4jLXVaOHO0lzYE+Ci2dz6a3Hkd/y5y5V5wl/49HKMaisMOebG2ggy+YsUV OJsS/bQNoom8QC/85o1I+xcoh9JyQF+TZMMnXA4KJqMbIqUjK4WMtMGxc39Q3LaHK0/F wRrW9nrwTCE+9zti4UZ/6WT9TPosIj9L7XFxhzzjeUUWzwQTzqnyBQxAPsg6pgj74OGn g1nw== 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=UtGwWV9JnIFPiWjrQK60PuerJA+wMQcv8skk+f0OMac=; b=zKl9Ogn8YwbPNsG+LBEGpAEeuC6P2Mo6a6eBKTaTRALjU/NxE6RS70YTkJme0y9vSi no6eP5o4bq/U4xS5H5MyFnuo88h80UUHpaW+TLN7qwkL37OKTnVZDrlHHZMCFBY1IEnn bHb0iEq5RTd92KIi7IUTdNZbRWt5/C3YJIXGNGQcOou1pN9hpt2OMSu3xEZ+k6WycucX MORoJw0Hi2wwp9zbjvmsoXqtz8NASS+k8enXeKLVvFWQsR/zwE77YypAQbqgZhSFx06i V73L/tN5RYbKMDbwnpuLrZtJLvqFBdniaCvb+WHKF2N/uQnPtFKJy5lV6wXHp1Fky5Ob BR3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=lWVuYmdd; 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 x4si588454pgc.320.2017.11.07.00.10.58; Tue, 07 Nov 2017 00:10:58 -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=lWVuYmdd; 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 S932621AbdKGIK5 (ORCPT + 26 others); Tue, 7 Nov 2017 03:10:57 -0500 Received: from conuserg-09.nifty.com ([210.131.2.76]:24880 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932504AbdKGIKx (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 vA789u4L027191; Tue, 7 Nov 2017 17:09:59 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com vA789u4L027191 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1510042199; bh=UtGwWV9JnIFPiWjrQK60PuerJA+wMQcv8skk+f0OMac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lWVuYmddaygY8e0qDRXIPVdVfv+F6xRGklc7eMiuMbtVYUDfcg95GfH1EJ//1L0dj nwhQ8zpQB2iJQXiqgliesYO9Bv73YDlKVQlv7knuzn3BnvHKZI6SqENVPrUH+vhEXD UycAkTyHmgvWW/0Yjhel1Y66R3gEnhA0zTFu5BzlB7uL4+MFfZKP2CdvyMt5/WSsQa 6yuxZavpgguLC0MErFNGpNkXi1P9OBQzRQHgngRgmK9A0RtgrZtfnixZqwMXxUy54e 6RRJt51W6jPRXZRcyI/AJi6bmzYtFf8WMb+fqKrhm2vVf4FgpmbXu43Fj3b+0B7NvG LWxjFVP2fFG5Q== 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 3/6] mmc: tmio: use devm_ioremap_resource() instead of devm_ioremap() Date: Tue, 7 Nov 2017 17:09:29 +0900 Message-Id: <1510042172-27220-4-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 TMIO core misses to request_mem_region(). devm_ioremap_resource() takes care of it and makes the code cleaner. Signed-off-by: Masahiro Yamada --- drivers/mmc/host/tmio_mmc_core.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) -- 2.7.4 diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c index 9b8ef73..0db6cac 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -1182,8 +1182,9 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host, _host->write16_hook = NULL; res_ctl = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res_ctl) - return -EINVAL; + _host->ctl = devm_ioremap_resource(&pdev->dev, res_ctl); + if (IS_ERR(_host->ctl)) + return PTR_ERR(_host->ctl); ret = mmc_of_parse(mmc); if (ret < 0) @@ -1199,11 +1200,6 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host, if (ret < 0) return ret; - _host->ctl = devm_ioremap(&pdev->dev, - res_ctl->start, resource_size(res_ctl)); - if (!_host->ctl) - return -ENOMEM; - tmio_mmc_ops.card_busy = _host->card_busy; tmio_mmc_ops.start_signal_voltage_switch = _host->start_signal_voltage_switch; From patchwork Tue Nov 7 08:09:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 118119 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3685904qgn; Tue, 7 Nov 2017 00:11:15 -0800 (PST) X-Google-Smtp-Source: ABhQp+QTmy48/XjazGuE9hEKTFxYyC/Gu76+cQjKD3vPoTs4aR2C8nSBWs8/sngf6KliuUY9BWtG X-Received: by 10.159.235.147 with SMTP id f19mr17399455plr.42.1510042275416; Tue, 07 Nov 2017 00:11:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510042275; cv=none; d=google.com; s=arc-20160816; b=oprDXoOAfDjzCb+Vbo23HS+hogXkZ8nKt7gLDk82bDl/FQujXnne1loQNg+FbswbZ7 09EI+b3z51KA6Cfgmv7cHaXuxnEFF5UDYI7x1PSS5QNqcpvzlTguiTEzwvnGLjEASJEF DM9KllOhUEnnw7ZEcROkqlKBwVknppviur/LIGmvgtPuEbcayL6AtZUHwWXn8nMZ50Cs ltDxZ8qCs5iHQaGXrPcXV5yTcmx8JDnIJvNV85dp9prVVgL01I91QrjH/2wLn0zVjZlZ V3Sx9fV5hpXUb0oaEM7+gSpNE/OpGBVz9c9Dh8YSyW0EjyQ94RhLZskvRwfA+uW9HJHs C63A== 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=INAJOaawGKkfHGq22YsS3yh4bPVyazEPnngjscbfTwY=; b=A+cfL8ePec9vmxLo+139CY4VbtMasxkqc5hmoaV/8ijE3ItRw9OmX+Vo6ZB4MS6o1T d/SDecyg25IRS/Dn+1Q1ceb+3+BI2fJfIVFx1Xc53PJvpxMYR4WGPMUneW7tm2mod3DX lnxNCgETeTds3RZmWuyU4r79FB2fRLZdz29Fd0vD7HRUMk6IG9EQy1u++XafOmfmFfcl Pme2pXX0c79uOJFSkRLoFlyUQTuvVae0tyf1deh3Qp7JMStpBWxRqJO7KZFsyAWPU8Fn m8GFkps5fPo0hNTfEfJr/w7eBkrGP2kUrkreL37heZKfEEuGmorbXrlM76jm7nytoLPu /AKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=1mHPHa+M; 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 n73si639753pfb.254.2017.11.07.00.11.15; Tue, 07 Nov 2017 00:11:15 -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=1mHPHa+M; 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 S932699AbdKGILN (ORCPT + 26 others); Tue, 7 Nov 2017 03:11:13 -0500 Received: from conuserg-09.nifty.com ([210.131.2.76]:24937 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932525AbdKGIKz (ORCPT ); Tue, 7 Nov 2017 03:10:55 -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 vA789u4M027191; Tue, 7 Nov 2017 17:09:59 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com vA789u4M027191 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1510042200; bh=INAJOaawGKkfHGq22YsS3yh4bPVyazEPnngjscbfTwY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1mHPHa+M+icTsvQk2ZxPqZUC7YfoOV95NfOsSgcoTN3YxJb0RyieJfO6ZSwjAIFyl 8atzBQOmiOs/vMF89Qew/OX7Mq2UVRuJBJY6c0vmEu+jnBWPfU/lYkUnXnIzw7s7v4 DPBzOGKwy04Yz9xHIOJVqrSIz6YJKb7oGarRgEv7Lo8I92n7Sd3oiimWSkiZHgABl3 6UwLlpnFOxIo8nWJrc243ZivKOLsechzNA+7No0rfexZhlJbsG96NeAOWHvsVADAso lSZZWT4OWYuZAeMP/OzLd/nyfMrkf/IP0RgFLK8wA518EaEd9X1FxzdQjBU2SRej+6 8P6wnRa8O1TNQ== 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 4/6] mmc: tmio: move mmc_host_ops to struct tmio_mmc_host from static data Date: Tue, 7 Nov 2017 17:09:30 +0900 Message-Id: <1510042172-27220-5-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 Currently, tmio_mmc_ops is static data and tmio_mmc_host_probe() updates some hooks in the static data. This is a problem when two or more instances call tmio_mmc_host_probe() and each of them requests to use its own card_busy/start_signal_voltage_switch. We can borrow a solution from sdhci_alloc_host(). Copy the whole ops structure to host->mmc_host_ops, then override the hooks in malloc'ed data. Constify tmio_mmc_ops since it is a template ops used by default. Signed-off-by: Masahiro Yamada --- drivers/mmc/host/tmio_mmc.h | 1 + drivers/mmc/host/tmio_mmc_core.c | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) -- 2.7.4 Reviewed-by: Wolfram Sang Tested-by: Wolfram Sang diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h index 3e6ff89..b251f1c 100644 --- a/drivers/mmc/host/tmio_mmc.h +++ b/drivers/mmc/host/tmio_mmc.h @@ -134,6 +134,7 @@ struct tmio_mmc_host { struct mmc_request *mrq; struct mmc_data *data; struct mmc_host *mmc; + struct mmc_host_ops mmc_host_ops; /* Callbacks for clock / power control */ void (*set_pwr)(struct platform_device *host, int state); diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c index 0db6cac..3c84044 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -1098,7 +1098,7 @@ static int tmio_multi_io_quirk(struct mmc_card *card, return blk_size; } -static struct mmc_host_ops tmio_mmc_ops = { +static const struct mmc_host_ops tmio_mmc_ops = { .request = tmio_mmc_request, .set_ios = tmio_mmc_set_ios, .get_ro = tmio_mmc_get_ro, @@ -1155,6 +1155,8 @@ tmio_mmc_host_alloc(struct platform_device *pdev) host = mmc_priv(mmc); host->mmc = mmc; host->pdev = pdev; + host->mmc_host_ops = tmio_mmc_ops; + mmc->ops = &host->mmc_host_ops; return host; } @@ -1200,10 +1202,9 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host, if (ret < 0) return ret; - tmio_mmc_ops.card_busy = _host->card_busy; - tmio_mmc_ops.start_signal_voltage_switch = + _host->mmc_host_ops.card_busy = _host->card_busy; + _host->mmc_host_ops.start_signal_voltage_switch = _host->start_signal_voltage_switch; - mmc->ops = &tmio_mmc_ops; mmc->caps |= MMC_CAP_4_BIT_DATA | pdata->capabilities; mmc->caps2 |= pdata->capabilities2; From patchwork Tue Nov 7 08:09:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 118121 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3686587qgn; Tue, 7 Nov 2017 00:12:01 -0800 (PST) X-Google-Smtp-Source: ABhQp+SiQRjRenUbkxa8qVzqp+B6ecEVR1e11WDBOoMOTMH1gvXu81Ez7UdMJX8EF6UeaK1QOhJd X-Received: by 10.84.149.197 with SMTP id a5mr17644451plh.231.1510042321785; Tue, 07 Nov 2017 00:12:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510042321; cv=none; d=google.com; s=arc-20160816; b=pHR+c3gTvasQD+wg8dF0hicG2o4Yp1lhH/55vQgVKjmfWHZ/svdIZtsv70MNaZMtwc x2U/vkD09sDu48Y5+Kv7ykhuMOArUrFeLzwVk5vFVblw8yR6DVoSFZLDpzmR3CcxOBuU tEesQeEW/Fnfl0PPF9lCOP+0b57qQKncl4gYOhNOy1jHLdyiR6DR7vLVD0Yto0DLK6PD qHQmPLIjG1I0W/dWE7WxwMsTYdWmOAViEy6ztRTS03u2rZPdNEnZDEmKcDs0dLkTtPs1 jvUuLnJDGKH4rsUCh4TjG0d/E7ILgjvsvu9ZYNMCPRJ4523W1AuVSLlAlMNvkG+biUui 73fg== 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=DwMtmEMhoQeKCP+xXK1eqp6kUDEqMWCSMJjO2972Fxg=; b=yZnAw1ACZkqU9X2qpYg0Q4HCzxAXqWA7PwxZgg8mPFRJOOcuyFlUrQ5D7GCV0aTiOQ 2ptqk0lFktZAVOsJT9CYXgwLNcfYSDMMCtVIjvtrUIckBCle/9excoipBJfZ/6JceI2V 2V2J7vZ8h95V1iSmVQ5aItJ0IYG1xhR+Sl2Nz55jGDJIW/lkkKQdyTHOBlGE4/OGQnwj uBXjsnPFsYQ/B5YUThOjJ2rckW5ntkb+gNnCB2+cXyahp+0mps/anEl7RvRTH0fOhxzf op/cPURL7u3IiPeBPTLmI3csnVg7gt1ZREGCfs/lWCz+H8hr8jo8Ss+11E1o3PvEE3WF zzqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=HyBzpl+c; 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 q18si587723pge.257.2017.11.07.00.12.01; Tue, 07 Nov 2017 00:12:01 -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=HyBzpl+c; 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 S932752AbdKGIMA (ORCPT + 26 others); Tue, 7 Nov 2017 03:12:00 -0500 Received: from conuserg-09.nifty.com ([210.131.2.76]:24877 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932518AbdKGIKx (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 vA789u4N027191; Tue, 7 Nov 2017 17:10:00 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com vA789u4N027191 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1510042201; bh=DwMtmEMhoQeKCP+xXK1eqp6kUDEqMWCSMJjO2972Fxg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HyBzpl+ckA7ZFKYvDB8aUnuEkNkomvXZiJ9CZzfHII2TpTKbRElVHWBChunNh03aD 0YlESjO+sFpm2/O4VFrBr2o1jJ7uqZD/jTecgR7F7Nl14YrygOEfo2kvS39KgdsSc0 aHMLAfURuq8dSs5jgA7V2o7ZUAgMG6yCnNIoWpF11GZGwdYkh1Jt6OiBX6yN6pnNxr UA9OdbTGtf0RvmLytOrraRLKAesRQyDC12Irp5hEffmC8+iWtpQ4ABeduVwAyLdhKa hn/zBsRjYixSmnwIT6EdmCpST3/uBGN6AqSMoak0TWOTz4HlsEx4a3M6+GwY0ZxW6e JGj5/HQA9MI0A== 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 5/6] mmc: tmio, renesas_sdhi: set mmc_host_ops hooks directly Date: Tue, 7 Nov 2017 17:09:31 +0900 Message-Id: <1510042172-27220-6-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 Drivers can set any mmc_host_ops hooks between tmio_mmc_host_alloc() and tmio_mmc_host_probe(). Remove duplicated hooks in tmio_mmc_host. Signed-off-by: Masahiro Yamada --- drivers/mmc/host/renesas_sdhi_core.c | 4 ++-- drivers/mmc/host/tmio_mmc.h | 3 --- drivers/mmc/host/tmio_mmc_core.c | 4 ---- 3 files changed, 2 insertions(+), 9 deletions(-) -- 2.7.4 diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c index 23c250e..7bb0252 100644 --- a/drivers/mmc/host/renesas_sdhi_core.c +++ b/drivers/mmc/host/renesas_sdhi_core.c @@ -548,8 +548,8 @@ int renesas_sdhi_probe(struct platform_device *pdev, /* SDR speeds are only available on Gen2+ */ if (mmc_data->flags & TMIO_MMC_MIN_RCAR2) { /* card_busy caused issues on r8a73a4 (pre-Gen2) CD-less SDHI */ - host->card_busy = renesas_sdhi_card_busy; - host->start_signal_voltage_switch = + host->mmc_host_ops.card_busy = renesas_sdhi_card_busy; + host->mmc_host_ops.start_signal_voltage_switch = renesas_sdhi_start_signal_voltage_switch; } diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h index b251f1c..319a2d6 100644 --- a/drivers/mmc/host/tmio_mmc.h +++ b/drivers/mmc/host/tmio_mmc.h @@ -186,9 +186,6 @@ struct tmio_mmc_host { void (*clk_disable)(struct tmio_mmc_host *host); int (*multi_io_quirk)(struct mmc_card *card, unsigned int direction, int blk_size); - int (*card_busy)(struct mmc_host *mmc); - int (*start_signal_voltage_switch)(struct mmc_host *mmc, - struct mmc_ios *ios); int (*write16_hook)(struct tmio_mmc_host *host, int addr); void (*hw_reset)(struct tmio_mmc_host *host); void (*prepare_tuning)(struct tmio_mmc_host *host, unsigned long tap); diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c index 3c84044..695b4f4 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -1202,10 +1202,6 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host, if (ret < 0) return ret; - _host->mmc_host_ops.card_busy = _host->card_busy; - _host->mmc_host_ops.start_signal_voltage_switch = - _host->start_signal_voltage_switch; - mmc->caps |= MMC_CAP_4_BIT_DATA | pdata->capabilities; mmc->caps2 |= pdata->capabilities2; mmc->max_segs = pdata->max_segs ? : 32; From patchwork Tue Nov 7 08:09:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 118123 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3687133qgn; Tue, 7 Nov 2017 00:12:44 -0800 (PST) X-Google-Smtp-Source: ABhQp+SPlb4TQriBgCE0NBlWJqoMyJEpftRymV/fwInpJbcDD65sHLAbYbyQsBsuCqhIeEKlLiGt X-Received: by 10.84.217.81 with SMTP id e17mr17566655plj.345.1510042364873; Tue, 07 Nov 2017 00:12:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510042364; cv=none; d=google.com; s=arc-20160816; b=PAxH6aFuhOF2fTPIjKzLEh/t/avEzABVd3rKbs961EXf3e09eJHihWaEPKs/LuuRRN cXX6jqxtRO6zpsxoTz6Ax88r9UQHzbpA/oy3jEIz1qIbJxxraXioSezkb+N4vTAHYemS SiKA0l3LOg/W/twqDfFmP/urmicvy/PSZvmqvrUeF+zuxnfO1ss5Fv5DfNqkCiaoS5pU 3hZ/n3X5HPYBJUQUM8J2qbpIU4V0wNTFBilEfdem4tBcX8oASyQU7OoAnhRZ0sMVTBWt ms6Iw4Js4Apdpce4jIknO35AnpHc64QsrQFO8SHl4qZSlT0ZHMeQT9QHLhE52Idcf5aG txWg== 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=+Kt3mW9F5gEDgN7ZCV1zLJQInPHI87HJRRB4K6Qn5c4=; b=kypdxYjjFSkMRDOAPlqHQ/u1T8yhQdBbrHk/3dJKYAkBXDyCw+uLfgWNIAkHhayc8v bb+4nyZYo3xNSuWODMZXrfKH4SzZSUXKo8CZevHOGTTBz2QTAdTkPjFOd0C55TxBMbZV 4MTKopYRGpTw+bqeZs5/xN7eWn05e2cC6SLccY+v8xxjUoHkpv8ifV0c2zIe7f7vBqIq nOInQlNtwixzhK74YPHIx1wmRz0tcEPz4Wp719yaYz4OcyVeDGTxFlkBlwr1Ii6JbKfp Z+Aa3QCT091gAyJ7D6XGxWNJDVytwpiRxkVJZj1zH6h0iWt7KImvTsIhu+DqsP1ObTyk vgRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=aHvtroZT; 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 c7si592761plo.298.2017.11.07.00.12.44; Tue, 07 Nov 2017 00:12:44 -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=aHvtroZT; 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 S932726AbdKGIL7 (ORCPT + 26 others); Tue, 7 Nov 2017 03:11:59 -0500 Received: from conuserg-09.nifty.com ([210.131.2.76]:24878 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932520AbdKGIKx (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 vA789u4O027191; Tue, 7 Nov 2017 17:10:01 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com vA789u4O027191 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1510042201; bh=+Kt3mW9F5gEDgN7ZCV1zLJQInPHI87HJRRB4K6Qn5c4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aHvtroZT8ISSoqe+uLMuwEhLvBZrXeUgubIGX2G2SY5oZY+XAvyO9AT71LXPhmyWH 7z+xkHsrwtulVV4zkC2D9g/kUY2Dpuw0Kr1T7MweMlPF4jEAWQ9CQnOadlQu+DCUNV l0shQnkp2qMDiGkP2fuVKtrfRtSGljLI/AzTq35k4nHa3npjhqJfrA6c11DnGCnxdj 1pHBRlFu4eHfy5F+1Eeh1QLdquHBBdQ/bGPeHEAqUEXRGotTPkjAKza6dya3q5xjLX 6YFYYMjzf9wvMV8nXWCXC3sBQnSFXBV0MbHUrKEqX8RCBJtTOF+oky6DL0iYg9n0Hu yBsELsXQ5E1kw== 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 6/6] mmc: tmio: move mmc_of_parse() out of tmio_mmc_host_probe() Date: Tue, 7 Nov 2017 17:09:32 +0900 Message-Id: <1510042172-27220-7-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 mmc_of_parse() parses various DT properties and sets capability flags accordingly. However, drivers have no chance to run platform init code depending on such flags because mmc_of_parse() is called from tmio_mmc_host_probe(). Move mmc_of_parse() out of tmio_mmc_host_probe() so that drivers can handle capabilities before mmc_add_host(). Signed-off-by: Masahiro Yamada --- drivers/mmc/host/renesas_sdhi_core.c | 4 ++++ drivers/mmc/host/tmio_mmc.c | 4 ++++ drivers/mmc/host/tmio_mmc_core.c | 4 ---- 3 files changed, 8 insertions(+), 4 deletions(-) -- 2.7.4 Tested-by: Wolfram Sang diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c index 7bb0252..4658fb5 100644 --- a/drivers/mmc/host/renesas_sdhi_core.c +++ b/drivers/mmc/host/renesas_sdhi_core.c @@ -526,6 +526,10 @@ int renesas_sdhi_probe(struct platform_device *pdev, if (!host) return -ENOMEM; + ret = mmc_of_parse(host->mmc); + if (ret) + goto efree; + if (of_data) { mmc_data->flags |= of_data->tmio_flags; mmc_data->ocr_mask = of_data->tmio_ocr_mask; diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c index ccfbc15..87052b3 100644 --- a/drivers/mmc/host/tmio_mmc.c +++ b/drivers/mmc/host/tmio_mmc.c @@ -96,6 +96,10 @@ static int tmio_mmc_probe(struct platform_device *pdev) if (!host) goto cell_disable; + ret = mmc_of_parse(host->mmc); + if (ret) + goto host_free; + /* SD control register space size is 0x200, 0x400 for bus_shift=1 */ host->bus_shift = resource_size(res) >> 10; diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c index 695b4f4..c2f759b 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -1188,10 +1188,6 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host, if (IS_ERR(_host->ctl)) return PTR_ERR(_host->ctl); - ret = mmc_of_parse(mmc); - if (ret < 0) - return ret; - _host->pdata = pdata; platform_set_drvdata(pdev, _host);