Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Heiko Stübner and committed by
Alexandre Belloni
4be1f6bb 45b4c85b

+11 -9
+1 -1
Documentation/devicetree/bindings/rtc/haoyu,hym8563.txt
··· 6 6 Required properties: 7 7 - compatible: should be: "haoyu,hym8563" 8 8 - reg: i2c address 9 - - interrupts: rtc alarm/event interrupt 10 9 - #clock-cells: the value should be 0 11 10 12 11 Optional properties: 13 12 - clock-output-names: From common clock binding 13 + - interrupts: rtc alarm/event interrupt 14 14 15 15 Example: 16 16
+10 -8
drivers/rtc/rtc-hym8563.c
··· 548 548 return ret; 549 549 } 550 550 551 - ret = devm_request_threaded_irq(&client->dev, client->irq, 552 - NULL, hym8563_irq, 553 - IRQF_TRIGGER_LOW | IRQF_ONESHOT, 554 - client->name, hym8563); 555 - if (ret < 0) { 556 - dev_err(&client->dev, "irq %d request failed, %d\n", 557 - client->irq, ret); 558 - return ret; 551 + if (client->irq > 0) { 552 + ret = devm_request_threaded_irq(&client->dev, client->irq, 553 + NULL, hym8563_irq, 554 + IRQF_TRIGGER_LOW | IRQF_ONESHOT, 555 + client->name, hym8563); 556 + if (ret < 0) { 557 + dev_err(&client->dev, "irq %d request failed, %d\n", 558 + client->irq, ret); 559 + return ret; 560 + } 559 561 } 560 562 561 563 /* check state of calendar information */