diff options
author | Heiko Stübner <heiko@sntech.de> | 2015-06-13 06:34:04 -0400 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@free-electrons.com> | 2015-06-24 19:13:45 -0400 |
commit | 4be1f6bbd1e968ab02653c28eababd9480dfff77 (patch) | |
tree | cc47bc7c2fe9902357f938d87fe6fb38216e38d8 /drivers/rtc | |
parent | 45b4c85b71bbe691329983c9bf9877392700edc3 (diff) |
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.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/rtc/rtc-hym8563.c b/drivers/rtc/rtc-hym8563.c index 0f710e98538f..e9da7959d3fe 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, | |||
548 | return ret; | 548 | return ret; |
549 | } | 549 | } |
550 | 550 | ||
551 | ret = devm_request_threaded_irq(&client->dev, client->irq, | 551 | if (client->irq > 0) { |
552 | NULL, hym8563_irq, | 552 | ret = devm_request_threaded_irq(&client->dev, client->irq, |
553 | IRQF_TRIGGER_LOW | IRQF_ONESHOT, | 553 | NULL, hym8563_irq, |
554 | client->name, hym8563); | 554 | IRQF_TRIGGER_LOW | IRQF_ONESHOT, |
555 | if (ret < 0) { | 555 | client->name, hym8563); |
556 | dev_err(&client->dev, "irq %d request failed, %d\n", | 556 | if (ret < 0) { |
557 | client->irq, ret); | 557 | dev_err(&client->dev, "irq %d request failed, %d\n", |
558 | return ret; | 558 | client->irq, ret); |
559 | return ret; | ||
560 | } | ||
559 | } | 561 | } |
560 | 562 | ||
561 | /* check state of calendar information */ | 563 | /* check state of calendar information */ |