From patchwork Thu Aug 31 17:52:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 9932653 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 903CF602F0 for ; Thu, 31 Aug 2017 17:53:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81A6D28A47 for ; Thu, 31 Aug 2017 17:53:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7662328A4A; Thu, 31 Aug 2017 17:53:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC3D728A47 for ; Thu, 31 Aug 2017 17:53:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751415AbdHaRws (ORCPT ); Thu, 31 Aug 2017 13:52:48 -0400 Received: from mail-cys01nam02on0068.outbound.protection.outlook.com ([104.47.37.68]:6943 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751405AbdHaRwp (ORCPT ); Thu, 31 Aug 2017 13:52:45 -0400 Received: from BN6PR03CA0081.namprd03.prod.outlook.com (10.164.122.147) by CY1PR03MB2268.namprd03.prod.outlook.com (10.166.207.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Thu, 31 Aug 2017 17:52:44 +0000 Received: from BL2FFO11OLC015.protection.gbl (2a01:111:f400:7c09::127) by BN6PR03CA0081.outlook.office365.com (2603:10b6:405:6f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10 via Frontend Transport; Thu, 31 Aug 2017 17:52:44 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11OLC015.mail.protection.outlook.com (10.173.160.81) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Thu, 31 Aug 2017 17:52:43 +0000 Received: from r49496.am.freescale.net (r49496.am.freescale.net [10.29.244.202]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v7VHqajM026181; Thu, 31 Aug 2017 10:52:42 -0700 From: Fabio Estevam To: CC: , Fabio Estevam , Pratyush Anand Subject: [PATCH 05/10] PCI: spear13xx: Fix platform_get_irq() error handling Date: Thu, 31 Aug 2017 14:52:05 -0300 Message-ID: <1504201930-3617-5-git-send-email-fabio.estevam@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504201930-3617-1-git-send-email-fabio.estevam@nxp.com> References: <1504201930-3617-1-git-send-email-fabio.estevam@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131486755640481839; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39860400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(50986999)(54906002)(76176999)(53936002)(36756003)(47776003)(50466002)(110136004)(4326008)(68736007)(48376002)(2950100002)(626005)(6916009)(85426001)(104016004)(6666003)(50226002)(498600001)(8936002)(81166006)(81156014)(5003940100001)(8656003)(189998001)(39060400002)(86362001)(97736004)(356003)(5660300001)(8676002)(106466001)(33646002)(2351001)(105606002)(77096006)(2906002)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2268; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC015; 1:n8yymzVvIoxiXcAmlJNP9aHsTKPfyMYcBxGQHairdiwCd4gsqv7s8oJdRfV6vP3DwbLRwvxeM+CUomm1AMlKBInGDKuUkxCzZuw/6iPJ/OyrBkOjSDIl+ZGmkQLFSYm4 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8e7d1fac-af06-47a9-982f-08d4f0991515 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY1PR03MB2268; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2268; 3:meZM1iGW7Stsrsdn6Zo2PqfIOH6NDzTODp/JxEWGEz1WcVXi954rlNC4mOKbNnZ0ag5U+Zodk7v5s1oegJ0jrqq5s2bsxqp+HBZVb6GG4JI/ZEhkRrMrhRfozwKt4UjMUpSV5uKHgaVNbAe1s5sexCwd0UPzGESFRS54pGL8Ud/0x0FHgmL2BSDZgnv1XIbNwcoZGQk1enDV0h+PMG8o6nDPPIqWWwFY5lOvhZBH6wgySSF+2UW5HciFQwF1H/mgMTvSi+Flf3k5vNGsXDz28sQsjzWLabPG2Omw08/mlnhWX0hxXA7q8Stp+Tb8gKKsedZfhkLUZ30omsLaHa8+aPYvhffLSw7yDkHZLqp4/r8=; 25:B4EyU0Sgj7g6sRB5p+hiQuExNt6Oz/KKUNLiPl3n70Fjui4mV1iD4x4B59wQmbPD2lYHELELHHkwEpYcu3WqGFrqd0nTXy+lJzMTwe83a4J71tYoNHUNgGRkv4XQuRS6APaIMZOQ4bCRLvcugOYv9Undi3uEcfQVCG2YoB4SXkj3WskkAjICrakF9hSzWq+VRRETrMJXi9AyYNsFumYe+aDBL2YU3xfbN8HVzHUE827rbHdF3B3Ztqo5TISm6bll42j693kOa7jPa7ROuwWX5gfXMx9dAIJly298EehwDhq0Es+Epik8i1xiQr05RaJcYr4P/WoKHblysXGUG5bOgA== X-MS-TrafficTypeDiagnostic: CY1PR03MB2268: X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2268; 31:4ji1v6yfofh2UUU13PqX3YaB6booVMlsQzQOTqcHw6MV0/qwWGTnzChDIWmX04sccblsKROrt5KLQBTis+xmkZEGHe5MhvURdAwfzbwvLRAKPuN/JNvLI4UP57z2WH4DjvKDzOoww6hV+adN2NB1v0th41l/xoihatD/yYz9QTPVNMIYOLfnBCzCTTJejBSgsGZUduN/ym+YLoIfWgQ9+htjrn3rkBK4poxavX+5LWA=; 4:oLDKgCdLpIFboOgGjnT2sPAu68r8VWjlflNuJ5leV1q2BBpbqhkrDuyDGcTK70jM9jr+F60enshtVbpJeOQYJeKlhbijRcUf1lOSwiwIg84iQ7kZC29ZgZfGHeyVE6XBMLQbeeIiAX8PI9zo+nfcPEYw9FXiLTi6il56PHv5dguiEGQlPA3aw6aAI1Po1NmuiVHa1XooT8lC7E/msL2VncONUki7YuUejH/brlr6wPKH57V/HWfLi2jEyn+QHtAkfD3ReJ4FoP7aEFwzIjtqWdpl583ZHewS99L0xGrmy9g= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(13018025)(8121501046)(5005006)(13016025)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(6055026)(6096035)(20161123556025)(20161123563025)(20161123561025)(20161123565025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123559100)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR03MB2268; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR03MB2268; X-Forefront-PRVS: 04163EF38A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2268; 23:ZO7pHp157xUBQjSwe/4sCcHPO42GyfmoShQ56+gh9?= =?us-ascii?Q?RrPQXaW43DgduQArLdW/jGR2pQKjqGpSHcOOkFRHZ9a1Y6rRdmyyAV/mFevk?= =?us-ascii?Q?PsBDxhK7vajF88KhJjvG/bYCTy4x59GRItOI2H/TttOJufVqpuDVbqSgccRe?= =?us-ascii?Q?B9em28B55+U/yNuLlQoYiavo+Dw1UM5884pb7yqfaY3HpDJ1wL3ZtjydfEnX?= =?us-ascii?Q?/7bW3VEUC9Cn69DDiBuMtTdu8nOnvqKsvIRbe0vFHsXiO6eGvwqpP8F4IQEV?= =?us-ascii?Q?q+abybnuiP0D3nW9AfaBOUjN3a4XtMNsI4rh5e2KDGy0Qv7ObCQYqVGGwBxx?= =?us-ascii?Q?KvVF+1fY+ekSIriKYzq3mohQdG55J/9LPz3bODedRgrRMUg6EqSbXhSt7NLl?= =?us-ascii?Q?5Q3mtcT95n2dCMj3Ov2OB8uEA1YDmqFxrTkqnRJp7N+Y1C7nj8j64HHwoD2T?= =?us-ascii?Q?84ZZo7DMoCsIkudUVH8j4iZNN21JP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0gEAwpB4AyCopmM+5MfSTPMejzxlWMDC8OGLtrTrUszqVhDaAcg2Bxf3xib7GVLjBaHPdOqesTK0JRVfebqXbcJhpftAjNX5T25Uv1OyQ9XAofsz5oLxg4PZDun08nyBkCzFJhXVVe5icy+gsogmhJ72cyvGdvKiAldng==; 5:fkoza02CG4btsTsTaU8qGz8MDVVU4hEPqpbvbe75IL/ZkFjHodvCfm7b0Tblk86mQ9qEQFCTbRjNargjXooKAhqKt0keI06iVt+mZkMoyxz33ywyJwDU43ouPQw6NfDEb2I6E1W01MXJPuN44o8qCQ==; 24:TRiODMj0yq7nLxVWlumU/whEFibcTnYdzaWou7gaT1YJGLutaABibW0BTMziVwJJm5POFAP4yqwpPnUzdxIgGKyUmGPwVerFpNSGs00e0Go=; 7:OJnJ8Ws0DpI79h7RJcw29IzX5ouCEF080BIPhVvxqakivZzdwSInSj2Ef52f178/wHYaRISfvbrJKcYDctdKpUs56V0x6W5D8wypk2z9ik2wEMKCLbYTwlOP11C3VWCVYaLEFFXJuG/ju9HjIAVxGZtMUww+tvzwXtFrJ0rqXlyC8EjKHvK+PZZqVK/PBXYPVLwzapz9Wkj2mLtWRvWHl+J9F+agfnUb4tLR9Tot3AY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2017 17:52:43.8765 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB2268 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP platform_get_irq() returns a negative number on failure, so adjust the logic to detect such condition and propagate the real error value on failure. Cc: Pratyush Anand Signed-off-by: Fabio Estevam --- drivers/pci/dwc/pcie-spear13xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/dwc/pcie-spear13xx.c b/drivers/pci/dwc/pcie-spear13xx.c index 52000bc..709189d 100644 --- a/drivers/pci/dwc/pcie-spear13xx.c +++ b/drivers/pci/dwc/pcie-spear13xx.c @@ -201,9 +201,9 @@ static int spear13xx_add_pcie_port(struct spear13xx_pcie *spear13xx_pcie, int ret; pp->irq = platform_get_irq(pdev, 0); - if (!pp->irq) { + if (pp->irq < 0) { dev_err(dev, "failed to get irq\n"); - return -ENODEV; + return pp->irq; } ret = devm_request_irq(dev, pp->irq, spear13xx_pcie_irq_handler, IRQF_SHARED | IRQF_NO_THREAD,