summaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorHeiko Stübner <heiko@sntech.de>2015-06-13 12:34:04 +0200
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>2015-06-25 01:13:45 +0200
commit4be1f6bbd1e968ab02653c28eababd9480dfff77 (patch)
treecc47bc7c2fe9902357f938d87fe6fb38216e38d8 /drivers/rtc
parent45b4c85b71bbe691329983c9bf9877392700edc3 (diff)
downloadop-kernel-dev-4be1f6bbd1e968ab02653c28eababd9480dfff77.zip
op-kernel-dev-4be1f6bbd1e968ab02653c28eababd9480dfff77.tar.gz
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. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-hym8563.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/rtc/rtc-hym8563.c b/drivers/rtc/rtc-hym8563.c
index 0f710e9..e9da795 100644
--- a/drivers/rtc/rtc-hym8563.c
+++ b/drivers/rtc/rtc-hym8563.c
@@ -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 */
OpenPOWER on IntegriCloud