[PATCH] mmc: slot-gpio: Fix missing assignment to ctx->ro_gpio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx>
Signed-off-by: Chris Ball <cjb@xxxxxxxxxx>
---
 drivers/mmc/core/slot-gpio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mmc/core/slot-gpio.c b/drivers/mmc/core/slot-gpio.c
index 0582429..4f9b366 100644
--- a/drivers/mmc/core/slot-gpio.c
+++ b/drivers/mmc/core/slot-gpio.c
@@ -99,6 +99,7 @@ int mmc_gpio_request_ro(struct mmc_host *host, unsigned int gpio)
 		return ret;
 
 	ctx = host->slot.handler_priv;
+	ctx->ro_gpio = gpio;
 
 	return gpio_request_one(gpio, GPIOF_DIR_IN, ctx->ro_label);
 }
-- 
Chris Ball   <cjb@xxxxxxxxxx>   <http://printf.net/>
One Laptop Per Child
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux