Commit 558e4c36 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Jassi Brar

maiblox: mediatek: Fix handling of platform_get_irq() error

platform_get_irq() returns -ERRNO on error.  In such case casting to u32
and comparing to 0 would pass the check.

Fixes: 623a6143 ("mailbox: mediatek: Add Mediatek CMDQ driver")
Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
parent 7002ca23
...@@ -69,7 +69,7 @@ struct cmdq_task { ...@@ -69,7 +69,7 @@ struct cmdq_task {
struct cmdq { struct cmdq {
struct mbox_controller mbox; struct mbox_controller mbox;
void __iomem *base; void __iomem *base;
u32 irq; int irq;
u32 thread_nr; u32 thread_nr;
u32 irq_mask; u32 irq_mask;
struct cmdq_thread *thread; struct cmdq_thread *thread;
...@@ -525,10 +525,8 @@ static int cmdq_probe(struct platform_device *pdev) ...@@ -525,10 +525,8 @@ static int cmdq_probe(struct platform_device *pdev)
} }
cmdq->irq = platform_get_irq(pdev, 0); cmdq->irq = platform_get_irq(pdev, 0);
if (!cmdq->irq) { if (cmdq->irq < 0)
dev_err(dev, "failed to get irq\n"); return cmdq->irq;
return -EINVAL;
}
plat_data = (struct gce_plat *)of_device_get_match_data(dev); plat_data = (struct gce_plat *)of_device_get_match_data(dev);
if (!plat_data) { if (!plat_data) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment