Openbmc Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Vince Chang <vince_chang@aspeedtech.com>
To: <openbmc@lists.ozlabs.org>, <andrew@codeconstruct.com.au>,
	<tan.siewert@9elements.com>
Cc: bui duc phuc <phucduc.bui@gmail.com>, <joel@jms.id.au>,
	Guenter Roeck <linux@roeck-us.net>
Subject: [PATCH linux dev-6.18 4/4] watchdog: aspeed: Propagate errors from optional IRQ lookup
Date: Thu, 29 Oct 2026 13:08:45 +0800	[thread overview]
Message-ID: <20261029050847.810331-5-vince_chang@aspeedtech.com> (raw)
In-Reply-To: <20261029050847.810331-1-vince_chang@aspeedtech.com>

From: bui duc phuc <phucduc.bui@gmail.com>

platform_get_irq_optional() returns a positive IRQ number on success or
a negative error code on failure. For an optional IRQ, -ENXIO indicates
that no IRQ is available, while other errors should be propagated.

Propagate errors such as -EPROBE_DEFER and -EINVAL instead of continuing
probe without the IRQ.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
Link: https://lore.kernel.org/r/20260807081652.38692-4-phucduc.bui@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
(cherry picked from commit 1f3c3fa76ddbc2eb92b60c5d4db24d7f702a7811)
Signed-off-by: Vince Chang <vince_chang@aspeedtech.com>
---
 drivers/watchdog/aspeed_wdt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/watchdog/aspeed_wdt.c b/drivers/watchdog/aspeed_wdt.c
index c9e79851504c..48454ac86074 100644
--- a/drivers/watchdog/aspeed_wdt.c
+++ b/drivers/watchdog/aspeed_wdt.c
@@ -429,6 +429,8 @@ static int aspeed_wdt_probe(struct platform_device *pdev)
 	if (wdt->cfg->irq_mask) {
 		int irq = platform_get_irq_optional(pdev, 0);
 
+		if (irq < 0 && irq != -ENXIO)
+			return irq;
 		if (irq > 0) {
 			ret = devm_request_irq(dev, irq, aspeed_wdt_irq,
 					       IRQF_SHARED, dev_name(dev),
-- 
2.43.0



  parent reply	other threads:[~2026-10-29  5:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29  5:08 [PATCH linux dev-6.18 0/4] Backport ASPEED AST2700 watchdog support Vince Chang
2026-10-29  5:08 ` [PATCH linux dev-6.18 1/4] dt-bindings: watchdog: aspeed,ast2400-wdt: Add support for AST2700 Vince Chang
2026-10-29  5:08 ` [PATCH linux dev-6.18 2/4] watchdog: aspeed: Support variable number of reset mask registers Vince Chang
2026-10-29  5:08 ` [PATCH linux dev-6.18 3/4] watchdog: aspeed: Add support for AST2700 platform Vince Chang
2026-10-29  5:08 ` Vince Chang [this message]
2026-10-29 23:59 ` [PATCH linux dev-6.18 0/4] Backport ASPEED AST2700 watchdog support Andrew Jeffery

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261029050847.810331-5-vince_chang@aspeedtech.com \
    --to=vince_chang@aspeedtech.com \
    --cc=andrew@codeconstruct.com.au \
    --cc=joel@jms.id.au \
    --cc=linux@roeck-us.net \
    --cc=openbmc@lists.ozlabs.org \
    --cc=phucduc.bui@gmail.com \
    --cc=tan.siewert@9elements.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox