extcon: arizona: Reorder the default statement to remove unnecessary warning
authorChanwoo Choi <cwchoi00@gmail.com>
Tue, 29 Sep 2015 10:06:31 +0000 (19:06 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Wed, 30 Sep 2015 10:11:47 +0000 (19:11 +0900)
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 <cw00.choi@samsung.com>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
drivers/extcon/extcon-arizona.c

index b01030735f0ccbc30b1f2d088eadc6a6db0b6163..a1ab0a56b798da5686cd04c7726eb9d7682c72a7 100644 (file)
@@ -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);