From patchwork Fri Jun 29 14:47:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 10496807 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 C565C601C7 for ; Fri, 29 Jun 2018 14:48:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE7352817F for ; Fri, 29 Jun 2018 14:48:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B25E129878; Fri, 29 Jun 2018 14:48:02 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 4DD692817F for ; Fri, 29 Jun 2018 14:48:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935496AbeF2OsA (ORCPT ); Fri, 29 Jun 2018 10:48:00 -0400 Received: from mail.bugwerft.de ([46.23.86.59]:34602 "EHLO mail.bugwerft.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935019AbeF2Or7 (ORCPT ); Fri, 29 Jun 2018 10:47:59 -0400 Received: from localhost.localdomain (tmo-105-139.customers.d1-online.com [80.187.105.139]) by mail.bugwerft.de (Postfix) with ESMTPSA id BCFED28C392; Fri, 29 Jun 2018 14:44:41 +0000 (UTC) From: Daniel Mack To: ulf.hansson@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com Cc: robert.jarzmik@free.fr, linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, Daniel Mack Subject: [PATCH 5/7] mmc: pxamci: call mmc_of_parse() Date: Fri, 29 Jun 2018 16:47:36 +0200 Message-Id: <20180629144738.446-6-daniel@zonque.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180629144738.446-1-daniel@zonque.org> References: <20180629144738.446-1-daniel@zonque.org> 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 Call into mmc_of_parse() from pxamci_of_init(). As it needs a pointer to a struct mmc_host, refactor the code a bit. This allows all generic MMC properties to be set that are described in Documentation/devicetree/bindings/mmc/mmc.txt. Signed-off-by: Daniel Mack --- drivers/mmc/host/pxamci.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c index 3df60c7babce..e15708aa77a2 100644 --- a/drivers/mmc/host/pxamci.c +++ b/drivers/mmc/host/pxamci.c @@ -591,11 +591,13 @@ static const struct of_device_id pxa_mmc_dt_ids[] = { MODULE_DEVICE_TABLE(of, pxa_mmc_dt_ids); -static int pxamci_of_init(struct platform_device *pdev) +static int pxamci_of_init(struct platform_device *pdev, + struct mmc_host *mmc) { struct device_node *np = pdev->dev.of_node; struct pxamci_platform_data *pdata; u32 tmp; + int ret; if (!np) return 0; @@ -616,12 +618,17 @@ static int pxamci_of_init(struct platform_device *pdev) if (of_property_read_u32(np, "pxa-mmc,detect-delay-ms", &tmp) == 0) pdata->detect_delay_ms = tmp; + ret = mmc_of_parse(mmc); + if (ret < 0) + return ret; + pdev->dev.platform_data = pdata; return 0; } #else -static int pxamci_of_init(struct platform_device *pdev) +static int pxamci_of_init(struct platform_device *pdev, + struct mmc_host *mmc) { return 0; } @@ -634,10 +641,6 @@ static int pxamci_probe(struct platform_device *pdev) struct resource *r; int ret, irq, gpio_cd = -1, gpio_ro = -1, gpio_power = -1; - ret = pxamci_of_init(pdev); - if (ret) - return ret; - r = platform_get_resource(pdev, IORESOURCE_MEM, 0); irq = platform_get_irq(pdev, 0); if (irq < 0) @@ -672,6 +675,10 @@ static int pxamci_probe(struct platform_device *pdev) */ mmc->max_blk_count = 65535; + ret = pxamci_of_init(pdev, mmc); + if (ret) + return ret; + host = mmc_priv(mmc); host->mmc = mmc; host->pdata = pdev->dev.platform_data;