From patchwork Fri Mar 6 07:35:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 1250092 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) 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 48YfYc1nJ7z9sPK for ; Fri, 6 Mar 2020 18:36:04 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725927AbgCFHgA (ORCPT ); Fri, 6 Mar 2020 02:36:00 -0500 Received: from relay10.mail.gandi.net ([217.70.178.230]:51451 "EHLO relay10.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725869AbgCFHf4 (ORCPT ); Fri, 6 Mar 2020 02:35:56 -0500 Received: from localhost (lfbn-lyo-1-9-35.w86-202.abo.wanadoo.fr [86.202.105.35]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay10.mail.gandi.net (Postfix) with ESMTPSA id D6CE3240003; Fri, 6 Mar 2020 07:35:54 +0000 (UTC) From: Alexandre Belloni To: Support Opensource , Alessandro Zummo , Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] rtc: da9052: switch to rtc_time64_to_tm/rtc_tm_to_time64 Date: Fri, 6 Mar 2020 08:35:47 +0100 Message-Id: <20200306073548.57579-3-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200306073548.57579-1-alexandre.belloni@bootlin.com> References: <20200306073548.57579-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 X-Spam-Flag: yes X-Spam-Level: ************************** X-GND-Spam-Score: 400 X-GND-Status: SPAM Sender: linux-rtc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rtc@vger.kernel.org Call the 64bit versions of rtc_tm time conversion. Signed-off-by: Alexandre Belloni Acked-by: Adam Thomson --- drivers/rtc/rtc-da9052.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/rtc/rtc-da9052.c b/drivers/rtc/rtc-da9052.c index 27cde834a1b8..1c567f86ee30 100644 --- a/drivers/rtc/rtc-da9052.c +++ b/drivers/rtc/rtc-da9052.c @@ -103,13 +103,11 @@ static int da9052_set_alarm(struct da9052_rtc *rtc, struct rtc_time *rtc_tm) int ret; uint8_t v[3]; - ret = rtc_tm_to_time(rtc_tm, &alm_time); - if (ret != 0) - return ret; + alm_time = rtc_tm_to_time64(rtc_tm); if (rtc_tm->tm_sec > 0) { alm_time += 60 - rtc_tm->tm_sec; - rtc_time_to_tm(alm_time, rtc_tm); + rtc_time64_to_tm(alm_time, rtc_tm); } BUG_ON(rtc_tm->tm_sec); /* it will cause repeated irqs if not zero */