Skip to content

Commit

Permalink
PCI: rcar: Fix error handling of irq_of_parse_and_map()
Browse files Browse the repository at this point in the history
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 <dtor@chromium.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Phil Edworthy <phil.edworthy@renesas.com>
  • Loading branch information
Dmitry Torokhov authored and Bjorn Helgaas committed Dec 26, 2014
1 parent 97bf6af commit c51d411
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/pci/host/pcie-rcar.c
Original file line number Diff line number Diff line change
Expand Up @@ -757,15 +757,15 @@ 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;
}
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;
Expand Down

0 comments on commit c51d411

Please sign in to comment.