From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Chanwoo Choi <cwchoi00@gmail.com>
Cc: <linux-kernel@vger.kernel.org>, <rf@opensource.wolfsonmicro.com>,
<cw00.choi@samsung.com>
Subject: Re: [PATCH] extcon: arizona: Reorder the default statement to remove unnecessary warning
Date: Tue, 29 Sep 2015 11:08:52 +0100 [thread overview]
Message-ID: <20150929100852.GH5432@ck-lbox> (raw)
In-Reply-To: <1443521191-18050-1-git-send-email-cw00.choi@samsung.com>
On Tue, Sep 29, 2015 at 07:06:31PM +0900, Chanwoo Choi wrote:
> This patch reorders the default statement to remove unnecessary warning message
> when info->hpdet_ip_version is 2.
Should say is higher than 2.
>
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> ---
But otherwise looks fine, the intention I imagine was to print a
warning for unknown hpdep ip but still handle it as ip version 2.
But given that the ip can only be unknown if there has been a
mistake coding the driver return EINVAL seems fine too.
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Thanks,
Charles
> drivers/extcon/extcon-arizona.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
> index b010307..a1ab0a5 100644
> --- a/drivers/extcon/extcon-arizona.c
> +++ b/drivers/extcon/extcon-arizona.c
> @@ -477,9 +477,6 @@ static int arizona_hpdet_read(struct arizona_extcon_info *info)
> arizona_hpdet_b_ranges[range].factor_a);
> break;
>
> - default:
> - dev_warn(arizona->dev, "Unknown HPDET IP revision %d\n",
> - info->hpdet_ip_version);
> case 2:
> if (!(val & ARIZONA_HP_DONE_B)) {
> dev_err(arizona->dev, "HPDET did not complete: %x\n",
> @@ -516,6 +513,12 @@ static int arizona_hpdet_read(struct arizona_extcon_info *info)
> arizona_hpdet_c_ranges[range].min);
> val = arizona_hpdet_c_ranges[range].min;
> }
> + break;
> +
> + default:
> + dev_warn(arizona->dev, "Unknown HPDET IP revision %d\n",
> + info->hpdet_ip_version);
> + return -EINVAL;
> }
>
> dev_dbg(arizona->dev, "HP impedance %d ohms\n", val);
> --
> 2.2.0.GIT
prev parent reply other threads:[~2015-09-29 10:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-29 10:06 [PATCH] extcon: arizona: Reorder the default statement to remove unnecessary warning Chanwoo Choi
2015-09-29 10:08 ` Charles Keepax [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=20150929100852.GH5432@ck-lbox \
--to=ckeepax@opensource.wolfsonmicro.com \
--cc=cw00.choi@samsung.com \
--cc=cwchoi00@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rf@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