lkml.org 
[lkml]   [2012]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@opensource.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 ?


\
 
 \ /
  Last update: 2012-11-27 01:01    [W:0.109 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site