From patchwork Tue Jun 20 09:35:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105970 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1277153qgd; Tue, 20 Jun 2017 02:45:18 -0700 (PDT) X-Received: by 10.84.128.1 with SMTP id 1mr34800947pla.244.1497951918065; Tue, 20 Jun 2017 02:45:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951918; cv=none; d=google.com; s=arc-20160816; b=aK5TLjKka2hmipciaWXP153iBj2YBuOt+1t0MHWR07RrrOinJpnCC1kp8RCkgDZhVT PG4HP/idzNJaaAptrgyOyRCF059siEDGrY8GqgCUKVUyTpH/E47M/h9bKk8hOsHpG03s LsBVbSH5pyhRVru+WfHuGKmXINo6+w1RxKprQRnNAB9d/NqwWI2dmGZnruUgLxhnvyZ9 4KnIN+Qmezcw2y+ga6lc4tl7if/AemkVRG3qFZwIUGEKWJIl+C4DKaryJ8gQLcGATVoY DpgWcOp6dcLm0bxHjS/70+WpIYHU/lyWchPh0OvpTvXqU4dbB1KDkYu5eTD0WDgXyAVa 3QPQ== 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=tNi3uLOcoYGFr034TYF4/wMep5+Fq99Ji2cqY3u5bM0=; b=csgxanfH9l717Enj+EMG1XscFoZixjejlVMfO9KzJieqKlJhoLQkUGQrYNllKx8+1t NSz26W8GXOLq8B5vfWDxKicueqNwOsJ0haL16f2gsK9Om7zdcb7UQkxTx21z7625D/zP aJkmfFdosxaZWqQgy0asVa6Z1PuNmF96vqAzT463YhU/tsYwLn5pVLEcBUik7O2k0EFc +LvFKHikvm2U7Wr7ixiJ7cpC5cVijb9ys+uPc+ZZQqOySzhUgR2Pi4HmlUyF/OQptaZh Fs12vO3ih783lycTX3Bl2FhlpjeY3DeU6EYKWGPfphaO00ND71emt1Z3ke+bpoi64kSR GphA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=UWO0mCp9; 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 s129si3023913pgc.348.2017.06.20.02.45.17; Tue, 20 Jun 2017 02:45:18 -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=UWO0mCp9; 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 S1753006AbdFTJiU (ORCPT + 25 others); Tue, 20 Jun 2017 05:38:20 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:37101 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752973AbdFTJiR (ORCPT ); Tue, 20 Jun 2017 05:38:17 -0400 Received: by mail-wm0-f50.google.com with SMTP id d73so14637271wma.0 for ; Tue, 20 Jun 2017 02:38:16 -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=tNi3uLOcoYGFr034TYF4/wMep5+Fq99Ji2cqY3u5bM0=; b=UWO0mCp95dN4ajZTuey7vWXzYeCQOQ18MX3jHwgJ545uY//U6kmicC1zT5sZFwZz4+ 5CVdKSpnsW+RR22lHUcpNCBL7xii1ZyASr5jwiwIjH7zBVuJQ54cw7Knl3Nxuqqj/jyD FZaYQV/qxCsUdseouyu+uU1iPMV5KZezn5Bh0= 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=tNi3uLOcoYGFr034TYF4/wMep5+Fq99Ji2cqY3u5bM0=; b=rPv4c60zTQq4bHYZ9qbzdKRmOmTvGYVd6Lk2HR9G25RXRkF/SRCmzcAc5VKZgFgEwd iCUjXql1U8LKFRGuVxT1uRpmVSL1p8ATdXS7UU1j9K30fOq3jR+NxlyLdrl7Tm8mHW3c ElV9n6tLbvJEFKZWJjHPzIVla3inUESDm0yXwnc2lRwkQtmn8efPlpfx/bAdFN6Dt1eE qIPJUWLu1Rd4OtuUzFRokdj66aJJXTirrxsZ2COMud9Q2gFFVTe0A10itkpB3mDi44KS yEsgQOgnDo3tVbYCIZPGN34cAqEyp9gjRWhLc8Wrauu0d6j/AJK8jqJr2bdBdBe5Twar z9FA== X-Gm-Message-State: AKS2vOyJQpB1p8qtxcxgqp6nbCU8CIRrjpOpdNmZFu6Nj3o/GVqpwssc MjfYrrelu0+szQa3 X-Received: by 10.28.69.91 with SMTP id s88mr2088104wma.104.1497951490957; Tue, 20 Jun 2017 02:38:10 -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.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38:10 -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 32/51] rtc: pcap: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:40 +0200 Message-Id: <1497951359-13334-33-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-pcap.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-pcap.c b/drivers/rtc/rtc-pcap.c index c443324..fbd2cd6 100644 --- a/drivers/rtc/rtc-pcap.c +++ b/drivers/rtc/rtc-pcap.c @@ -46,7 +46,7 @@ static int pcap_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) struct platform_device *pdev = to_platform_device(dev); struct pcap_rtc *pcap_rtc = platform_get_drvdata(pdev); struct rtc_time *tm = &alrm->time; - unsigned long secs; + unsigned long long secs; u32 tod; /* time of day, seconds since midnight */ u32 days; /* days since 1/1/1970 */ @@ -56,7 +56,7 @@ static int pcap_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) ezx_pcap_read(pcap_rtc->pcap, PCAP_REG_RTC_DAYA, &days); secs += (days & PCAP_RTC_DAY_MASK) * SEC_PER_DAY; - rtc_time_to_tm(secs, tm); + rtc_time64_to_tm(secs, tm); return 0; } @@ -66,10 +66,10 @@ static int pcap_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) struct platform_device *pdev = to_platform_device(dev); struct pcap_rtc *pcap_rtc = platform_get_drvdata(pdev); struct rtc_time *tm = &alrm->time; - unsigned long secs; + unsigned long long secs; u32 tod, days; - rtc_tm_to_time(tm, &secs); + secs = rtc_tm_to_time64(tm); tod = secs % SEC_PER_DAY; ezx_pcap_write(pcap_rtc->pcap, PCAP_REG_RTC_TODA, tod); @@ -84,7 +84,7 @@ static int pcap_rtc_read_time(struct device *dev, struct rtc_time *tm) { struct platform_device *pdev = to_platform_device(dev); struct pcap_rtc *pcap_rtc = platform_get_drvdata(pdev); - unsigned long secs; + unsigned long long secs; u32 tod, days; ezx_pcap_read(pcap_rtc->pcap, PCAP_REG_RTC_TOD, &tod); @@ -93,12 +93,12 @@ static int pcap_rtc_read_time(struct device *dev, struct rtc_time *tm) ezx_pcap_read(pcap_rtc->pcap, PCAP_REG_RTC_DAY, &days); secs += (days & PCAP_RTC_DAY_MASK) * SEC_PER_DAY; - rtc_time_to_tm(secs, tm); + rtc_time64_to_tm(secs, tm); return rtc_valid_tm(tm); } -static int pcap_rtc_set_mmss(struct device *dev, unsigned long secs) +static int pcap_rtc_set_mmss64(struct device *dev, time64_t secs) { struct platform_device *pdev = to_platform_device(dev); struct pcap_rtc *pcap_rtc = platform_get_drvdata(pdev); @@ -135,7 +135,7 @@ static int pcap_rtc_alarm_irq_enable(struct device *dev, unsigned int en) .read_time = pcap_rtc_read_time, .read_alarm = pcap_rtc_read_alarm, .set_alarm = pcap_rtc_set_alarm, - .set_mmss = pcap_rtc_set_mmss, + .set_mmss64 = pcap_rtc_set_mmss64, .alarm_irq_enable = pcap_rtc_alarm_irq_enable, };