From: Chanwoo Choi Date: Tue, 29 Sep 2015 10:06:31 +0000 (+0900) Subject: extcon: arizona: Reorder the default statement to remove unnecessary warning X-Git-Tag: v4.14-rc1~4418^2~57^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e9844b2cafd7b78486400f9b6cf3188e9a527312;p=platform%2Fkernel%2Flinux-rpi.git extcon: arizona: Reorder the default statement to remove unnecessary warning This patch reorders the default statement to remove unnecessary warning message when info->hpdet_ip_version is higher than 2. Signed-off-by: Chanwoo Choi Acked-by: Charles Keepax --- 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);