From patchwork Tue Jun 20 09:35:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105981 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1279307qgd; Tue, 20 Jun 2017 02:52:11 -0700 (PDT) X-Received: by 10.84.178.101 with SMTP id y92mr34677464plb.116.1497952331706; Tue, 20 Jun 2017 02:52:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952331; cv=none; d=google.com; s=arc-20160816; b=uyQwGaryDcg9EVTInTf1aRL2LhFLdJYlT6Z1uV8lYNLNvPmEfPzitH+rEkhgR5iP/B TKy2kmr02k+YCVnHAlwMPr/I9nrJYH8hpnot3SAaJulWpxuXlD/hBcoYN1tt8ydmnIvo RPMFicYrZ94B6K8SciXCGYkKeFv5Ny53akc6K+c9tbmnQueekD6Oe/YKEH5zP+OVCHSg 8TwgwkhIYLTRNdY3TBo/goFn0mndlFCK4h9eA7xUmb+FcvzMZQB+NO3bcWMg3DWVEYch Gt98zzqYNl0KyXuauLVeuxIxVq47Wou0oBpbiQf4ycYZe+4m1HOm0JDZWsWDbN+uC76E /kpA== 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=lE5peXKkK5KDRu4axlEoImezWiuwcRc3ccP74XPTEf4=; b=XyF4YvXxBZGYEe4U1xoXlSBMxrGM7NfGTeFQIlIwaSTt7QVNgPsFkEbf0pUMGfRdU+ NE029SdVhDyWDFMgIfX2VCnEP9C4oc8PTRG3OAjwC+l8Li9emevnHaoSQZZuwwbuwCct yRkBtjKgJRmE/jfx51LW32kI8TAs0b0qkSZ3atifdZITYku7c1LPIDG/k271tOF8g90p Pi4D8AF0uB6DUV1AvVsLXCaIMqp9Sqr+eFBtt4fQ+MDf+eGSnJYpybH5Tp8vEp+JmQw2 rjYCblL9IpMBIZaBhcMEBrvgxbugyZ3l1zl/SgDGB1rfPpx7cNQCTLWNMbznUe9usU+C TAxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=aYFgCH3Y; 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 l20si10309362pgn.282.2017.06.20.02.52.11; Tue, 20 Jun 2017 02:52: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=aYFgCH3Y; 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 S1752861AbdFTJh6 (ORCPT + 25 others); Tue, 20 Jun 2017 05:37:58 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:38710 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751774AbdFTJhy (ORCPT ); Tue, 20 Jun 2017 05:37:54 -0400 Received: by mail-wm0-f42.google.com with SMTP id u195so14570952wmd.1 for ; Tue, 20 Jun 2017 02:37:54 -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=lE5peXKkK5KDRu4axlEoImezWiuwcRc3ccP74XPTEf4=; b=aYFgCH3YM7d97D8QpkfAF6StHqgVzVI6ibyBNLVb1Wu2bn479fApd9Xgb0JqW3z/Ac ergwxB7mHZapdDeim9sEFF0jr1Y30aJy9Z+uzBAw9GcGQeks2YVZTMispZPIYe5V4H9O YWNCPB+JYfLRJQQ/M3PkDAECl8VYsf7VIaH4E= 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=lE5peXKkK5KDRu4axlEoImezWiuwcRc3ccP74XPTEf4=; b=M9n55jCg0+BquSvvr8Zq1w6ep1l4FFmHXVpVjkd6LFVXXZzghZ8ZBCp48RC0uSX4+/ gMBwvIZ45aU5s/aDZ0T6q1IH9v0M4Nz5LEGoJMR4d2VXv+likT88YHQADKPKR5m9JCrW hgdgKccpA4vmez/KQUTc4yfBhkU3VOlru1l7z9ZM5IvfIz3d/qlWd6jtNhRDF6HCrZgj f8l8bjMuC3ICOHYxPMfyb8x7+dvnmV9xdj79j+zSnNsrVYjQNfb5BxAdKiCCbxOcNUx/ mrBCSMJTE9BGUkb1JaRyfQ57J2RlclV1WwVCKxi3h52W+KF485g5JgtvK6KfhGPt1O3w OPOw== X-Gm-Message-State: AKS2vOwnTt9aWqaG99pOHOx7ImeOEPK6ifFmyyCXqi88sopcxH/SGexU 28wjLnuDrw/7t16Z X-Received: by 10.28.101.213 with SMTP id z204mr2152966wmb.106.1497951473206; Tue, 20 Jun 2017 02:37:53 -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.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:52 -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 23/51] rtc: ds1672: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:31 +0200 Message-Id: <1497951359-13334-24-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-ds1672.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-ds1672.c b/drivers/rtc/rtc-ds1672.c index 7bf46bf..ff2468c 100644 --- a/drivers/rtc/rtc-ds1672.c +++ b/drivers/rtc/rtc-ds1672.c @@ -30,7 +30,7 @@ */ static int ds1672_get_datetime(struct i2c_client *client, struct rtc_time *tm) { - unsigned long time; + unsigned long long time; unsigned char addr = DS1672_REG_CNT_BASE; unsigned char buf[4]; @@ -60,7 +60,7 @@ static int ds1672_get_datetime(struct i2c_client *client, struct rtc_time *tm) time = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; - rtc_time_to_tm(time, tm); + rtc_time64_to_tm(time, tm); dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d, " "mday=%d, mon=%d, year=%d, wday=%d\n", @@ -96,7 +96,7 @@ static int ds1672_rtc_read_time(struct device *dev, struct rtc_time *tm) return ds1672_get_datetime(to_i2c_client(dev), tm); } -static int ds1672_rtc_set_mmss(struct device *dev, unsigned long secs) +static int ds1672_rtc_set_mmss64(struct device *dev, time64_t secs) { return ds1672_set_mmss(to_i2c_client(dev), secs); } @@ -148,7 +148,7 @@ static ssize_t show_control(struct device *dev, struct device_attribute *attr, static const struct rtc_class_ops ds1672_rtc_ops = { .read_time = ds1672_rtc_read_time, - .set_mmss = ds1672_rtc_set_mmss, + .set_mmss64 = ds1672_rtc_set_mmss64, }; static int ds1672_probe(struct i2c_client *client,