From: Chris Ball Date: Mon, 10 Sep 2012 02:56:48 +0000 (-0400) Subject: mmc: slot-gpio: Fix missing assignment to ctx->ro_gpio X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=15e8a8e42966162c207bb97ed55c803bc437eeae;p=linux-beck.git 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 Acked-by: Guennadi Liakhovetski Signed-off-by: Chris Ball --- 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);