From patchwork Wed Jul 12 08:04: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: 9836085 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 45CD8602BD for ; Wed, 12 Jul 2017 08:06:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38C2628437 for ; Wed, 12 Jul 2017 08:06:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2CF6928602; Wed, 12 Jul 2017 08:06:02 +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=ham 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 A271228437 for ; Wed, 12 Jul 2017 08:06:01 +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=ei4IdXkK0oVYv3X/C+MhkMP+JxhxwVrmoPPs8Fw1a2Q=; b=HaflS125IQjHcl8CDE6ZTGxrDe vNKu3mWRO5d7tq74Oz6ksVJ7Obo9tiE4tJFoOjjez/yHf7zrWAH49CF7BFTlNV/W6HSwNNwbLsMLu 44Z2OXZNAY0aaATVMeQSIeH/kQ1N+b4zaHLhIJfmzzyjqPq4cqW32kqHS8DZ1Y1MrHqEiv1fRjLB2 mkDuhluKQOx25EljMmxnyLK7cEGg8EDoKE0LLuKYw6qA9A90bANj3Cgdrretoi9EYg3JY7jzSTnN+ zV81y8cErUqzjhWIEiwUNhPndDxdX7EINFGbTdjee8Gnz9M62RGLpIQuUtothtnA7+HDRvLO/lCA9 TCbFJbIg==; 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 1dVCel-0007Q6-Az; Wed, 12 Jul 2017 08:05:59 +0000 Received: from mail-wr0-x229.google.com ([2a00:1450:400c:c0c::229]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dVCea-0007Ag-RU for linux-arm-kernel@lists.infradead.org; Wed, 12 Jul 2017 08:05:52 +0000 Received: by mail-wr0-x229.google.com with SMTP id c11so22374991wrc.3 for ; Wed, 12 Jul 2017 01:05:28 -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=zXII0zO7QokUmEbsAtI2Xd+ZAzl1PcCW94AR09ahDVw=; b=Y1YykQ7dNhsp0DeQn/yVlTDeK1puAdwtw97mEAJPNmRzVe9D9EW1Uog0nGs6aBUeAw yJtv4ZQfT5/x6pwBfEm6WVQ0vJhH+o/URW2KMwjamoAylxMwkVO16O8gkpi5jxBQuiF1 umNNuDgI+zqD9vFxVbE579yWJcffKqguCKs8Y= 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=zXII0zO7QokUmEbsAtI2Xd+ZAzl1PcCW94AR09ahDVw=; b=fWC2IN0f3mz6toesCqX0ysUnhF8o6KNBTpbm93lzh15y3A7QmxXhe0ENDukdytujoq 8X5Sj3GOJXrcGoryXo9LhL0BE+DyyQHC6eY6tF6226Nt/pIURCUC1F5L+UWZeZaGjBzz jvOCRpzakJSTC5S+HvxoJRlg22+TdP3a8yJq4kFA3hECfd2Geqyda67IlX5pi/59KJGF sh6PwWMcSsKdArCojcwCxkda5FO2Ff2+IuYIruIk/kouG1u0bjvyt/gB/yVEj354ygQ+ D5+sCloZYjmDfxj3bula6oP5acaZ7uISgH2XfcXTw06AqZIDMzzU1bKXV8zwsuo095sU XCQA== X-Gm-Message-State: AIVw113kCErYcwl6VgZIMmuAKb61ZPn6oGnkbN6w7eqXcgNZ+hGQcNoG o64WWRiShSgldxBh X-Received: by 10.223.151.51 with SMTP id r48mr2012282wrb.189.1499846726713; Wed, 12 Jul 2017 01:05:26 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.158.26]) by smtp.gmail.com with ESMTPSA id p34sm1430744wrc.66.2017.07.12.01.05.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 12 Jul 2017 01:05:26 -0700 (PDT) From: Benjamin Gaignard To: benjamin.gaignard@linaro.org Subject: [PATCH v2 11/22] rtc: gemini: stop using rtc deprecated functions Date: Wed, 12 Jul 2017 10:04:31 +0200 Message-Id: <1499846682-14093-12-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1499846682-14093-1-git-send-email-benjamin.gaignard@linaro.org> References: <1499846682-14093-1-git-send-email-benjamin.gaignard@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170712_010549_113753_162644CB X-CRM114-Status: GOOD ( 11.84 ) 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, Hans Ulli Kroll , linux-kernel@vger.kernel.org, Alexandre Belloni , 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: Hans Ulli Kroll 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-ftrtc010.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/rtc/rtc-ftrtc010.c b/drivers/rtc/rtc-ftrtc010.c index af8d6be..6328913 100644 --- a/drivers/rtc/rtc-ftrtc010.c +++ b/drivers/rtc/rtc-ftrtc010.c @@ -74,7 +74,7 @@ static int ftrtc010_rtc_read_time(struct device *dev, struct rtc_time *tm) struct ftrtc010_rtc *rtc = dev_get_drvdata(dev); unsigned int days, hour, min, sec; - unsigned long offset, time; + unsigned long long offset, time; sec = readl(rtc->rtc_base + FTRTC010_RTC_SECOND); min = readl(rtc->rtc_base + FTRTC010_RTC_MINUTE); @@ -84,7 +84,7 @@ static int ftrtc010_rtc_read_time(struct device *dev, struct rtc_time *tm) time = offset + days * 86400 + hour * 3600 + min * 60 + sec; - rtc_time_to_tm(time, tm); + rtc_time64_to_tm(time, tm); return 0; } @@ -93,12 +93,12 @@ static int ftrtc010_rtc_set_time(struct device *dev, struct rtc_time *tm) { struct ftrtc010_rtc *rtc = dev_get_drvdata(dev); unsigned int sec, min, hour, day; - unsigned long offset, time; + unsigned long long offset, time; if (tm->tm_year >= 2148) /* EPOCH Year + 179 */ return -EINVAL; - rtc_tm_to_time(tm, &time); + time = rtc_tm_to_time64(tm); sec = readl(rtc->rtc_base + FTRTC010_RTC_SECOND); min = readl(rtc->rtc_base + FTRTC010_RTC_MINUTE);