Skip to content

Commit 25356be

Browse files
cjbgregkh
authored andcommitted
mmc: slot-gpio: Fix missing assignment to ctx->ro_gpio
commit 15e8a8e upstream. 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. Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Chris Ball <cjb@laptop.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 07c0544 commit 25356be

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/mmc/core/slot-gpio.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,13 @@ int mmc_gpio_request_ro(struct mmc_host *host, unsigned int gpio)
100100

101101
ctx = host->slot.handler_priv;
102102

103-
return gpio_request_one(gpio, GPIOF_DIR_IN, ctx->ro_label);
103+
ret = gpio_request_one(gpio, GPIOF_DIR_IN, ctx->ro_label);
104+
if (ret < 0)
105+
return ret;
106+
107+
ctx->ro_gpio = gpio;
108+
109+
return 0;
104110
}
105111
EXPORT_SYMBOL(mmc_gpio_request_ro);
106112

0 commit comments

Comments
 (0)