From patchwork Tue Jun 20 09:35:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105966 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1276479qgd; Tue, 20 Jun 2017 02:43:11 -0700 (PDT) X-Received: by 10.84.217.138 with SMTP id p10mr29549055pli.66.1497951791682; Tue, 20 Jun 2017 02:43:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951791; cv=none; d=google.com; s=arc-20160816; b=I6o45SLszHI84b6nCF5cVOs0lxnw2t/Ehd3Fucr1zIcczUskrugAGy3anDz+JgZasl DjLNaQJs1b9j9wl5JU5Y69WAbkuGjtKUXwnGPxUN8s8FnVzQWPHXj1PwCtERD6aSiBUC hXVP6iLJkY4rOVSype2nH/+xjQZ8QmyIloGKeb1MfJaM3JfqcVfhszjfRu6FYSfqPyh4 WfwqeID3WsnVX65+TPsTtkis0O5YbZ46cH1QSiRiNZfTMhcdvIFmevv3wQQzvoOVAzQC 7A4vFMyES4W06Y1Y53L37W1SbTQQz/93podvLb/4lvxvsmrKL23+g3sDBx5lP3tSpcCC PRZw== 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=ORD3Pu6ElgfhUPhtBN0bFttKmJ3C5kLuYfhq7UKeTSs=; b=GVuXtlpn1ttlA1qEbJ/iidmxVXDLyJK0CfN1szCRFhN0JDkVCInwyAcG/C7ANcneuT T1LaiYrDBgrAXF/LSmHm/YIVu/JTCr/po1gv/hZsvNpCGyYfNGoqsi6LjMG8PUzKmmm8 feWnrh4021Yg23gueY1Q3t+klQ2Z6vm3mxYgmgOsJiJ1LX7x1DB/TVBONKtQXSzvJlYM V9KQIz15b3Bqp2DoZTvQSy0zzHE1DK0q8b3Tze2RcCxV8z5rf8C7cQ31OqkAdhfv45uY 0q0j5F9yOAUhGMlBvHgkn38IxoKGOdLjCu/5saBZ8GzjXSkSm29b/jMmUbcQ8uSMyOWv G0aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=WNJG1cu3; 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 201si10144015pga.81.2017.06.20.02.43.11; Tue, 20 Jun 2017 02:43:11 -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=WNJG1cu3; 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 S1753183AbdFTJnI (ORCPT + 25 others); Tue, 20 Jun 2017 05:43:08 -0400 Received: from mail-wr0-f169.google.com ([209.85.128.169]:35837 "EHLO mail-wr0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753049AbdFTJi2 (ORCPT ); Tue, 20 Jun 2017 05:38:28 -0400 Received: by mail-wr0-f169.google.com with SMTP id y25so49137882wrd.2 for ; Tue, 20 Jun 2017 02:38:28 -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=ORD3Pu6ElgfhUPhtBN0bFttKmJ3C5kLuYfhq7UKeTSs=; b=WNJG1cu3j1ctGTe4Upg5W8DWVSFOss/DhB2sukmf5jRRVzeKw0t8+mQ1dFcTi7wzd+ Q7bpGF9WjIG7K1r9gon5SrxEgZoes94wqs8Ht1x1gj4krRXUBGqngwqrKVXHBE9mjIJ/ gTzL9CrvHlu5+W5JggJDfJloi0Q7ALj4nNTMc= 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=ORD3Pu6ElgfhUPhtBN0bFttKmJ3C5kLuYfhq7UKeTSs=; b=Gy0wtaBnPWjlogN7eAwqRMahySkJTdN9GxNnhJKVBS8ktewzUPBDmrAVlzjnSQiuib U4erI9qy8vqjnRtGiGNM0Jb99xqgL2pDGjmi3Q6d6+mYtzqWpmGJcF5EZ+VW5GSimuYc EsCxDXkujZQBopcfmSKgJzmuoJ2dRsLB/HFbPxJeWU2AaPtE3tomSIUmyw9Uz2U2VsGF ySyqoshFDAfVjL7SNA1yEulRLTI6UQk7FLyb2gkA+UkZv9RF7AeowxXtAME1kMDoHLqY xO848gZ+aTj+iKCxBrPxjgvMzYqe//q1c5CzFSERMKTIPxw6ojqwtMlDJOhTpa0NLKGa J3+A== X-Gm-Message-State: AKS2vOzM/rnVauHtreK1x/rHDzPKrrvLox0+1zF7hhZqugGDoVnMMaoY /NSVDuAqLBXaWAPL X-Received: by 10.223.166.196 with SMTP id t62mr17952255wrc.52.1497951507584; Tue, 20 Jun 2017 02:38:27 -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.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38:27 -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 42/51] rtc: stmp3xxx: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:50 +0200 Message-Id: <1497951359-13334-43-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-stmp3xxx.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-stmp3xxx.c b/drivers/rtc/rtc-stmp3xxx.c index d578e40..0f7cedc 100644 --- a/drivers/rtc/rtc-stmp3xxx.c +++ b/drivers/rtc/rtc-stmp3xxx.c @@ -160,11 +160,11 @@ static int stmp3xxx_rtc_gettime(struct device *dev, struct rtc_time *rtc_tm) if (ret) return ret; - rtc_time_to_tm(readl(rtc_data->io + STMP3XXX_RTC_SECONDS), rtc_tm); + rtc_time64_to_tm(readl(rtc_data->io + STMP3XXX_RTC_SECONDS), rtc_tm); return 0; } -static int stmp3xxx_rtc_set_mmss(struct device *dev, unsigned long t) +static int stmp3xxx_rtc_set_mmss64(struct device *dev, time64_t t) { struct stmp3xxx_rtc_data *rtc_data = dev_get_drvdata(dev); @@ -214,16 +214,16 @@ static int stmp3xxx_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alm) { struct stmp3xxx_rtc_data *rtc_data = dev_get_drvdata(dev); - rtc_time_to_tm(readl(rtc_data->io + STMP3XXX_RTC_ALARM), &alm->time); + rtc_time64_to_tm(readl(rtc_data->io + STMP3XXX_RTC_ALARM), &alm->time); return 0; } static int stmp3xxx_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) { - unsigned long t; + unsigned long long t; struct stmp3xxx_rtc_data *rtc_data = dev_get_drvdata(dev); - rtc_tm_to_time(&alm->time, &t); + t = rtc_tm_to_time64(&alm->time); writel(t, rtc_data->io + STMP3XXX_RTC_ALARM); stmp3xxx_alarm_irq_enable(dev, alm->enabled); @@ -235,7 +235,7 @@ static int stmp3xxx_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) .alarm_irq_enable = stmp3xxx_alarm_irq_enable, .read_time = stmp3xxx_rtc_gettime, - .set_mmss = stmp3xxx_rtc_set_mmss, + .set_mmss64 = stmp3xxx_rtc_set_mmss64, .read_alarm = stmp3xxx_rtc_read_alarm, .set_alarm = stmp3xxx_rtc_set_alarm, };