LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Arvind Yadav <arvind.yadav.cs@gmail.com>, <jikos@kernel.org>,
	<benjamin.tissoires@redhat.com>, <jkosina@suse.cz>
Cc: <alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>,
	<linux-input@vger.kernel.org>
Subject: Re: [alsa-devel] [PATCH 1/3] ASoC: tlv320dac33: Use gpio_is_valid()
Date: Fri, 27 Apr 2018 12:33:29 +0300	[thread overview]
Message-ID: <c96ee82d-6b8f-2836-bbdc-57191f894056@ti.com> (raw)
In-Reply-To: <b61f3ee038bc0f577e60256c71a68bea783d0a13.1524819052.git.arvind.yadav.cs@gmail.com>



On 2018-04-27 11:56, Arvind Yadav wrote:
> Replace the manual validity checks for the GPIO with the
> gpio_is_valid().

Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
>  sound/soc/codecs/tlv320dac33.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c
> index a957eae..c23b9db 100644
> --- a/sound/soc/codecs/tlv320dac33.c
> +++ b/sound/soc/codecs/tlv320dac33.c
> @@ -397,13 +397,13 @@ static int dac33_hard_power(struct snd_soc_component *component, int power)
>  				goto exit;
>  		}
>  
> -		if (dac33->power_gpio >= 0)
> +		if (gpio_is_valid(dac33->power_gpio))
>  			gpio_set_value(dac33->power_gpio, 1);
>  
>  		dac33->chip_power = 1;
>  	} else {
>  		dac33_soft_power(component, 0);
> -		if (dac33->power_gpio >= 0)
> +		if (gpio_is_valid(dac33->power_gpio))
>  			gpio_set_value(dac33->power_gpio, 0);
>  
>  		ret = regulator_bulk_disable(ARRAY_SIZE(dac33->supplies),
> @@ -1519,7 +1519,7 @@ static int dac33_i2c_probe(struct i2c_client *client,
>  	dac33->fifo_mode = DAC33_FIFO_BYPASS;
>  
>  	/* Check if the reset GPIO number is valid and request it */
> -	if (dac33->power_gpio >= 0) {
> +	if (gpio_is_valid(dac33->power_gpio)) {
>  		ret = gpio_request(dac33->power_gpio, "tlv320dac33 reset");
>  		if (ret < 0) {
>  			dev_err(&client->dev,
> @@ -1548,7 +1548,7 @@ static int dac33_i2c_probe(struct i2c_client *client,
>  
>  	return ret;
>  err_get:
> -	if (dac33->power_gpio >= 0)
> +	if (gpio_is_valid(dac33->power_gpio))
>  		gpio_free(dac33->power_gpio);
>  err_gpio:
>  	return ret;
> @@ -1561,7 +1561,7 @@ static int dac33_i2c_remove(struct i2c_client *client)
>  	if (unlikely(dac33->chip_power))
>  		dac33_hard_power(dac33->component, 0);
>  
> -	if (dac33->power_gpio >= 0)
> +	if (gpio_is_valid(dac33->power_gpio))
>  		gpio_free(dac33->power_gpio);
>  
>  	return 0;
> 

- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

  reply	other threads:[~2018-04-27  9:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-27  8:56 [PATCH 0/3] ASoC: " Arvind Yadav
2018-04-27  8:56 ` [PATCH 1/3] ASoC: tlv320dac33: " Arvind Yadav
2018-04-27  9:33   ` Peter Ujfalusi [this message]
2018-04-27  8:56 ` [PATCH 2/3] ASoC: tpa6130a2: " Arvind Yadav
2018-04-27  9:33   ` [alsa-devel] " Peter Ujfalusi
2018-04-27  8:56 ` [PATCH 3/3] ASoC: samsung: " Arvind Yadav
     [not found]   ` <CGME20180427093444epcas2p185dbba85e2d37bde95ce3929a57c1f01@epcas2p1.samsung.com>
2018-04-27  9:34     ` Sylwester Nawrocki

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=c96ee82d-6b8f-2836-bbdc-57191f894056@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=arvind.yadav.cs@gmail.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=jikos@kernel.org \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [alsa-devel] [PATCH 1/3] ASoC: tlv320dac33: Use gpio_is_valid()' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).