]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
rtc: ds1672: use .set_time
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Sun, 7 Apr 2019 21:05:39 +0000 (23:05 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Mon, 8 Apr 2019 12:35:38 +0000 (14:35 +0200)
Use .set_time instead of the deprecated .set_mmss.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-ds1672.c

index 653abef2e5cd24a746d2ef5db3d1f68c01bf271f..4997b4f3d66725d7169bc266e02d6e35be6fc666 100644 (file)
@@ -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,