Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp411079img; Fri, 22 Mar 2019 00:18:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwgzlX7ZQPWbEOllBD7Y5prbiZ5kgvFp64XqxdK+jLi1CnBCXRrBv3cVuJmdGSdy3SGGAkp X-Received: by 2002:a65:628f:: with SMTP id f15mr7574539pgv.410.1553239134254; Fri, 22 Mar 2019 00:18:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553239134; cv=none; d=google.com; s=arc-20160816; b=Set5kn3lf2ZuIZ8UyZ8Fpo8en1ZnqC96FQhf0RiWMn9WXUkJMJ2qfnPvk7wpN5p9l7 fJeZCUhJmXpE1pI5Ksm+LzGBZ3i9UkF+9zah/45Tz9qX9k6Bg75W+zrTa8lw6iRYNgz3 u9CnMemGVeYemAxFxSxaYxTjpVWh7P03pw3NXpvT5A2q8aYlfIS7HwT3e3isidB70g89 Ps958aM2w6WNl8Q6uE4cLa9XfB+6I3DL08Er1QLjxOsq4bhJlVzYcAhivhMmI/LCJydH d7exgYn8XW5NLOVIY4ApWnFsrb0K1OgesnP1jCDKWb1pWekJ5MO83T+UK25cMInDCmDN ABSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=smm/VLhHLromHbNPh+yo9F28wjToDnvnoz4U32/j8tY=; b=Cj8SHdPvfxHoah11Ft7E0Mhx89Tu3srVKTDslGzwU7BBuKEaZkk4h52OuTjPTn0n7M 06C/w69jKxyuxcJPH4JjjEQpTv8eprT9Z6d6joe4S3/6k3yvHS5Ffb0wfzElHo5oMfZ7 J67hpOu0I/JJsrBtC8bTM3BWSNov0Sc/vjH7GhXpi9GFN0Otht5at+aUUCx4Cts21d0M 5vHXsn/s5Li4AF3qNLPXat8BGtWtuiysCUcaWjuh9bIZf2Z39cuiTu2H78ZaIvucpvfz W+KduqZ7d5VTvJqJ/Zi7WlYJYoNtUFyQ5e/oakm46TxbAJk9h+F3oPusHgp0Wrlz4VDW fKOg== 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 97si6618726plb.407.2019.03.22.00.18.38; Fri, 22 Mar 2019 00:18:54 -0700 (PDT) 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 S1727927AbfCVHQb (ORCPT + 99 others); Fri, 22 Mar 2019 03:16:31 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:41729 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727574AbfCVHQb (ORCPT ); Fri, 22 Mar 2019 03:16:31 -0400 X-Originating-IP: 182.72.246.220 Received: from localhost (unknown [182.72.246.220]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 15F3760007; Fri, 22 Mar 2019 07:16:27 +0000 (UTC) From: Alexandre Belloni To: linux-rtc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, patches@opensource.cirrus.com, Alexandre Belloni Subject: [PATCH 3/4] rtc: wm831x: switch to rtc_time64_to_tm/rtc_tm_to_time64 Date: Fri, 22 Mar 2019 08:16:10 +0100 Message-Id: <20190322071611.16407-3-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190322071611.16407-1-alexandre.belloni@bootlin.com> References: <20190322071611.16407-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Call the 64bit versions of rtc_tm time conversion now that the range is enforced by the core. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-wm831x.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/rtc/rtc-wm831x.c b/drivers/rtc/rtc-wm831x.c index 1b0c3b3f63e8..d286dd1dfcf9 100644 --- a/drivers/rtc/rtc-wm831x.c +++ b/drivers/rtc/rtc-wm831x.c @@ -155,7 +155,7 @@ static int wm831x_rtc_readtime(struct device *dev, struct rtc_time *tm) if (memcmp(time1, time2, sizeof(time1)) == 0) { u32 time = (time1[0] << 16) | time1[1]; - rtc_time_to_tm(time, tm); + rtc_time64_to_tm(time, tm); return 0; } @@ -215,11 +215,7 @@ static int wm831x_rtc_set_mmss(struct device *dev, unsigned long time) if (ret < 0) return ret; - ret = rtc_tm_to_time(&new_tm, &new_time); - if (ret < 0) { - dev_err(dev, "Failed to convert time: %d\n", ret); - return ret; - } + new_time = rtc_tm_to_time64(&new_tm); /* Allow a second of change in case of tick */ if (new_time - time > 1) { @@ -249,7 +245,7 @@ static int wm831x_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm) time = (data[0] << 16) | data[1]; - rtc_time_to_tm(time, &alrm->time); + rtc_time64_to_tm(time, &alrm->time); ret = wm831x_reg_read(wm831x_rtc->wm831x, WM831X_RTC_CONTROL); if (ret < 0) { @@ -288,11 +284,7 @@ static int wm831x_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) int ret; unsigned long time; - ret = rtc_tm_to_time(&alrm->time, &time); - if (ret < 0) { - dev_err(dev, "Failed to convert time: %d\n", ret); - return ret; - } + time = rtc_tm_to_time64(&alrm->time); ret = wm831x_rtc_stop_alarm(wm831x_rtc); if (ret < 0) { -- 2.20.1