lkml.org 
[lkml]   [2012]   [Nov]   [27]   [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 Tue, Nov 27, 2012 at 08:26:35AM +0900, Chanwoo Choi wrote:
> On 11/26/2012 08:28 PM, Mark Brown wrote:

> > + 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 ?

Zero is normally a valid GPIO (since it's an index into a big array
after all) but this is unhelpful when checking to see if someone filled
in platform data as it's also the default value for uninitialised member
variables. It's much more likely that someone didn't fill in a GPIO
than that GPIO 0 got assigned to this.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2012-11-27 08:01    [W:0.068 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site