From patchwork Tue Jun 20 09:35:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105978 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1278290qgd; Tue, 20 Jun 2017 02:48:56 -0700 (PDT) X-Received: by 10.98.42.207 with SMTP id q198mr3012295pfq.143.1497952136147; Tue, 20 Jun 2017 02:48:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952136; cv=none; d=google.com; s=arc-20160816; b=XS6DogpdHrHmFg9yHZ/f7U9NXbiOYeHu2pAEb0yE4vJHZBRI0MC+EdZhmuXIWoyu9K 3Co/UdvYK9XLmTgE0FBf7w9gIdAlnoNIwSvR6YphPbt3J8YdF96d7YNcasAymnnqgYjW VE2loU9T9ctyvsCruqT+9xfp6PxyXBb6x6+tLRU2O750Isyy4kzOLNyBroKMid76jPHk y8ylQmWtoKCmHB98XudMrCLwuqla5qwxseJrBVVZ5e4XIeA0xPP+aOZUljsz7E77JiOs pDeWgzo/GeCR9TittyZXMoUQQvVxi5jaAB2BdJSQMDvFTIj8pw2ejbX1oQPrPERIKK6g Kcnw== 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=h4R47hd6TLsGSY2gaZ5GUBi1Up6TjHNC7a/u8DJok6g=; b=ibtTPbv3DVkZ79Q0RGi1agRwS4tN3/aR/vt15qi2wopVutaQZZuWSpWwCydvcvDL1s uTShgde+a9fNA8ILT4OlBlwwiYV3X4MMVrjv8xXiuy/cAxEf78nmEXUegcaTNVf4oONQ RcyxDa+8rQB0JrmZr9L6oqagznlr3As+sBnYO2bFjI7pnuvvvF0Q9eR4INQGM22tT7Nq JZlHLSzT/F6MIW9hiPaio9ZKsOc/V7d7KXcxZu3GCMnSKCm6tO0K6ulKZykL+gr3wxww Q+egC9mNLCgZJmEnbWWgTysSL/KqXnHgYbTuy/sFW+jD81yQjFSU+rV+lCY7D311H8Ri WJEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=B1Aart5f; 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 z29si9644962pfg.345.2017.06.20.02.48.55; Tue, 20 Jun 2017 02:48:56 -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=B1Aart5f; 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 S1753107AbdFTJsv (ORCPT + 25 others); Tue, 20 Jun 2017 05:48:51 -0400 Received: from mail-wr0-f179.google.com ([209.85.128.179]:35978 "EHLO mail-wr0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751120AbdFTJiE (ORCPT ); Tue, 20 Jun 2017 05:38:04 -0400 Received: by mail-wr0-f179.google.com with SMTP id c11so32954830wrc.3 for ; Tue, 20 Jun 2017 02:38:03 -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=h4R47hd6TLsGSY2gaZ5GUBi1Up6TjHNC7a/u8DJok6g=; b=B1Aart5fJlbyVmlIRbY90Q2Erj7EhR0Gy3BwuSKzzuff/cEinEcA58n4jsNHwIqf6m zkAatxT5wxknCRhgAj13tBrFUJcpBRo/HSBA6ZIHUt3WqEZkxPsfr1wsIcmYZnV5k9R4 64qALUuXhzq/TcW9yn06/MP5BdIpt4A6KK9jc= 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=h4R47hd6TLsGSY2gaZ5GUBi1Up6TjHNC7a/u8DJok6g=; b=m1soRqwQgZ5rlX8wdYu39M+4kULlByDZUGOj49bVPSN9u4pODtGq37jMIywijaAabP 5yjK4IV6ZrZcrXF9IGN90FbQR+qpPjcYC/OhkmUnv5gsA863FjtOFE95ZTdEvmYsYdPm /dB7kZpoWhuLFfubu08rc7H42qsZxoHqbCyuwKqq693OW1nOxTXsWqRi2BPPoHGM1z6+ o8GwYyeCkMy8J0tQIYRFPBMMI2RZZlW8wlUfH1yZ42inoS2XXb4G2DsgM4KkD/6/X8/u ri972TzrROrUhD2APEaNMFZLCHZzEW+snxIu40GY/tdm/UftWocQV3OYrJthSYojoJPp xbRg== X-Gm-Message-State: AKS2vOwq68mG7oErT57AfTLwgGeGqLNTQtYLHG9e7z1fEMfqQAsbnbKb B1dfDHpyBELqx2Sl X-Received: by 10.223.163.152 with SMTP id l24mr12145677wrb.203.1497951482868; Tue, 20 Jun 2017 02:38:02 -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.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38:02 -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 28/51] rtc: jz4740: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:36 +0200 Message-Id: <1497951359-13334-29-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-jz4740.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-jz4740.c b/drivers/rtc/rtc-jz4740.c index 64989af..7ce1f43 100644 --- a/drivers/rtc/rtc-jz4740.c +++ b/drivers/rtc/rtc-jz4740.c @@ -171,12 +171,12 @@ static int jz4740_rtc_read_time(struct device *dev, struct rtc_time *time) if (timeout == 0) return -EIO; - rtc_time_to_tm(secs, time); + rtc_time64_to_tm((u64)secs, time); return rtc_valid_tm(time); } -static int jz4740_rtc_set_mmss(struct device *dev, unsigned long secs) +static int jz4740_rtc_set_mmss64(struct device *dev, time64_t secs) { struct jz4740_rtc *rtc = dev_get_drvdata(dev); @@ -196,7 +196,7 @@ static int jz4740_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) alrm->enabled = !!(ctrl & JZ_RTC_CTRL_AE); alrm->pending = !!(ctrl & JZ_RTC_CTRL_AF); - rtc_time_to_tm(secs, &alrm->time); + rtc_time64_to_tm((u64)secs, &alrm->time); return rtc_valid_tm(&alrm->time); } @@ -205,9 +205,9 @@ static int jz4740_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) { int ret; struct jz4740_rtc *rtc = dev_get_drvdata(dev); - unsigned long secs; + unsigned long long secs; - rtc_tm_to_time(&alrm->time, &secs); + secs = rtc_tm_to_time64(&alrm->time); ret = jz4740_rtc_reg_write(rtc, JZ_REG_RTC_SEC_ALARM, secs); if (!ret) @@ -225,7 +225,7 @@ static int jz4740_rtc_alarm_irq_enable(struct device *dev, unsigned int enable) static const struct rtc_class_ops jz4740_rtc_ops = { .read_time = jz4740_rtc_read_time, - .set_mmss = jz4740_rtc_set_mmss, + .set_mmss64 = jz4740_rtc_set_mmss64, .read_alarm = jz4740_rtc_read_alarm, .set_alarm = jz4740_rtc_set_alarm, .alarm_irq_enable = jz4740_rtc_alarm_irq_enable,