From patchwork Thu Aug 31 17:52:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 9932661 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 5097260362 for ; Thu, 31 Aug 2017 17:53:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 426E228A4F for ; Thu, 31 Aug 2017 17:53:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3713228A4E; Thu, 31 Aug 2017 17:53:45 +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 7266F28A45 for ; Thu, 31 Aug 2017 17:53:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750968AbdHaRwy (ORCPT ); Thu, 31 Aug 2017 13:52:54 -0400 Received: from mail-by2nam01on0052.outbound.protection.outlook.com ([104.47.34.52]:25824 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751405AbdHaRwt (ORCPT ); Thu, 31 Aug 2017 13:52:49 -0400 Received: from DM5PR03CA0029.namprd03.prod.outlook.com (2603:10b6:4:3b::18) by SN2PR03MB2272.namprd03.prod.outlook.com (2603:10b6:804:d::17) 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:48 +0000 Received: from BN1BFFO11FD045.protection.gbl (2a01:111:f400:7c10::1:144) by DM5PR03CA0029.outlook.office365.com (2603:10b6:4:3b::18) 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:48 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; altera.com; dkim=none (message not signed) header.d=none; altera.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 BN1BFFO11FD045.mail.protection.outlook.com (10.58.145.0) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1385.11 via Frontend Transport; Thu, 31 Aug 2017 17:52:47 +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 v7VHqajP026181; Thu, 31 Aug 2017 10:52:45 -0700 From: Fabio Estevam To: CC: , Fabio Estevam , Ley Foon Tan Subject: [PATCH 08/10] PCI: altera: Fix platform_get_irq() error handling Date: Thu, 31 Aug 2017 14:52:08 -0300 Message-ID: <1504201930-3617-8-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: 131486755676906295; (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)(1109001)(1110001)(339900001)(199003)(189002)(6916009)(2950100002)(2351001)(105606002)(106466001)(4326008)(6666003)(626005)(33646002)(189998001)(8666007)(77096006)(54906002)(110136004)(8656003)(53936002)(97736004)(48376002)(47776003)(68736007)(50466002)(50226002)(8676002)(81166006)(81156014)(8936002)(356003)(305945005)(5660300001)(5003940100001)(76176999)(50986999)(36756003)(498600001)(85426001)(2906002)(104016004)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR03MB2272; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD045; 1:TCPrV33/xMBYGxMkd8m60zs0zgpjo34fvCQznwo+vx974zGCRAGNbu9UOxEFWhNCUXKyJwxPwH3+L5kX3opRs1vM3jKwG+LyflGE3cJ+lU1mV+YGp0eJwb1qq5Pk+CKu MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: adbeff93-d914-411a-5837-08d4f099172e 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:SN2PR03MB2272; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2272; 3:/caG+DqJgeRr5YqwDlDaZ1BU0aFB2H++0iBWH189k7G2d2IKXC5St4sulOkyIQZtoXaSkUs13eDVjLxPnYB1jqyKkO0Q4DeNoy//I5xYurBOzGaej0KzQvLUxZXk0iTi11sNSQbkMisbcwabbaVqEYffl2z1O00mBy0X9akDCokVEws9ki+Io1JVnmUBgOZYDk2mcWEXRZ+g7XNMXNcECc+Yv5+IHMk5O7JWGmfifV/AhTEiccbz1nCIStYtuGpZWgNZoXUumQ0gbfCj0rVZ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Q== X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(80048183373757); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(5005006)(8121501046)(13018025)(13016025)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6096035)(20161123563025)(20161123565025)(20161123561025)(20161123556025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123559100)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN2PR03MB2272; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN2PR03MB2272; X-Forefront-PRVS: 04163EF38A X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2272; 23:1ZQNNrSMYL+R9fi1cMbFi1tI908Zv7S2ssHX/mjPy?= =?us-ascii?Q?D7VfcNVcBBzw6A7nEXwyVbzB0Fel/D3QsvyiSRzBM2+BCVqH2XkpZZcOt4Om?= =?us-ascii?Q?/wUkoieEK742Vvj1I6uMOlkFl+nFsPTl9r8MdEdmvnWPaAuaug6wCIylI5L2?= =?us-ascii?Q?H1+ka66JshFH+TXsj0riclbc4ACasPFGEgPN6mb89mO4GqLNYbEiKifg4KaQ?= =?us-ascii?Q?/jmkBIII7RZVZl/Alhjw8gNCdBji91i1e3hru3PmNSS0A8u8j/qVo/yp5gQl?= =?us-ascii?Q?ObuRduOVEKIDco31bzGbRiotJpp9ut24EJ+zppybPnpQ7cZErW4gzColzws7?= =?us-ascii?Q?mctuaZFaG4swx6/eO/GbD2p8pNd34U6xo5HgqTej0bwOF7arne1Hhg1QvSb4?= =?us-ascii?Q?tR6pe5sxH4hNbNOqzQeqRrbVkQlshgYdIZbUETqDETv/lV1L1hXkECxFmFDO?= =?us-ascii?Q?S81whfkZ8a70sQK+at6gM1i3crmLJZecBEAaSJznbbq6jxNANYK2LpCys/7d?= =?us-ascii?Q?Uq54dEQGuzSW4JwSpwtWVmd0qj1prhBpL40TKMk2WJUxC71sHM3eWzkZti9a?= =?us-ascii?Q?U/WJ1/9J06nloDBUPHyh2OALJodjYRpv1LZqhNhKMh2J1ZpoD6QlHoQCAfLX?= =?us-ascii?Q?UBQswa+ET77/5G+lwiAx8e3943GeLNT7Mr7eFVseqs+JxaPU205w3mgZMsi5?= =?us-ascii?Q?mVabzKWyz4ly1gur0AN+e5OMKksh6jELZcxN4OYNjc/UASWonBKfa10sq+/h?= =?us-ascii?Q?K9Dh0l1OJv/5gWNbVbBoh4VKZeEld7EhiZJ5hQ9hzqUirLhmyzhh4hfoCpfy?= =?us-ascii?Q?XyTjeI3h0bi3UUyJnG6odee1TC7Fx6q/E9i1mtDA443UHVsmtNqluToSwaM7?= =?us-ascii?Q?2ZCq2vyHgnzCJ67U8W+suv0RcCE8XqGJo948spN9ObV9t6gZc4tLo4tPhtrM?= =?us-ascii?Q?bV6fUYnI6aI4O6jlqOeelaXXkUFrcALQuh4EZXtV6r+88uA1sk9NpQuC6uFY?= =?us-ascii?Q?IvlR8aRqDqN/KDJGqienM0cAvzDkc98LbqzUdO5iAS05omGqjWDM+WvxslDf?= =?us-ascii?Q?9URIT58Y6WSINe7PrH7+nqQ2s4Ub54n54xnmhr2tz03uiKyOp+qX3doL3EWu?= =?us-ascii?Q?DvissB3/XJBZV9+wLgZlDKQYkm7EMSq?= X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2272; 6:5zMEDbgTUfb0NyGbffx8LFMEJ628tJTieqmgbEts08/IqikTfhXe9OxpTFcsqJazWjQhxJ3LuPSNmA1q7ChPUJXJYQZx7T45mesmfayhQrctFP0WqsSk/3OYZz589rkoi7GIgLi4/WiBsM+iFVZYYGAvJBFUQuHhSbLUt5/TSyJfveBsmsaH/WaTspJGv4RD9eRzrCjeyUmN0GBMr+aMuP+MeBT3oImyQH0dz217Hpnggeg8tIWRqZtA2qnnFJG3a89/qGKUfEJE4/BarCgVA/bomOVCqRR/0ZXuXeG4qaH8ehyd/3VwZaGiEVGwmwQ2JUes0ZZOySTRY4sctzZOwQ==; 5:57lWvvSjFK+8on0iDpl7kB9pq8lKPeRAMLyoOp6SCk82mCFbVrkDzAwb+MGsyGiKxDmq+SW/zJkSTaim9NAhcMs3FdUnOFIiWqU6cb46FD0G0QaKRhZbhNQ07avLw1s7CwW4REcdtZFbWKL6AOEBZg==; 24:zqICIkXe+gxn5cwydp5/0MJ/nIqhLtayubRrr57/ZiiZSVLA4zCGP1i2jAzfQV2UOGmyNbl6W8HIOvfIcwZgH+CNvMhmeMAIkNHUSZNUSDE=; 7:CBdJpljMF4chCCBvYG9Plt4PZoGeZKBl/+CDeABSIscT6kRH8VrszgesE54wV1NCqdFxIlmocR6/HIi7tPC94eeUWrfdR7RSkMMkdsoJFqpkpcWUOLA4WDm9rTAGEZWvhDWSkv4FK2pBFpGkWooI+mKjkVyC+JdN7Ub5CNq++DsclH2XFRr37IhuwwLQPV5Ra0peRMHfIrlQ27xdQmjyq8no58DA1FWmmLH8Kmc2VlA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2017 17:52:47.3942 (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: SN2PR03MB2272 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: Ley Foon Tan Signed-off-by: Fabio Estevam --- drivers/pci/host/pcie-altera.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/host/pcie-altera.c b/drivers/pci/host/pcie-altera.c index 6fced59..b468b8ccc 100644 --- a/drivers/pci/host/pcie-altera.c +++ b/drivers/pci/host/pcie-altera.c @@ -558,9 +558,9 @@ static int altera_pcie_parse_dt(struct altera_pcie *pcie) /* setup IRQ */ pcie->irq = platform_get_irq(pdev, 0); - if (pcie->irq <= 0) { + if (pcie->irq < 0) { dev_err(dev, "failed to get IRQ: %d\n", pcie->irq); - return -EINVAL; + return pcie->irq; } irq_set_chained_handler_and_data(pcie->irq, altera_pcie_isr, pcie);