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);