All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: core: do not abort if wp is disabled
@ 2015-03-13  8:08 Jun Nie
  2015-03-13  9:50 ` Ulf Hansson
  0 siblings, 1 reply; 3+ messages in thread
From: Jun Nie @ 2015-03-13  8:08 UTC (permalink / raw)
  To: linux-mmc, ulf.hansson, chris, shawn.guo, jun.nie

Do not abort probe due to no detection to write protection pin,
if host specify disable-wp.

Signed-off-by: Jun Nie <jun.nie@linaro.org>

diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index 8be0df7..30ed253 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -394,11 +394,14 @@ int mmc_of_parse(struct mmc_host *host)
 	/* Parse Write Protection */
 	ro_cap_invert = of_property_read_bool(np, "wp-inverted");
 
-	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)
-		return ret;
+	if (!of_get_property(np, "disable-wp", NULL)) {
+		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)
+			return ret;
+	}
 
 	/* See the comment on CD inversion above */
 	if (ro_cap_invert ^ ro_gpio_invert)
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-13 10:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-13  8:08 [PATCH] mmc: core: do not abort if wp is disabled Jun Nie
2015-03-13  9:50 ` Ulf Hansson
2015-03-13 10:22   ` Jun Nie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.