From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752627AbdHILox (ORCPT ); Wed, 9 Aug 2017 07:44:53 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:46255 "EHLO relmlie4.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752348AbdHILov (ORCPT ); Wed, 9 Aug 2017 07:44:51 -0400 X-IronPort-AV: E=Sophos;i="5.41,347,1498489200"; d="scan'208";a="254042736" From: Yoshihiro Shimoda To: "Gustavo A. R. Silva" , Felipe Balbi , Greg Kroah-Hartman CC: "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] usb: gadget: udc: renesas_usb3: fix error return code in renesas_usb3_probe() Thread-Topic: [PATCH] usb: gadget: udc: renesas_usb3: fix error return code in renesas_usb3_probe() Thread-Index: AQHTEJoAJYsOz98msUu5c0i0XJJNeqJ75WUA Date: Wed, 9 Aug 2017 11:44:48 +0000 Message-ID: References: <20170808223445.GA7163@embeddedgus> In-Reply-To: <20170808223445.GA7163@embeddedgus> Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=yoshihiro.shimoda.uh@renesas.com; x-originating-ip: [211.11.155.139] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;TY1PR06MB0990;20:p9uiGpwv+kep5vfRrc2MbfTQOdmAoBfrOleZmQQ0KW6+UxRsEZu9DPtbrv1wlgYjL1EtU4+mPNofF63/UGFt1LDiHmggX8RebXKbR829dwZChfKJY4a3iIzLzMuKGW/wIFCXDst0dT7eoo675XLKvVtqApdvooDE8wpU218ouKc= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: caf4a041-c8f3-4329-897a-08d4df1c09d1 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:TY1PR06MB0990; x-ms-traffictypediagnostic: TY1PR06MB0990: x-exchange-antispam-report-test: UriScan:(9452136761055)(84791874153150); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(6055026)(6041248)(20161123555025)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:TY1PR06MB0990;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:TY1PR06MB0990; x-forefront-prvs: 0394259C80 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39860400002)(39450400003)(39840400002)(39400400002)(39410400002)(39850400002)(199003)(13464003)(377454003)(189002)(74316002)(229853002)(7736002)(97736004)(3280700002)(3660700001)(6306002)(6116002)(6436002)(5660300001)(101416001)(55016002)(25786009)(38730400002)(2950100002)(102836003)(99286003)(6246003)(3846002)(53936002)(54906002)(76176999)(54356999)(50986999)(86362001)(68736007)(6506006)(77096006)(4326008)(9686003)(105586002)(81166006)(966005)(345774005)(66066001)(478600001)(7696004)(106356001)(8936002)(33656002)(8676002)(189998001)(2906002)(305945005)(14454004)(2900100001)(81156014)(15760500002)(422495003);DIR:OUT;SFP:1102;SCL:1;SRVR:TY1PR06MB0990;H:TY1PR06MB0992.apcprd06.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Aug 2017 11:44:48.1012 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY1PR06MB0990 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v79Bj05Q015342 Hi Gustavo, Thank you for the patch! > -----Original Message----- > From: Gustavo A. R. Silva > Sent: Wednesday, August 9, 2017 7:35 AM > > platform_get_irq() returns an error code, but the renesas_usb3 driver > ignores it and always returns -ENODEV. This is not correct and, > prevents -EPROBE_DEFER from being propagated properly. Thank you for the point. I got it. > Also, notice that platform_get_irq() no longer returns 0 on error: > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e330b9a6bb35dc7097a4f02cb1ae7b6f96df92 > af I don't think this explanation needs. After this is removed, Acked-by: Yoshihiro Shimoda Best regards, Yoshihiro Shimoda > Print error message and propagate the return value of platform_get_irq > on failure. > > This issue was detected with the help of Coccinelle. > > Signed-off-by: Gustavo A. R. Silva > --- > drivers/usb/gadget/udc/renesas_usb3.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c > index e1de8fe..616d053 100644 > --- a/drivers/usb/gadget/udc/renesas_usb3.c > +++ b/drivers/usb/gadget/udc/renesas_usb3.c > @@ -2468,8 +2468,10 @@ static int renesas_usb3_probe(struct platform_device *pdev) > priv = match->data; > > irq = platform_get_irq(pdev, 0); > - if (irq < 0) > - return -ENODEV; > + if (irq < 0) { > + dev_err(&pdev->dev, "Failed to get IRQ: %d\n", irq); > + return irq; > + } > > usb3 = devm_kzalloc(&pdev->dev, sizeof(*usb3), GFP_KERNEL); > if (!usb3) > -- > 2.5.0 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-usb" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html