Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp5840220pxb; Sun, 7 Nov 2021 21:48:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJyWYWXMkRi/NckkTdI2YViB1F2TyTjD3HYOgvMV4ky3xa9aWad1jQCii158kVCuFjMXjHrD X-Received: by 2002:a17:906:3745:: with SMTP id e5mr94193440ejc.400.1636350487206; Sun, 07 Nov 2021 21:48:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636350487; cv=none; d=google.com; s=arc-20160816; b=nYT7Zb6Aaaeq9/5Qv9wQuZYTF19+Gpna9BI5PEPku8aTGsQz6g7gMJPsO0CeJCqus8 0XU96VMydyF4UqqooKo2y+EybuJJxgV7WwBuN9KEdhucS92BZRFkUx5toyvczqVMVlm2 +9n8YZT1q59YmrJyz5LKpVZH4qChvgUeB0s1K2QJ8no3YiTf24wzwTiqySJJBIMmGSxn 2P+XHP3jvkwz24bthVta/AyXvKQY00YUYS5c3pisVEfdhymXDFStya7yY9fjtHly/2xI nTb3JJl7LJAHOs8/fOeQOjGaJqnfQwe9TRmilLNetpgDi6nAHL5Kg0hCZg+vssrXOole LMJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=G0h+syk1+A/7NeyPHmDFF9vX0GLdkPArrsyzGOKBe5o=; b=acdM46KKhkpOy3Y31y+niRy3L4NeL7xaCHlq4BqTB2ejdSZpg+sBULOdh9kcvkVe/F x2xcHJuKnUGJFSGAp99YiKH2ZndyXlC3yiF/gulOarc65Ea+wN4jCkW5/gKz742DCUFj l3WvIZQl7sZx8/+YunmEwZE3a0n6onJS1KzauvFnLy5JkV/K7io31zANTcM9JVKLUggo oOW222PMoT7zj4Un65VAynQFVwYLj0jRHIo0gK5TuZ1L2F8NomFx5ZmgyVUhunBLhfT1 csa12flXEEdhCvUvidG0mjVNHVi+78g1j9cXx6+NbIAdGg/Ew5tonnVqmP0hv7yMVs9s XGAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h5si25955698edf.265.2021.11.07.21.47.23; Sun, 07 Nov 2021 21:48:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236811AbhKGW6C (ORCPT + 99 others); Sun, 7 Nov 2021 17:58:02 -0500 Received: from relay11.mail.gandi.net ([217.70.178.231]:59471 "EHLO relay11.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236734AbhKGW5x (ORCPT ); Sun, 7 Nov 2021 17:57:53 -0500 Received: (Authenticated sender: alexandre.belloni@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 3D43D100005; Sun, 7 Nov 2021 22:55:09 +0000 (UTC) From: Alexandre Belloni To: Alessandro Zummo , Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 09/12] rtc: rx8025: set range Date: Sun, 7 Nov 2021 23:54:54 +0100 Message-Id: <20211107225458.111068-9-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211107225458.111068-1-alexandre.belloni@bootlin.com> References: <20211107225458.111068-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Set the RTC range, it is a classic BCD RTC, with 00 being a leap year. Let the core handle range checking. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-rx8025.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/rtc/rtc-rx8025.c b/drivers/rtc/rtc-rx8025.c index 6941e0518290..6002305efa2d 100644 --- a/drivers/rtc/rtc-rx8025.c +++ b/drivers/rtc/rtc-rx8025.c @@ -248,9 +248,6 @@ static int rx8025_set_time(struct device *dev, struct rtc_time *dt) u8 date[7]; int ret; - if ((dt->tm_year < 100) || (dt->tm_year > 199)) - return -EINVAL; - /* * Here the read-only bits are written as "0". I'm not sure if that * is sound. @@ -553,6 +550,8 @@ static int rx8025_probe(struct i2c_client *client, return PTR_ERR(rx8025->rtc); rx8025->rtc->ops = &rx8025_rtc_ops; + rx8025->rtc->range_min = RTC_TIMESTAMP_BEGIN_1900; + rx8025->rtc->range_max = RTC_TIMESTAMP_END_2099; if (client->irq > 0) { dev_info(&client->dev, "IRQ %d supplied\n", client->irq); -- 2.31.1