From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Chanwoo Choi <cw00.choi@samsung.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 06:35:28 +0000 [thread overview]
Message-ID: <20121127063528.GU9411@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <50B3FAAB.9090406@samsung.com>
[-- Attachment #1: Type: text/plain, Size: 653 bytes --]
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.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-11-27 6:35 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 [this message]
2012-11-27 7:15 ` Chanwoo Choi
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=20121127063528.GU9411@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=cw00.choi@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox