Skip to content

Commit

Permalink
PM / devfreq: tegra: fix error return code in tegra_devfreq_probe()
Browse files Browse the repository at this point in the history
platform_get_irq() returns an error code, but the tegra-devfreq
driver ignores it and always returns -ENODEV. This is not correct,
and prevents -EPROBE_DEFER from being propagated properly.

Notice that platform_get_irq() no longer returns 0 on error:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e330b9a6bb35dc7097a4f02cb1ae7b6f96df92af

Print and propagate the return value of platform_get_irq on failure.

Reviewed-by: Chanwoo Choi <[email protected]>
Signed-off-by: Gustavo A. R. Silva <[email protected]>
Signed-off-by: MyungJoo Ham <[email protected]>
  • Loading branch information
GustavoARSilva authored and myungjoo committed Jul 6, 2017
1 parent da55b1a commit 9e578b3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/devfreq/tegra-devfreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,9 +688,9 @@ static int tegra_devfreq_probe(struct platform_device *pdev)
}

irq = platform_get_irq(pdev, 0);
if (irq <= 0) {
dev_err(&pdev->dev, "Failed to get IRQ\n");
return -ENODEV;
if (irq < 0) {
dev_err(&pdev->dev, "Failed to get IRQ: %d\n", irq);
return irq;
}

platform_set_drvdata(pdev, tegra);
Expand Down

0 comments on commit 9e578b3

Please sign in to comment.