From patchwork Fri Nov 24 16:24:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 119623 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2450249qgn; Fri, 24 Nov 2017 08:33:03 -0800 (PST) X-Google-Smtp-Source: AGs4zMYTvY2GZCE11TGp9naCYTiUIiX8dkWcWazCs24pr/pHNUyZ1JJwo/th/4rlHVeq1ZidQeKE X-Received: by 10.98.99.68 with SMTP id x65mr10635205pfb.56.1511541183680; Fri, 24 Nov 2017 08:33:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511541183; cv=none; d=google.com; s=arc-20160816; b=YvOcz582oFfsTToD6sM++uLsULqVoIy28U6QUwlR0GdAjUIgoVMuVelMFbMamJUrTn mGyR1XfgoJkWAk8GZzSzJ/PVuL5FtzrwMmO3rkGgmjZD1D4BxcUjn/pnC433U1qZMPgs wZKa6k0T1xo+uZa4xjEjQorzpPKdRtnni0DLnQx9Y16nwdCKjme+/mchvxWXX6lofwel BPyNlYrPJP0ZOTZIlfdnYZtE0X7dkXLUKlRU3LG1vh03FtyrxKJFAgToZWxPmvgj6TPP unGMOxR0+p4Uxuk61NB1LPoKb/pTh3dG+/iFkuUdVTBW4i0gSti/RygNWK6SEQ3+3tpx XD6w== 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=yOXj3yJ7cLaZ56m/x0qKE3PkK/y+Tkhu04xxPeqNqwk=; b=FeYNVa88BCVnCohwLvOSYw/HQDh1AcZILx5+aJVcBavNJLv3gscF76PyrGqYzbxvD0 GvhU2IAe+rTX/spUY2j41rpXwDrkxtNM9UQNt4yVYdgNKYFsd6ctSmGaI4kNRTHaZPZB OlyQX4RtVPyuvpGwFrsvxLRiBwFzQs6q0X4sT4K5ViSmwcWnvDlUwfC5JkA9XoLRgefN mGQPR+GZMqnFoV5C9y2dyHcHK/ot0yvwS3wuXB8gnMK/KL8ujK+YdzfkyADTzmKVSojE 922aH12iJt68pa0N7K2dJV6wMzQxqXA88JOziQSESAX4DSX1VvtbVDDJR6qWVd+D4Y2K lwLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=JV46Bktq; 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 h61si19111593pld.330.2017.11.24.08.33.03; Fri, 24 Nov 2017 08:33:03 -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=JV46Bktq; 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 S1753812AbdKXQcq (ORCPT + 28 others); Fri, 24 Nov 2017 11:32:46 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:61401 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753560AbdKXQZ6 (ORCPT ); Fri, 24 Nov 2017 11:25:58 -0500 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-11.nifty.com with ESMTP id vAOGP9Vs007100; Sat, 25 Nov 2017 01:25:16 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com vAOGP9Vs007100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1511540717; bh=yOXj3yJ7cLaZ56m/x0qKE3PkK/y+Tkhu04xxPeqNqwk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JV46Bktq+Q7N/bDBIj7vsEOICuRe1HY9KidNQJ65YHuM/60VDexSe7RFMt+nrBBuV bLDlipvNcpnUqf/nCS2yFFw6M6SmTXrEZGG/wzpEUr19fgBWBBc1CstbCnlot05BSh hYJjfsABcVfS78a02ewhVk1vdbaI7M0sfGx6Rjkbwi97ZdiNDwS4gJwYPPzVBbn4M9 8JqlfG67nIZ3zBghKyZtVhUTcTrPmU5kYbrTQ6gTvLV6gNSWsRa7qgM7moTsCv6jQR njHTxyVk/QblzXH5EoYKNesAVIyw5OhLquENq3kG44elVf5jjQePJjdgFb0e2Wehbb L5QVMQUpx3oig== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-mmc@vger.kernel.org, Wolfram Sang Cc: Simon Horman , Yoshihiro Shimoda , linux-renesas-soc@vger.kernel.org, Masahiro Yamada , linux-kernel@vger.kernel.org, Ulf Hansson Subject: [PATCH v2 08/22] mmc: tmio: move mmc_gpio_request_cd() before mmc_add_host() Date: Sat, 25 Nov 2017 01:24:43 +0900 Message-Id: <1511540697-27387-9-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511540697-27387-1-git-send-email-yamada.masahiro@socionext.com> References: <1511540697-27387-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 --- Changes in v2: None 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 46f77c3..efffb04 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -1205,6 +1205,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; @@ -1300,14 +1306,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: