From: Dan Murphy <dmurphy@ti.com>
To: Axel Lin <axel.lin@ingics.com>, Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org, Liam Girdwood <lgirdwood@gmail.com>
Subject: Re: [PATCH] ASoC: tas2552: Remove unneeded NULL test for tas2552->enable_gpio
Date: Mon, 27 Jul 2015 08:19:37 -0500 [thread overview]
Message-ID: <55B62FE9.7020501@ti.com> (raw)
In-Reply-To: <1437809536.5851.1.camel@ingics.com>
On 07/25/2015 02:32 AM, Axel Lin wrote:
> It's safe to call gpiod_set_value() with NULL desc.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> ---
> sound/soc/codecs/tas2552.c | 15 +++++----------
> 1 file changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/sound/soc/codecs/tas2552.c b/sound/soc/codecs/tas2552.c
> index 2f6a65a..e3a0bca 100644
> --- a/sound/soc/codecs/tas2552.c
> +++ b/sound/soc/codecs/tas2552.c
> @@ -493,8 +493,7 @@ static int tas2552_runtime_suspend(struct device *dev)
> regcache_cache_only(tas2552->regmap, true);
> regcache_mark_dirty(tas2552->regmap);
>
> - if (tas2552->enable_gpio)
> - gpiod_set_value(tas2552->enable_gpio, 0);
> + gpiod_set_value(tas2552->enable_gpio, 0);
>
> return 0;
> }
> @@ -503,8 +502,7 @@ static int tas2552_runtime_resume(struct device *dev)
> {
> struct tas2552_data *tas2552 = dev_get_drvdata(dev);
>
> - if (tas2552->enable_gpio)
> - gpiod_set_value(tas2552->enable_gpio, 1);
> + gpiod_set_value(tas2552->enable_gpio, 1);
>
> tas2552_sw_shutdown(tas2552, 0);
>
> @@ -585,8 +583,7 @@ static int tas2552_codec_probe(struct snd_soc_codec *codec)
> return ret;
> }
>
> - if (tas2552->enable_gpio)
> - gpiod_set_value(tas2552->enable_gpio, 1);
> + gpiod_set_value(tas2552->enable_gpio, 1);
>
> ret = pm_runtime_get_sync(codec->dev);
> if (ret < 0) {
> @@ -610,8 +607,7 @@ static int tas2552_codec_probe(struct snd_soc_codec *codec)
> return 0;
>
> probe_fail:
> - if (tas2552->enable_gpio)
> - gpiod_set_value(tas2552->enable_gpio, 0);
> + gpiod_set_value(tas2552->enable_gpio, 0);
>
> regulator_bulk_disable(ARRAY_SIZE(tas2552->supplies),
> tas2552->supplies);
> @@ -624,8 +620,7 @@ static int tas2552_codec_remove(struct snd_soc_codec *codec)
>
> pm_runtime_put(codec->dev);
>
> - if (tas2552->enable_gpio)
> - gpiod_set_value(tas2552->enable_gpio, 0);
> + gpiod_set_value(tas2552->enable_gpio, 0);
>
> return 0;
> };
Acked-by: Dan Murphy <dmurphy@ti.com>
--
------------------
Dan Murphy
next prev parent reply other threads:[~2015-07-27 13:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-25 7:32 [PATCH] ASoC: tas2552: Remove unneeded NULL test for tas2552->enable_gpio Axel Lin
2015-07-27 13:19 ` Dan Murphy [this message]
2015-07-29 14:13 ` Applied "ASoC: tas2552: Remove unneeded NULL test for tas2552->enable_gpio" to the asoc tree Mark Brown
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=55B62FE9.7020501@ti.com \
--to=dmurphy@ti.com \
--cc=alsa-devel@alsa-project.org \
--cc=axel.lin@ingics.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.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