Skip to contentSkip to conversation

rtc: hym8563: make the irq optional

PATCH Applied Heiko Stübner 2 participants 2 messages Jun 13, 2015 – Jun 14, 2015

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

PATCH 1/1 rtc: hym8563: make the irq optional

Sometimes the irq line is not connected to any soc-pin. This does not hinder basic timekeeping functionality of the rtc, so probe should not fail in this case.

---
 .../devicetree/bindings/rtc/haoyu,hym8563.txt          |  2 +-
 drivers/rtc/rtc-hym8563.c                              | 18 ++++++++++--------
 2 files changed, 11 insertions(+), 9 deletions(-)
Documentation/devicetree/bindings/rtc/haoyu,hym8563.txt +1 -1
index 5c199ee..a8934fe 100644
@@ -6,11 +6,11 @@ as well as a clock output of up to 32kHz.
 Required properties:
 - compatible: should be: "haoyu,hym8563"
 - reg: i2c address
-- interrupts: rtc alarm/event interrupt
 - #clock-cells: the value should be 0
 
 Optional properties:
 - clock-output-names: From common clock binding
+- interrupts: rtc alarm/event interrupt
 
 Example:
 
drivers/rtc/rtc-hym8563.c +10 -8
index 0f710e9..e9da795 100644
@@ -548,14 +548,16 @@ static int hym8563_probe(struct i2c_client *client,
 		return ret;
 	}
 
-	ret = devm_request_threaded_irq(&client->dev, client->irq,
-					NULL, hym8563_irq,
-					IRQF_TRIGGER_LOW | IRQF_ONESHOT,
-					client->name, hym8563);
-	if (ret < 0) {
-		dev_err(&client->dev, "irq %d request failed, %d\n",
-			client->irq, ret);
-		return ret;
+	if (client->irq > 0) {
+		ret = devm_request_threaded_irq(&client->dev, client->irq,
+						NULL, hym8563_irq,
+						IRQF_TRIGGER_LOW | IRQF_ONESHOT,
+						client->name, hym8563);
+		if (ret < 0) {
+			dev_err(&client->dev, "irq %d request failed, %d\n",
+				client->irq, ret);
+			return ret;
+		}
 	}
 
 	/* check state of calendar information */
Signature · 7 lines
2.1.4


--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#1 lore raw
Quoted 10 lines · Heiko Stübner

Sometimes the irq line is not connected to any soc-pin. This does not hinder basic timekeeping functionality of the rtc, so probe should not fail in this case.

---
 .../devicetree/bindings/rtc/haoyu,hym8563.txt          |  2 +-
 drivers/rtc/rtc-hym8563.c                              | 18 ++++++++++--------
 2 files changed, 11 insertions(+), 9 deletions(-)

Applied, thanks.

Signature · 7 lines
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html