From patchwork Tue Jun 20 09:35:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105964 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1276252qgd; Tue, 20 Jun 2017 02:42:25 -0700 (PDT) X-Received: by 10.99.97.5 with SMTP id v5mr27403925pgb.77.1497951745346; Tue, 20 Jun 2017 02:42:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951745; cv=none; d=google.com; s=arc-20160816; b=Iw4Ad+1hduYv1nz+SOvDEWPeTs3rEaliYLiHVhknLOBfzqJNiif3Y6J1tSSIne4ybn NOjmqMF+YetxfWpV95E+T38fwvhXX48KNZCMsod2GYqhL2vcOUafg3+ZO3y/4/wLQxLS F4ALat5iR+dw46hbOwegcChDO2c9d2ExqjNmeBflPFQSJjx27xvXIAZjwGZZhCVQ6Hib T6tQNgavYX5Ty8x6n8kuxv2NlmCUsGZQ7SRCa5wEsuCFuVjMd1AfvoS0YcYQuckWjkPZ xIUyjEZZ1S7UpqG/3lpVuycfalPaTT1YdDmUCS1munGKoCnpvwLwoc3G90W3kcZmPqoK iIxw== 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=eJN3s8DB8hXLKoAccDvkfDznoSYrTCD5emV7ERQs4Insb9rl79Iw3vEQ5kFzWaT93N WjHWS53cqUOGZPcsLjtiM1hHqvJ9weol3tsWNdxpMdhSvLWyp34/IVDqW1R2sdRCpv+f v3uliMXRR/wsj0CMXSLcbHSB7IkJWLVg/w3kNR0eOkbVYv3imXmQGbC5JY6VeuePczIk t3/UNibXa3I11os6zIqMa/F8I2+V2F7Ik1RQDUHdAydfRHUXpkojC8hoY0fwhHFBVwHC o7vjVmsHZR8zRno825edCwjS/cQMcQu3RN4sVaPvJ2BZRYd8yOYG2WJZsaKU7i1WgFeu /HIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=DPv2Rlhi; 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 j62si4587595pfc.194.2017.06.20.02.42.25; Tue, 20 Jun 2017 02:42:25 -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=DPv2Rlhi; 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 S1753082AbdFTJib (ORCPT + 25 others); Tue, 20 Jun 2017 05:38:31 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:36110 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753039AbdFTJiZ (ORCPT ); Tue, 20 Jun 2017 05:38:25 -0400 Received: by mail-wm0-f54.google.com with SMTP id m125so16116846wmm.1 for ; Tue, 20 Jun 2017 02:38:25 -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=DPv2RlhigTbbiz7wEg9omGHZv7sHdsEK7I8PTI3gJLJ7LuKNpIXptcEoY3BCJYsPIr qMfnW0Jd08P5RHEVi2XF/HGDxs59F3BgFyyBrlMpifyr0+aKTAaRGn2v3W83nXg0YeV8 nAPDla4esx4vjI171WL5vhGHzwct2MdxEjNkU= 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=N/hplNrnXiReNqLh/d7+S0J662WBqEY1Q2S9GvpA6Ggj9sFbRwtrghKWCLkiSEGtSm 6eIrxjY6gnJW6zy1iRPDmYyL1+36aoE64ODU7sEea1L21eOYJH0mbx1ry9jjSoZKqMhF jb6Mc1ZF+PdFMdQRoNrDyk85lZtw40v2QI9Hd8+IzdN8ptrDylXgj+7e1tQEuYpzuvJr VyRGHbljwfMZ14TlI6kxDxWY/g8hNMMq8wqk4k4e4PE1AFzQiT8aBL0Q6T/z2mbmcrRr 6V75+CoRTSAoXfEIhgBx90DWqTYa9u2GrfeujaOW3Z/b+BCB5jvzc9BcojY8VyDI2+QU ZGZQ== X-Gm-Message-State: AKS2vOzmmshiaurZoZNAY/kMSbFAMjPA4smq3l5He7QicHuhttxhu+L3 pn0MsmhYyri72Xhi X-Received: by 10.28.19.206 with SMTP id 197mr2210629wmt.70.1497951504512; Tue, 20 Jun 2017 02:38:24 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.38.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38:24 -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 40/51] rtc: snvs: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:48 +0200 Message-Id: <1497951359-13334-41-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: 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);