From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934370AbbI2KGl (ORCPT ); Tue, 29 Sep 2015 06:06:41 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:35171 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933654AbbI2KGe (ORCPT ); Tue, 29 Sep 2015 06:06:34 -0400 From: Chanwoo Choi X-Google-Original-From: Chanwoo Choi Cc: linux-kernel@vger.kernel.org, rf@opensource.wolfsonmicro.com, ckeepax@opensource.wolfsonmicro.com, cw00.choi@samsung.com Subject: [PATCH] extcon: arizona: Reorder the default statement to remove unnecessary warning Date: Tue, 29 Sep 2015 19:06:31 +0900 Message-Id: <1443521191-18050-1-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 2.2.0.GIT To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch reorders the default statement to remove unnecessary warning message when info->hpdet_ip_version is 2. Signed-off-by: Chanwoo Choi --- 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