From patchwork Tue Jun 5 21:09:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 925638 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-rtc-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bootlin.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 410l5k57Rtz9s08 for ; Wed, 6 Jun 2018 07:18:18 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752635AbeFEVR4 (ORCPT ); Tue, 5 Jun 2018 17:17:56 -0400 Received: from mail.bootlin.com ([62.4.15.54]:58381 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752034AbeFEVRy (ORCPT ); Tue, 5 Jun 2018 17:17:54 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id A6785207CA; Tue, 5 Jun 2018 23:09:17 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (unknown [88.191.26.124]) by mail.bootlin.com (Postfix) with ESMTPSA id 7F1682055A; Tue, 5 Jun 2018 23:09:17 +0200 (CEST) From: Alexandre Belloni To: linux-rtc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Alexandre Belloni Subject: [PATCH 2/3] rtc: test: remove alarm support from the first device Date: Tue, 5 Jun 2018 23:09:13 +0200 Message-Id: <20180605210914.8054-2-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180605210914.8054-1-alexandre.belloni@bootlin.com> References: <20180605210914.8054-1-alexandre.belloni@bootlin.com> Sender: linux-rtc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rtc@vger.kernel.org To test for issues with RTCs that don't provide an alarm, remove alarm support from the first test RTC device. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-test.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c index 6a6bc1f2a14d..9b7ef6f63251 100644 --- a/drivers/rtc/rtc-test.c +++ b/drivers/rtc/rtc-test.c @@ -95,6 +95,12 @@ static int test_rtc_alarm_irq_enable(struct device *dev, unsigned int enable) return 0; } +static const struct rtc_class_ops test_rtc_ops_noalm = { + .read_time = test_rtc_read_time, + .set_mmss64 = test_rtc_set_mmss64, + .alarm_irq_enable = test_rtc_alarm_irq_enable, +}; + static const struct rtc_class_ops test_rtc_ops = { .read_time = test_rtc_read_time, .read_alarm = test_rtc_read_alarm, @@ -124,7 +130,13 @@ static int test_probe(struct platform_device *plat_dev) if (IS_ERR(rtd->rtc)) return PTR_ERR(rtd->rtc); - rtd->rtc->ops = &test_rtc_ops; + switch (plat_dev->id) { + case 0: + rtd->rtc->ops = &test_rtc_ops_noalm; + break; + default: + rtd->rtc->ops = &test_rtc_ops; + } timer_setup(&rtd->alarm, test_rtc_alarm_handler, 0); rtd->alarm.expires = 0;