Skip to contentSkip to conversation

rtc: isl1208: do not advertise update interrupt feature if no interrupt specified

PATCH Applied Quentin Schulz 2 participants 2 messages May 23, 2022 – Jun 24, 2022 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc: isl1208: do not advertise update interrupt feature if no interrupt specified

From: Quentin Schulz <[email protected]>

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).

---
 drivers/rtc/rtc-isl1208.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/rtc/rtc-isl1208.c +7 -3
index 182dfa6055155..f448a525333e1 100644
@@ -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);
Signature · 1 line
2.36.1
maintainer Applied
#1 lore raw
Quoted 8 lines · Quentin Schulz

From: Quentin Schulz <[email protected]>

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,

Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com