From patchwork Sat Oct 14 22:07:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10006657 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 C609C60230 for ; Sat, 14 Oct 2017 22:07:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8E6D28BBA for ; Sat, 14 Oct 2017 22:07:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ADCF0291E2; Sat, 14 Oct 2017 22:07:53 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 2196F28BBA for ; Sat, 14 Oct 2017 22:07:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751451AbdJNWHw (ORCPT ); Sat, 14 Oct 2017 18:07:52 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:51628 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751138AbdJNWHv (ORCPT ); Sat, 14 Oct 2017 18:07:51 -0400 Received: by mail-qk0-f194.google.com with SMTP id 17so8837343qkq.8 for ; Sat, 14 Oct 2017 15:07:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pfvGi2h9ncQ2Vox4kFV+iDCkzu90L6vGBU7vPJhbWqs=; b=eowe5vxuvwvoqKT57ySVhcBVR/C+pi4m90qz5IYBKe3ffU8bw3QZJwl/4Nq5EVfquJ kIbeO+kPbnU/szUP3zvMpn2AvP058DAS+0eutP29QMb28Co4j4z0nCU+HiefaufXUHqL lNT+imv/KPpWy4i2BPBFgC9AA9IL8Nrnpv7Z0NzjK1JEpW3XvV8H859sdGY5oi9wkzwq D2B6kyZGld6kzU1ERA7gnGJFgpZNRFuSdr0jVoc5ihhggHeEECupiWzHs3T3YDtzK1W/ Xg2dH7OS2Xy2p3chxieQyRHY3UKttqgv3hYgc5G/XjVbZ3UIjYBGgHosLDRc/4DGtbpd taMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pfvGi2h9ncQ2Vox4kFV+iDCkzu90L6vGBU7vPJhbWqs=; b=mLcPAhS5rpPWAr443m55+ryDSo/VSrmSnGD4ElqzMPNPN/XZjx4q2yZqEJVE6SfLqy VaHFL3bM83zgf37NaLtB2Oxi1htr3qBFvENu6jl4Qco1ilOM7TpnfGBi2QqcpKnBO56B z8ErmwhW4JfwkzwmZi+zrxHcz28V28SNcd2xr9/DRxII2c15ri0UpdiANIjsOZWysiq1 BOOJMXvSvQK/iTz5vNLZdBqmrM/Tx+buODnJsIChqMe4u7dNzJZKSurOttNykL0WOF19 1hKIYNrcQ7gdLkrYPrkbvcztcmkJ0GDIqdwX6IiZTHTXqQHVUEw0AwQp3UOPzxPDXemI tx3A== X-Gm-Message-State: AMCzsaUeaTzEuRkLUa7ZMVXuKhzwk4Bw+v05RxpkvLZwIAJixYCmD4fz R/XzsFDvlT7AXZgJo+Ew3g4= X-Google-Smtp-Source: AOwi7QB9xpgn8RwLYauhwa5lyiERQzjAGNul86y4GgRc7bxFwqyN+idHJVYjg7dlChmL8uO0VzxIaw== X-Received: by 10.55.164.141 with SMTP id n135mr7967415qke.328.1508018870790; Sat, 14 Oct 2017 15:07:50 -0700 (PDT) Received: from localhost.localdomain ([187.180.180.72]) by smtp.gmail.com with ESMTPSA id c10sm2547758qtj.29.2017.10.14.15.07.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 14 Oct 2017 15:07:50 -0700 (PDT) From: Fabio Estevam To: bhelgaas@google.com Cc: linux-pci@vger.kernel.org, Fabio Estevam , Michal Simek Subject: [PATCH 5/5] PCI: xilinx-nwl: Fix platform_get_irq() error handling Date: Sat, 14 Oct 2017 19:07:31 -0300 Message-Id: <1508018851-9272-5-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508018851-9272-1-git-send-email-festevam@gmail.com> References: <1508018851-9272-1-git-send-email-festevam@gmail.com> 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 When platform_get_irq() fails we should propagate the real error value instead of always returning -EINVAL. Cc: Michal Simek Signed-off-by: Fabio Estevam Acked-by: Michal Simek --- drivers/pci/host/pcie-xilinx-nwl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pci/host/pcie-xilinx-nwl.c b/drivers/pci/host/pcie-xilinx-nwl.c index 65dea98..b896167 100644 --- a/drivers/pci/host/pcie-xilinx-nwl.c +++ b/drivers/pci/host/pcie-xilinx-nwl.c @@ -591,7 +591,7 @@ static int nwl_pcie_enable_msi(struct nwl_pcie *pcie) msi->irq_msi1 = platform_get_irq_byname(pdev, "msi1"); if (msi->irq_msi1 < 0) { dev_err(dev, "failed to get IRQ#%d\n", msi->irq_msi1); - ret = -EINVAL; + ret = msi->irq_msi1; goto err; } @@ -602,7 +602,7 @@ static int nwl_pcie_enable_msi(struct nwl_pcie *pcie) msi->irq_msi0 = platform_get_irq_byname(pdev, "msi0"); if (msi->irq_msi0 < 0) { dev_err(dev, "failed to get IRQ#%d\n", msi->irq_msi0); - ret = -EINVAL; + ret = msi->irq_msi0; goto err; } @@ -735,7 +735,7 @@ static int nwl_pcie_bridge_init(struct nwl_pcie *pcie) if (pcie->irq_misc < 0) { dev_err(dev, "failed to get misc IRQ %d\n", pcie->irq_misc); - return -EINVAL; + return pcie->irq_misc; } err = devm_request_irq(dev, pcie->irq_misc,