* [PATCH] extcon: arizona: Reorder the default statement to remove unnecessary warning
@ 2015-09-29 10:06 Chanwoo Choi
2015-09-29 10:08 ` Charles Keepax
0 siblings, 1 reply; 2+ messages in thread
From: Chanwoo Choi @ 2015-09-29 10:06 UTC (permalink / raw)
Cc: linux-kernel, rf, ckeepax, cw00.choi
This patch reorders the default statement to remove unnecessary warning message
when info->hpdet_ip_version is 2.
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] extcon: arizona: Reorder the default statement to remove unnecessary warning
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
0 siblings, 0 replies; 2+ messages in thread
From: Charles Keepax @ 2015-09-29 10:08 UTC (permalink / raw)
To: Chanwoo Choi; +Cc: linux-kernel, rf, cw00.choi
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-09-29 10:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox