From patchwork Tue Jun 20 09:35:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105952 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1274887qgd; Tue, 20 Jun 2017 02:38:15 -0700 (PDT) X-Received: by 10.98.157.204 with SMTP id a73mr30101691pfk.235.1497951495589; Tue, 20 Jun 2017 02:38:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951495; cv=none; d=google.com; s=arc-20160816; b=fVeT7HzZ+iNs2q2osendXb4YZ3DLIKdNr8UhyBB6yhh0PnJ6pFNMgfmVJNuZC6vWgI y9uVtbbwSlhWn9NYbelAXCZ0B6f7DVcBX9z7aNK3lnn0QksavcYuuC5NaB5MxAbm8PJk Cx+mwDvPXlEXox/zJkrwwSqupihvYrBEAdATSoF6wsv7f9nYAOLjSvrF3bBILANHVibr cX1kJX68QhOz8LxXOeS2KNCmgTNhH/7zbrIUzO2mPYhk4q0LmkXnmOcDZUFpmpFM7Kvf Ee3up6hW233MoeIbL7TLSNPWkAbNsuPoFlQbENw3jGgCE4y74rTpdc8mTowTqeHXuUr8 KTVw== 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=fSDpDJZOi7udJb+Yu+37Krp3ePaYEeK8U2NAyc4QH9Q=; b=cIlQh4SvsASv45z1k1KEHIG2VymzGKhC2FymWg2evDg+R+myazLqQ/NE0fpANsf/J2 Om0ghPhwae8Kr+y8x+BWavuHeQ6N7Emi4c1xRd5DHJhKLkKIh3uGSFJhdbFLaqbLIeiG xJ2o89vNlSjVHskrg82mwNyA1/OXbZqXqDGXZ7S4J2UrDoqlA0hpkihFZJQ5o36Fmaeq Kt0b+XOhsGiJbaOGrNk26QVbpjLq2+YBTmaNcUeyUJb3HuEXlkmdhzyNa3Z0BLqt3HKm akF5MsMInEaur01QANu+7D93by6WNcz3CIujKgtRcPf3KxFG+2TCqPzXhWJGoXv4iFat +bnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=cixtKAgk; 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 31si11226599pli.289.2017.06.20.02.38.14; Tue, 20 Jun 2017 02:38:15 -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=cixtKAgk; 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 S1752947AbdFTJiK (ORCPT + 25 others); Tue, 20 Jun 2017 05:38:10 -0400 Received: from mail-wm0-f49.google.com ([74.125.82.49]:35334 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752915AbdFTJiG (ORCPT ); Tue, 20 Jun 2017 05:38:06 -0400 Received: by mail-wm0-f49.google.com with SMTP id x70so16031100wme.0 for ; Tue, 20 Jun 2017 02:37:55 -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=fSDpDJZOi7udJb+Yu+37Krp3ePaYEeK8U2NAyc4QH9Q=; b=cixtKAgkYcLUGItOpVdOCRRy+BeF92qCVUKkWkT4elfdFnTWpOHNar6QnQX2QhgpgH aZ8AvPJZkYE+Qfo4V6WgHZ9pChNOCKDPzN63WvyedEFhicfy7e8uR0JGiNR4jVJWSelP HqgoPyJ/vJpOUb2FWdvF868FkWa687ojU+8aI= 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=fSDpDJZOi7udJb+Yu+37Krp3ePaYEeK8U2NAyc4QH9Q=; b=W10G/Av+3sutIOvp5yc27Rrz+P103YgecZ7ktPJcx3Y3lNcO5SJPxVoB+GZ7gpI7/z sc4VsIG2s3BEIGp2V+EDPXOWECh28Jrhj0xW8OwHftaedI8l0JET6bcT3knU2RImAD3p HbgU7d9wl+ekz+GkJA5k5JhugKBvng12XGFeWnINMwUVewaStJ2H+14xFmcCP55M76vv ajoerc5AD9m5IgTKR42n4QAgREHK8BhqRAonFbEP6JUM8Xr/PIe1gxtadkOw2ew0Tk29 N5fEiIBYvBh+jbToEjaVErrk/M0MWeYTPDutfx8NhNkMywhpE3r6rCc3pfk9XetDAao/ bBnQ== X-Gm-Message-State: AKS2vOzzK9aO3WiRcjp1G208FODX8xHsgNYFNDN8pAVKz47/iahxoPWq 7sAiwOBXr6xmGbwPnonw8A== X-Received: by 10.28.170.15 with SMTP id t15mr2097009wme.16.1497951474835; Tue, 20 Jun 2017 02:37:54 -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.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:54 -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 24/51] rtc: ds2404: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:32 +0200 Message-Id: <1497951359-13334-25-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-ds2404.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-ds2404.c b/drivers/rtc/rtc-ds2404.c index 9a1582e..b7d04a7 100644 --- a/drivers/rtc/rtc-ds2404.c +++ b/drivers/rtc/rtc-ds2404.c @@ -201,16 +201,16 @@ static void ds2404_enable_osc(struct device *dev) static int ds2404_read_time(struct device *dev, struct rtc_time *dt) { - unsigned long time = 0; + unsigned long long time = 0; ds2404_read_memory(dev, 0x203, 4, (u8 *)&time); time = le32_to_cpu(time); - rtc_time_to_tm(time, dt); + rtc_time64_to_tm(time, dt); return rtc_valid_tm(dt); } -static int ds2404_set_mmss(struct device *dev, unsigned long secs) +static int ds2404_set_mmss64(struct device *dev, time64_t secs) { u32 time = cpu_to_le32(secs); ds2404_write_memory(dev, 0x203, 4, (u8 *)&time); @@ -219,7 +219,7 @@ static int ds2404_set_mmss(struct device *dev, unsigned long secs) static const struct rtc_class_ops ds2404_rtc_ops = { .read_time = ds2404_read_time, - .set_mmss = ds2404_set_mmss, + .set_mmss64 = ds2404_set_mmss64, }; static int rtc_probe(struct platform_device *pdev)