From patchwork Fri Nov 14 22:21:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 5309911 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6890B9F2ED for ; Fri, 14 Nov 2014 22:22:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 911B220149 for ; Fri, 14 Nov 2014 22:21:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6F9C52015D for ; Fri, 14 Nov 2014 22:21:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422644AbaKNWV5 (ORCPT ); Fri, 14 Nov 2014 17:21:57 -0500 Received: from mail-ig0-f173.google.com ([209.85.213.173]:48015 "EHLO mail-ig0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161930AbaKNWV4 (ORCPT ); Fri, 14 Nov 2014 17:21:56 -0500 Received: by mail-ig0-f173.google.com with SMTP id r10so505573igi.12 for ; Fri, 14 Nov 2014 14:21:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=uV0TGXRBI4jkXX0jOjFxFr8CjUJBgu3erEiy7wKXVIU=; b=S6i0FVe9VTQT5W96r3tBP/LiYSRJEVRiEu4/tJflm4KSwUH5YiF+LfsyIFtxvO9Cn2 DpZ0i/ynschOT6Urx5Ui76s4rkU5q39B9weMndUQwxXeyjRjQzYlQJRX4bN2kZbE5JU7 knyEsicMD7AWu5AvGWDmV8+uKxnnza+N1ggp+mMA5OhuIGyyzNk60kQg2AxpD8Z15HW4 236A8h5ejPTEnc6fNztM6Bgdl6Wy2M7cAHvSfNwm7Xr3AARs6zanRqPa596D2YnPkvlc O8CEfmVqywmtcH1zrvv4u5xlrfvWnoM6aPtFbJIftOg8xKBgtFIwzmSch4QdfZgkIQKi z6EQ== X-Gm-Message-State: ALoCoQlziCgkKQ9rrT/o9D6nwJ+wiQaF9S+uMCI7wNKk7p7+ONICclCgCR+W2g7EXmSZcoCxRL5J X-Received: by 10.107.165.19 with SMTP id o19mr13410553ioe.1.1416003715549; Fri, 14 Nov 2014 14:21:55 -0800 (PST) Received: from dtor-ws ([2620:0:1000:1301:8c0e:c406:dbcd:b83b]) by mx.google.com with ESMTPSA id p137sm12718789ioe.13.2014.11.14.14.21.54 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 14 Nov 2014 14:21:55 -0800 (PST) Date: Fri, 14 Nov 2014 14:21:53 -0800 From: Dmitry Torokhov To: Simon Horman Cc: Bjorn Helgaas , Phil Edworthy , linux-pci@vger.kernel.org, linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] PCI: rcar: fix error handling of irq_of_parse_and_map Message-ID: <20141114222153.GA39494@dtor-ws> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Return value of irq_of_parse_and_map() is unsigned int, with 0 indicating failure, so testing for negative result never works. Signed-off-by: Dmitry Torokhov Acked-by: Phil Edworthy --- Not tested, found by casual code inspection. drivers/pci/host/pcie-rcar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c index 9b356c3..6ca976f 100644 --- a/drivers/pci/host/pcie-rcar.c +++ b/drivers/pci/host/pcie-rcar.c @@ -764,7 +764,7 @@ static int rcar_pcie_get_resources(struct platform_device *pdev, goto err_map_reg; i = irq_of_parse_and_map(pdev->dev.of_node, 0); - if (i < 0) { + if (!i) { dev_err(pcie->dev, "cannot get platform resources for msi interrupt\n"); err = -ENOENT; goto err_map_reg; @@ -772,7 +772,7 @@ static int rcar_pcie_get_resources(struct platform_device *pdev, pcie->msi.irq1 = i; i = irq_of_parse_and_map(pdev->dev.of_node, 1); - if (i < 0) { + if (!i) { dev_err(pcie->dev, "cannot get platform resources for msi interrupt\n"); err = -ENOENT; goto err_map_reg;