Skip to content

Commit

Permalink
MIPS: ralink: Fix platform_get_irq's error checking
Browse files Browse the repository at this point in the history
The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.

Signed-off-by: Arvind Yadav <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/17783/
Signed-off-by: Ralf Baechle <[email protected]>
  • Loading branch information
ArvindYadavCs authored and ralfbaechle committed Jan 10, 2018
1 parent 7e5e371 commit b6ab1a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/mips/ralink/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ static int rt_timer_probe(struct platform_device *pdev)
}

rt->irq = platform_get_irq(pdev, 0);
if (!rt->irq) {
if (rt->irq < 0) {
dev_err(&pdev->dev, "failed to load irq\n");
return -ENOENT;
return rt->irq;
}

rt->membase = devm_ioremap_resource(&pdev->dev, res);
Expand Down

0 comments on commit b6ab1a1

Please sign in to comment.