mmc: slot-gpio: Update default label when no con_id provided
[linux-2.6-microblaze.git] / drivers / mmc / core / slot-gpio.c
index e365d32..dd2a4b6 100644 (file)
@@ -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)