lkml.org 
[lkml]   [2015]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] regulator: max8973: get rid of extra variable for gpio validity
On Wednesday 08 April 2015 08:12 PM, Mark Brown wrote:
> * PGP Signed by an unknown key
>
> On Wed, Apr 08, 2015 at 07:08:00PM +0530, Laxman Dewangan wrote:
>> To find that dvs-gpio is valid or not, gpio API gpio_is_valid()
>> can be directly used instead of intermediate variable.
>>
>> Removing the extra variable and using the gpio_is_valid().
> Are you sure that platform data using 0 as default/unset is still
> handled correctly after this?
>

This issue already exist and this patch will not handle this case
because gpio_is_valid() return true for gpio 0 also.

I search the registration of this driver on linux-next and found that it
is used from DT only. No one is registering this device from non-DT.

However, I can push another patch to fix the issue as if platform data
is provided from non-DT and dvs_gpio is 0 then mark this as -EINVAL so
that it will treat this as invalid gpio.
Still there will be issue if some platform have real GPIO number as 0
and register from board files.

Does it make sense?




\
 
 \ /
  Last update: 2015-04-09 13:21    [W:0.085 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site