From: Axel Lin <axel.lin@ingics.com>
To: Mark Brown <broonie@kernel.org>
Cc: Brian Austin <brian.austin@cirrus.com>,
alsa-devel@alsa-project.org, Liam Girdwood <lgirdwood@gmail.com>,
Paul Handrigan <Paul.Handrigan@cirrus.com>,
Tim Howe <tim.howe@cirrus.com>
Subject: [PATCH] ASoC: cs4349: Remove unneeded NULL test for cs4349->reset_gpio
Date: Wed, 22 Jul 2015 09:59:47 +0800 [thread overview]
Message-ID: <1437530387.24723.1.camel@ingics.com> (raw)
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(-)
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);
--
2.1.0
next reply other threads:[~2015-07-22 1:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-22 1:59 Axel Lin [this message]
2015-07-22 9:57 ` Applied "ASoC: cs4349: Remove unneeded NULL test for cs4349->reset_gpio" to the asoc tree Mark Brown
2015-07-30 21:47 ` [PATCH] ASoC: cs4349: Remove unneeded NULL test for cs4349->reset_gpio Tim Howe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1437530387.24723.1.camel@ingics.com \
--to=axel.lin@ingics.com \
--cc=Paul.Handrigan@cirrus.com \
--cc=alsa-devel@alsa-project.org \
--cc=brian.austin@cirrus.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=tim.howe@cirrus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox