From patchwork Wed Nov 8 10:16:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 118233 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5097644qgn; Wed, 8 Nov 2017 02:18:55 -0800 (PST) X-Google-Smtp-Source: ABhQp+RcMN1GhpLXAfi3a96+QBxKkvsVHTz++BGrfm1V7zkZY+CzN9JxymxE5mfn6FKbE4gn8uUu X-Received: by 10.84.176.132 with SMTP id v4mr1771340plb.393.1510136335220; Wed, 08 Nov 2017 02:18:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510136335; cv=none; d=google.com; s=arc-20160816; b=FtjiF4yiCCQPQlVBIMnbx86FwNoyEafdwKSYEibVmDQVzXZdj+RK6te2JGUGjBkX40 BYIj2+RpW0msGAKKqgtRja/wghWYcv7BJDa3N6Q0o568SmxbMhrMoh0XBUTePr/tAG7A lkvRTAjgU4o1jtmtsRPA4uyQ4XE3aDFPf5WD1PEHxXIm+YsYXGiWsnB0NJWDy0SInW8D jfe1lvTP4KbGyGR7tns3EYeuVyRp46MN1SMVTjVW4zemxq6tfXeDQq5BIftqSeUoIuJX hE+e/LuTUDpfy2cRGeKGtMBaHXhkNPP/UkJTR25DSQErUSbJ7b19zsmD7V9giPXWFGSh JNiA== 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=/blhpwY6spQ9CKanR35MzGsnYypGKrLj3pzGFbNPKhg=; b=zcqtmKCbyNZiFDT5DlIm1Evrqp1WS+AcnL2vc5b3+ZYsc//QxRRPvJzvtQWxRNKrWX yWrepy9HgCiRPJNdhsPD/ySf4AAQDKh8fszNg03cwKuertIIw/fWA6y17Iqrr1nIiMCC 5F22F8NW1MUeonfp756+EULCxUlzAuiWdoWqsJVjVeHOIq7H7B/iIci4roAEu40ejL4o qm+/2j4hDMSkuTEEgxk2Q09VM1+X8MPVilkYJRpI/p4/QtO6uECpQ1yAbv9D6f8xzjTj Ro85l57Nolpd62Y/BMDUr45VeVoepWAon+HTuZIqaibXLQpPRyM9+L3bHTdxUlIX+2SS lxHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=WSSHpAdd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 r17si3542260pgd.673.2017.11.08.02.18.54; Wed, 08 Nov 2017 02:18:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=WSSHpAdd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751826AbdKHKSv (ORCPT + 26 others); Wed, 8 Nov 2017 05:18:51 -0500 Received: from conuserg-08.nifty.com ([210.131.2.75]:43224 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751352AbdKHKR4 (ORCPT ); Wed, 8 Nov 2017 05:17:56 -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 vA8AH4rt031631; Wed, 8 Nov 2017 19:17:05 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com vA8AH4rt031631 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1510136225; bh=/blhpwY6spQ9CKanR35MzGsnYypGKrLj3pzGFbNPKhg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WSSHpAddeDg4dmEWyMVLlBLTHClQrpdayBxt+XXMPJ/Sw4lRIeXHhnKZeJbYpilh4 cxEHvTTiBE3SVgLXexwX8qZOxWL+ZLwjISxJOGHC0YVIt5Tlzmlaz/0teW8tPyQm6j gtzTaQLoUq7d9VAHLXw0jLBeA4QT83UsRj7gwWhLeDI5rfxPVlDUSCQ+1EDgQU6QG5 ReoyVRVDCVzSSGY7w6OXMum71pNkI1uKXRR+E1pZvTyKGZcq4OomE4/7P2VOVrFnbp LsHCOlDRRDbQEYOyyaLfa+JXcgWQDXXQGkCwaC8tDggPRmFXIvYVAqDor62o4WBNvi By5TX8OM//+ig== 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 1/3] mmc: tmio: move mmc_gpio_request_cd() before mmc_add_host() Date: Wed, 8 Nov 2017 19:16:58 +0900 Message-Id: <1510136220-31853-2-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Drivers do not need to call mmc_gpiod_request_cd_irq() explicitly because mmc_start_host() calls it. To make it work, cd_gpio must be set before mmc_add_host(). Signed-off-by: Masahiro Yamada --- drivers/mmc/host/tmio_mmc_core.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) -- 2.7.4 diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c index 2abc6bc..7c0e952 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -1201,6 +1201,12 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host, if (ret < 0) return ret; + if (pdata->flags & TMIO_MMC_USE_GPIO_CD) { + ret = mmc_gpio_request_cd(mmc, pdata->cd_gpio, 0); + if (ret) + return ret; + } + mmc->caps |= MMC_CAP_4_BIT_DATA | pdata->capabilities; mmc->caps2 |= pdata->capabilities2; mmc->max_segs = pdata->max_segs ? : 32; @@ -1296,14 +1302,6 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host, dev_pm_qos_expose_latency_limit(&pdev->dev, 100); - if (pdata->flags & TMIO_MMC_USE_GPIO_CD) { - ret = mmc_gpio_request_cd(mmc, pdata->cd_gpio, 0); - if (ret) - goto remove_host; - - mmc_gpiod_request_cd_irq(mmc); - } - return 0; remove_host: