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: 124863 Delivered-To: patch@linaro.org Received: by 10.46.62.1 with SMTP id l1csp108220lja; Wed, 17 Jan 2018 08:43:39 -0800 (PST) X-Google-Smtp-Source: ACJfBouLlPHjy5KILtYvyNIWlI3/HHwom/3q/TsqnIg7s2KslsP6lYckmMj31rp+pgQbHOjuDHH+ X-Received: by 10.98.98.5 with SMTP id w5mr38369318pfb.233.1516207418866; Wed, 17 Jan 2018 08:43:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516207418; cv=none; d=google.com; s=arc-20160816; b=b/thPhR1mHgF1Zdbp6zK8jQYYvLJimOkU0K4Llgm4QVM1iQsHIWRQrEU47Y+s63X3I /oKxpUVoQRTrJQXFvSw5kA56Eiq8IlsoNK/wwrxipQlVPs8aACLBkUXMwdPnuatxnyZd 25pFr06K3qsTVSoG85uOpS/c4odO3A8dQPvSU3bNxpwr58iRDwdwYGcVdnb/MyGK1KDo dpKxCU0/siyGWB80p4vUrUA74mM+G+zkAHI94N7t+s0qxh1G5SaioiT5B1yYfCVvAjJY 7okNFkJ0/EZiE52dh1R4U1qrHxKIi1+92/oKuQOFIVCUInye0X0G+O41W5XWGFoi6eM0 CeIQ== 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=ZVQUgH/WacIygQaUdJm4zUU7OUxNeiBXZgYLjjAqygI=; b=EmfSMyh8wVtB6Eu9fA6wC8mzo8ruW1gr8CPGIsUzUhTujYBvcabDaHqNoEOcomS3K3 qUniIOaH7NAafJJXrr8zHOrwWcl+E8CkIrUFHHu7+WaygMs686uh52dMliGQ8Z+ga8To v0uVVlchZSqj3iEhDSs/j9yc1o1WR5up7meE0PezAPIQv7gbBM22gmaeLyt4My1a8LVd /nJEiKyNABCs3NGa8mohNDnONjbJ++wps0ieel2ecTaMtnjOfxJeh1/fLt/wYhRhi05L 6Su4O2Ssmg66k+hDyqUh1MOpRF+FoGBcmeeL6JCJMHKbTEoZ42LNJaEyHdcfGHjC+Apx pDPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=QzviiQyd; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-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 d18si4031993pgv.575.2018.01.17.08.43.38; Wed, 17 Jan 2018 08:43:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=QzviiQyd; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753984AbeAQQng (ORCPT + 6 others); 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-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org 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 --- Changes in v3: - newly added Changes in v2: None drivers/mmc/host/tmio_mmc_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Wolfram Sang 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);