Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 82cf77a1 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown
Browse files

ASoC: tas2552: Remove unneeded NULL test for tas2552->enable_gpio



It's safe to call gpiod_set_value() with NULL desc.

Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Acked-by: default avatarDan Murphy <dmurphy@ti.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 95f1044f
Loading
Loading
Loading
Loading
+5 −10
Original line number Diff line number Diff line
@@ -493,7 +493,6 @@ static int tas2552_runtime_suspend(struct device *dev)
	regcache_cache_only(tas2552->regmap, true);
	regcache_mark_dirty(tas2552->regmap);

	if (tas2552->enable_gpio)
	gpiod_set_value(tas2552->enable_gpio, 0);

	return 0;
@@ -503,7 +502,6 @@ static int tas2552_runtime_resume(struct device *dev)
{
	struct tas2552_data *tas2552 = dev_get_drvdata(dev);

	if (tas2552->enable_gpio)
	gpiod_set_value(tas2552->enable_gpio, 1);

	tas2552_sw_shutdown(tas2552, 0);
@@ -585,7 +583,6 @@ static int tas2552_codec_probe(struct snd_soc_codec *codec)
		return ret;
	}

	if (tas2552->enable_gpio)
	gpiod_set_value(tas2552->enable_gpio, 1);

	ret = pm_runtime_get_sync(codec->dev);
@@ -610,7 +607,6 @@ static int tas2552_codec_probe(struct snd_soc_codec *codec)
	return 0;

probe_fail:
	if (tas2552->enable_gpio)
	gpiod_set_value(tas2552->enable_gpio, 0);

	regulator_bulk_disable(ARRAY_SIZE(tas2552->supplies),
@@ -624,7 +620,6 @@ static int tas2552_codec_remove(struct snd_soc_codec *codec)

	pm_runtime_put(codec->dev);

	if (tas2552->enable_gpio)
	gpiod_set_value(tas2552->enable_gpio, 0);

	return 0;