ASoC: tas2552: Use devm_gpiod_get_optional for enable-gpio
commit ea178d1456
("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>
This commit is contained in:
parent
21e397bd90
commit
8604bc2836
|
@ -703,13 +703,10 @@ static int tas2552_probe(struct i2c_client *client,
|
||||||
if (data == NULL)
|
if (data == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
data->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW);
|
data->enable_gpio = devm_gpiod_get_optional(dev, "enable",
|
||||||
if (IS_ERR(data->enable_gpio)) {
|
GPIOD_OUT_LOW);
|
||||||
if (PTR_ERR(data->enable_gpio) == -EPROBE_DEFER)
|
if (IS_ERR(data->enable_gpio))
|
||||||
return -EPROBE_DEFER;
|
return PTR_ERR(data->enable_gpio);
|
||||||
|
|
||||||
data->enable_gpio = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
data->tas2552_client = client;
|
data->tas2552_client = client;
|
||||||
data->regmap = devm_regmap_init_i2c(client, &tas2552_regmap_config);
|
data->regmap = devm_regmap_init_i2c(client, &tas2552_regmap_config);
|
||||||
|
|
Loading…
Reference in New Issue