* [PATCH] rtc: isl1208: do not advertise update interrupt feature if no interrupt specified
@ 2022-05-23 14:53 Quentin Schulz
2022-06-24 17:08 ` Alexandre Belloni
0 siblings, 1 reply; 2+ messages in thread
From: Quentin Schulz @ 2022-05-23 14:53 UTC (permalink / raw)
Cc: a.zummo, alexandre.belloni, linux-rtc, linux-kernel, foss+kernel,
Quentin Schulz
From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
If an ISL1208 device does not have an interrupt line routed, the feature
shouldn't be advertised (it is by default in rtc core) or it'll confuse
userspace requesting that feature (such as hwclock from util-linux).
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
---
drivers/rtc/rtc-isl1208.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/rtc/rtc-isl1208.c b/drivers/rtc/rtc-isl1208.c
index 182dfa6055155..f448a525333e1 100644
--- a/drivers/rtc/rtc-isl1208.c
+++ b/drivers/rtc/rtc-isl1208.c
@@ -880,10 +880,14 @@ isl1208_probe(struct i2c_client *client, const struct i2c_device_id *id)
if (rc)
return rc;
- if (client->irq > 0)
+ if (client->irq > 0) {
rc = isl1208_setup_irq(client, client->irq);
- if (rc)
- return rc;
+ if (rc)
+ return rc;
+
+ } else {
+ clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, isl1208->rtc->features);
+ }
if (evdet_irq > 0 && evdet_irq != client->irq)
rc = isl1208_setup_irq(client, evdet_irq);
--
2.36.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] rtc: isl1208: do not advertise update interrupt feature if no interrupt specified
2022-05-23 14:53 [PATCH] rtc: isl1208: do not advertise update interrupt feature if no interrupt specified Quentin Schulz
@ 2022-06-24 17:08 ` Alexandre Belloni
0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2022-06-24 17:08 UTC (permalink / raw)
To: foss+kernel; +Cc: linux-rtc, quentin.schulz, linux-kernel, a.zummo
On Mon, 23 May 2022 16:53:20 +0200, Quentin Schulz wrote:
> From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
>
> If an ISL1208 device does not have an interrupt line routed, the feature
> shouldn't be advertised (it is by default in rtc core) or it'll confuse
> userspace requesting that feature (such as hwclock from util-linux).
>
>
> [...]
Applied, thanks!
[1/1] rtc: isl1208: do not advertise update interrupt feature if no interrupt specified
commit: ddc9c54b6b993bca4aa810402b17a0f42c5744d1
Best regards,
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-06-24 17:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-23 14:53 [PATCH] rtc: isl1208: do not advertise update interrupt feature if no interrupt specified Quentin Schulz
2022-06-24 17:08 ` Alexandre Belloni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).