From patchwork Wed Nov 8 10:16:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10048235 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 71D06603FF for ; Wed, 8 Nov 2017 10:18:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5BC562A18C for ; Wed, 8 Nov 2017 10:18:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 50A082A301; Wed, 8 Nov 2017 10:18:06 +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 E1CB82A200 for ; Wed, 8 Nov 2017 10:18:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751489AbdKHKSC (ORCPT ); Wed, 8 Nov 2017 05:18:02 -0500 Received: from conuserg-08.nifty.com ([210.131.2.75]:43318 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752057AbdKHKR7 (ORCPT ); Wed, 8 Nov 2017 05:17:59 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id vA8AH4ru031631; Wed, 8 Nov 2017 19:17:06 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com vA8AH4ru031631 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1510136226; bh=vwPTx3xPR0VwxS3ZMa3bQfqPUuODdw1NbGpyVnJoawE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LVqyKM/gAvajeZBR6mhnun6uMgmSyYGYNfi50lYU/iT/N/pd6vxqhZ1I+oeiw9L+N Hp9B24/cfRY+eiwMTDcj204EsZHm4HEh99fzCkgzdR4Fe74cuXizzAtGh75aTY9COK Oz9NOhvoBpPNOZbavhSJ1mp4nhxGKGJYdVgM4HOfMK7CeIxVwEWRgzpHKF3OuDkyx5 3h6SgqTVf5Rxbwosz3w/3i/j522DoEN1qYtaPaXRrOXnCrneGbSLpHcE6T95hbuZ83 aT3PGyy/Z2z0CjuR80kI2vUNULOTbgoTd/qAP+0FJnA6qk38XkYvP+K5/VTbixdsXz rwimeF2aw8i7g== 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 2/3] mmc: tmio: use mmc_can_gpio_cd() instead of checking TMIO_MMC_USE_GPIO_CD Date: Wed, 8 Nov 2017 19:16:59 +0900 Message-Id: <1510136220-31853-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510136220-31853-1-git-send-email-yamada.masahiro@socionext.com> References: <1510136220-31853-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 To use a GPIO line for card detection, TMIO_MMC_USE_GPIO_CD is used by a legacy board (arch/sh/boards/mach-ecovec24). For DT platforms, the "cd-gpios" property is a legitimate way for that in case the IP-builtin card detection can not be used for some reason. mmc_of_parse() calls mmc_gpiod_request_cd() to set up ctx->cd_gpio if the "cd-gpios" property is specified. To cater to both cases, mmc_can_gpio_cd() is a correct way to check which card detection logic is used. Signed-off-by: Masahiro Yamada --- drivers/mmc/host/tmio_mmc_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c index 7c0e952..9fd0874 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -1228,7 +1228,7 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host, } mmc->max_seg_size = mmc->max_req_size; - _host->native_hotplug = !(pdata->flags & TMIO_MMC_USE_GPIO_CD || + _host->native_hotplug = !(mmc_can_gpio_cd(mmc) || mmc->caps & MMC_CAP_NEEDS_POLL || !mmc_card_is_removable(mmc));