aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/soc-jack.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c
index 9f60c25c4568..171c4291ea21 100644
--- a/sound/soc/soc-jack.c
+++ b/sound/soc/soc-jack.c
@@ -315,8 +315,11 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
315 goto undo; 315 goto undo;
316 } 316 }
317 317
318 if (gpios[i].gpiod_dev) { 318 if (gpios[i].desc) {
319 /* GPIO descriptor */ 319 /* Already have a GPIO descriptor. */
320 goto got_gpio;
321 } else if (gpios[i].gpiod_dev) {
322 /* Get a GPIO descriptor */
320 gpios[i].desc = gpiod_get_index(gpios[i].gpiod_dev, 323 gpios[i].desc = gpiod_get_index(gpios[i].gpiod_dev,
321 gpios[i].name, 324 gpios[i].name,
322 gpios[i].idx, GPIOD_IN); 325 gpios[i].idx, GPIOD_IN);
@@ -344,7 +347,7 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
344 347
345 gpios[i].desc = gpio_to_desc(gpios[i].gpio); 348 gpios[i].desc = gpio_to_desc(gpios[i].gpio);
346 } 349 }
347 350got_gpio:
348 INIT_DELAYED_WORK(&gpios[i].work, gpio_work); 351 INIT_DELAYED_WORK(&gpios[i].work, gpio_work);
349 gpios[i].jack = jack; 352 gpios[i].jack = jack;
350 353