Commit 55be663d authored by Fabio Estevam's avatar Fabio Estevam Committed by Mark Brown
Browse files

ASoC: cs53l30: Remove unneeded gpiod NULL check



The gpiod API checks for NULL descriptors, so there is no need to
duplicate the check in the driver.

Signed-off-by: default avatarFabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 5771a8c0
Loading
Loading
Loading
Loading
+5 −10
Original line number Original line Diff line number Diff line
@@ -842,7 +842,6 @@ static int cs53l30_mute_stream(struct snd_soc_dai *dai, int mute, int stream)
{
{
	struct cs53l30_private *priv = snd_soc_codec_get_drvdata(dai->codec);
	struct cs53l30_private *priv = snd_soc_codec_get_drvdata(dai->codec);


	if (priv->mute_gpio)
	gpiod_set_value_cansleep(priv->mute_gpio, mute);
	gpiod_set_value_cansleep(priv->mute_gpio, mute);


	return 0;
	return 0;
@@ -960,7 +959,6 @@ static int cs53l30_i2c_probe(struct i2c_client *client,
		goto error;
		goto error;
	}
	}


	if (cs53l30->reset_gpio)
	gpiod_set_value_cansleep(cs53l30->reset_gpio, 1);
	gpiod_set_value_cansleep(cs53l30->reset_gpio, 1);


	i2c_set_clientdata(client, cs53l30);
	i2c_set_clientdata(client, cs53l30);
@@ -1056,7 +1054,6 @@ static int cs53l30_i2c_remove(struct i2c_client *client)
	snd_soc_unregister_codec(&client->dev);
	snd_soc_unregister_codec(&client->dev);


	/* Hold down reset */
	/* Hold down reset */
	if (cs53l30->reset_gpio)
	gpiod_set_value_cansleep(cs53l30->reset_gpio, 0);
	gpiod_set_value_cansleep(cs53l30->reset_gpio, 0);


	regulator_bulk_disable(ARRAY_SIZE(cs53l30->supplies),
	regulator_bulk_disable(ARRAY_SIZE(cs53l30->supplies),
@@ -1073,7 +1070,6 @@ static int cs53l30_runtime_suspend(struct device *dev)
	regcache_cache_only(cs53l30->regmap, true);
	regcache_cache_only(cs53l30->regmap, true);


	/* Hold down reset */
	/* Hold down reset */
	if (cs53l30->reset_gpio)
	gpiod_set_value_cansleep(cs53l30->reset_gpio, 0);
	gpiod_set_value_cansleep(cs53l30->reset_gpio, 0);


	regulator_bulk_disable(ARRAY_SIZE(cs53l30->supplies),
	regulator_bulk_disable(ARRAY_SIZE(cs53l30->supplies),
@@ -1094,7 +1090,6 @@ static int cs53l30_runtime_resume(struct device *dev)
		return ret;
		return ret;
	}
	}


	if (cs53l30->reset_gpio)
	gpiod_set_value_cansleep(cs53l30->reset_gpio, 1);
	gpiod_set_value_cansleep(cs53l30->reset_gpio, 1);


	regcache_cache_only(cs53l30->regmap, false);
	regcache_cache_only(cs53l30->regmap, false);