From: Axel Lin <axel.lin@ingics.com>
To: Mark Brown <broonie@kernel.org>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>,
alsa-devel@alsa-project.org, Liam Girdwood <lgirdwood@gmail.com>,
Dan Murphy <dmurphy@ti.com>
Subject: [PATCH] ASoC: tas2552: Use devm_gpiod_get_optional for enable-gpio
Date: Wed, 10 Jun 2015 22:46:05 +0800 [thread overview]
Message-ID: <1433947565.19912.1.camel@ingics.com> (raw)
commit ea178d1456dc ("ASoC: tas2552: Make the enable-gpio really optional")
makes enable-gpio optional. devm_gpiod_get_optional() is the better
function for optional gpio, so let's switch to use it.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
sound/soc/codecs/tas2552.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/sound/soc/codecs/tas2552.c b/sound/soc/codecs/tas2552.c
index 169a703..4f25a7d 100644
--- a/sound/soc/codecs/tas2552.c
+++ b/sound/soc/codecs/tas2552.c
@@ -703,13 +703,10 @@ static int tas2552_probe(struct i2c_client *client,
if (data == NULL)
return -ENOMEM;
- data->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW);
- if (IS_ERR(data->enable_gpio)) {
- if (PTR_ERR(data->enable_gpio) == -EPROBE_DEFER)
- return -EPROBE_DEFER;
-
- data->enable_gpio = NULL;
- }
+ data->enable_gpio = devm_gpiod_get_optional(dev, "enable",
+ GPIOD_OUT_LOW);
+ if (IS_ERR(data->enable_gpio))
+ return PTR_ERR(data->enable_gpio);
data->tas2552_client = client;
data->regmap = devm_regmap_init_i2c(client, &tas2552_regmap_config);
--
2.1.0
next reply other threads:[~2015-06-10 14:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-10 14:46 Axel Lin [this message]
2015-06-11 10:22 ` [PATCH] ASoC: tas2552: Use devm_gpiod_get_optional for enable-gpio Peter Ujfalusi
2015-06-11 10:42 ` 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=1433947565.19912.1.camel@ingics.com \
--to=axel.lin@ingics.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=dmurphy@ti.com \
--cc=lgirdwood@gmail.com \
--cc=peter.ujfalusi@ti.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.