All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chanwoo Choi <cw00.choi@samsung.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	MyungJoo Ham <myungjoo.ham@samsung.com>,
	patches@opensource.wolfsonmicro.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] extcon: arizona: Only set GPIO if it has been requested
Date: Tue, 27 Nov 2012 16:15:12 +0900	[thread overview]
Message-ID: <50B46880.30109@samsung.com> (raw)
In-Reply-To: <20121127063528.GU9411@opensource.wolfsonmicro.com>

On 11/27/2012 03:35 PM, Mark Brown wrote:
> 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.

OK, Applied it.

You can check it after some minutes.
- git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon.git (for-next branch)

Thanks,
Chanwoo Choi

      reply	other threads:[~2012-11-27  7:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-26 11:28 [PATCH] extcon: arizona: Only set GPIO if it has been requested Mark Brown
2012-11-26 23:26 ` Chanwoo Choi
2012-11-27  6:35   ` Mark Brown
2012-11-27  7:15     ` Chanwoo Choi [this message]

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=50B46880.30109@samsung.com \
    --to=cw00.choi@samsung.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=patches@opensource.wolfsonmicro.com \
    /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.