diff options
author | Axel Lin <axel.lin@ingics.com> | 2015-07-21 21:59:47 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-07-22 05:55:06 -0400 |
commit | 6a75c0b62b0981c3a34d3336725b0840747e7680 (patch) | |
tree | 47576edda93228a06d44e8a29aca1fb4c111f3e2 | |
parent | 091571d071a435a517aec42c4f8c56883c5dc531 (diff) |
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: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/cs4349.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sound/soc/codecs/cs4349.c b/sound/soc/codecs/cs4349.c index a7538aea7f99..852be858bb9f 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, | |||
300 | if (IS_ERR(cs4349->reset_gpio)) | 300 | if (IS_ERR(cs4349->reset_gpio)) |
301 | return PTR_ERR(cs4349->reset_gpio); | 301 | return PTR_ERR(cs4349->reset_gpio); |
302 | 302 | ||
303 | if (cs4349->reset_gpio) | 303 | gpiod_set_value_cansleep(cs4349->reset_gpio, 1); |
304 | gpiod_set_value_cansleep(cs4349->reset_gpio, 1); | ||
305 | 304 | ||
306 | i2c_set_clientdata(client, cs4349); | 305 | i2c_set_clientdata(client, cs4349); |
307 | 306 | ||
@@ -316,8 +315,7 @@ static int cs4349_i2c_remove(struct i2c_client *client) | |||
316 | snd_soc_unregister_codec(&client->dev); | 315 | snd_soc_unregister_codec(&client->dev); |
317 | 316 | ||
318 | /* Hold down reset */ | 317 | /* Hold down reset */ |
319 | if (cs4349->reset_gpio) | 318 | gpiod_set_value_cansleep(cs4349->reset_gpio, 0); |
320 | gpiod_set_value_cansleep(cs4349->reset_gpio, 0); | ||
321 | 319 | ||
322 | return 0; | 320 | return 0; |
323 | } | 321 | } |
@@ -335,8 +333,7 @@ static int cs4349_runtime_suspend(struct device *dev) | |||
335 | regcache_cache_only(cs4349->regmap, true); | 333 | regcache_cache_only(cs4349->regmap, true); |
336 | 334 | ||
337 | /* Hold down reset */ | 335 | /* Hold down reset */ |
338 | if (cs4349->reset_gpio) | 336 | gpiod_set_value_cansleep(cs4349->reset_gpio, 0); |
339 | gpiod_set_value_cansleep(cs4349->reset_gpio, 0); | ||
340 | 337 | ||
341 | return 0; | 338 | return 0; |
342 | } | 339 | } |
@@ -350,8 +347,7 @@ static int cs4349_runtime_resume(struct device *dev) | |||
350 | if (ret < 0) | 347 | if (ret < 0) |
351 | return ret; | 348 | return ret; |
352 | 349 | ||
353 | if (cs4349->reset_gpio) | 350 | gpiod_set_value_cansleep(cs4349->reset_gpio, 1); |
354 | gpiod_set_value_cansleep(cs4349->reset_gpio, 1); | ||
355 | 351 | ||
356 | regcache_cache_only(cs4349->regmap, false); | 352 | regcache_cache_only(cs4349->regmap, false); |
357 | regcache_sync(cs4349->regmap); | 353 | regcache_sync(cs4349->regmap); |