Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Andy Shevchenko and committed by
Ulf Hansson
8792b0a0 4877b81f

+8
+8
drivers/mmc/core/slot-gpio.c
··· 178 178 if (IS_ERR(desc)) 179 179 return PTR_ERR(desc); 180 180 181 + /* Update default label if no con_id provided */ 182 + if (!con_id) 183 + gpiod_set_consumer_name(desc, ctx->cd_label); 184 + 181 185 if (debounce) { 182 186 ret = gpiod_set_debounce(desc, debounce); 183 187 if (ret < 0) ··· 229 225 desc = devm_gpiod_get_index(host->parent, con_id, idx, GPIOD_IN); 230 226 if (IS_ERR(desc)) 231 227 return PTR_ERR(desc); 228 + 229 + /* Update default label if no con_id provided */ 230 + if (!con_id) 231 + gpiod_set_consumer_name(desc, ctx->ro_label); 232 232 233 233 if (debounce) { 234 234 ret = gpiod_set_debounce(desc, debounce);