From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934668AbbI2KcE (ORCPT ); Tue, 29 Sep 2015 06:32:04 -0400 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:56284 "EHLO mx0a-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934418AbbI2Kbz (ORCPT ); Tue, 29 Sep 2015 06:31:55 -0400 Date: Tue, 29 Sep 2015 11:08:52 +0100 From: Charles Keepax To: Chanwoo Choi CC: , , Subject: Re: [PATCH] extcon: arizona: Reorder the default statement to remove unnecessary warning Message-ID: <20150929100852.GH5432@ck-lbox> References: <1443521191-18050-1-git-send-email-cw00.choi@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1443521191-18050-1-git-send-email-cw00.choi@samsung.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2015-09-29_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1507310000 definitions=main-1509290134 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- 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 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