rtc: stop validating rtc_time after rtc_time_to_tm
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Mon, 19 Feb 2018 15:23:55 +0000 (16:23 +0100)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 1 Mar 2018 09:49:41 +0000 (10:49 +0100)
rtc_time_to_tm never generates an invalid tm. It is not necessary to
validate it.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
13 files changed:
drivers/rtc/rtc-ab8500.c
drivers/rtc/rtc-coh901331.c
drivers/rtc/rtc-jz4740.c
drivers/rtc/rtc-lpc32xx.c
drivers/rtc/rtc-ls1x.c
drivers/rtc/rtc-mpc5121.c
drivers/rtc/rtc-pcap.c
drivers/rtc/rtc-ps3.c
drivers/rtc/rtc-starfire.c
drivers/rtc/rtc-tps6586x.c
drivers/rtc/rtc-tx4939.c
drivers/rtc/rtc-wm831x.c
drivers/rtc/rtc-xgene.c

index 24a0af6..98c7123 100644 (file)
@@ -131,7 +131,7 @@ static int ab8500_rtc_read_time(struct device *dev, struct rtc_time *tm)
        secs += get_elapsed_seconds(AB8500_RTC_EPOCH);
 
        rtc_time_to_tm(secs, tm);
-       return rtc_valid_tm(tm);
+       return 0;
 }
 
 static int ab8500_rtc_set_time(struct device *dev, struct rtc_time *tm)
index cfc4141..2fc5174 100644 (file)
@@ -82,7 +82,7 @@ static int coh901331_read_time(struct device *dev, struct rtc_time *tm)
        if (readl(rtap->virtbase + COH901331_VALID)) {
                rtc_time_to_tm(readl(rtap->virtbase + COH901331_CUR_TIME), tm);
                clk_disable(rtap->clk);
-               return rtc_valid_tm(tm);
+               return 0;
        }
        clk_disable(rtap->clk);
        return -EINVAL;
index ff65a7d..d0a8917 100644 (file)
@@ -173,7 +173,7 @@ static int jz4740_rtc_read_time(struct device *dev, struct rtc_time *time)
 
        rtc_time_to_tm(secs, time);
 
-       return rtc_valid_tm(time);
+       return 0;
 }
 
 static int jz4740_rtc_set_mmss(struct device *dev, unsigned long secs)
index 887871c..3ba8723 100644 (file)
@@ -70,7 +70,7 @@ static int lpc32xx_rtc_read_time(struct device *dev, struct rtc_time *time)
        elapsed_sec = rtc_readl(rtc, LPC32XX_RTC_UCOUNT);
        rtc_time_to_tm(elapsed_sec, time);
 
-       return rtc_valid_tm(time);
+       return 0;
 }
 
 static int lpc32xx_rtc_set_mmss(struct device *dev, unsigned long secs)
index e04ca54..045af11 100644 (file)
@@ -98,7 +98,7 @@ static int ls1x_rtc_read_time(struct device *dev, struct rtc_time *rtm)
                        ls1x_get_min(v), ls1x_get_sec(v));
        rtc_time_to_tm(t, rtm);
 
-       return rtc_valid_tm(rtm);
+       return 0;
 }
 
 static int ls1x_rtc_set_time(struct device *dev, struct  rtc_time *rtm)
index 4ca4daa..dd03642 100644 (file)
@@ -122,7 +122,7 @@ static int mpc5121_rtc_read_time(struct device *dev, struct rtc_time *tm)
         */
        mpc5121_rtc_update_smh(regs, tm);
 
-       return rtc_valid_tm(tm);
+       return 0;
 }
 
 static int mpc5121_rtc_set_time(struct device *dev, struct rtc_time *tm)
index c443324..c05f524 100644 (file)
@@ -95,7 +95,7 @@ static int pcap_rtc_read_time(struct device *dev, struct rtc_time *tm)
 
        rtc_time_to_tm(secs, tm);
 
-       return rtc_valid_tm(tm);
+       return 0;
 }
 
 static int pcap_rtc_set_mmss(struct device *dev, unsigned long secs)
index 6a8f5d7..347288b 100644 (file)
@@ -41,7 +41,7 @@ static u64 read_rtc(void)
 static int ps3_get_time(struct device *dev, struct rtc_time *tm)
 {
        rtc_time_to_tm(read_rtc() + ps3_os_area_get_rtc_diff(), tm);
-       return rtc_valid_tm(tm);
+       return 0;
 }
 
 static int ps3_set_time(struct device *dev, struct rtc_time *tm)
index 7fc3697..a7d4932 100644 (file)
@@ -28,7 +28,7 @@ static u32 starfire_get_time(void)
 static int starfire_read_time(struct device *dev, struct rtc_time *tm)
 {
        rtc_time_to_tm(starfire_get_time(), tm);
-       return rtc_valid_tm(tm);
+       return 0;
 }
 
 static const struct rtc_class_ops starfire_rtc_ops = {
index a3418a8..d7785ae 100644 (file)
@@ -90,7 +90,7 @@ static int tps6586x_rtc_read_time(struct device *dev, struct rtc_time *tm)
        seconds = ticks >> 10;
        seconds += rtc->epoch_start;
        rtc_time_to_tm(seconds, tm);
-       return rtc_valid_tm(tm);
+       return 0;
 }
 
 static int tps6586x_rtc_set_time(struct device *dev, struct rtc_time *tm)
index 3b83cdb..08dbefc 100644 (file)
@@ -112,7 +112,7 @@ static int tx4939_rtc_read_time(struct device *dev, struct rtc_time *tm)
        sec = ((unsigned long)buf[5] << 24) | (buf[4] << 16) |
                (buf[3] << 8) | buf[2];
        rtc_time_to_tm(sec, tm);
-       return rtc_valid_tm(tm);
+       return 0;
 }
 
 static int tx4939_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
index 75aea4c..7b824da 100644 (file)
@@ -156,7 +156,7 @@ static int wm831x_rtc_readtime(struct device *dev, struct rtc_time *tm)
                        u32 time = (time1[0] << 16) | time1[1];
 
                        rtc_time_to_tm(time, tm);
-                       return rtc_valid_tm(tm);
+                       return 0;
                }
 
        } while (++count < WM831X_GET_TIME_RETRIES);
index 0c34d3b..1538208 100644 (file)
@@ -60,7 +60,7 @@ static int xgene_rtc_read_time(struct device *dev, struct rtc_time *tm)
        struct xgene_rtc_dev *pdata = dev_get_drvdata(dev);
 
        rtc_time_to_tm(readl(pdata->csr_base + RTC_CCVR), tm);
-       return rtc_valid_tm(tm);
+       return 0;
 }
 
 static int xgene_rtc_set_mmss(struct device *dev, unsigned long secs)