From patchwork Tue Jun 20 09:35:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105961 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1275858qgd; Tue, 20 Jun 2017 02:41:08 -0700 (PDT) X-Received: by 10.98.10.2 with SMTP id s2mr29462426pfi.121.1497951668841; Tue, 20 Jun 2017 02:41:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951668; cv=none; d=google.com; s=arc-20160816; b=OPQG0UhksMw/JKRP4BhJwbu/669uiPyPTNU8yrfmWyvxbfqsqexfsTCLN/Iedhwf5+ S9EOfSu+qFamc1uChAeTFq1yUaf//6dEe2beJGjH4U0Q4XoLgA29o9pCMsKecEzFBip4 Ol7DPkoipJeVNZGCQ89oOLTuww86R9/hH6xOQsx7291LTB6qJbaucn8yW9bhA+SJE4zs ROuxcU2gFq2iACMcDcHJS6UYy847U/Lv4qq3YaSaOY1YDUwNTdrSqBIj0cVkZEX7VAAS PwyaLZTWR904rweRyj/khbXFsIUpfJCdqUtyZBrML0exgUyjjzh/1nOjkOyXLgr/6D7Q ssyA== 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=qZW2G+fipSS25rq3gUwa4EK0OIZISlbbiERdCWYVhq8=; b=TU6Zaup3bFwQL3rzZpNMFXL1Mo9K90C4pPGjXWYUtGAcNGl4UEart2n3P2N+2hjTDY P4CGKkpTwfV3v4iQN4ULOEIQDo5ixBcu0Min/b2/Pbvw6HjAUKUmOQSiWlAuTcoH/6uM lZ+YT6fHpodUAYnqVHKFI+CYY6p91aGlMZjFVUspYXe7LQ9FHqIdmXNTo38Q+DujWfzU ylp2IwlthNXHKAVbXT1ftSSAhRS6ZTP5Erg1F6DLbGNjnAXQprRF3yZDNHQh+t6YCFVr QnTEBL3HR0/u7VN27bnhc4liZERz5mHoRDtPzxyTxMW6loFW5JolSJCcCO6U1fUXPA69 SXzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=aAUIKD1V; 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 e3si759071pgn.367.2017.06.20.02.41.08; Tue, 20 Jun 2017 02:41:08 -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=aAUIKD1V; 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 S1753116AbdFTJlE (ORCPT + 25 others); Tue, 20 Jun 2017 05:41:04 -0400 Received: from mail-wr0-f176.google.com ([209.85.128.176]:34378 "EHLO mail-wr0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753113AbdFTJij (ORCPT ); Tue, 20 Jun 2017 05:38:39 -0400 Received: by mail-wr0-f176.google.com with SMTP id 77so88384879wrb.1 for ; Tue, 20 Jun 2017 02:38:34 -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=qZW2G+fipSS25rq3gUwa4EK0OIZISlbbiERdCWYVhq8=; b=aAUIKD1VNOV1rE2xodCZ2LLbV2vFNRST9z6ri0GlKTvUB3aos9ooIFWSS/1SqwIvYq 5BuSxMg1xnpb1Tzz7mAFZzIH90X0yG32GWqbdsGnQ61GhgIDxsa+kx5zJpjAuuCrVy5b 4isyN6pLzfBruWWecJZTyctVU5ySBCEVuSBjw= 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=qZW2G+fipSS25rq3gUwa4EK0OIZISlbbiERdCWYVhq8=; b=Ycw3DKFoS2jl/f5cCsBBno69fSqJqFDIwWSmw7w9Ro9iTxTg14hrTdKfiBURMvBHvq oRsEQSLYVTui9EDL+1vfQnBCV/tstZA377GvP8vua25BoPRGeUvjzmGqk67387oOLX/8 UqcOG6J7xkpYuRqt5JLznTLNMHsex2fea6/1tfTKuRAzHdNt2pKezQBBxiphuy6G+2C1 cGVuVC1waRyTvFuOsdLeVXOrNey3mD5L+j27cyIeNzzw7xh4jv+SulPjce58GilX+upq ZUztufsaUyil4xxvhGfAj//yw6EhutNo4193SCSyeO9csAvGnt56JEigM+KWBnOXJP6J 4iiw== X-Gm-Message-State: AKS2vOz+7/bOPEoNZ2jMpVdE2q6zxVogaD5f9qBjKE04rZ7+2hEWOUPS rhP+KxK6VJo9/ijr X-Received: by 10.223.176.164 with SMTP id i33mr18068408wra.165.1497951513283; Tue, 20 Jun 2017 02:38:33 -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.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38:32 -0700 (PDT) From: Benjamin Gaignard To: benjamin.gaignard@linaro.org Cc: linaro-kernel@lists.linaro.org, Thierry Reding , Jonathan Hunter , Alessandro Zummo , Alexandre Belloni , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH 45/51] rtc: tegra stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:53 +0200 Message-Id: <1497951359-13334-46-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: Thierry Reding CC: Jonathan Hunter CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org CC: linux-tegra@vger.kernel.org --- drivers/rtc/rtc-tegra.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-tegra.c b/drivers/rtc/rtc-tegra.c index d30d57b..a429884 100644 --- a/drivers/rtc/rtc-tegra.c +++ b/drivers/rtc/rtc-tegra.c @@ -110,7 +110,7 @@ static int tegra_rtc_wait_while_busy(struct device *dev) static int tegra_rtc_read_time(struct device *dev, struct rtc_time *tm) { struct tegra_rtc_info *info = dev_get_drvdata(dev); - unsigned long sec, msec; + unsigned long long sec, msec; unsigned long sl_irq_flags; /* RTC hardware copies seconds to shadow seconds when a read @@ -122,9 +122,9 @@ static int tegra_rtc_read_time(struct device *dev, struct rtc_time *tm) spin_unlock_irqrestore(&info->tegra_rtc_lock, sl_irq_flags); - rtc_time_to_tm(sec, tm); + rtc_time64_to_tm(sec, tm); - dev_vdbg(dev, "time read as %lu. %d/%d/%d %d:%02u:%02u\n", + dev_vdbg(dev, "time read as %llu. %d/%d/%d %d:%02u:%02u\n", sec, tm->tm_mon + 1, tm->tm_mday, @@ -140,7 +140,7 @@ static int tegra_rtc_read_time(struct device *dev, struct rtc_time *tm) static int tegra_rtc_set_time(struct device *dev, struct rtc_time *tm) { struct tegra_rtc_info *info = dev_get_drvdata(dev); - unsigned long sec; + unsigned long long sec; int ret; /* convert tm to seconds. */ @@ -148,9 +148,9 @@ static int tegra_rtc_set_time(struct device *dev, struct rtc_time *tm) if (ret) return ret; - rtc_tm_to_time(tm, &sec); + sec = rtc_tm_to_time64(tm); - dev_vdbg(dev, "time set to %lu. %d/%d/%d %d:%02u:%02u\n", + dev_vdbg(dev, "time set to %llu. %d/%d/%d %d:%02u:%02u\n", sec, tm->tm_mon+1, tm->tm_mday, @@ -174,7 +174,7 @@ static int tegra_rtc_set_time(struct device *dev, struct rtc_time *tm) static int tegra_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) { struct tegra_rtc_info *info = dev_get_drvdata(dev); - unsigned long sec; + unsigned long long sec; unsigned tmp; sec = readl(info->rtc_base + TEGRA_RTC_REG_SECONDS_ALARM0); @@ -185,7 +185,7 @@ static int tegra_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) } else { /* alarm is enabled. */ alarm->enabled = 1; - rtc_time_to_tm(sec, &alarm->time); + rtc_time64_to_tm(sec, &alarm->time); } tmp = readl(info->rtc_base + TEGRA_RTC_REG_INTR_STATUS); @@ -220,10 +220,10 @@ static int tegra_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) static int tegra_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) { struct tegra_rtc_info *info = dev_get_drvdata(dev); - unsigned long sec; + unsigned long long sec; if (alarm->enabled) - rtc_tm_to_time(&alarm->time, &sec); + sec = rtc_tm_to_time64(&alarm->time); else sec = 0; @@ -236,7 +236,7 @@ static int tegra_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) if (sec) { tegra_rtc_alarm_irq_enable(dev, 1); - dev_vdbg(dev, "alarm set as %lu. %d/%d/%d %d:%02u:%02u\n", + dev_vdbg(dev, "alarm set as %llu. %d/%d/%d %d:%02u:%02u\n", sec, alarm->time.tm_mon+1, alarm->time.tm_mday,