Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1645222ybk; Mon, 11 May 2020 00:30:08 -0700 (PDT) X-Google-Smtp-Source: APiQypKPOlx7rdhUgQWU7LxTENxCZdRAzXEd4fR36cku9uFiMJ4T07WbOGjXdOXz8ALDidQHlyF+ X-Received: by 2002:a17:906:2e4d:: with SMTP id r13mr5193719eji.379.1589182208724; Mon, 11 May 2020 00:30:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589182208; cv=none; d=google.com; s=arc-20160816; b=GPQLRJShcjoiO/x/eSG/ueRKmisYvhSDtSaMvixb6n+ECQbdYatptSyJ927d9rRgN2 hEnMLiL6Eyv9bDQ6SxTICYHH1mvCitMrPF0BGuullnFXlUpl2O2ZhfrTVDOqxS08iiC3 maKDiQbLEQvef/K98iMe0mffi+si2Fxr+eaykwhvyy48R2Ska/0WdZMles26+tbV4d4p aywxGkDDAeG9H0U2mZNRGdIgAzIpbiBZ5+wnlMjFDjbRcYUn5r+0SkmZYOLjZfl06lL8 Rq9Txxj6/0NdMP9pD8YJS23rMiL+cAg/wWSDFkg4h790LSuS4Qwyh+jt29HTKWS97x+/ rzLA== 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=CUGcXyzDtZr9pBKzkVbxT0ln+7bj8sPWsUONT3Nw9cM=; b=JqQCeKvcCPfKz5+9q/RLWq1PKNl1zUFnDLjEmEIpcu8/W8R6koBuaSooDavr1w9Fo1 LKATJNnbXvQF9/24i5BAhOtYszijE7glIfMflCo+xXR2W0xNDEcx9aSwVOllfspTk6tB U+NV0Sqid+Ob8Gl6DeQ1adg++utj/itCmMWlUJ+7H270hAcsG/djEvmOgtZ3oMF3t3DW /M1t5kjBSNkl3VYfXCIns7oav73dtAsbsUc5MRM4/0iSoxydbCv1vzrCEusMJ7dbgNYK gGmqtSgc9bTFuzoLqVhctsqpHJaxYrtqZBtYR8TwRnUjfM97Uns4Ep8dez2NU6/z6QBU KSnQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s17si3182611eju.155.2020.05.11.00.29.45; Mon, 11 May 2020 00:30:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728017AbgEKH16 (ORCPT + 99 others); Mon, 11 May 2020 03:27:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725790AbgEKH16 (ORCPT ); Mon, 11 May 2020 03:27:58 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 432CDC061A0C for ; Mon, 11 May 2020 00:27:58 -0700 (PDT) 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 1jY2qt-00029y-0t; Mon, 11 May 2020 09:27:51 +0200 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1jY2qp-00065h-6l; Mon, 11 May 2020 09:27:47 +0200 Date: Mon, 11 May 2020 09:27:47 +0200 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Anson Huang Cc: gregkh@linuxfoundation.org, jslaby@suse.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Linux-imx@nxp.com Subject: Re: [PATCH] tty: serial: imx: Add return value check for platform_get_irq() Message-ID: <20200511072747.2vyavydpfa47kbuy@pengutronix.de> References: <1589180996-618-1-git-send-email-Anson.Huang@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1589180996-618-1-git-send-email-Anson.Huang@nxp.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 Hello Anson, On Mon, May 11, 2020 at 03:09:56PM +0800, Anson Huang wrote: > RX irq is required, so add return value check for platform_get_irq(). > > Signed-off-by: Anson Huang > --- > drivers/tty/serial/imx.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c > index f4d6810..f4023d9 100644 > --- a/drivers/tty/serial/imx.c > +++ b/drivers/tty/serial/imx.c > @@ -2252,6 +2252,8 @@ static int imx_uart_probe(struct platform_device *pdev) > return PTR_ERR(base); > > rxirq = platform_get_irq(pdev, 0); > + if (rxirq < 0) > + return rxirq; > txirq = platform_get_irq_optional(pdev, 1); > rtsirq = platform_get_irq_optional(pdev, 2); I'm not sure we need such a check as devm_request_irq fails if the return value of platform_get_irq() is bogus. But if we decide this construct is good enough, the error reporting needs some love as currently it emits two error messages which is confusing. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | https://www.pengutronix.de/ |