Skip to content

Commit

Permalink
mmc: slot-gpio: Update default label when no con_id provided
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andy Shevchenko authored and Ulf Hansson committed Oct 12, 2021
1 parent 4877b81 commit 8792b0a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/mmc/core/slot-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 8792b0a

Please sign in to comment.