From: phucduc.bui@gmail.com
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org,
bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH 2/2] rtc: cmos: Propagate errors from optional IRQ lookup
Date: Mon, 10 Aug 2026 12:15:04 +0700 [thread overview]
Message-ID: <20260810051504.26912-2-phucduc.bui@gmail.com> (raw)
In-Reply-To: <20260810051504.26912-1-phucduc.bui@gmail.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 optional IRQ is available, while other errors should be propagated.
Propagate all error codes returned by platform_get_irq_optional() other
than -ENXIO, while preserving -1 for the case where no optional IRQ is
available.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
drivers/rtc/rtc-cmos.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index fa04ece151b8..0a2c7383c8cd 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -1436,7 +1436,9 @@ static int __init cmos_platform_probe(struct platform_device *pdev)
else
resource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
irq = platform_get_irq_optional(pdev, 0);
- if (irq < 0) {
+ if (irq < 0 && irq != -ENXIO)
+ return irq;
+ if (irq == -ENXIO) {
irq = -1;
#ifdef CONFIG_X86
/*
--
2.43.0
next prev parent reply other threads:[~2026-08-10 5:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-10 5:15 [PATCH 1/2] rtc: m48t59: Propagate errors from optional IRQ lookup phucduc.bui
2026-08-10 5:15 ` phucduc.bui [this message]
2026-08-10 5:30 ` [PATCH 2/2] rtc: cmos: " sashiko-bot
2026-08-10 5:29 ` [PATCH 1/2] rtc: m48t59: " sashiko-bot
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=20260810051504.26912-2-phucduc.bui@gmail.com \
--to=phucduc.bui@gmail.com \
--cc=alexandre.belloni@bootlin.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
/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