From patchwork Tue Jun 20 09:35:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105974 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1277835qgd; Tue, 20 Jun 2017 02:47:27 -0700 (PDT) X-Received: by 10.84.218.198 with SMTP id g6mr11791561plm.132.1497952046982; Tue, 20 Jun 2017 02:47:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952046; cv=none; d=google.com; s=arc-20160816; b=hWnfBTE3gtoUEYN/xZJWh8Z3iFG5MLkdKI3/m61cB+Tmb7A6y3uS+6e1pchNKLu1kw 0eBbgiSJCvhAd9GeJjDr7t0iBDdrLyRspJEYfkilqgTC0YI5dQVQAiIrH9oiBXoD1jJq AmQTK6gwI8+KNxNzGkjAJip96bSxvehbronBgL38Emc6JSe+tOJXhmkAcRJBESpbImac mixLZgY23n/oUaHLltG0e9w57FQcpS3a6yHobdq9SdQiQQh+ejOtY6I22qvYQ+NIcbPn NdhjcrC5g7Oyhu6GaxRlZTDnYxsHBxjxuh1n8TxiOSWlZF+P0eIjeYPn5ufRUkWJd7A4 0pEA== 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=aVdtkvr1WbIchyzFYIP5K0ZUeeaRhJeIb/WPcbmKF2w=; b=fojxxgLjA/GYyKYW71mKlX5XD3YqFzBKHgYK7fjhLRobw7rcvsgxHqAsBBvpqdY2Hy ystg2f0YYcNrA1sm1Vus1AUXzIEiFIGqsPld6p6ImTTskx8Thb30aMAgY/Q8BOcIqy91 5thpRyp3NYgB0IL4XJCKLZyIkZ4m3yrzonLlF1Kj0yIjZErVNbGr+Zn3x3RIGuiQ9LBC qblCchkrYgZnuCZbdeF0rH3v7kuZ9xuSXg2md6yov6LZ6WfyqZ+Jx8v++RDn19f43Q8/ Gql+ibsp4UnX+y9+wl2MByJt8mSRU3g8WkZgyqiGPYiv9L4sIv/OhGazZ7yQmXDcjuGq SfIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=UyyvTJE+; 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 j25si10396091pgn.409.2017.06.20.02.47.26; Tue, 20 Jun 2017 02:47:26 -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=UyyvTJE+; 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 S1752966AbdFTJiP (ORCPT + 25 others); Tue, 20 Jun 2017 05:38:15 -0400 Received: from mail-wm0-f45.google.com ([74.125.82.45]:37003 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751868AbdFTJiM (ORCPT ); Tue, 20 Jun 2017 05:38:12 -0400 Received: by mail-wm0-f45.google.com with SMTP id d73so14633107wma.0 for ; Tue, 20 Jun 2017 02:38:06 -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=aVdtkvr1WbIchyzFYIP5K0ZUeeaRhJeIb/WPcbmKF2w=; b=UyyvTJE+/EGrc1TI4YyMfp+Rsy+UNaY8BUKVqpkJYRj5d4tki3QHlngy9itUTuu1o0 O48UbmddJNG9zpRiHxCgTN85l/w+1tYifshRGCkY7y0D3bAJpNvkIlgP7kRvsLOJ9EC6 e0Bvz3lA9hgygwO3mAb6CzEtTcGHHSciAN0UU= 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=aVdtkvr1WbIchyzFYIP5K0ZUeeaRhJeIb/WPcbmKF2w=; b=p0h/gjtwkkUl+bPVqwIlNfBLi28fCYrZtNqoQAvky515BXeXikBg9aWzRafhWkRAqb hco7+1OK5HzcTj72AHCGmRnhPw7KeQoXtzj2VThCPs66hJo9C2uk6DECxMOY0kyivlNp nyaOKuTlfbkIgEfFnTXamvJk4/JebtRHsWWyWUi/CVsZWFKr3N2m7OK/Ikqiof7rZfBv 7uiPdJKH/MenrJ7kFm9e3VCGE30NuhVcBmRggfmfZJGEKbtQ5Wl5eMw0DUbI3p3h3gzT RQidcCnpgyNFaKPgtezgbN3ZRkABeW+rL3RpQyxWECiUf/oZyj6ugpozgm1QCr2S+/LS JuwA== X-Gm-Message-State: AKS2vOw0SZDAIvIozr4JJzciStPgI4C+2cY6gCnh94ZoI+tyTE3ObYmD mWczf1Stye9z1Tnv X-Received: by 10.28.130.196 with SMTP id e187mr2193202wmd.24.1497951481139; Tue, 20 Jun 2017 02:38:01 -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.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:59 -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 27/51] rtc: imxdi: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:35 +0200 Message-Id: <1497951359-13334-28-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. For the same reasons use set_mmss64 callback instead of set_mmss 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-imxdi.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-imxdi.c b/drivers/rtc/rtc-imxdi.c index 6b54f6c..9af601d 100644 --- a/drivers/rtc/rtc-imxdi.c +++ b/drivers/rtc/rtc-imxdi.c @@ -549,10 +549,10 @@ static int di_write_wait(struct imxdi_dev *imxdi, u32 val, int reg) static int dryice_rtc_read_time(struct device *dev, struct rtc_time *tm) { struct imxdi_dev *imxdi = dev_get_drvdata(dev); - unsigned long now; + unsigned long long now; now = readl(imxdi->ioaddr + DTCMR); - rtc_time_to_tm(now, tm); + rtc_time64_to_tm(now, tm); return 0; } @@ -561,7 +561,7 @@ static int dryice_rtc_read_time(struct device *dev, struct rtc_time *tm) * set the seconds portion of dryice time counter and clear the * fractional part. */ -static int dryice_rtc_set_mmss(struct device *dev, unsigned long secs) +static int dryice_rtc_set_mmss64(struct device *dev, time64_t secs) { struct imxdi_dev *imxdi = dev_get_drvdata(dev); u32 dcr, dsr; @@ -618,7 +618,7 @@ static int dryice_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) u32 dcamr; dcamr = readl(imxdi->ioaddr + DCAMR); - rtc_time_to_tm(dcamr, &alarm->time); + rtc_time64_to_tm((u64)dcamr, &alarm->time); /* alarm is enabled if the interrupt is enabled */ alarm->enabled = (readl(imxdi->ioaddr + DIER) & DIER_CAIE) != 0; @@ -641,12 +641,10 @@ static int dryice_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) { struct imxdi_dev *imxdi = dev_get_drvdata(dev); unsigned long now; - unsigned long alarm_time; + unsigned long long alarm_time; int rc; - rc = rtc_tm_to_time(&alarm->time, &alarm_time); - if (rc) - return rc; + alarm_time = rtc_tm_to_time64(&alarm->time); /* don't allow setting alarm in the past */ now = readl(imxdi->ioaddr + DTCMR); @@ -668,7 +666,7 @@ static int dryice_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) static const struct rtc_class_ops dryice_rtc_ops = { .read_time = dryice_rtc_read_time, - .set_mmss = dryice_rtc_set_mmss, + .set_mmss64 = dryice_rtc_set_mmss64, .alarm_irq_enable = dryice_rtc_alarm_irq_enable, .read_alarm = dryice_rtc_read_alarm, .set_alarm = dryice_rtc_set_alarm,