aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-ds1672.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2019-04-07 23:05:39 +0200
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2019-04-08 14:35:38 +0200
commit219219d9b89b4be4cb58c1503393cd715d48933a (patch)
treeb8ff5420a737d92042a3e2bd08c54aa317d8ad6e /drivers/rtc/rtc-ds1672.c
parent520d6516736e1c3f5b7178b2eba13c0b9e172f37 (diff)
downloadlinux-219219d9b89b4be4cb58c1503393cd715d48933a.tar.gz
rtc: ds1672: use .set_time
Use .set_time instead of the deprecated .set_mmss. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-ds1672.c')
-rw-r--r--drivers/rtc/rtc-ds1672.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-ds1672.c b/drivers/rtc/rtc-ds1672.c
index 653abef2e5cd2..4997b4f3d6672 100644
--- a/drivers/rtc/rtc-ds1672.c
+++ b/drivers/rtc/rtc-ds1672.c
@@ -84,11 +84,12 @@ static int ds1672_read_time(struct device *dev, struct rtc_time *tm)
return 0;
}
-static int ds1672_set_mmss(struct device *dev, unsigned long secs)
+static int ds1672_set_time(struct device *dev, struct rtc_time *tm)
{
struct i2c_client *client = to_i2c_client(dev);
int xfer;
unsigned char buf[6];
+ unsigned long secs = rtc_tm_to_time64(tm);
buf[0] = DS1672_REG_CNT_BASE;
buf[1] = secs & 0x000000FF;
@@ -108,7 +109,7 @@ static int ds1672_set_mmss(struct device *dev, unsigned long secs)
static const struct rtc_class_ops ds1672_rtc_ops = {
.read_time = ds1672_read_time,
- .set_mmss = ds1672_set_mmss,
+ .set_time = ds1672_set_time,
};
static int ds1672_probe(struct i2c_client *client,