All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: broonie@kernel.org
Cc: Fabio Estevam <fabio.estevam@nxp.com>, alsa-devel@alsa-project.org
Subject: [PATCH 6/8] ASoC: cs42l42: Remove unneeded gpiod NULL check
Date: Sun, 16 Jul 2017 18:11:11 -0300	[thread overview]
Message-ID: <1500239473-14886-6-git-send-email-festevam@gmail.com> (raw)
In-Reply-To: <1500239473-14886-1-git-send-email-festevam@gmail.com>

From: Fabio Estevam <fabio.estevam@nxp.com>

The gpiod API checks for NULL descriptors, so there is no need to
duplicate the check in the driver.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 sound/soc/codecs/cs42l42.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c
index 55e4520..55caf5f 100644
--- a/sound/soc/codecs/cs42l42.c
+++ b/sound/soc/codecs/cs42l42.c
@@ -1898,8 +1898,7 @@ static int cs42l42_i2c_remove(struct i2c_client *i2c_client)
 	snd_soc_unregister_codec(&i2c_client->dev);
 
 	/* Hold down reset */
-	if (cs42l42->reset_gpio)
-		gpiod_set_value_cansleep(cs42l42->reset_gpio, 0);
+	gpiod_set_value_cansleep(cs42l42->reset_gpio, 0);
 
 	return 0;
 }
@@ -1913,8 +1912,7 @@ static int cs42l42_runtime_suspend(struct device *dev)
 	regcache_mark_dirty(cs42l42->regmap);
 
 	/* Hold down reset */
-	if (cs42l42->reset_gpio)
-		gpiod_set_value_cansleep(cs42l42->reset_gpio, 0);
+	gpiod_set_value_cansleep(cs42l42->reset_gpio, 0);
 
 	/* remove power */
 	regulator_bulk_disable(ARRAY_SIZE(cs42l42->supplies),
@@ -1937,8 +1935,7 @@ static int cs42l42_runtime_resume(struct device *dev)
 		return ret;
 	}
 
-	if (cs42l42->reset_gpio)
-		gpiod_set_value_cansleep(cs42l42->reset_gpio, 1);
+	gpiod_set_value_cansleep(cs42l42->reset_gpio, 1);
 
 	regcache_cache_only(cs42l42->regmap, false);
 	regcache_sync(cs42l42->regmap);
-- 
2.7.4

  parent reply	other threads:[~2017-07-16 21:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-16 21:11 [PATCH 1/8] ASoC: sun4i-codec: Remove unneeded gpiod NULL check Fabio Estevam
2017-07-16 21:11 ` [PATCH 2/8] ASoC: wm8804: " Fabio Estevam
2017-07-17 16:06   ` Applied "ASoC: wm8804: Remove unneeded gpiod NULL check" to the asoc tree Mark Brown
2017-07-16 21:11 ` [PATCH 3/8] ASoC: adau1977: Remove unneeded gpiod NULL check Fabio Estevam
2017-07-17 16:06   ` Applied "ASoC: adau1977: Remove unneeded gpiod NULL check" to the asoc tree Mark Brown
2017-07-16 21:11 ` [PATCH 4/8] ASoC: cs35l33: Remove unneeded gpiod NULL check Fabio Estevam
2017-07-17 16:05   ` Applied "ASoC: cs35l33: Remove unneeded gpiod NULL check" to the asoc tree Mark Brown
2017-07-16 21:11 ` [PATCH 5/8] ASoC: cs35l34: Remove unneeded gpiod NULL check Fabio Estevam
2017-07-17 16:05   ` Applied "ASoC: cs35l34: Remove unneeded gpiod NULL check" to the asoc tree Mark Brown
2017-07-16 21:11 ` Fabio Estevam [this message]
2017-07-17 16:05   ` Applied "ASoC: cs42l42: " Mark Brown
2017-07-16 21:11 ` [PATCH 7/8] ASoC: cs53l30: Remove unneeded gpiod NULL check Fabio Estevam
2017-07-17 16:05   ` Applied "ASoC: cs53l30: Remove unneeded gpiod NULL check" to the asoc tree Mark Brown
2017-07-16 21:11 ` [PATCH 8/8] ASoC: sta32x: Remove unneeded gpiod NULL check Fabio Estevam
2017-07-17 16:05   ` Applied "ASoC: sta32x: Remove unneeded gpiod NULL check" to the asoc tree Mark Brown
2017-07-17 16:06 ` Applied "ASoC: sun4i-codec: " 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=1500239473-14886-6-git-send-email-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=fabio.estevam@nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.