diff mbox

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

Message ID 1437530387.24723.1.camel@ingics.com (mailing list archive)
State Accepted
Commit 6a75c0b62b0981c3a34d3336725b0840747e7680
Headers show

Commit Message

Axel Lin July 22, 2015, 1:59 a.m. UTC
It's safe to call gpiod_set_value_cansleep() with NULL desc.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 sound/soc/codecs/cs4349.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

Comments

Howe, Tim July 30, 2015, 9:47 p.m. UTC | #1
On Tue, 21 Jul 2015, Axel Lin wrote:

> It's safe to call gpiod_set_value_cansleep() with NULL desc.
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
>  sound/soc/codecs/cs4349.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
Great, thanks.
Acked-by: Tim Howe <tim.howe@cirrus.com>
diff mbox

Patch

diff --git a/sound/soc/codecs/cs4349.c b/sound/soc/codecs/cs4349.c
index a7538ae..852be85 100644
--- a/sound/soc/codecs/cs4349.c
+++ b/sound/soc/codecs/cs4349.c
@@ -300,8 +300,7 @@  static int cs4349_i2c_probe(struct i2c_client *client,
 	if (IS_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);
 
@@ -316,8 +315,7 @@  static int cs4349_i2c_remove(struct i2c_client *client)
 	snd_soc_unregister_codec(&client->dev);
 
 	/* 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;
 }
@@ -335,8 +333,7 @@  static int cs4349_runtime_suspend(struct device *dev)
 	regcache_cache_only(cs4349->regmap, true);
 
 	/* 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;
 }
@@ -350,8 +347,7 @@  static int cs4349_runtime_resume(struct device *dev)
 	if (ret < 0)
 		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_sync(cs4349->regmap);