All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laxman Dewangan <ldewangan@nvidia.com>
To: Mark Brown <broonie@kernel.org>
Cc: <lgirdwood@gmail.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] regulator: max8973: get rid of extra variable for gpio validity
Date: Thu, 9 Apr 2015 16:06:11 +0530	[thread overview]
Message-ID: <5526561B.8000102@nvidia.com> (raw)
In-Reply-To: <20150408144205.GZ6023@sirena.org.uk>

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?



  reply	other threads:[~2015-04-09 10:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-08 13:38 [PATCH] regulator: max8973: get rid of extra variable for gpio validity Laxman Dewangan
2015-04-08 14:42 ` Mark Brown
2015-04-09 10:36   ` Laxman Dewangan [this message]
2015-04-10 17:46     ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5526561B.8000102@nvidia.com \
    --to=ldewangan@nvidia.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.