From patchwork Wed Jan 17 16:28:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10170117 X-Patchwork-Delegate: geert@linux-m68k.org 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 E458E60386 for ; Wed, 17 Jan 2018 16:44:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D43D126E51 for ; Wed, 17 Jan 2018 16:44:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C7F9C28450; Wed, 17 Jan 2018 16:44:53 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=unavailable 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 545D4223A0 for ; Wed, 17 Jan 2018 16:44:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753971AbeAQQng (ORCPT ); Wed, 17 Jan 2018 11:43:36 -0500 Received: from conuserg-08.nifty.com ([210.131.2.75]:36679 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753614AbeAQQ3d (ORCPT ); Wed, 17 Jan 2018 11:29:33 -0500 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-08.nifty.com with ESMTP id w0HGSIKt014790; Thu, 18 Jan 2018 01:28:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com w0HGSIKt014790 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1516206507; bh=En3rOM+T1cFJZYJRzc3Vu+g6rDcfF9CtX1LHZw+//m0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QzviiQydikQDllhlESSik454LOST/b9VY7C4N7S/hER1V81tjcmkNObf/UF1T3jJ+ +jYOUtKEs5H1kcOwYiW/uxIRrRJqx7f8254UM1XMqy2Ua0mDtYXM8rC/tONluz36Jm So92s2QpVNoHMR/vXhZD4wlH2XLJJxb/ZRsmpm1RskYCI97dcE52eQC5KhGZ3n71fP TDLMrKB3HAOScSNwQp9pZwn4aj3IXqL7VyPksanx3u0bSe0Dt2bXN/4kZyEoMEXGqX ZYdc2jog/nUE289k5JVjJeWl6E4BmoG0hiiKEJEBFQAT1/LzkdDlFuvIPCmxXcYr9G GUkBwDHwquwXw== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-mmc@vger.kernel.org, Wolfram Sang Cc: Ulf Magnusson , Geert Uytterhoeven , Simon Horman , Yoshihiro Shimoda , linux-renesas-soc@vger.kernel.org, Masahiro Yamada , linux-kernel@vger.kernel.org, Ulf Hansson Subject: [PATCH v3 09/16] mmc: tmio: use MMC_CAP2_NO_WRITE_PROTECT instead of TMIO own flag Date: Thu, 18 Jan 2018 01:28:09 +0900 Message-Id: <1516206496-16612-10-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516206496-16612-1-git-send-email-yamada.masahiro@socionext.com> References: <1516206496-16612-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP TMIO_MMC_WRPROTECT_DISABLE is equivalent to MMC_CAP2_NO_WRITE_PROTECT. Only the difference is the TMIO_... makes tmio_mmc_get_ro() return 0 (i.e. it does not affect mmc_gpio_get_ro() at all), while MMC_CAP2_... returns 0 before calling ->get_ro() hook (i.e. it affects both IP own logic and GPIO detection). The TMIO MMC drivers do not set-up gpio_ro by themselves. Only the possibility, if any, would be DT specifies "wp-gpios" property, and gpio_ro is set by mmc_gpiod_request_ro() called from mmc_of_parse(). However, it does not make sense to specify "wp-gpios" property and "toshiba,mmc-wrprotect-disable" at the same time. I checked under arch/arm/boot/dts/ and arch/arm64/boot/dts/renesas/, and I did not see any Renesas boards with "wp-gpios". So, this conversion should be safe. Signed-off-by: Masahiro Yamada Reviewed-by: Wolfram Sang --- Changes in v3: - newly added Changes in v2: None drivers/mmc/host/tmio_mmc_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c index 0032707..bdbff2d 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -1128,7 +1128,7 @@ static int tmio_mmc_init_ocr(struct tmio_mmc_host *host) } static void tmio_mmc_of_parse(struct platform_device *pdev, - struct tmio_mmc_data *pdata) + struct mmc_host *mmc) { const struct device_node *np = pdev->dev.of_node; @@ -1136,7 +1136,7 @@ static void tmio_mmc_of_parse(struct platform_device *pdev, return; if (of_get_property(np, "toshiba,mmc-wrprotect-disable", NULL)) - pdata->flags |= TMIO_MMC_WRPROTECT_DISABLE; + mmc->caps2 |= MMC_CAP2_NO_WRITE_PROTECT; } struct tmio_mmc_host *tmio_mmc_host_alloc(struct platform_device *pdev, @@ -1171,7 +1171,7 @@ struct tmio_mmc_host *tmio_mmc_host_alloc(struct platform_device *pdev, goto free; } - tmio_mmc_of_parse(pdev, pdata); + tmio_mmc_of_parse(pdev, mmc); platform_set_drvdata(pdev, host);