Skip to contentSkip to conversation

watchdog: mtk_wdt: use platform_get_irq_optional

PATCH In review Tzung-Bi Shih 2 participants 2 messages Dec 8, 2021

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

PATCH 1/1 watchdog: mtk_wdt: use platform_get_irq_optional

The watchdog pre-timeout (bark) interrupt is optional. Use platform_get_irq_optional() to avoid seeing such following error message:

Quoted 1 line
Quoted 1 line
Quoted 1 line

mtk-wdt 10007000.watchdog: IRQ index 0 not found

---
The patch bases on linux-next next-20211208.

 drivers/watchdog/mtk_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/mtk_wdt.c +1 -1
index 543cf38bd04e..4577a76dd464 100644
@@ -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);
Signature · 1 line
2.34.1.173.g76aa8bc2d0-goog
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Tzung-Bi Shih

The watchdog pre-timeout (bark) interrupt is optional. Use platform_get_irq_optional() to avoid seeing such following error message:

Quoted 1 line
Quoted 1 line
Quoted 1 line

mtk-wdt 10007000.watchdog: IRQ index 0 not found

Quoted 22 lines

---
The patch bases on linux-next next-20211208.

 drivers/watchdog/mtk_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/mtk_wdt.c +1 -1
index 543cf38bd04e..4577a76dd464 100644
@@ -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);
Signature · 1 line
2.34.1.173.g76aa8bc2d0-goog