Skip to contentSkip to conversation

drm/mcde: Fix handling of platform_get_irq() error

PATCH Applied Krzysztof Kozlowski 3 participants 5 messages Aug 27, 2020 – Oct 17, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/mcde: Fix handling of platform_get_irq() error

platform_get_irq() returns -ERRNO on error. In such case comparison to 0 would pass the check.

Fixes 5fc537bfd000 ("drm/mcde: Add new driver for ST-Ericsson MCDE")
---
 drivers/gpu/drm/mcde/mcde_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/mcde/mcde_drv.c +2 -2
index c592957ed07f..f9b5f450a9cb 100644
@@ -331,8 +331,8 @@ static int mcde_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (!irq) {
-		ret = -EINVAL;
+	if (irq < 0) {
+		ret = irq;
 		goto clk_disable;
 	}
 
Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 2/2 drm/tve200: Fix handling of platform_get_irq() error

platform_get_irq() returns -ERRNO on error. In such case comparison to 0 would pass the check.

Fixes 179c02fe90a4 ("drm/tve200: Add new driver for TVE200")
---
 drivers/gpu/drm/tve200/tve200_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/tve200/tve200_drv.c +2 -2
index c3aa39bd38ec..b5259cb1383f 100644
@@ -200,8 +200,8 @@ static int tve200_probe(struct platform_device *pdev)
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (!irq) {
-		ret = -EINVAL;
+	if (irq < 0) {
+		ret = irq;
 		goto clk_disable;
 	}
 
Signature · 1 line
2.17.1
Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] drm/tve200: Fix handling of platform_get_irq() error

Quoted 5 lines · Krzysztof Kozlowski

platform_get_irq() returns -ERRNO on error. In such case comparison to 0 would pass the check.

Fixes 179c02fe90a4 ("drm/tve200: Add new driver for TVE200")

Yours,
Linus Walleij
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Acked-by on v1 1/2
#3 lore raw
In reply to Krzysztof Kozlowski
Quoted 5 lines · Krzysztof Kozlowski

platform_get_irq() returns -ERRNO on error. In such case comparison to 0 would pass the check.

Fixes 5fc537bfd000 ("drm/mcde: Add new driver for ST-Ericsson MCDE")

Yours,
Linus Walleij
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Applied
#4 lore raw
In reply to Krzysztof Kozlowski

Hi Krzysztof

Quoted 5 lines · Krzysztof Kozlowski

platform_get_irq() returns -ERRNO on error. In such case comparison to 0 would pass the check.

Fixes 5fc537bfd000 ("drm/mcde: Add new driver for ST-Ericsson MCDE")

Thanks, applied this and the tve200 patch to drm-misc-next. They will appear in -next in a few weeks time.

Sam