From patchwork Tue Jun 20 09:35:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 105986 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1280529qgd; Tue, 20 Jun 2017 02:56:07 -0700 (PDT) X-Received: by 10.99.50.135 with SMTP id y129mr31285092pgy.238.1497952567586; Tue, 20 Jun 2017 02:56:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952567; cv=none; d=google.com; s=arc-20160816; b=de43vaufOtL9RSdp7iuuCo6Glp/2gxsNyaRUQzv/0EUV24E3jaucn2hmV89GyrqfGx jfT2KgL3EFkFcIQWeM3t9TFkoH5W92V4mm0EfcGOTv0e7h4M4ITt1zshATsejrVhGq11 fvu3OqReDnDCYq1IsV0aVrwvOkoy3oTDu3w7NqGwig3vKMdH/dZwkzuNZpojHOVWIp9t ABzRXj9sd9dbSRQIku2puCVpg2OXwFoO3nsTATtmCuHZ0vnDLxpW6wpu9jdw99F+ovvW Z9G4mc54KYK5mxg9I6Eq7h18ir0qBG42HeteK06Js2gJRtfCXf6raQMAhJnjh9diXB9m FPaw== 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=S7Ufj0TcqAY1UqTpH7Ellrm+6olfnvctbcq+/pxjvnk=; b=XQDZNLUOwe2E8HI55bYjN8TUBBkH1nQb8NHRtSGuymmKCBRcZ79VS5pc9KQDeLNN66 K3vHgJn+L1Gn1fN4+zdPvs1fxE90lXsUg+Dn6oxEHDrQHapVT9eODoY9SCITVehdyu0H rmGG0rCTgjGZsTB71hFiiURng4yGAxRoG6q3iYhz5W0XbK60m+THEfaXfPJXTRrpjnPb P+FyVUDtw2mDJ8Kpq4lPH3dzLRWzgdDyobLpqA8QZe1TePDNo+teifh9PIfkK3jS9Oga cAHZL+78tJLPthmfVekfDYQInAUIDkOqhWKdu0FlYdWTxXP7bEUoMbSRKZgOcEscMThb xUug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=GErEJjFk; 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 j76si10014645pfe.26.2017.06.20.02.56.07; Tue, 20 Jun 2017 02:56:07 -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=GErEJjFk; 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 S1752719AbdFTJh0 (ORCPT + 25 others); Tue, 20 Jun 2017 05:37:26 -0400 Received: from mail-wr0-f172.google.com ([209.85.128.172]:33541 "EHLO mail-wr0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751098AbdFTJhY (ORCPT ); Tue, 20 Jun 2017 05:37:24 -0400 Received: by mail-wr0-f172.google.com with SMTP id r103so88491910wrb.0 for ; Tue, 20 Jun 2017 02:37:23 -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=S7Ufj0TcqAY1UqTpH7Ellrm+6olfnvctbcq+/pxjvnk=; b=GErEJjFkbZXyLZx3KhUA3ALGM4DsFKgIy9akPexmvkrURTEZUyOe0dx/IN9WMXyE9F HTCjUVr3wk1Bs93Gy8TwhCrqNVev3vaHF+eBL4cj7D+42CN5eTgQjvaKvmw+WCZlB2Xv JDk71Bs8/3tCH1V2FSGlzBlKGF60IBeFVVoAI= 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=S7Ufj0TcqAY1UqTpH7Ellrm+6olfnvctbcq+/pxjvnk=; b=ol9cKY7E7nTPVvOxx1L+Om2QpzhQ6JVd9DDZm9x6WTAhjgZ+VFThWgqzBNNcjhG8QP 4Yzo82B2XrXkustMKuNIhFCzm3YM+oNSE6JTJyYjbm922hl6uvMbQX+y4BlQVZtEGQw2 g1yaW0rmcBfkAbX3tdC+4P4e6izYQuaKokG/CXOWpx7B5/14peMh575wKO2nEcGyVnwj xTI9gPfQdRLrrnxvhQHdPLzg21/1Z8iFsPwVNvQa8LuNFdKBWT1ZvI5V3/h2CVldiSMK PWzhXfIJkxWeh9b47oaQqbhJVdfxgJsqcpAnSt3bbzXpmS694cAw3YvPPmHXb+GZLvQr 1rdQ== X-Gm-Message-State: AKS2vOxFKLTj3jd2/QjCvi7BWreafV2v7zWFR77CCIMF4Hf5R3wGqiGn pbl7XSxVq75vjcOA X-Received: by 10.223.170.7 with SMTP id p7mr21052923wrd.72.1497951442973; Tue, 20 Jun 2017 02:37:22 -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.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:22 -0700 (PDT) From: Benjamin Gaignard To: benjamin.gaignard@linaro.org Cc: linaro-kernel@lists.linaro.org, Support Opensource , Alessandro Zummo , Alexandre Belloni , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org Subject: [PATCH 14/51] rtc: da9063: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:22 +0200 Message-Id: <1497951359-13334-15-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: Support Opensource CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org --- drivers/rtc/rtc-da9052.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) -- 1.9.1 diff --git a/drivers/rtc/rtc-da9052.c b/drivers/rtc/rtc-da9052.c index 4273377..99a0489 100644 --- a/drivers/rtc/rtc-da9052.c +++ b/drivers/rtc/rtc-da9052.c @@ -104,17 +104,15 @@ static int da9052_read_alarm(struct da9052_rtc *rtc, struct rtc_time *rtc_tm) static int da9052_set_alarm(struct da9052_rtc *rtc, struct rtc_time *rtc_tm) { struct da9052 *da9052 = rtc->da9052; - unsigned long alm_time; + unsigned long long alm_time; int ret; uint8_t v[3]; - ret = rtc_tm_to_time(rtc_tm, &alm_time); - if (ret != 0) - return ret; + alm_time = rtc_tm_to_time64(rtc_tm); if (rtc_tm->tm_sec > 0) { alm_time += 60 - rtc_tm->tm_sec; - rtc_time_to_tm(alm_time, rtc_tm); + rtc_time64_to_tm(alm_time, rtc_tm); } BUG_ON(rtc_tm->tm_sec); /* it will cause repeated irqs if not zero */