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: 10045861 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F13DB6032D for ; Tue, 7 Nov 2017 08:12:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E065229FB6 for ; Tue, 7 Nov 2017 08:12:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D581D29FAC; Tue, 7 Nov 2017 08:12:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DE3929F53 for ; Tue, 7 Nov 2017 08:12:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932701AbdKGIL6 (ORCPT ); Tue, 7 Nov 2017 03:11:58 -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-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Tested-by: Wolfram Sang --- 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(-) 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);