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 08:26:35 +0900 [thread overview]
Message-ID: <50B3FAAB.9090406@samsung.com> (raw)
In-Reply-To: <1353929315-8874-1-git-send-email-broonie@opensource.wolfsonmicro.com>
On 11/26/2012 08:28 PM, Mark Brown wrote:
> The micd_pol GPIO is only requested if we've specified one greater than 0
> so apply the same test before we set it.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
> drivers/extcon/extcon-arizona.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
> index cdab9e5..585882e 100644
> --- a/drivers/extcon/extcon-arizona.c
> +++ b/drivers/extcon/extcon-arizona.c
> @@ -85,8 +85,9 @@ static void arizona_extcon_set_mode(struct arizona_extcon_info *info, int mode)
> {
> struct arizona *arizona = info->arizona;
>
> - gpio_set_value_cansleep(arizona->pdata.micd_pol_gpio,
> - info->micd_modes[mode].gpio);
> + 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 ?
next prev parent reply other threads:[~2012-11-26 23:26 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 [this message]
2012-11-27 6:35 ` Mark Brown
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=50B3FAAB.9090406@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.