From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.1 required=3.0 tests=FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 462C4C4CECE for ; Wed, 18 Sep 2019 09:00:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1DEC121907 for ; Wed, 18 Sep 2019 09:00:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730743AbfIRJAe (ORCPT ); Wed, 18 Sep 2019 05:00:34 -0400 Received: from ns.iliad.fr ([212.27.33.1]:40740 "EHLO ns.iliad.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725909AbfIRJAe (ORCPT ); Wed, 18 Sep 2019 05:00:34 -0400 Received: from ns.iliad.fr (localhost [127.0.0.1]) by ns.iliad.fr (Postfix) with ESMTP id 3517A206A6; Wed, 18 Sep 2019 11:00:32 +0200 (CEST) Received: from [192.168.108.37] (freebox.vlq16.iliad.fr [213.36.7.13]) by ns.iliad.fr (Postfix) with ESMTP id 1D65120186; Wed, 18 Sep 2019 11:00:32 +0200 (CEST) Subject: Re: [PATCH v2 2/3] i2c: qup: Remove dev_err() log after platform_get_irq*() failure To: Saiyam Doshi Cc: MSM , I2C , LKML , Marc Zyngier , Thomas Gleixner References: <20190917172120.GA11581@SD> From: Marc Gonzalez Message-ID: <4e65aeeb-40da-7856-a22e-ce7aac21ae46@free.fr> Date: Wed, 18 Sep 2019 11:00:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190917172120.GA11581@SD> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP ; ns.iliad.fr ; Wed Sep 18 11:00:32 2019 +0200 (CEST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17/09/2019 19:21, Saiyam Doshi wrote: > The debug message after platform_get_irq() failure is redundant > because platform_get_irq() already prints an error. Thus remove it. > > Generated by: scripts/coccinelle/api/platform_get_irq.cocci > > Signed-off-by: Saiyam Doshi > --- > Changes in v2: > Updated changelog and removed unnecessary braces after if condition. > > drivers/i2c/busses/i2c-qup.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c > index 5519c19bfd9c..ed09a59066b2 100644 > --- a/drivers/i2c/busses/i2c-qup.c > +++ b/drivers/i2c/busses/i2c-qup.c > @@ -1766,10 +1766,8 @@ static int qup_i2c_probe(struct platform_device *pdev) > return PTR_ERR(qup->base); > > qup->irq = platform_get_irq(pdev, 0); > - if (qup->irq < 0) { > - dev_err(qup->dev, "No IRQ defined\n"); > + if (qup->irq < 0) > return qup->irq; > - } As far as I understand, platform_get_irq() == 0 is also an error condition. I think the typical way to handle this peculiarity is: (Maybe the IRQ maintainers will correct me) qup->irq = platform_get_irq(pdev, 0); if (qup->irq <= 0) return qup->irq ? : -ENXIO; Regards.