Skip to content

Commit

Permalink
ASoC: soc-ac97: Return correct error codes
Browse files Browse the repository at this point in the history
With the switching to dev_err_probe(), during the conversion
of GPIO calls, the return code is passed is a paratemer to it.
At the same time a copy'n'paste mistake was made, so the wrong
variable has been taken for the error reporting. Fix this.

Fixes: 3ee0d39 ("ASoC: soc-ac97: Convert to agnostic GPIO API")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230215132343.35547-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Andy Shevchenko authored and Mark Brown committed Feb 15, 2023
1 parent fdff966 commit 76f5aaa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/soc/soc-ac97.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,12 @@ static int snd_soc_ac97_parse_pinctl(struct device *dev,

cfg->sdata_gpio = devm_gpiod_get_index(dev, "ac97", 1, GPIOD_ASIS);
if (IS_ERR(cfg->sdata_gpio))
return dev_err_probe(dev, PTR_ERR(cfg->sync_gpio), "Can't find ac97-sdata gpio\n");
return dev_err_probe(dev, PTR_ERR(cfg->sdata_gpio), "Can't find ac97-sdata gpio\n");
gpiod_set_consumer_name(cfg->sdata_gpio, "AC97 link sdata");

cfg->reset_gpio = devm_gpiod_get_index(dev, "ac97", 2, GPIOD_ASIS);
if (IS_ERR(cfg->reset_gpio))
return dev_err_probe(dev, PTR_ERR(cfg->sync_gpio), "Can't find ac97-reset gpio\n");
return dev_err_probe(dev, PTR_ERR(cfg->reset_gpio), "Can't find ac97-reset gpio\n");
gpiod_set_consumer_name(cfg->reset_gpio, "AC97 link reset");

return 0;
Expand Down

0 comments on commit 76f5aaa

Please sign in to comment.