]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
watchdog: stm32_iwdg: fix error message during driver probe
authorClément Le Goffic <clement.legoffic@foss.st.com>
Wed, 18 Dec 2024 09:22:27 +0000 (10:22 +0100)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Mon, 30 Dec 2024 14:28:02 +0000 (15:28 +0100)
The commit 3ab1663af6c1 ("watchdog: stm32_iwdg: Add pretimeout support")
introduces the support for the pre-timeout interrupt.

The support for this interrupt is optional but the driver uses the
platform_get_irq() which produces an error message during the driver
probe if we don't have any `interrupts` property in the DT.

Use the platform_get_irq_optional() API to get rid of the error message
as this property is optional.

Fixes: 3ab1663af6c1 ("watchdog: stm32_iwdg: Add pretimeout support")
Signed-off-by: Clément Le Goffic <clement.legoffic@foss.st.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20241218092227.771133-1-clement.legoffic@foss.st.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
drivers/watchdog/stm32_iwdg.c

index d700e0d49bb95d5f25d60045b6462b109bf2f63a..8ad06b54c5adc6c4aac5f98a95703e0e1ed06947 100644 (file)
@@ -286,7 +286,7 @@ static int stm32_iwdg_irq_init(struct platform_device *pdev,
        if (!wdt->data->has_early_wakeup)
                return 0;
 
-       irq = platform_get_irq(pdev, 0);
+       irq = platform_get_irq_optional(pdev, 0);
        if (irq <= 0)
                return 0;