From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752223AbbFMKek (ORCPT ); Sat, 13 Jun 2015 06:34:40 -0400 Received: from gloria.sntech.de ([95.129.55.99]:54923 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751300AbbFMKec (ORCPT ); Sat, 13 Jun 2015 06:34:32 -0400 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Alessandro Zummo , Alexandre Belloni Cc: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , rtc-linux@googlegroups.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] rtc: hym8563: make the irq optional Date: Sat, 13 Jun 2015 12:34:04 +0200 Message-ID: <2559079.JyXCpe7EYV@diego> User-Agent: KMail/4.14.1 (Linux/3.16.0-4-amd64; KDE/4.14.2; x86_64; ; ) X-PRIORITY: 2 (High) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- .../devicetree/bindings/rtc/haoyu,hym8563.txt | 2 +- drivers/rtc/rtc-hym8563.c | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Documentation/devicetree/bindings/rtc/haoyu,hym8563.txt b/Documentation/devicetree/bindings/rtc/haoyu,hym8563.txt index 5c199ee..a8934fe 100644 --- a/Documentation/devicetree/bindings/rtc/haoyu,hym8563.txt +++ b/Documentation/devicetree/bindings/rtc/haoyu,hym8563.txt @@ -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: 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 */ -- 2.1.4