Commit 6a75c0b6 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

ASoC: cs4349: Remove unneeded NULL test for cs4349->reset_gpio

It's safe to call gpiod_set_value_cansleep() with NULL desc.
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 091571d0
...@@ -300,7 +300,6 @@ static int cs4349_i2c_probe(struct i2c_client *client, ...@@ -300,7 +300,6 @@ static int cs4349_i2c_probe(struct i2c_client *client,
if (IS_ERR(cs4349->reset_gpio)) if (IS_ERR(cs4349->reset_gpio))
return PTR_ERR(cs4349->reset_gpio); return PTR_ERR(cs4349->reset_gpio);
if (cs4349->reset_gpio)
gpiod_set_value_cansleep(cs4349->reset_gpio, 1); gpiod_set_value_cansleep(cs4349->reset_gpio, 1);
i2c_set_clientdata(client, cs4349); i2c_set_clientdata(client, cs4349);
...@@ -316,7 +315,6 @@ static int cs4349_i2c_remove(struct i2c_client *client) ...@@ -316,7 +315,6 @@ static int cs4349_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 (cs4349->reset_gpio)
gpiod_set_value_cansleep(cs4349->reset_gpio, 0); gpiod_set_value_cansleep(cs4349->reset_gpio, 0);
return 0; return 0;
...@@ -335,7 +333,6 @@ static int cs4349_runtime_suspend(struct device *dev) ...@@ -335,7 +333,6 @@ static int cs4349_runtime_suspend(struct device *dev)
regcache_cache_only(cs4349->regmap, true); regcache_cache_only(cs4349->regmap, true);
/* Hold down reset */ /* Hold down reset */
if (cs4349->reset_gpio)
gpiod_set_value_cansleep(cs4349->reset_gpio, 0); gpiod_set_value_cansleep(cs4349->reset_gpio, 0);
return 0; return 0;
...@@ -350,7 +347,6 @@ static int cs4349_runtime_resume(struct device *dev) ...@@ -350,7 +347,6 @@ static int cs4349_runtime_resume(struct device *dev)
if (ret < 0) if (ret < 0)
return ret; return ret;
if (cs4349->reset_gpio)
gpiod_set_value_cansleep(cs4349->reset_gpio, 1); gpiod_set_value_cansleep(cs4349->reset_gpio, 1);
regcache_cache_only(cs4349->regmap, false); regcache_cache_only(cs4349->regmap, false);
......
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