maiblox: mediatek: Fix handling of platform_get_irq() error
Subsystems (2)
PATCH v2 1/1 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.
---
Changes since v1:
1. Correct u32->int,
2. Fix left-over '!'.
--- drivers/mailbox/mtk-cmdq-mailbox.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/mailbox/mtk-cmdq-mailbox.c +3 -5
@@ -69,7 +69,7 @@ struct cmdq_task {struct cmdq {struct mbox_controller mbox;void __iomem *base; -u32 irq; +int irq;u32 thread_nr;u32 irq_mask;struct cmdq_thread *thread;
@@ -525,10 +525,8 @@ static int cmdq_probe(struct platform_device *pdev) } cmdq->irq =platform_get_irq (pdev,0 ); -if (!cmdq->irq) { -dev_err (dev,"failed to get irq\n" ); -return -EINVAL ; - } +if (cmdq->irq <0 ) +return cmdq->irq; plat_data = (struct gce_plat *)of_device_get_match_data (dev);if (!plat_data) {
Signature · 1 line
2.17.1
Quoted 3 lines
Gesendet: Donnerstag, 27. August 2020 um 09:31 Uhr
Von: "Krzysztof Kozlowski" <[email protected]>
Betreff: [PATCH v2] maiblox: mediatek: Fix handling ofplatform_get_irq()error
typo in subject i guess it should be "mailbox"
regards Frank
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Quoted 5 lines · Frank Wunderlich
Quoted 3 lines
Gesendet: Donnerstag, 27. August 2020 um 09:31 Uhr
Von: "Krzysztof Kozlowski" <[email protected]>
Betreff: [PATCH v2] maiblox: mediatek: Fix handling ofplatform_get_irq()errortypo in subject i guess it should be "mailbox"
Indeed, thanks.
Best regards,
Krzysztof