Message ID | 1497951359-13334-20-git-send-email-benjamin.gaignard@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1279037qgd; Tue, 20 Jun 2017 02:51:22 -0700 (PDT) X-Received: by 10.84.171.193 with SMTP id l59mr35234465plb.139.1497952282560; Tue, 20 Jun 2017 02:51:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952282; cv=none; d=google.com; s=arc-20160816; b=CcnCKlJVc1YxhgyrbPD/7AlFvikPoMeERdLPkI8v6GGIwUNbTIyeQh2QyFoPvBs/6s rzFJkLIHAbHJWKNucwxb3phvZga7Epn35wZsFT5hvnLQiDrpybNDV1x8u+i+4Ec3Sj5x LYTnmL4Aw7eDQt1hWfuHJLrVfBClponGYQeWoezCCCesYQeaR4cnmvcL4kZL5sWPcTOS 8Tdpydq+h6OiARgKysAzSPt2MY9k13Y2RXbyqt+QuRRGBXoE4pTS5tJfsidnM5E/YLID 5gFsCvAtwyAkEBgwui/SJtNJtfTnEKL4Ntx71pf4fnhcraVhB7uro+bJnAYSzb/FgJyz pFHg== 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=xQZnvb6WkHY7uiUpIFUonTnxXqndHkNZi2qqU6KJSMU=; b=t3LixsOSxn4CiQfccZTPhcEsUBX+pUtlG2m8zNKbPmR/KTzJNS37xmRLHpYXyzUA2r wzFO7AdUz3CG2/rEHFOyE4TPyhyLyrMsbql9xEnu6l6gf89R5b50vTtBPDpXbHarOVl6 NdP1Cxmwoj7MvYZkym0ru7DKEQaRLT0OALCeehucdQIO4wcjTLpfu4l3S91ovVkdSoeB ueo9P94j3L96349xp4GRoe4ZzI5ZwTY1p/yCpGyXfJhdAgdptMIutx1zQTymnAVf0L/P ckdPYWhZydmvVN5MWWyTIWAABSW6xDtAlM4tg8RXmVJuwo13JVkv9e+JG+PjUs4ovojg wRIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=KRgPhkcU; 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: <linux-kernel-owner@vger.kernel.org> Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f16si11557584plk.281.2017.06.20.02.51.21; Tue, 20 Jun 2017 02:51:21 -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=KRgPhkcU; 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 S1752880AbdFTJh7 (ORCPT <rfc822;georgi.djakov@linaro.org> + 25 others); Tue, 20 Jun 2017 05:37:59 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:33120 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750925AbdFTJhx (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 20 Jun 2017 05:37:53 -0400 Received: by mail-wm0-f47.google.com with SMTP id u185so5613432wmd.0 for <linux-kernel@vger.kernel.org>; Tue, 20 Jun 2017 02:37:47 -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=xQZnvb6WkHY7uiUpIFUonTnxXqndHkNZi2qqU6KJSMU=; b=KRgPhkcU82aihO0QUlIhy4dyyp8DekrDE5pD/q0Rfh1u5mllkJwkoqFZVLrqgpc2sO ivkfJGYYc+K8WV9vV7MpoBFj2iLYxwQjj3xM0bCsFF59lE7pOLbcbzYWCXJAUkGMGOAh W2RY4lW7m0ma24rGQ19jYlEwZuKLKygaH/NXA= 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=xQZnvb6WkHY7uiUpIFUonTnxXqndHkNZi2qqU6KJSMU=; b=YrUZbbKT/m7KaFEkO9+1sEapereILD0qLVxj7VbCYyZSuv7M7NwtjHPTmH0FeGBl/k nCpl3qXh+68C21zjcfagO2o10EJJqUkuEnCi9XQVxOd15Wt4m9K9cobAyH2E0B8mAsrY At2ypQAto2YbwijlToOKKuE3I4PVLddlVhWXAyUCWMAAQ0HKj480OeTWlrV62BRu8YzS okPtNJhpi17Ui7W7425YhQqTzuxGJLr0OTIXbPjVZF0yVziU/bOZ+/Yxzsrx3QOS5NBv QFfvxO8FnfxHJ/QWFztFBLp0nNMOLUqN7ck+aMKcI8YpSjVp/ZqMBNiqIbJw8jAzHkII FI9Q== X-Gm-Message-State: AKS2vOwUnmiuBnFtjVC9a8LLOQjeVOSPR0Bon0CJfp7f9TQ63jbZjt6f 93kwJPf0I6Xll8cf X-Received: by 10.28.92.130 with SMTP id q124mr2168459wmb.21.1497951466868; Tue, 20 Jun 2017 02:37:46 -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.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:46 -0700 (PDT) From: Benjamin Gaignard <benjamin.gaignard@linaro.org> To: benjamin.gaignard@linaro.org Cc: linaro-kernel@lists.linaro.org, Alessandro Zummo <a.zummo@towertech.it>, Alexandre Belloni <alexandre.belloni@free-electrons.com>, rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org Subject: [PATCH 19/51] rtc: ds1305: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:27 +0200 Message-Id: <1497951359-13334-20-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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org |
Series |
rtc: stop using rtc deprecated functions
|
expand
|
diff --git a/drivers/rtc/rtc-ds1305.c b/drivers/rtc/rtc-ds1305.c index 72b2293..b41168b 100644 --- a/drivers/rtc/rtc-ds1305.c +++ b/drivers/rtc/rtc-ds1305.c @@ -324,23 +324,20 @@ static int ds1305_set_alarm(struct device *dev, struct rtc_wkalrm *alm) { struct ds1305 *ds1305 = dev_get_drvdata(dev); struct spi_device *spi = ds1305->spi; - unsigned long now, later; + unsigned long long now, later; struct rtc_time tm; int status; u8 buf[1 + DS1305_ALM_LEN]; /* convert desired alarm to time_t */ - status = rtc_tm_to_time(&alm->time, &later); - if (status < 0) - return status; + later = rtc_tm_to_time64(&alm->time); /* Read current time as time_t */ status = ds1305_get_time(dev, &tm); if (status < 0) return status; - status = rtc_tm_to_time(&tm, &now); - if (status < 0) - return status; + + now = rtc_tm_to_time64(&tm); /* make sure alarm fires within the next 24 hours */ if (later <= now)
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 <benjamin.gaignard@linaro.org> CC: Alessandro Zummo <a.zummo@towertech.it> CC: Alexandre Belloni <alexandre.belloni@free-electrons.com> CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org --- drivers/rtc/rtc-ds1305.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) -- 1.9.1