From patchwork Sat Oct 14 22:07:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10006655 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 CC75E60595 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 BFB3A28BBA for ; Sat, 14 Oct 2017 22:07:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4E17291E2; 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 F285F291DE for ; Sat, 14 Oct 2017 22:07:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751394AbdJNWHp (ORCPT ); Sat, 14 Oct 2017 18:07:45 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:44432 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751138AbdJNWHp (ORCPT ); Sat, 14 Oct 2017 18:07:45 -0400 Received: by mail-qt0-f193.google.com with SMTP id 8so25456372qtv.1 for ; Sat, 14 Oct 2017 15:07:44 -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=A72fWmvSVyaA3iVDf9rmrg1DUZVxsxLwhtb+W1eb4pQ=; b=UFbfZiWrijcUdOYbjPg9jC/k9DzLaWU7L5DhSAqdKzaB7zt1R6FFYCSsuS6GzvoCJn 65ZeGSfl0N+u8Hl+SGN84vXqRAgtC2Gy7YIAyceu5X5jYBmwWayR9TfcFoHiQDtE0F3K OWkjhAdoGHjMll3kiXWYxaNQMsKZhEEPXUcm5J3MGWUhxQ1FN+c5KyXYQ+3ipv6QA3xM zuw5QUVJKLdtfTKV9ta0EnuUj+DY4JMm2VDHhThlL9OQDTB9hCeG/XiA71KmrcSwtN6r xMM6j58UkQtqTqlST3ILDCCpjIX4/6TPfDlLx/TDVoKbbYYqd6nTwU5lsA/GIqZLCgEt mdaQ== 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=A72fWmvSVyaA3iVDf9rmrg1DUZVxsxLwhtb+W1eb4pQ=; b=nhWa861W+AJwdbJaeNoG3T2higCYEfEVlnah+FD/PPXsbfJcX7TtX0RdLEhFDkP9YN M9kVL2cQ95epsQ2rIimmdfpeCwbex+FpHhrRGYP0kRTw5DFy43TWgnQ/LC4e54Ffsplm fvcZWHbPWncS1wqYyELsEQuAEKJAVoq5SAsuGImlQQqkai1NrY3ZxTGSvfykE9TsomWA M9++7eSXvZwcEEMH8/CXeBDgLBXEJgFtr3u7Y0Ye0rBPJdbeOFV7TKH3Y6WyZ5ztsNcC HiSWHjrVbOfNdR/cxvvmW7zCtkEAkPoBuEMQBZlRglZRcFAoI1Z6HzDgA6UtAJKRscDJ cIHQ== X-Gm-Message-State: AMCzsaVJ+dQ2nWsgsFYLQY9NTOmyPm9ropfG2Vsi9sPqo+nGJbMd8trL jU2rDhmD59SYfp3zuExFJ4s= X-Google-Smtp-Source: AOwi7QBMfTFn0Zs8ZlaqpLDEjz8a4OirALNbdV33381DiQZGVz/tEYa4QfSY8gnyk8Adh1LfiHTTsw== X-Received: by 10.200.22.181 with SMTP id r50mr8691336qtj.137.1508018864439; Sat, 14 Oct 2017 15:07:44 -0700 (PDT) Received: from localhost.localdomain ([187.180.180.72]) by smtp.gmail.com with ESMTPSA id c10sm2547758qtj.29.2017.10.14.15.07.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 14 Oct 2017 15:07:44 -0700 (PDT) From: Fabio Estevam To: bhelgaas@google.com Cc: linux-pci@vger.kernel.org, Fabio Estevam , Linus Walleij Subject: [PATCH 2/5] PCI: v3-semi: Fix platform_get_irq() error handling Date: Sat, 14 Oct 2017 19:07:28 -0300 Message-Id: <1508018851-9272-2-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 -ENODEV. Cc: Linus Walleij Signed-off-by: Fabio Estevam --- drivers/pci/host/pci-v3-semi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/host/pci-v3-semi.c b/drivers/pci/host/pci-v3-semi.c index a544d72..01017af 100644 --- a/drivers/pci/host/pci-v3-semi.c +++ b/drivers/pci/host/pci-v3-semi.c @@ -806,9 +806,9 @@ static int v3_pci_probe(struct platform_device *pdev) /* Get and request error IRQ resource */ irq = platform_get_irq(pdev, 0); - if (irq <= 0) { + if (irq < 0) { dev_err(dev, "unable to obtain PCIv3 error IRQ\n"); - return -ENODEV; + return irq; } ret = devm_request_irq(dev, irq, v3_irq, 0, "PCIv3 error", v3);