Commit 8604bc28 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

ASoC: tas2552: Use devm_gpiod_get_optional for enable-gpio

commit ea178d14 ("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: default avatarAxel Lin <axel.lin@ingics.com>
Acked-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 21e397bd
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment