* [PATCH] maiblox: mediatek: Fix handling of platform_get_irq() error
@ 2020-08-27 7:26 Krzysztof Kozlowski
2020-08-27 7:28 ` Krzysztof Kozlowski
0 siblings, 1 reply; 2+ messages in thread
From: Krzysztof Kozlowski @ 2020-08-27 7:26 UTC (permalink / raw)
To: Jassi Brar, Matthias Brugger, Houlong Wei, HS Liao, CK Hu,
linux-kernel, linux-arm-kernel, linux-mediatek
Cc: Krzysztof Kozlowski
platform_get_irq() returns -ERRNO on error. In such case comparison
to 0 would pass the check.
Fixes: 623a6143a845 ("mailbox: mediatek: Add Mediatek CMDQ driver")
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
drivers/mailbox/mtk-cmdq-mailbox.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c
index 484d4438cd83..76e4dfcf5228 100644
--- a/drivers/mailbox/mtk-cmdq-mailbox.c
+++ b/drivers/mailbox/mtk-cmdq-mailbox.c
@@ -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) {
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] maiblox: mediatek: Fix handling of platform_get_irq() error
2020-08-27 7:26 [PATCH] maiblox: mediatek: Fix handling of platform_get_irq() error Krzysztof Kozlowski
@ 2020-08-27 7:28 ` Krzysztof Kozlowski
0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Kozlowski @ 2020-08-27 7:28 UTC (permalink / raw)
To: Jassi Brar, Matthias Brugger, Houlong Wei, HS Liao, CK Hu,
linux-kernel, linux-arm-kernel, linux-mediatek
On Thu, 27 Aug 2020 at 09:26, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> platform_get_irq() returns -ERRNO on error. In such case comparison
> to 0 would pass the check.
>
> Fixes: 623a6143a845 ("mailbox: mediatek: Add Mediatek CMDQ driver")
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
> drivers/mailbox/mtk-cmdq-mailbox.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c
> index 484d4438cd83..76e4dfcf5228 100644
> --- a/drivers/mailbox/mtk-cmdq-mailbox.c
> +++ b/drivers/mailbox/mtk-cmdq-mailbox.c
> @@ -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)
Ah, this is wrong. The irq is u32... without my patch this was so broken...
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-08-27 7:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-27 7:26 [PATCH] maiblox: mediatek: Fix handling of platform_get_irq() error Krzysztof Kozlowski
2020-08-27 7:28 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).