summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core
diff options
context:
space:
mode:
authorChris Ball <cjb@laptop.org>2012-09-09 22:56:48 -0400
committerChris Ball <cjb@laptop.org>2012-09-11 10:55:20 -0400
commit15e8a8e42966162c207bb97ed55c803bc437eeae (patch)
treee6136461d4d1bce995796a3518fe2eef08568964 /drivers/mmc/core
parent0d4de8f5de2a642353834b183b16b367d39ff893 (diff)
downloadlinux-15e8a8e42966162c207bb97ed55c803bc437eeae.tar.bz2
mmc: slot-gpio: Fix missing assignment to ctx->ro_gpio
mmc_gpio_request_ro() doesn't store the requested gpio in ctx->ro_gpio. As a result, subsequent calls to mmc_gpio_get_ro() will always fail with -ENOSYS because the gpio number isn't available to that function. Cc: stable <stable@vger.kernel.org> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/core')
-rw-r--r--drivers/mmc/core/slot-gpio.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/mmc/core/slot-gpio.c b/drivers/mmc/core/slot-gpio.c
index 058242916cef..08c6b3dfe080 100644
--- a/drivers/mmc/core/slot-gpio.c
+++ b/drivers/mmc/core/slot-gpio.c
@@ -100,7 +100,13 @@ int mmc_gpio_request_ro(struct mmc_host *host, unsigned int gpio)
ctx = host->slot.handler_priv;
- return gpio_request_one(gpio, GPIOF_DIR_IN, ctx->ro_label);
+ ret = gpio_request_one(gpio, GPIOF_DIR_IN, ctx->ro_label);
+ if (ret < 0)
+ return ret;
+
+ ctx->ro_gpio = gpio;
+
+ return 0;
}
EXPORT_SYMBOL(mmc_gpio_request_ro);