Message ID | 1497951359-13334-27-git-send-email-benjamin.gaignard@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1278284qgd; Tue, 20 Jun 2017 02:48:54 -0700 (PDT) X-Received: by 10.84.128.68 with SMTP id 62mr35005429pla.184.1497952134098; Tue, 20 Jun 2017 02:48:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952134; cv=none; d=google.com; s=arc-20160816; b=l+RfhpJS41vw2Ousz4+GHcyRLekXeZ+vvDFhthVShBaGv9JqqNVL+TdCZATlZJFRlX xsQmYadtuPejUwr53tmfVLxgWQ+5E0DgkrcQj5biJKSzWrO0JiK1FvvN1MpRq3WJkfUg +mFRWJj97b23DWv62wwqhI5ZqX4KBENXgTr6b81C8NW9zrxh/w9FFS4YXSiXPW98x3tT WnkFXKSVwro5/1dr/I9b85alXreCk/Jb0AGMgHvRBEaudLT6tVuZCxUcI2dj6lr5MX4Q wSKLL1AR2h3Zuy0d9C9eoMDj7B05QH/vBO1C+lo8MXVkZG033raFEoI07v4G6Q6m8bLi LVlw== 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=3PYykTE2yZSoBGAA9xsOg7AqClvTXcP6I6le/qM9kKc=; b=s63bIRy6lj9Kzo8ummzlk7x6R2Trf0Okc3ddqxjR10YMCkz2QhsH1/FKSPUTQF79HF nAmmbz9GhDr2RFws9slfjLnS9FsiNABuBzs54sFbDLni2iZwr2xDzXYkRRtQTz2e3aaI A4TYAzJPJntNqenHX+7D286ED2t/tO43fC2HOfPg6PEHdoW3lnkUizbDUkSxFklh/aCM 39bXunYqJa5PJhCvLDalgI7Ecau/XKt+tBaoLkZQDauP2ss++7TC6TYkC/RdEVnqAx2A mf3N3wE8hC1j3cHNjObTwz4ZkYNfzZ70bg8kcZQiJLnXKAo3eqfkqIKPARsLYOCIdYGx kyLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=YLR3W/7e; 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: <linux-kernel-owner@vger.kernel.org> Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z29si9644962pfg.345.2017.06.20.02.48.53; Tue, 20 Jun 2017 02:48: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; dkim=pass header.i=@linaro.org header.b=YLR3W/7e; 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 S1753072AbdFTJst (ORCPT <rfc822;georgi.djakov@linaro.org> + 25 others); Tue, 20 Jun 2017 05:48:49 -0400 Received: from mail-wm0-f52.google.com ([74.125.82.52]:38763 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752900AbdFTJiE (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 20 Jun 2017 05:38:04 -0400 Received: by mail-wm0-f52.google.com with SMTP id u195so14573107wmd.1 for <linux-kernel@vger.kernel.org>; Tue, 20 Jun 2017 02:38:04 -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=3PYykTE2yZSoBGAA9xsOg7AqClvTXcP6I6le/qM9kKc=; b=YLR3W/7eoAcee1znh2WEacExSu0T2v0U5VM4tCjWBmu2MEeMR9Cf2WNAG8PEcJINo2 CVsaXV/4WI0/xFQMnpNzqMpfJLe5kQRqcIyycT3mM2TiCJj+TBbTt7BZz+0uQbDwwBSZ kiOR/6Qnn8YcT+rN0srE19g5hK161EBAQwHEc= 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=3PYykTE2yZSoBGAA9xsOg7AqClvTXcP6I6le/qM9kKc=; b=Depcv4OA7hG2Pg/dnpoQTPna9yvbV+NYvxerQKXlvMFd+O+cR4SOH+cAUmJfJ++6B2 t0WG6Uk+FkMJY+9BV49zFgHaHcltlxl5JN1uzklXs2aMAIL4e1rBQ75z2WN+yBwd2hV6 /nuKBUDWj2NMDnYoTQmSv5iHpD3XzN2xmJZeKTDVq/YMkRy1y4rCuv9VkOyWX7Nyo9KW tjPnlLRiiFh2MUiYNKlSQ3tSmUa597Z9+EfR7Ac9v4wrpfI9gPsjMF/jUw2DG/kmZhAe gwaP+iFmzETeiqBk33sh6eyQQk+9AKkIbOXoEnKQJQ1nzvANe3rzFlxIuy/7+9DwN27w ICPg== X-Gm-Message-State: AKS2vOyskA9kuOhf77Y2tkZDM/uHNXi1QT7W3ofkv9jVDHWqtC9sYB1J bu7ZwYba60lTXWUV X-Received: by 10.28.22.4 with SMTP id 4mr2047185wmw.68.1497951478229; Tue, 20 Jun 2017 02:37:58 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:57 -0700 (PDT) From: Benjamin Gaignard <benjamin.gaignard@linaro.org> To: benjamin.gaignard@linaro.org Cc: linaro-kernel@lists.linaro.org, Hans Ulli Kroll <ulli.kroll@googlemail.com>, Alessandro Zummo <a.zummo@towertech.it>, Alexandre Belloni <alexandre.belloni@free-electrons.com>, rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 26/51] rtc: gemini: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:34 +0200 Message-Id: <1497951359-13334-27-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org |
Series |
rtc: stop using rtc deprecated functions
|
expand
|
diff --git a/drivers/rtc/rtc-gemini.c b/drivers/rtc/rtc-gemini.c index 5279390..222f144 100644 --- a/drivers/rtc/rtc-gemini.c +++ b/drivers/rtc/rtc-gemini.c @@ -71,7 +71,7 @@ static int gemini_rtc_read_time(struct device *dev, struct rtc_time *tm) struct gemini_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 + GEMINI_RTC_SECOND); min = readl(rtc->rtc_base + GEMINI_RTC_MINUTE); @@ -81,7 +81,7 @@ static int gemini_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; } @@ -90,12 +90,12 @@ static int gemini_rtc_set_time(struct device *dev, struct rtc_time *tm) { struct gemini_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 + GEMINI_RTC_SECOND); min = readl(rtc->rtc_base + GEMINI_RTC_MINUTE);
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 <benjamin.gaignard@linaro.org> CC: Hans Ulli Kroll <ulli.kroll@googlemail.com> CC: Alessandro Zummo <a.zummo@towertech.it> CC: Alexandre Belloni <alexandre.belloni@free-electrons.com> CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org CC: linux-arm-kernel@lists.infradead.org --- drivers/rtc/rtc-gemini.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 1.9.1