From: Michal Simek <michal.simek@xilinx.com>
To: Ulf Hansson <ulf.hansson@linaro.org>, linux-mmc@vger.kernel.org
Cc: Michal Simek <michal.simek@xilinx.com>,
Marcus Overhagen <marcus.overhagen@gmail.com>,
Venu Byravarasu <vbyravarasu@nvidia.com>
Subject: Re: [PATCH V2] mmc: core: Don't return an error for CD/WP GPIOs when GPIOLIB is unset
Date: Mon, 14 Sep 2015 12:20:38 +0200 [thread overview]
Message-ID: <55F69F76.7080603@xilinx.com> (raw)
In-Reply-To: <1442225935-24155-1-git-send-email-ulf.hansson@linaro.org>
On 09/14/2015 12:18 PM, Ulf Hansson wrote:
> When CONFIG_GPIOLIB is unset, its stubs will return -ENOSYS. That means
> when the mmc core parses DT for CD/WP GPIOs via mmc_of_parse(), -ENOSYS
> becomes propagated to the caller. Typically this means that the mmc host
> driver fails to probe.
>
> As the CD/WP GPIOs are already treated as optional, let's extend that to
> cover the case when CONFIG_GPIOLIB is unset.
>
> Reported-by: Michal Simek <michal.simek@xilinx.com>
> Fixes: 16b23787fc70 ("mmc: sdhci-of-arasan: Call OF parsing for MMC")
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> ---
>
> Changes in v2:
> - Corrected error code check.
>
> ---
> drivers/mmc/core/host.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
> index abd933b..5466f25 100644
> --- a/drivers/mmc/core/host.c
> +++ b/drivers/mmc/core/host.c
> @@ -457,7 +457,7 @@ int mmc_of_parse(struct mmc_host *host)
> 0, &cd_gpio_invert);
> if (!ret)
> dev_info(host->parent, "Got CD GPIO\n");
> - else if (ret != -ENOENT)
> + else if (ret != -ENOENT && ret != -ENOSYS)
> return ret;
>
> /*
> @@ -481,7 +481,7 @@ int mmc_of_parse(struct mmc_host *host)
> ret = mmc_gpiod_request_ro(host, "wp", 0, false, 0, &ro_gpio_invert);
> if (!ret)
> dev_info(host->parent, "Got WP GPIO\n");
> - else if (ret != -ENOENT)
> + else if (ret != -ENOENT && ret != -ENOSYS)
> return ret;
>
> if (of_property_read_bool(np, "disable-wp"))
>
Tested-by: Michal Simek <michal.simek@xilinx.com>
Thanks,
Michal
next prev parent reply other threads:[~2015-09-14 10:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-14 10:18 [PATCH V2] mmc: core: Don't return an error for CD/WP GPIOs when GPIOLIB is unset Ulf Hansson
2015-09-14 10:20 ` Michal Simek [this message]
2015-09-14 10:26 ` Venu Byravarasu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55F69F76.7080603@xilinx.com \
--to=michal.simek@xilinx.com \
--cc=linux-mmc@vger.kernel.org \
--cc=marcus.overhagen@gmail.com \
--cc=ulf.hansson@linaro.org \
--cc=vbyravarasu@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).