mmc: slot-gpio: switch to use flags when getting GPIO
When the slot GPIO driver gets the GPIO to be used for card detect, it is now possible to specify a flag to have the line set up as input. Get rid of the explicit setup call for input and use the flag. The extra argument works as there are transition varargs macros in place in the <linux/gpio/consumer.h> header, in the future we will make the flags argument compulsory. Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
parent
f5b4d71f72
commit
9fbc695075
|
@ -308,14 +308,10 @@ int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id,
|
||||||
if (!con_id)
|
if (!con_id)
|
||||||
con_id = ctx->cd_label;
|
con_id = ctx->cd_label;
|
||||||
|
|
||||||
desc = devm_gpiod_get_index(host->parent, con_id, idx);
|
desc = devm_gpiod_get_index(host->parent, con_id, idx, GPIOD_IN);
|
||||||
if (IS_ERR(desc))
|
if (IS_ERR(desc))
|
||||||
return PTR_ERR(desc);
|
return PTR_ERR(desc);
|
||||||
|
|
||||||
ret = gpiod_direction_input(desc);
|
|
||||||
if (ret < 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
if (debounce) {
|
if (debounce) {
|
||||||
ret = gpiod_set_debounce(desc, debounce);
|
ret = gpiod_set_debounce(desc, debounce);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
|
Loading…
Reference in New Issue