From patchwork Sun Jan 10 23:17:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 12009559 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=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 B05E4C433E0 for ; Sun, 10 Jan 2021 23:20:12 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6C461227C3 for ; Sun, 10 Jan 2021 23:20:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C461227C3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ACDwhA2GhYq/jY72EoFm4jMqnZWWzp7JQyFGFydhPAI=; b=Wu+SCIEJH8xdp1s0TEFj8nB2v FMa8icgckeyVAlL5wmfxwQv87xyHJz7p9GRKLLY9AQ21z3tn4RB7fdqMouYEhvR8GJYfVfBVG+9BH NHr6JKD50+kbpTrl9sAXelqLAJr2jxoyLBseLNjYuzCl4vrFYBxaxYBZ3Tk0oLmoR1OYSv11T4KHI IW9Qd0BCwu6F8z7bDwoVLkbRyy47fsZjLy3yy0NWLFczUkdko7LOoskqdj4u8GBN5rU56pdgNqXUO pDAQSSTW1La7EeYIR3gv+haDzzIFjfMkpOiBSmlsg2UEk9SUPRgw3Ti9NIOdsOrsyrpy8Qp6ksAU2 7JDeA6GgQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kyjym-0001bg-H8; Sun, 10 Jan 2021 23:18:36 +0000 Received: from relay2-d.mail.gandi.net ([217.70.183.194]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kyjyN-0001RK-3j for linux-arm-kernel@lists.infradead.org; Sun, 10 Jan 2021 23:18:13 +0000 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 E8FE740006; Sun, 10 Jan 2021 23:18:06 +0000 (UTC) From: Alexandre Belloni To: linux-rtc@vger.kernel.org, Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Alessandro Zummo , Alexandre Belloni Subject: [PATCH 03/17] rtc: armada38x: remove armada38x_rtc_ops_noirq Date: Mon, 11 Jan 2021 00:17:38 +0100 Message-Id: <20210110231752.1418816-4-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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210110_181811_326939_A3C3E40C X-CRM114-Status: GOOD ( 12.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Clear RTC_FEATURE_ALARM to signal that alarms are not available instead of having a supplementary struct rtc_class_ops with a NULL .set_alarm. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-armada38x.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/rtc/rtc-armada38x.c b/drivers/rtc/rtc-armada38x.c index 807a79c07f08..cc542e6b1d5b 100644 --- a/drivers/rtc/rtc-armada38x.c +++ b/drivers/rtc/rtc-armada38x.c @@ -458,14 +458,6 @@ static const struct rtc_class_ops armada38x_rtc_ops = { .set_offset = armada38x_rtc_set_offset, }; -static const struct rtc_class_ops armada38x_rtc_ops_noirq = { - .read_time = armada38x_rtc_read_time, - .set_time = armada38x_rtc_set_time, - .read_alarm = armada38x_rtc_read_alarm, - .read_offset = armada38x_rtc_read_offset, - .set_offset = armada38x_rtc_set_offset, -}; - static const struct armada38x_rtc_data armada38x_data = { .update_mbus_timing = rtc_update_38x_mbus_timing_params, .read_rtc_reg = read_rtc_register_38x_wa, @@ -540,20 +532,15 @@ static __init int armada38x_rtc_probe(struct platform_device *pdev) } platform_set_drvdata(pdev, rtc); - if (rtc->irq != -1) { + if (rtc->irq != -1) device_init_wakeup(&pdev->dev, 1); - rtc->rtc_dev->ops = &armada38x_rtc_ops; - } else { - /* - * If there is no interrupt available then we can't - * use the alarm - */ - rtc->rtc_dev->ops = &armada38x_rtc_ops_noirq; - } + else + clear_bit(RTC_FEATURE_ALARM, rtc->rtc_dev->features); /* Update RTC-MBUS bridge timing parameters */ rtc->data->update_mbus_timing(rtc); + rtc->rtc_dev->ops = &armada38x_rtc_ops; rtc->rtc_dev->range_max = U32_MAX; return devm_rtc_register_device(rtc->rtc_dev);