From patchwork Tue Jun 20 09:35:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105946 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1274663qgd; Tue, 20 Jun 2017 02:37:32 -0700 (PDT) X-Received: by 10.99.115.16 with SMTP id o16mr30070068pgc.31.1497951452069; Tue, 20 Jun 2017 02:37:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497951452; cv=none; d=google.com; s=arc-20160816; b=V1zwqaBERjDXZFOFnBwlz17UqTut5K9eh9j+AeKrduyanP9XNMznUBC69+A2qiCMUN Smi7tKPcVOM3Zeozd9Vnxy2MYXW1jUt7LlYu+UxRzs47R99wM4Bt+CImQxHjnMH9rLjg Ce36OexDgWfXULWQLKzYu19T/OK7nJKSWyWM9VMcZ9b3UP2oEz5cJ3VQekLf6hQ3uCnm yPV64uw9GVVVR4YyqxGRQqe7zIUMC3LV/oKLRLR00q4v6PdrVSSGH/HoPt9CLDmq+mZ0 N8l4uz5Q06zqgoxCGcVSZlnUI1S0m4ISZzsr9KH5wnt2ChyxkMcwWNNGOZaT/CEpP+RI BEkA== 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=w7ceW9TGs47oPU8ENU08dUtjwQVvQs5KyoFicWnGEiA=; b=UmggGeOb0PbEoO4DZ60TSFs0Xhm0c7MEbHpcBJuqOOqtISSkaAgj0Zb0/+SDeMuABn H1Kwm5IaqvkLOckm0CKCp/BR+/kwEUA9qy4g62Maqu/PrFn3HWpBH4hqJeAkXI0CfqF4 VjoOOuZiptzwNRoDW2GyO2jTYu9AQpvAMjDns6YH/yyJW9hnfMPyQEI41PiyKM3D/IBD 5butPxsmqRIEZ13gLDkPEiuoLrzpiMrsPkF3zf8Y4FWIvrOS6YuuopHxaS6Lu9AbVe7b J255PIRAhDKubEs3Y6mWcbyg5b5/OsvRwoQwTU4qr48ZYPDmPQize5caPJahRv/harai rGEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=ShWqnK8v; 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 x2si6435654plm.471.2017.06.20.02.37.31; Tue, 20 Jun 2017 02:37:32 -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=ShWqnK8v; 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 S1752706AbdFTJhV (ORCPT + 25 others); Tue, 20 Jun 2017 05:37:21 -0400 Received: from mail-wr0-f180.google.com ([209.85.128.180]:33921 "EHLO mail-wr0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752539AbdFTJhT (ORCPT ); Tue, 20 Jun 2017 05:37:19 -0400 Received: by mail-wr0-f180.google.com with SMTP id 77so88365713wrb.1 for ; Tue, 20 Jun 2017 02:37:18 -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=w7ceW9TGs47oPU8ENU08dUtjwQVvQs5KyoFicWnGEiA=; b=ShWqnK8vqC313Vo8VzTNtsbEFzlHypIX+6IoqG4DafUH7bZ88udjXwG8rdDphdqM7Z BpEPfmeO+Cm8N7CRbykq7c4xmyiGU2+Xjvh1WDAVa+r7e2ZlvKAFaKFsMqCAxWctIE7x IsQ33ISZXKjgGyK1HgQZDLmAtePtATQU54kPc= 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=w7ceW9TGs47oPU8ENU08dUtjwQVvQs5KyoFicWnGEiA=; b=M7fyvKT89MPwIIW+qxJvluVFGkd1eYDrPiYY2CB9j0pFUAAGkSguoVmz7vkL8DwOHy O7nrcsgAMeKa1cFfW4K79TT4LrhYDu9GluV58U9kmsWRxdouohIsTj+LiDMwu21oGrWZ 3qFyo87qAuY2q2Dq0juVVgkal3M1NWv6A9Q05qDik4rMS9FniMZ12Tioo7ILSKyegkB6 AMi2GCkv4WgT4PGgflvkvSEBsnv+MsztFnmN8kFDqaPLWezoPB00hWUoF7KF90WWDOwI 3RNo5KcZo4WglxGAXw3wjEW4arUAgUvyb3CKGsEfM1FCumg++YwancQ6j8Bdteb2s/4N t1aA== X-Gm-Message-State: AKS2vOyLxQ0tRxhkQC+0uB+0n2NUcAbCGNpldBqBJlVy6xGsCi3m8heo jEaO8B36/UbeauXE X-Received: by 10.223.165.13 with SMTP id i13mr17093380wrb.35.1497951437825; Tue, 20 Jun 2017 02:37:17 -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.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:17 -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, adi-buildroot-devel@lists.sourceforge.net Subject: [PATCH 11/51] rtc: bfin: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:19 +0200 Message-Id: <1497951359-13334-12-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 CC: adi-buildroot-devel@lists.sourceforge.net --- drivers/rtc/rtc-bfin.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c index 15344b7..4c79bd0 100644 --- a/drivers/rtc/rtc-bfin.c +++ b/drivers/rtc/rtc-bfin.c @@ -103,7 +103,7 @@ static inline unsigned long rtc_bfin_to_time(u32 rtc_bfin) } static inline void rtc_bfin_to_tm(u32 rtc_bfin, struct rtc_time *tm) { - rtc_time_to_tm(rtc_bfin_to_time(rtc_bfin), tm); + rtc_time64_to_tm(rtc_bfin_to_time(rtc_bfin), tm); } /** @@ -271,20 +271,17 @@ static int bfin_rtc_read_time(struct device *dev, struct rtc_time *tm) static int bfin_rtc_set_time(struct device *dev, struct rtc_time *tm) { struct bfin_rtc *rtc = dev_get_drvdata(dev); - int ret; - unsigned long now; + unsigned long long now; dev_dbg_stamp(dev); - ret = rtc_tm_to_time(tm, &now); - if (ret == 0) { - if (rtc->rtc_wrote_regs & 0x1) - bfin_rtc_sync_pending(dev); - bfin_write_RTC_STAT(rtc_time_to_bfin(now)); - rtc->rtc_wrote_regs = 0x1; - } + now = rtc_tm_to_time64(tm); + if (rtc->rtc_wrote_regs & 0x1) + bfin_rtc_sync_pending(dev); + bfin_write_RTC_STAT(rtc_time_to_bfin(now)); + rtc->rtc_wrote_regs = 0x1; - return ret; + return 0; } static int bfin_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) @@ -300,12 +297,11 @@ static int bfin_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) static int bfin_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) { struct bfin_rtc *rtc = dev_get_drvdata(dev); - unsigned long rtc_alarm; + unsigned long long rtc_alarm; dev_dbg_stamp(dev); - if (rtc_tm_to_time(&alrm->time, &rtc_alarm)) - return -EINVAL; + rtc_alarm = rtc_tm_to_time64(&alrm->time); rtc->rtc_alarm = alrm->time;