Skip to content

Commit

Permalink
mmc: slot-gpio: Fix missing assignment to ctx->ro_gpio
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Guennadi Liakhovetski <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
  • Loading branch information
cjb committed Sep 11, 2012
1 parent 0d4de8f commit 15e8a8e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/mmc/core/slot-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 15e8a8e

Please sign in to comment.