History

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.

Chris Ball committed 14 years ago

Commit 15e8a8e1 parent 0d4de8f1 file · +7 −1Browse files

Unified · Split

drivers/mmc/core/slot-gpio.c+7−1
@@ -100,7 +100,13 @@ int mmc_gpio_request_ro(struct mmc_host *host, unsigned int gpio) · 99 unmodified lines
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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t