Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6453689ybx; Mon, 11 Nov 2019 09:20:54 -0800 (PST) X-Google-Smtp-Source: APXvYqy73DVlGTLLdZ6R3WzXrjNHqJ4JP/U87p9p7z8fkxmA0wAFvM2QLTfZT9XK+4+1Ak5Yk2ZV X-Received: by 2002:a17:906:344c:: with SMTP id d12mr17102708ejb.227.1573492854843; Mon, 11 Nov 2019 09:20:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573492854; cv=none; d=google.com; s=arc-20160816; b=CSb4KwpU9S4OHpYbnR+l6qV08oQpNaKsviS+5mPYHbpvkEPk0Lqcw4G9RyPzwL/4GT 733wLejLacoszYUfMkwWiK4MloubYAmuSWSN9FX6r9fKFb3IPzyXy6dM1g2rKK49mAN5 2sPWBItyNAmPoB0726vrzT2DvYnxfR9FdFMRxhGWewTtfMf7ApK8KQntH+sT8LkOuNIq 0pc7muMdoA5ykfCTx9xEINvBmB3zcEFd/R9oJ2Jtrb7KL712OyPLT6E76QStoZq3864t u89HVzJGoCsRBegvmdfX5hAZyxxPwMuFTpFvobq0jDUX+lmkDafuDEmxM2OM+8Qv4Cxb Or1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=/zRPXHkwm0gk5+vgDpdSSbWWsaZEVREg74fApENVir0=; b=MMOArWSp13mFDfZZTe7OxT79iurpAhKCMLUjbjnJY9oXg2YrI8lzols9CVdGUQRGYg yHMJgxKupXfVSs+un0PCQZECWJv5DT8yGRfy2d+Xk0i9TAj1g2vOnw8CcGQ0J9QYmIcb Vt4tIaYefrM5WcWxJPwGNoYMY+6sUvoHVGF09Uaau3ylNwDA6UEPpz2vvJcivtjINVDJ y/p0UME4dI3P3jwSHzUrHwQpZSDHzifEqghBdYt6P7h/NDCNV/Yk8fYs9VP4BlrUu9YK EgTzzZ071ELK9K65/whQYSYjYYvkgNcy7iGmuJv6I+SpjwoSyQKM1B8dF/We8wHEcSMx Dm5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i13si9664868ejc.76.2019.11.11.09.20.30; Mon, 11 Nov 2019 09:20:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726954AbfKKRTS (ORCPT + 99 others); Mon, 11 Nov 2019 12:19:18 -0500 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:50953 "EHLO relay8-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726845AbfKKRTS (ORCPT ); Mon, 11 Nov 2019 12:19:18 -0500 X-Originating-IP: 90.65.92.102 Received: from localhost (lfbn-1-1723-102.w90-65.abo.wanadoo.fr [90.65.92.102]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id BD89E1BF205; Mon, 11 Nov 2019 17:19:15 +0000 (UTC) Date: Mon, 11 Nov 2019 18:19:15 +0100 From: Alexandre Belloni To: Andrey Skvortsov Cc: Alessandro Zummo , linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rtc: tps65910: allow using RTC without alarm interrupt Message-ID: <20191111171915.GA3572@piout.net> References: <20191109154652.7419-1-andrej.skvortzov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191109154652.7419-1-andrej.skvortzov@gmail.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, This needs a proper commit message. On 09/11/2019 18:46:52+0300, Andrey Skvortsov wrote: > Signed-off-by: Andrey Skvortsov > --- > drivers/rtc/rtc-tps65910.c | 19 +++++++++++++++---- > 1 file changed, 15 insertions(+), 4 deletions(-) > > diff --git a/drivers/rtc/rtc-tps65910.c b/drivers/rtc/rtc-tps65910.c > index 2c0467a9e717..aa3a001ef413 100644 > --- a/drivers/rtc/rtc-tps65910.c > +++ b/drivers/rtc/rtc-tps65910.c > @@ -361,6 +361,13 @@ static const struct rtc_class_ops tps65910_rtc_ops = { > .set_offset = tps65910_set_offset, > }; > > +static const struct rtc_class_ops tps65910_rtc_ops_noirq = { > + .read_time = tps65910_rtc_read_time, > + .set_time = tps65910_rtc_set_time, > + .read_offset = tps65910_read_offset, > + .set_offset = tps65910_set_offset, > +}; > + > static int tps65910_rtc_probe(struct platform_device *pdev) > { > struct tps65910 *tps65910 = NULL; > @@ -415,13 +422,17 @@ static int tps65910_rtc_probe(struct platform_device *pdev) > tps65910_rtc_interrupt, IRQF_TRIGGER_LOW, > dev_name(&pdev->dev), &pdev->dev); > if (ret < 0) { > - dev_err(&pdev->dev, "IRQ is not free.\n"); > - return ret; > + dev_err(&pdev->dev, "request IRQ:%d failed, err = %d\n", > + irq, ret); Do we actually need an error message here? > + irq = -1; > } > tps_rtc->irq = irq; > - device_set_wakeup_capable(&pdev->dev, 1); > + if (irq != -1) { > + device_set_wakeup_capable(&pdev->dev, 1); > + tps_rtc->rtc->ops = &tps65910_rtc_ops; > + } else > + tps_rtc->rtc->ops = &tps65910_rtc_ops_noirq; > > - tps_rtc->rtc->ops = &tps65910_rtc_ops; > tps_rtc->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000; > tps_rtc->rtc->range_max = RTC_TIMESTAMP_END_2099; > > -- > 2.20.1 > -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com