diff mbox series

watchdog: mtk_wdt: use platform_get_irq_optional

Message ID 20211208095555.4099551-1-tzungbi@google.com
State New
Headers show
Series watchdog: mtk_wdt: use platform_get_irq_optional | expand

Commit Message

Tzung-Bi Shih Dec. 8, 2021, 9:55 a.m. UTC
The watchdog pre-timeout (bark) interrupt is optional.  Use
platform_get_irq_optional() to avoid seeing such following
error message:
>>> mtk-wdt 10007000.watchdog: IRQ index 0 not found

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
---
The patch bases on linux-next next-20211208.

 drivers/watchdog/mtk_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Guenter Roeck Dec. 8, 2021, 3:44 p.m. UTC | #1
On Wed, Dec 08, 2021 at 05:55:55PM +0800, Tzung-Bi Shih wrote:
> The watchdog pre-timeout (bark) interrupt is optional.  Use
> platform_get_irq_optional() to avoid seeing such following
> error message:
> >>> mtk-wdt 10007000.watchdog: IRQ index 0 not found
> 
> Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
> The patch bases on linux-next next-20211208.
> 
>  drivers/watchdog/mtk_wdt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/watchdog/mtk_wdt.c b/drivers/watchdog/mtk_wdt.c
> index 543cf38bd04e..4577a76dd464 100644
> --- a/drivers/watchdog/mtk_wdt.c
> +++ b/drivers/watchdog/mtk_wdt.c
> @@ -339,7 +339,7 @@ static int mtk_wdt_probe(struct platform_device *pdev)
>  	if (IS_ERR(mtk_wdt->wdt_base))
>  		return PTR_ERR(mtk_wdt->wdt_base);
>  
> -	irq = platform_get_irq(pdev, 0);
> +	irq = platform_get_irq_optional(pdev, 0);
>  	if (irq > 0) {
>  		err = devm_request_irq(&pdev->dev, irq, mtk_wdt_isr, 0, "wdt_bark",
>  				       &mtk_wdt->wdt_dev);
> -- 
> 2.34.1.173.g76aa8bc2d0-goog
>
diff mbox series

Patch

diff --git a/drivers/watchdog/mtk_wdt.c b/drivers/watchdog/mtk_wdt.c
index 543cf38bd04e..4577a76dd464 100644
--- a/drivers/watchdog/mtk_wdt.c
+++ b/drivers/watchdog/mtk_wdt.c
@@ -339,7 +339,7 @@  static int mtk_wdt_probe(struct platform_device *pdev)
 	if (IS_ERR(mtk_wdt->wdt_base))
 		return PTR_ERR(mtk_wdt->wdt_base);
 
-	irq = platform_get_irq(pdev, 0);
+	irq = platform_get_irq_optional(pdev, 0);
 	if (irq > 0) {
 		err = devm_request_irq(&pdev->dev, irq, mtk_wdt_isr, 0, "wdt_bark",
 				       &mtk_wdt->wdt_dev);