diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2021-09-29 13:17:57 +0200 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2021-10-12 10:21:20 +0200 |
commit | 8792b0a09fa470cc476b2124f6c1061258c9ef7a (patch) | |
tree | a71f21a0e428808bf549764280573006268c52c5 /drivers/mmc | |
parent | mmc: slot-gpio: Refactor mmc_gpio_alloc() (diff) | |
download | linux-8792b0a09fa470cc476b2124f6c1061258c9ef7a.tar.xz linux-8792b0a09fa470cc476b2124f6c1061258c9ef7a.zip |
mmc: slot-gpio: Update default label when no con_id provided
Currently default label of GPIO is assigned to the device name,
when no con_id provided. Instead, let's update it to reflect
what it's about (use already prepared template).
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210929111757.52625-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/core/slot-gpio.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mmc/core/slot-gpio.c b/drivers/mmc/core/slot-gpio.c index e365d328f43c..dd2a4b6ab6ad 100644 --- a/drivers/mmc/core/slot-gpio.c +++ b/drivers/mmc/core/slot-gpio.c @@ -178,6 +178,10 @@ int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id, if (IS_ERR(desc)) return PTR_ERR(desc); + /* Update default label if no con_id provided */ + if (!con_id) + gpiod_set_consumer_name(desc, ctx->cd_label); + if (debounce) { ret = gpiod_set_debounce(desc, debounce); if (ret < 0) @@ -226,6 +230,10 @@ int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id, if (IS_ERR(desc)) return PTR_ERR(desc); + /* Update default label if no con_id provided */ + if (!con_id) + gpiod_set_consumer_name(desc, ctx->ro_label); + if (debounce) { ret = gpiod_set_debounce(desc, debounce); if (ret < 0) |