From patchwork Sat Oct 14 22:07:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10006651 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 323D860595 for ; Sat, 14 Oct 2017 22:07:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 252D628BBA for ; Sat, 14 Oct 2017 22:07:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 19D8C291F0; Sat, 14 Oct 2017 22:07:52 +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 04BF3291EF for ; Sat, 14 Oct 2017 22:07:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751420AbdJNWHt (ORCPT ); Sat, 14 Oct 2017 18:07:49 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:43759 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751138AbdJNWHt (ORCPT ); Sat, 14 Oct 2017 18:07:49 -0400 Received: by mail-qk0-f193.google.com with SMTP id w134so8834593qkb.0 for ; Sat, 14 Oct 2017 15:07:49 -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=XhpYOXSOXKRuU11xkN/8m3yQLPN8W5xpRIuLx5RnY6U=; b=GLDeLV8vlEjijDpSoiNcSP2T3xBI2BfD8pY56OB9Fv6ODhcGeMsmXl9R6nd/dLFk9b q7L6v2A9ZvDfPh4C2BAJo7ahKV+BNGcbSnyA/chtv/r+GwDT1HmwZcMIBsV9eFa44rPl dVpcjI4Ub760vEsdko0mKZB9YVILafT8bQgy2eTyKsFiSP824ZqIbU9q7I5Bp1L9PS16 XyHLNdFAgWvyLaTjQXAf354hwejJTdALdITwh3bpwkpgu3OyNG+SMzNFViXUx3rw8Bb0 1RdWHeSsqh/t56i43gw7i58eL8FuhBFAlGfU6hFL96MSBnERxhJH5Bak7DD3wsuCOqxA DZoA== 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=XhpYOXSOXKRuU11xkN/8m3yQLPN8W5xpRIuLx5RnY6U=; b=IN56ZrswhEOXt5qtvqDw7l8KHllhC9wUA79lGqDkv/TORT/qp1nvbiyKVuSnq6jw9c qPqP6Xemb7weN1zQJP9K1A+zaCQsHipIEEHNPlFbOtoSEYngl5uh4od2iIP9InagnwBY tNygiaj/hQY1nCQmqUBdwDAaKFXfcbKknrSesNpaWZGOwdQiK1B9UiXPXELmmmgjYUKz uOBMP8j5nTWqS8vlLtgooWSlo8Q7HowWuwZW1PfhDM+BdxrqhqMt4F+6myPZTyOEPQ+5 0t1JYF/+lGU3b25SfjQzvRquAZZNt/kfc1y1LSMlo51G0CwP51IagTBmmF6KqtjIrtiy cQEA== X-Gm-Message-State: AMCzsaWEjw+yYmtXiDkHhi3+oQhU+TP8AXqMVu106fiM1Twf7puLBOev 5xQfFCyaaDEdk9is9fnUat/p4rLt X-Google-Smtp-Source: ABhQp+QQa3PMLYW+Ulwjc+QPHlnV7dk4JWcg7EQU/7IJf+Rec8VvcWChpnNrPCO0DLUjKEJG/0OzwA== X-Received: by 10.55.109.195 with SMTP id i186mr8104625qkc.147.1508018868555; Sat, 14 Oct 2017 15:07:48 -0700 (PDT) Received: from localhost.localdomain ([187.180.180.72]) by smtp.gmail.com with ESMTPSA id c10sm2547758qtj.29.2017.10.14.15.07.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 14 Oct 2017 15:07:48 -0700 (PDT) From: Fabio Estevam To: bhelgaas@google.com Cc: linux-pci@vger.kernel.org, Fabio Estevam , Marc Gonzalez Subject: [PATCH 4/5] PCI: tango: Fix platform_get_irq() error handling Date: Sat, 14 Oct 2017 19:07:30 -0300 Message-Id: <1508018851-9272-4-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 -ENXIO. Cc: Marc Gonzalez Signed-off-by: Fabio Estevam --- drivers/pci/host/pcie-tango.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/host/pcie-tango.c b/drivers/pci/host/pcie-tango.c index e23f738..5196583 100644 --- a/drivers/pci/host/pcie-tango.c +++ b/drivers/pci/host/pcie-tango.c @@ -272,9 +272,9 @@ static int tango_pcie_probe(struct platform_device *pdev) writel_relaxed(0, pcie->base + SMP8759_ENABLE + offset); virq = platform_get_irq(pdev, 1); - if (virq <= 0) { + if (virq < 0) { dev_err(dev, "Failed to map IRQ\n"); - return -ENXIO; + return virq; } irq_dom = irq_domain_create_linear(fwnode, MSI_MAX, &dom_ops, pcie);