* [PATCH] ASoC: tas2552: Use devm_gpiod_get_optional for enable-gpio
@ 2015-06-10 14:46 Axel Lin
2015-06-11 10:22 ` Peter Ujfalusi
2015-06-11 10:42 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2015-06-10 14:46 UTC (permalink / raw)
To: Mark Brown; +Cc: Peter Ujfalusi, alsa-devel, Liam Girdwood, Dan Murphy
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: tas2552: Use devm_gpiod_get_optional for enable-gpio
2015-06-10 14:46 [PATCH] ASoC: tas2552: Use devm_gpiod_get_optional for enable-gpio Axel Lin
@ 2015-06-11 10:22 ` Peter Ujfalusi
2015-06-11 10:42 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Peter Ujfalusi @ 2015-06-11 10:22 UTC (permalink / raw)
To: Axel Lin, Mark Brown; +Cc: alsa-devel, Liam Girdwood, Dan Murphy
On 06/10/2015 05:46 PM, Axel Lin wrote:
> 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>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.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);
>
--
Péter
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: tas2552: Use devm_gpiod_get_optional for enable-gpio
2015-06-10 14:46 [PATCH] ASoC: tas2552: Use devm_gpiod_get_optional for enable-gpio Axel Lin
2015-06-11 10:22 ` Peter Ujfalusi
@ 2015-06-11 10:42 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2015-06-11 10:42 UTC (permalink / raw)
To: Axel Lin; +Cc: Peter Ujfalusi, alsa-devel, Liam Girdwood, Dan Murphy
[-- Attachment #1.1: Type: text/plain, Size: 281 bytes --]
On Wed, Jun 10, 2015 at 10:46:05PM +0800, Axel Lin wrote:
> 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.
Applied, thanks.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-06-11 10:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-10 14:46 [PATCH] ASoC: tas2552: Use devm_gpiod_get_optional for enable-gpio Axel Lin
2015-06-11 10:22 ` Peter Ujfalusi
2015-06-11 10:42 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox