Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 43934ece authored by Ulf Hansson's avatar Ulf Hansson
Browse files

mmc: core: Don't return an error for CD/WP GPIOs when GPIOLIB is unset



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: default avatarMichal Simek <michal.simek@xilinx.com>
Fixes: 16b23787 ("mmc: sdhci-of-arasan: Call OF parsing for MMC")
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Tested-by: default avatarMichal Simek <michal.simek@xilinx.com>
Acked-by: default avatarVenu Byravarasu <vbyravarasu@nvidia.com>
parent 9ffecb10
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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"))