From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50854C43331 for ; Sun, 10 Jan 2021 23:19:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2F3E422AAE for ; Sun, 10 Jan 2021 23:19:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727008AbhAJXSu (ORCPT ); Sun, 10 Jan 2021 18:18:50 -0500 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:64899 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726908AbhAJXSs (ORCPT ); Sun, 10 Jan 2021 18:18:48 -0500 X-Originating-IP: 86.202.109.140 Received: from localhost (lfbn-lyo-1-13-140.w86-202.abo.wanadoo.fr [86.202.109.140]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 3FDA640005; Sun, 10 Jan 2021 23:18:05 +0000 (UTC) From: Alexandre Belloni To: linux-rtc@vger.kernel.org, Linus Walleij , Alessandro Zummo , Alexandre Belloni Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH 02/17] rtc: pl031: use RTC_FEATURE_ALARM Date: Mon, 11 Jan 2021 00:17:37 +0100 Message-Id: <20210110231752.1418816-3-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210110231752.1418816-1-alexandre.belloni@bootlin.com> References: <20210110231752.1418816-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-rtc@vger.kernel.org Clear RTC_FEATURE_ALARM instead of setting set_alarm, read_alarm and alarm_irq_enable to NULL. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-pl031.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c index 224bbf096262..7c3967df4f9a 100644 --- a/drivers/rtc/rtc-pl031.c +++ b/drivers/rtc/rtc-pl031.c @@ -352,12 +352,8 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id) } } - if (!adev->irq[0]) { - /* When there's no interrupt, no point in exposing the alarm */ - ops->read_alarm = NULL; - ops->set_alarm = NULL; - ops->alarm_irq_enable = NULL; - } + if (!adev->irq[0]) + clear_bit(RTC_FEATURE_ALARM, ldata->rtc->features); device_init_wakeup(&adev->dev, true); ldata->rtc = devm_rtc_allocate_device(&adev->dev); -- 2.29.2