From patchwork Tue Jun 20 09:35:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105959 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1275483qgd; Tue, 20 Jun 2017 02:40:02 -0700 (PDT) X-Received: by 10.98.166.196 with SMTP id r65mr29411819pfl.120.1497951602319; Tue, 20 Jun 2017 02:40:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951602; cv=none; d=google.com; s=arc-20160816; b=c4Dqnmro4ESTftkLzxpcS//8f12QB2LCa5qzGmDi0ctgb2wV+4fGGUiKE/m8FxGZmT udK727chYhDNnA3fQFUUu/mzvPABTKC9EG+vIJaoJ/3+7UtQxlhTyMrfZUbm746p67tJ s4nuH+z4Ea6UwVpdrb1R0c4/r/ZwoW5XE3O6D9OuhO5g2b9R7BRLLtpEp7tPNtezoq4L lVLigWrSgh50cNC0Zd12MjwLZUY2YEo5VBkf4R0jvTHX2JLM8qx1hTJKbJgtcWrzohSo bYtbqYQzA1d8y3AXNXVGZAmf8HTCImeuEiqx+l2/7cQt072IDVoZ1lOsN/+l6p/qOIkR 3Q7A== 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=LUZO9XI+LaMBeUtsTmxC8aFc5qdwKJ3jq2ahjF4fYwo=; b=RfJTUUPyHFKr+Ji4GP90zSTFKeVqqmHm+EWEOjOhh4IdVzE9Ockblel9asaQCyyso2 Rvo8i6/4VRIj26tGMPMVbLR14O78Z4Xe7ViHEGE26HSDL1yHbuMpIp44loYq/G6cDWD2 AaPxLtTuXIlkKt+xMSCVYjkyVKD+ADodHNiZog/f08n/DKMTJnRksYTdRtNiV4iogMTP +gpDzNT53BVPluIVoExKmW6eZQeSi/jbbPXXegit5bBMHnWw+enrGEouu85DB7nPVfcP a8dOZ/Y29pssCAmmFPQhPseQ2dS/xH9decSwP9YQT1fD48HCrHT3Wkuwz512ZBDFP8FS gAgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=SB8gDV8g; 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 d6si4535637plj.558.2017.06.20.02.40.01; Tue, 20 Jun 2017 02:40:02 -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=SB8gDV8g; 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 S1751689AbdFTJj6 (ORCPT + 25 others); Tue, 20 Jun 2017 05:39:58 -0400 Received: from mail-wm0-f53.google.com ([74.125.82.53]:38176 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753133AbdFTJim (ORCPT ); Tue, 20 Jun 2017 05:38:42 -0400 Received: by mail-wm0-f53.google.com with SMTP id u195so14590887wmd.1 for ; Tue, 20 Jun 2017 02:38:42 -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=LUZO9XI+LaMBeUtsTmxC8aFc5qdwKJ3jq2ahjF4fYwo=; b=SB8gDV8gGpwTauhvtf2ce/f+UYqEIuK2LP4H8muwB6IgI3VzCBIykbxteD8ViwbofW 28QE2auGesgb7xsdizXFfhUmO7L/DzDbJmnNqz9DOHbedOudPobtVwZBVc9BXVWlZYIP 0+1Ix9+D9C6NIXj5lmkh4DNKev/5sEUia7vCE= 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=LUZO9XI+LaMBeUtsTmxC8aFc5qdwKJ3jq2ahjF4fYwo=; b=FapCQlV8BidhVxTWhdrT4p8Fh3VcCgednDnlhk4gOkaNL27TcNa1FDsAQEjIsnmN/M 7CGcaSDwkKgEr+8usdS4kF7Dq2M6YeWz9oWbAio83iESVzL8WpN5d5uwgFOkAMz8FvZU bJdYb8wOfdhaHsI9VWZKw5PJJpF+gXuknmfd9Tj34m6byKdkYMcI3fL9967CdZwMr45N 15+MtiwjOn2fknptrfdbY6p/PpzsCkvmZZEeecyss8bp4e5HFOcyHOmL7QpeMHb60J5T 9thFSn1fROAvePqRhc3LmBPImC6wBOKopfj+CuLAA4x23ouqoCj1RlybTK9P3Jbp9zOY mdTQ== X-Gm-Message-State: AKS2vOxfHuU88tc3I5g9tzSt9R3OanstlaQTo0h507uFoBfoGoOwqfDH OMHp4y+915iLs5ir X-Received: by 10.28.65.68 with SMTP id o65mr1989550wma.68.1497951521629; Tue, 20 Jun 2017 02:38:41 -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.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38:41 -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 50/51] rtc: xgene stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:58 +0200 Message-Id: <1497951359-13334-51-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-xgene.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-xgene.c b/drivers/rtc/rtc-xgene.c index 65b432a..c62b5b6 100644 --- a/drivers/rtc/rtc-xgene.c +++ b/drivers/rtc/rtc-xgene.c @@ -58,11 +58,11 @@ static int xgene_rtc_read_time(struct device *dev, struct rtc_time *tm) { struct xgene_rtc_dev *pdata = dev_get_drvdata(dev); - rtc_time_to_tm(readl(pdata->csr_base + RTC_CCVR), tm); + rtc_time64_to_tm(readl(pdata->csr_base + RTC_CCVR), tm); return rtc_valid_tm(tm); } -static int xgene_rtc_set_mmss(struct device *dev, unsigned long secs) +static int xgene_rtc_set_mmss64(struct device *dev, time64_t secs) { struct xgene_rtc_dev *pdata = dev_get_drvdata(dev); @@ -80,7 +80,7 @@ static int xgene_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) { struct xgene_rtc_dev *pdata = dev_get_drvdata(dev); - rtc_time_to_tm(pdata->alarm_time, &alrm->time); + rtc_time64_to_tm(pdata->alarm_time, &alrm->time); alrm->enabled = readl(pdata->csr_base + RTC_CCR) & RTC_CCR_IE; return 0; @@ -108,10 +108,10 @@ static int xgene_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) { struct xgene_rtc_dev *pdata = dev_get_drvdata(dev); unsigned long rtc_time; - unsigned long alarm_time; + unsigned long long alarm_time; rtc_time = readl(pdata->csr_base + RTC_CCVR); - rtc_tm_to_time(&alrm->time, &alarm_time); + alarm_time = rtc_tm_to_time64(&alrm->time); pdata->alarm_time = alarm_time; writel((u32) pdata->alarm_time, pdata->csr_base + RTC_CMR); @@ -123,7 +123,7 @@ static int xgene_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) static const struct rtc_class_ops xgene_rtc_ops = { .read_time = xgene_rtc_read_time, - .set_mmss = xgene_rtc_set_mmss, + .set_mmss64 = xgene_rtc_set_mmss64, .read_alarm = xgene_rtc_read_alarm, .set_alarm = xgene_rtc_set_alarm, .alarm_irq_enable = xgene_rtc_alarm_irq_enable,