Skip to content

Commit fe50388

Browse files
Yuuoniygregkh
authored andcommitted
slimbus: qcom: Fix IRQ check in qcom_slim_probe
platform_get_irq() returns non-zero IRQ number on success, negative error number on failure. And the doc of platform_get_irq() provides a usage example: int irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; Fix the check of return value to catch errors correctly. Fixes: ad7fcbc ("slimbus: qcom: Add Qualcomm Slimbus controller driver") Cc: [email protected] Signed-off-by: Miaoqian Lin <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 672c0c5 commit fe50388

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/slimbus/qcom-ctrl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,9 +510,9 @@ static int qcom_slim_probe(struct platform_device *pdev)
510510
}
511511

512512
ctrl->irq = platform_get_irq(pdev, 0);
513-
if (!ctrl->irq) {
513+
if (ctrl->irq < 0) {
514514
dev_err(&pdev->dev, "no slimbus IRQ\n");
515-
return -ENODEV;
515+
return ctrl->irq;
516516
}
517517

518518
sctrl = &ctrl->ctrl;

0 commit comments

Comments
 (0)