lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 27 Apr 2018 12:33:43 +0300
From:   Peter Ujfalusi <peter.ujfalusi@...com>
To:     Arvind Yadav <arvind.yadav.cs@...il.com>, <jikos@...nel.org>,
        <benjamin.tissoires@...hat.com>, <jkosina@...e.cz>
CC:     <alsa-devel@...a-project.org>, <linux-kernel@...r.kernel.org>,
        <linux-input@...r.kernel.org>
Subject: Re: [alsa-devel] [PATCH 2/3] ASoC: tpa6130a2: Use gpio_is_valid()



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@...com>

> Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
> ---
>  sound/soc/codecs/tpa6130a2.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/sound/soc/codecs/tpa6130a2.c b/sound/soc/codecs/tpa6130a2.c
> index 616cd4b..18f32b9 100644
> --- a/sound/soc/codecs/tpa6130a2.c
> +++ b/sound/soc/codecs/tpa6130a2.c
> @@ -62,7 +62,7 @@ static int tpa6130a2_power(struct tpa6130a2_data *data, bool enable)
>  			return ret;
>  		}
>  		/* Power on */
> -		if (data->power_gpio >= 0)
> +		if (gpio_is_valid(data->power_gpio))
>  			gpio_set_value(data->power_gpio, 1);
>  
>  		/* Sync registers */
> @@ -72,7 +72,7 @@ static int tpa6130a2_power(struct tpa6130a2_data *data, bool enable)
>  			dev_err(data->dev,
>  				"Failed to sync registers: %d\n", ret);
>  			regcache_cache_only(data->regmap, true);
> -			if (data->power_gpio >= 0)
> +			if (gpio_is_valid(data->power_gpio))
>  				gpio_set_value(data->power_gpio, 0);
>  			ret2 = regulator_disable(data->supply);
>  			if (ret2 != 0)
> @@ -89,7 +89,7 @@ static int tpa6130a2_power(struct tpa6130a2_data *data, bool enable)
>  		regcache_cache_only(data->regmap, true);
>  
>  		/* Power off */
> -		if (data->power_gpio >= 0)
> +		if (gpio_is_valid(data->power_gpio))
>  			gpio_set_value(data->power_gpio, 0);
>  
>  		ret = regulator_disable(data->supply);
> @@ -259,7 +259,7 @@ static int tpa6130a2_probe(struct i2c_client *client,
>  
>  	data->id = id->driver_data;
>  
> -	if (data->power_gpio >= 0) {
> +	if (gpio_is_valid(data->power_gpio)) {
>  		ret = devm_gpio_request(dev, data->power_gpio,
>  					"tpa6130a2 enable");
>  		if (ret < 0) {
> 

- P├ęter

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

Powered by blists - more mailing lists