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  linux-cve-announce  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]
Message-id: <50B3FAAB.9090406@samsung.com>
Date:	Tue, 27 Nov 2012 08:26:35 +0900
From:	Chanwoo Choi <cw00.choi@...sung.com>
To:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	MyungJoo Ham <myungjoo.ham@...sung.com>,
	patches@...nsource.wolfsonmicro.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] extcon: arizona: Only set GPIO if it has been requested

On 11/26/2012 08:28 PM, Mark Brown wrote:
> The micd_pol GPIO is only requested if we've specified one greater than 0
> so apply the same test before we set it.
> 
> Signed-off-by: Mark Brown <broonie@...nsource.wolfsonmicro.com>
> ---
>  drivers/extcon/extcon-arizona.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
> index cdab9e5..585882e 100644
> --- a/drivers/extcon/extcon-arizona.c
> +++ b/drivers/extcon/extcon-arizona.c
> @@ -85,8 +85,9 @@ static void arizona_extcon_set_mode(struct arizona_extcon_info *info, int mode)
>  {
>  	struct arizona *arizona = info->arizona;
>  
> -	gpio_set_value_cansleep(arizona->pdata.micd_pol_gpio,
> -				info->micd_modes[mode].gpio);
> +	if (arizona->pdata.micd_pol_gpio > 0)
> +		gpio_set_value_cansleep(arizona->pdata.micd_pol_gpio,
> +					info->micd_modes[mode].gpio);

Why not use gpio_is_valid() function to test arizona->pdata.micd_pol_gpio ?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ