From patchwork Tue Jun 20 09:35:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 9799227 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CC9A560329 for ; Tue, 20 Jun 2017 10:49:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF74E28464 for ; Tue, 20 Jun 2017 10:49:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B2F752847A; Tue, 20 Jun 2017 10:49:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F155428464 for ; Tue, 20 Jun 2017 10:49:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=5SwnTgG5UpVagzYx+n8bBH6KG5dZX//04MaXeSb7JUo=; b=PcyOq2teB847b6mEsAZtg0wR98 QtAgE5/SuWDk/OMoEEiKroT+2bE7Kgm9rI5skqpXxuvxhUOVZXILf9TqiQLFtXZMKkDjJ0p1VcBRK DawCPYOsyROirvu8GJWZh3d9Aw8smDVk9wdPbVy7a8qsc/W7r5+bEmUH0SzxcSUghxnGhSN/VlXlG Mpd+zq6De8OvQstoHJ8LoAORZWf6Kl55Vgc5gaxSIfiSEOGnfX2MGTpEtB+xdzsyPspC3HynJcdS8 zk5srP1rVl/Zt/TPhg/HF51BgOHfyUhdku9eHgDgoUjgpWf56HVmnUsM7l8gakgbiofuFKW8VabTz bKqcL+kg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dNGih-0003Cy-4v; Tue, 20 Jun 2017 10:49:15 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dNGif-0003C2-AG for linux-arm-kernel@bombadil.infradead.org; Tue, 20 Jun 2017 10:49:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=N5o21xjhsfYiOkiAvAc8xDLniSaY3M4Z9yubD+7kWIo=; b=iwFNE8iSFDunm2R7ru7+qUcM6 xAOxGCUPylqWTZ6pRDcVIb3Cpz2/7oioAr/Q/WWdbIAgLvQngb0G5beK6ml9XdLKzJT0/eXGurz9w BOv3N+w2Z+l/LtD82xkLPyWlkcELYNj6xn5YS/I26oZy6PV0XeZ349wP0YeqF3PMxO5QtXBn07/fR 7RLUbC+3uFffLvnMF/C2Z7gH5bXUq2ll6gBWN3F45DdSRP1bSmuYK2khnY0a+nCnMsTfUNVOm0n1W xZMH/uo6d2n/HGcLcPwkqI9AZBCwVOcfkB6LhAZqhndG3dABpcRjem0b+4XEIBflhmIJDStFyQ9Co V9alZwbqg==; Received: from mail-wr0-x22c.google.com ([2a00:1450:400c:c0c::22c]) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dNFcZ-0002MG-9M for linux-arm-kernel@lists.infradead.org; Tue, 20 Jun 2017 09:38:52 +0000 Received: by mail-wr0-x22c.google.com with SMTP id y25so49138308wrd.2 for ; Tue, 20 Jun 2017 02:38:31 -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=N5o21xjhsfYiOkiAvAc8xDLniSaY3M4Z9yubD+7kWIo=; b=be1UQMm1fIIuSiv6rU5xx2EtG+GZpvRQOZQCbdbkJ6oqyshXn0QT48qD2C8cBePi2Y hI2NykcJQmE5kuAcf0lh4RbxBkO7UUarFJ0+/K0CHWMgwBabLdAy8REb4FvqQH/C2IIZ txeuu1KoE2X+WvomhPMBIrUxy73cBKPVetGR0= 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=N5o21xjhsfYiOkiAvAc8xDLniSaY3M4Z9yubD+7kWIo=; b=Ejh+akS7/SWa64e8eWJwPUEJSOCr8/uYh/7JK2dvKcyT5M1wPKwC9Hu/wvfEJV8Qjp mtyUw33r2jjAkFlyr02URQR68N2UUapiXAprmjtu1da06gAEe3tTrQ8eN/d+3DRsQsTv uKa63dImTH9Kw5lFEQhhugBSn++zVTKxhWg/0LQKs7WIR4MlnKUnPbkwbFg0kEKWheOF lxWa22JMPWyslz3gWh/IiVvxj0M8LYl1B75YnnTEO1x18/8nX21C9SBIllsTlCbbxi1Y 4lQEABC6Kcatl4Y8mGqpDRQmLo2B9PcuOqNTuhY+Qg2uzDGiRORo/kHWhrKP46TUt3S7 u4bw== X-Gm-Message-State: AKS2vOyJd5O5w7fQFwMkelUYEgCVm3Ll3HEdfqORC1iWmj8aIP7BiuvQ wNOpbNmHvvWMXwwh X-Received: by 10.223.130.110 with SMTP id 101mr15734766wrb.21.1497951509399; Tue, 20 Jun 2017 02:38:29 -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.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:38:29 -0700 (PDT) From: Benjamin Gaignard To: benjamin.gaignard@linaro.org Subject: [PATCH 43/51] rtc: sun6i: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:51 +0200 Message-Id: <1497951359-13334-44-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> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alessandro Zummo , linaro-kernel@lists.linaro.org, rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org, Chen-Yu Tsai , Alexandre Belloni , Maxime Ripard , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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: Maxime Ripard CC: Chen-Yu Tsai CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org CC: linux-arm-kernel@lists.infradead.org --- drivers/rtc/rtc-sun6i.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c index 39cbc12..9928f74 100644 --- a/drivers/rtc/rtc-sun6i.c +++ b/drivers/rtc/rtc-sun6i.c @@ -120,7 +120,7 @@ struct sun6i_rtc_dev { struct device *dev; void __iomem *base; int irq; - unsigned long alarm; + unsigned long long alarm; struct clk_hw hw; struct clk_hw *int_osc; @@ -342,7 +342,7 @@ static int sun6i_rtc_getalarm(struct device *dev, struct rtc_wkalrm *wkalrm) wkalrm->enabled = !!(alrm_en & SUN6I_ALRM_EN_CNT_EN); wkalrm->pending = !!(alrm_st & SUN6I_ALRM_EN_CNT_EN); - rtc_time_to_tm(chip->alarm, &wkalrm->time); + rtc_time64_to_tm(chip->alarm, &wkalrm->time); return 0; } @@ -352,9 +352,9 @@ static int sun6i_rtc_setalarm(struct device *dev, struct rtc_wkalrm *wkalrm) struct sun6i_rtc_dev *chip = dev_get_drvdata(dev); struct rtc_time *alrm_tm = &wkalrm->time; struct rtc_time tm_now; - unsigned long time_now = 0; - unsigned long time_set = 0; - unsigned long time_gap = 0; + unsigned long long time_now = 0; + unsigned long long time_set = 0; + unsigned long long time_gap = 0; int ret = 0; ret = sun6i_rtc_gettime(dev, &tm_now); @@ -363,8 +363,8 @@ static int sun6i_rtc_setalarm(struct device *dev, struct rtc_wkalrm *wkalrm) return -EINVAL; } - rtc_tm_to_time(alrm_tm, &time_set); - rtc_tm_to_time(&tm_now, &time_now); + time_set = rtc_tm_to_time64(alrm_tm); + time_now = rtc_tm_to_time64(&tm_now); if (time_set <= time_now) { dev_err(dev, "Date to set in the past\n"); return -EINVAL;