Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp466299ybh; Wed, 18 Mar 2020 03:19:28 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuGhYPXoxGrDtGpacrDxlwAcnw3fUCmOzI/5XKbzGIPcj5eTR8Bw8DcCAO/I4mgwKWY8wrm X-Received: by 2002:a05:6808:abc:: with SMTP id r28mr2546511oij.161.1584526768111; Wed, 18 Mar 2020 03:19:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584526768; cv=none; d=google.com; s=arc-20160816; b=mnE2iadfmjxzg7kExgJRAIGXmEFjiuTaPM/CCdJFtUua32teYzQ3tsIdYfmj4KicWB OCCMAA65Y58stqBinV5TIKARuK+Cm95MiyrZvnzOdBpEj8wOnrbl0EUiMJGT9KqQxpBc J6Bpt55QX5vLHNvIfBAWj3W+I2E0U82fON2/srH7bYwCtzEDFEZLsUqhKfz3tww7Sajp JD+Vj4EsPnAbs+ofgh/pNsThma5IAC8zeoZC8YUhr74TUWv8rajNWd3CJsecIKU8MeGs gkvCOH8sTKSX+CL4KLUdddBzLM3lvvqyQgXAYrnJ1YWSGuchUhshuGCI0/P7M0AgpYuZ S6ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=DWbTKGbgk4pOTBh7IdmU1BhwWNJWn4LMUz0hSuykwU0=; b=F5yDmdGkOkY2jasp4x8yYYou5I31CZVtENCwIFfVUhuKOu0VyBw+XO0EkduirMFXDg dbwHr8Dn13NxMgpMdBZpke+xFuxFPq9jsJcMJifxMn2nggWkIinpcoFz9DyXt43hlxVa EtQp0BDLpwF898VH700WDnIiqF0RlYY2NWrV9/06eddO/kIJLNNSP/1rlOxuw9rLXuWU EiKCktfPauPhcyslHs9j4DOsVw6fcwstWfZ7SGxB/Svkf0J9ixEKyrgnxAW2NXHqoc4G P5y8vYc9Iyja9XJgVEV4yyUI+o7Qycn5AoAFkyRJZ7Bgzl6UtDFQ9ylO3ZoNcKlPOeGU qorQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i142si3218513oib.87.2020.03.18.03.19.15; Wed, 18 Mar 2020 03:19:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727415AbgCRKSy (ORCPT + 99 others); Wed, 18 Mar 2020 06:18:54 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:52375 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726586AbgCRKSy (ORCPT ); Wed, 18 Mar 2020 06:18:54 -0400 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jEVme-0005Tb-LH; Wed, 18 Mar 2020 11:18:44 +0100 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1jEVme-0000ds-3Q; Wed, 18 Mar 2020 11:18:44 +0100 Date: Wed, 18 Mar 2020 11:18:44 +0100 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Tang Bin Cc: linux@rempel-privat.de, s.hauer@pengutronix.de, shawnguo@kernel.org, linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drivers/i2c/busses/i2c-imx.c:remove duplicate print after platform_get_irq() Message-ID: <20200318101844.55c273zh242ymxcf@pengutronix.de> References: <20200318100748.17540-1-tangbin@cmss.chinamobile.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200318100748.17540-1-tangbin@cmss.chinamobile.com> User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 18, 2020 at 06:07:48PM +0800, Tang Bin wrote: > We don't need dev_err() message because when something goes wrong, > platform_get_irq() has print an error message itself, so we should > remove duplicate dev_err(). > > Signed-off-by: Tang Bin > --- > drivers/i2c/busses/i2c-imx.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c > index a3b61336f..01fd46682 100644 > --- a/drivers/i2c/busses/i2c-imx.c > +++ b/drivers/i2c/busses/i2c-imx.c > @@ -1066,10 +1066,8 @@ static int i2c_imx_probe(struct platform_device *pdev) > dev_dbg(&pdev->dev, "<%s>\n", __func__); > > irq = platform_get_irq(pdev, 0); > - if (irq < 0) { > - dev_err(&pdev->dev, "can't get irq number\n"); > + if (irq < 0) > return irq; > - } Maybe add a comment for the next person who wonders about an error path without error message? Something like: irq = platform_get_irq(pdev, 0); if (irq < 0) /* * platform_get_irq() already issued an error message, so * fail silently here. */ return irq; And to get some extra kudos mention the commit that modified platform_get_irq() to emit a message in the commit log. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | https://www.pengutronix.de/ |