From patchwork Wed Jul 12 08:04:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 107461 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp604476obm; Wed, 12 Jul 2017 01:09:38 -0700 (PDT) X-Received: by 10.99.140.7 with SMTP id m7mr2638768pgd.49.1499846978313; Wed, 12 Jul 2017 01:09:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499846978; cv=none; d=google.com; s=arc-20160816; b=Ycc4JZ3bd9ARELAF2GjgkudliVTupc9D9y0evrRnT08MA8Fpz0+MeKyNAJHzsPn9rN sdNywCGwnlPzx4SsKghiSH3uDqK3Qh7P9ZQ0tlNOKTEm9vh4iPhWxCN4+Zn8LBLwvveD EtEiR9Rj+87+hgUqE6BXWYyWBVi0sFKjkV8MCvsA9dsIRSsTaDxpIb9fEjwxIl6Nh0at qOaDCvsHajMclNzjbSwxkwbMIjOFCzMPMDKzyPDd26Qw8VX89MjeLa1D8n+Gp0pxpXjD EbJWPZsskfqMioYw9/RnMopXgzoOQlb1rIiuSM6dycHL9t3QhtwKkjzps67yRsynDWEH 6N1Q== 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=aBh/3iKDfE3lB5q51PrewX5zCw8dBpIQ6MbdXIEf5kg=; b=TRvL0nydfHtq+6V1JXzumHJoZHy1W59VMNDwcVlmzPQRaGK8+9uslekcyXRCxGo4Sa u1d4GKmaDChinMcSKbq6TlGive5r3Vs9fdNtdC8mheloUXpwnbeqF37pAd8dmed+kDck 3r+4lyzy81ZRJjndzVIjnMGMstVkNNbw460sKq4QWtSwe9UgOTBenr6ej510C8/OHCS/ 6uBDCK7GyvfwL8XYht8wJbXOu3FJOflHnOl+aYIvMZhcPqidn//wsgXkEMkz+frViWFE WNVX7RUlDCHDbtL4pM9hL/CTXZwBinVWsBdkDShwvbKZrHaI8h06H5bBIeQ8pH4aCKCf Lz1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=YzLjX0DI; 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 p15si1422755pli.605.2017.07.12.01.09.37; Wed, 12 Jul 2017 01:09:38 -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=YzLjX0DI; 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 S933700AbdGLIJ3 (ORCPT + 25 others); Wed, 12 Jul 2017 04:09:29 -0400 Received: from mail-wr0-f180.google.com ([209.85.128.180]:36787 "EHLO mail-wr0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756967AbdGLIFs (ORCPT ); Wed, 12 Jul 2017 04:05:48 -0400 Received: by mail-wr0-f180.google.com with SMTP id c11so22381372wrc.3 for ; Wed, 12 Jul 2017 01:05:43 -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=aBh/3iKDfE3lB5q51PrewX5zCw8dBpIQ6MbdXIEf5kg=; b=YzLjX0DIRKb6pQT3YhK4KtEfGVTZuqELzo8j+13jHgiNEs26Ldv9qnHzRvgF2w55BB pAYbaEeFMYt2LL7hEZr6mH8NOI1hd4/K7fTcS7YeqYvtcH5KMocBQQIj8O+txxjBZBXU SBWewNg5G+2cj3Wq4j/nqZANJuq/Di0Hfz334= 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=aBh/3iKDfE3lB5q51PrewX5zCw8dBpIQ6MbdXIEf5kg=; b=XML4RHO3VerjzEWOzQ0NtFFDYQID2v2d7Icb0tsvFteA2m/ZGomDJb7ia+VF7qgFlq eBT+/7DyOshX9XRkhthPH0BKwCMWzrkJy0RBv0nSEIS4lHOCso247lW+H40sI+v99+F+ ZsxntUBQ35643Ah2ltIIcGbxztXCZb4eek3ev2IfVoMSVeMjRkk+L+aROPrHZEPOFbbA I47416785yT/SINJoOq/KiHty7mnIDVclv0CBeYsTZ+oMnLWGQVXrvOZqPmnc/e/IY4C HqhxQvP4ltwrP9jI7uctDtGxqtXjg5zaPxGrRdg+DbzygA5rNsI+8Cqg37XeLi+H7GqQ x02A== X-Gm-Message-State: AIVw1129Y4EOhCHkdlxmnOuiGC1qSxX0cdy5+jaaIKzIRFk+zHv+xyAS VBe+kBFkwDcmhnmk X-Received: by 10.223.173.143 with SMTP id w15mr2168928wrc.113.1499846737279; Wed, 12 Jul 2017 01:05:37 -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.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 01:05:36 -0700 (PDT) From: Benjamin Gaignard To: benjamin.gaignard@linaro.org Cc: linaro-kernel@lists.linaro.org, Alessandro Zummo , Alexandre Belloni , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org Subject: [PATCH v2 17/22] rtc: snvs: stop using rtc deprecated functions Date: Wed, 12 Jul 2017 10:04:37 +0200 Message-Id: <1499846682-14093-18-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: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org --- drivers/rtc/rtc-snvs.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-snvs.c b/drivers/rtc/rtc-snvs.c index d8ef9e0..774048e 100644 --- a/drivers/rtc/rtc-snvs.c +++ b/drivers/rtc/rtc-snvs.c @@ -121,9 +121,9 @@ static int snvs_rtc_enable(struct snvs_rtc_data *data, bool enable) static int snvs_rtc_read_time(struct device *dev, struct rtc_time *tm) { struct snvs_rtc_data *data = dev_get_drvdata(dev); - unsigned long time = rtc_read_lp_counter(data); + unsigned long long time = rtc_read_lp_counter(data); - rtc_time_to_tm(time, tm); + rtc_time64_to_tm(time, tm); return 0; } @@ -131,9 +131,9 @@ static int snvs_rtc_read_time(struct device *dev, struct rtc_time *tm) static int snvs_rtc_set_time(struct device *dev, struct rtc_time *tm) { struct snvs_rtc_data *data = dev_get_drvdata(dev); - unsigned long time; + unsigned long long time; - rtc_tm_to_time(tm, &time); + time = rtc_tm_to_time64(tm); /* Disable RTC first */ snvs_rtc_enable(data, false); @@ -154,7 +154,7 @@ static int snvs_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) u32 lptar, lpsr; regmap_read(data->regmap, data->offset + SNVS_LPTAR, &lptar); - rtc_time_to_tm(lptar, &alrm->time); + rtc_time64_to_tm((u64)lptar, &alrm->time); regmap_read(data->regmap, data->offset + SNVS_LPSR, &lpsr); alrm->pending = (lpsr & SNVS_LPSR_LPTA) ? 1 : 0; @@ -179,9 +179,9 @@ static int snvs_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) { struct snvs_rtc_data *data = dev_get_drvdata(dev); struct rtc_time *alrm_tm = &alrm->time; - unsigned long time; + unsigned long long time; - rtc_tm_to_time(alrm_tm, &time); + time = rtc_tm_to_time64(alrm_tm); regmap_update_bits(data->regmap, data->offset + SNVS_LPCR, SNVS_LPCR_LPTA_EN, 0); rtc_write_sync_lp(data);