From patchwork Wed Jul 12 08:04:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 107452 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp601227obm; Wed, 12 Jul 2017 01:05:45 -0700 (PDT) X-Received: by 10.84.216.28 with SMTP id m28mr2707374pli.275.1499846745393; Wed, 12 Jul 2017 01:05:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499846745; cv=none; d=google.com; s=arc-20160816; b=EJ+XmMKbwQ7aTk2Myq5YD6C/BnzaajEkygPyOIU/vxlvU3Gc9IP6iXcS1mnDkAgYXK GK9fHZcSDiVgCxPcQuSgIySYG9yytKnFvdl+IeVGqeTApOZ86WszDq3VKveNIuF97k+T mBUNNpuXk2itQg4Kd09D0abLP+fVCb+MffsY2qCVZmPtJnQTPR2FaJPhcUT/5z1G5aA/ yqVLHGU+LvfDmV5NHaEXD18/NTva/CXXWlXZB2Gal0n/FzM7ngiH13IhdBG235wnta91 PL0iyAs71k0MU7iXbBmCCmy2OQWnd0mwDYIlE6f67m0cW9uo0n7eCYsXGqrWo26CHS0c 2MkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=zXII0zO7QokUmEbsAtI2Xd+ZAzl1PcCW94AR09ahDVw=; b=rNRVLRGHkmKldFfZCmJ9JWAzHrJ3wa1qeHiHT2Z8mOAsJf6p7EqO0rZhI/4BgFV0gg K5dP9dLj2SWAd5iMsd3M4RSy/RDA+JbS1D8Nn4FFdfb5Jw7B0Pg4sLQeQxjBQVPlXGE+ Qeclx1KCFKo5le7oLeSvz0em9MC4hOgM3BCmS/TJLL5z3/rpxR9tGtsl/8vN4Sh7tO3G Rjo6RCdlkmZqXr+4bcWiBkr3UxcmL7z80miDmjTBYBg0KviCeLuoBfhX4aUI3MFiJZBW ohYWQtV3yQ9kJt3Inj8fkJkGd2MfEnrjIamF+CmingcdMrjO+FRvE7Dy2K5dfduif7a3 lHKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=Y1YykQ7d; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y15si1430087pli.569.2017.07.12.01.05.45; Wed, 12 Jul 2017 01:05:45 -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; dkim=pass header.i=@linaro.org header.b=Y1YykQ7d; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757050AbdGLIFc (ORCPT + 25 others); Wed, 12 Jul 2017 04:05:32 -0400 Received: from mail-wr0-f176.google.com ([209.85.128.176]:34325 "EHLO mail-wr0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757033AbdGLIF2 (ORCPT ); Wed, 12 Jul 2017 04:05:28 -0400 Received: by mail-wr0-f176.google.com with SMTP id 77so22546207wrb.1 for ; Wed, 12 Jul 2017 01:05:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zXII0zO7QokUmEbsAtI2Xd+ZAzl1PcCW94AR09ahDVw=; b=Y1YykQ7dNhsp0DeQn/yVlTDeK1puAdwtw97mEAJPNmRzVe9D9EW1Uog0nGs6aBUeAw yJtv4ZQfT5/x6pwBfEm6WVQ0vJhH+o/URW2KMwjamoAylxMwkVO16O8gkpi5jxBQuiF1 umNNuDgI+zqD9vFxVbE579yWJcffKqguCKs8Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zXII0zO7QokUmEbsAtI2Xd+ZAzl1PcCW94AR09ahDVw=; b=E7BEkNkBt01HXlN4Q5n97lUHY3Op/O+ciEmpYLmVWas4telX1U+1LiVMe1840FeQAx qUbsxTd342Sc9oQfh4CMfv6/SLKCIjEbkE02l2Q5Hk4FwVe0YK4FWtjrUc/fvFBqXP1Z PlRyPQ3NHT9ah2RlbuJKQCCTE9ih4N71yJPaVfmB+wNjh9h/YMd6yMMJv7cIsjrF8+wr 1f53zznk7iOjoY0lRhidgaOh/KQZNhd6B7mAl/DUC+MJ9bv505U3I6HDLgY4gP4IqOBj WRLe7WAzvyDHLpMcAXqd1+wlfMci9IiFEfwG7sPavYwL9rledYK0IYs9mmPytgm3sBb4 a+Sw== X-Gm-Message-State: AIVw113T4gtVAXOXuvHtuNEcP5AtgNyATmlK09XAzOTk3TkKk50hgQDv GGs72exbTzlDrVT9 X-Received: by 10.223.151.51 with SMTP id r48mr2012282wrb.189.1499846726713; Wed, 12 Jul 2017 01:05:26 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.158.26]) by smtp.gmail.com with ESMTPSA id p34sm1430744wrc.66.2017.07.12.01.05.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 01:05:26 -0700 (PDT) From: Benjamin Gaignard To: benjamin.gaignard@linaro.org Cc: linaro-kernel@lists.linaro.org, Hans Ulli Kroll , Alessandro Zummo , Alexandre Belloni , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 11/22] rtc: gemini: stop using rtc deprecated functions Date: Wed, 12 Jul 2017 10:04:31 +0200 Message-Id: <1499846682-14093-12-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1499846682-14093-1-git-send-email-benjamin.gaignard@linaro.org> References: <1499846682-14093-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Hans Ulli Kroll CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org CC: linux-arm-kernel@lists.infradead.org --- drivers/rtc/rtc-ftrtc010.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-ftrtc010.c b/drivers/rtc/rtc-ftrtc010.c index af8d6be..6328913 100644 --- a/drivers/rtc/rtc-ftrtc010.c +++ b/drivers/rtc/rtc-ftrtc010.c @@ -74,7 +74,7 @@ static int ftrtc010_rtc_read_time(struct device *dev, struct rtc_time *tm) struct ftrtc010_rtc *rtc = dev_get_drvdata(dev); unsigned int days, hour, min, sec; - unsigned long offset, time; + unsigned long long offset, time; sec = readl(rtc->rtc_base + FTRTC010_RTC_SECOND); min = readl(rtc->rtc_base + FTRTC010_RTC_MINUTE); @@ -84,7 +84,7 @@ static int ftrtc010_rtc_read_time(struct device *dev, struct rtc_time *tm) time = offset + days * 86400 + hour * 3600 + min * 60 + sec; - rtc_time_to_tm(time, tm); + rtc_time64_to_tm(time, tm); return 0; } @@ -93,12 +93,12 @@ static int ftrtc010_rtc_set_time(struct device *dev, struct rtc_time *tm) { struct ftrtc010_rtc *rtc = dev_get_drvdata(dev); unsigned int sec, min, hour, day; - unsigned long offset, time; + unsigned long long offset, time; if (tm->tm_year >= 2148) /* EPOCH Year + 179 */ return -EINVAL; - rtc_tm_to_time(tm, &time); + time = rtc_tm_to_time64(tm); sec = readl(rtc->rtc_base + FTRTC010_RTC_SECOND); min = readl(rtc->rtc_base + FTRTC010_RTC_MINUTE);