Skip to content

Commit

Permalink
ASoC: tas2552: Use devm_gpiod_get_optional for enable-gpio
Browse files Browse the repository at this point in the history
commit ea178d1 ("ASoC: tas2552: Make the enable-gpio really optional")
makes enable-gpio optional. devm_gpiod_get_optional() is the better
function for optional gpio, so let's switch to use it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Axel Lin authored and Mark Brown committed Jun 11, 2015
1 parent 21e397b commit 8604bc2
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions sound/soc/codecs/tas2552.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,13 +703,10 @@ static int tas2552_probe(struct i2c_client *client,
if (data == NULL)
return -ENOMEM;

data->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW);
if (IS_ERR(data->enable_gpio)) {
if (PTR_ERR(data->enable_gpio) == -EPROBE_DEFER)
return -EPROBE_DEFER;

data->enable_gpio = NULL;
}
data->enable_gpio = devm_gpiod_get_optional(dev, "enable",
GPIOD_OUT_LOW);
if (IS_ERR(data->enable_gpio))
return PTR_ERR(data->enable_gpio);

data->tas2552_client = client;
data->regmap = devm_regmap_init_i2c(client, &tas2552_regmap_config);
Expand Down

0 comments on commit 8604bc2

Please sign in to comment.