Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtc: stop validating rtc_time after rtc_time_to_tm

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 -13
+1 -1
drivers/rtc/rtc-ab8500.c
··· 131 131 secs += get_elapsed_seconds(AB8500_RTC_EPOCH); 132 132 133 133 rtc_time_to_tm(secs, tm); 134 - return rtc_valid_tm(tm); 134 + return 0; 135 135 } 136 136 137 137 static int ab8500_rtc_set_time(struct device *dev, struct rtc_time *tm)
+1 -1
drivers/rtc/rtc-coh901331.c
··· 82 82 if (readl(rtap->virtbase + COH901331_VALID)) { 83 83 rtc_time_to_tm(readl(rtap->virtbase + COH901331_CUR_TIME), tm); 84 84 clk_disable(rtap->clk); 85 - return rtc_valid_tm(tm); 85 + return 0; 86 86 } 87 87 clk_disable(rtap->clk); 88 88 return -EINVAL;
+1 -1
drivers/rtc/rtc-jz4740.c
··· 173 173 174 174 rtc_time_to_tm(secs, time); 175 175 176 - return rtc_valid_tm(time); 176 + return 0; 177 177 } 178 178 179 179 static int jz4740_rtc_set_mmss(struct device *dev, unsigned long secs)
+1 -1
drivers/rtc/rtc-lpc32xx.c
··· 70 70 elapsed_sec = rtc_readl(rtc, LPC32XX_RTC_UCOUNT); 71 71 rtc_time_to_tm(elapsed_sec, time); 72 72 73 - return rtc_valid_tm(time); 73 + return 0; 74 74 } 75 75 76 76 static int lpc32xx_rtc_set_mmss(struct device *dev, unsigned long secs)
+1 -1
drivers/rtc/rtc-ls1x.c
··· 98 98 ls1x_get_min(v), ls1x_get_sec(v)); 99 99 rtc_time_to_tm(t, rtm); 100 100 101 - return rtc_valid_tm(rtm); 101 + return 0; 102 102 } 103 103 104 104 static int ls1x_rtc_set_time(struct device *dev, struct rtc_time *rtm)
+1 -1
drivers/rtc/rtc-mpc5121.c
··· 122 122 */ 123 123 mpc5121_rtc_update_smh(regs, tm); 124 124 125 - return rtc_valid_tm(tm); 125 + return 0; 126 126 } 127 127 128 128 static int mpc5121_rtc_set_time(struct device *dev, struct rtc_time *tm)
+1 -1
drivers/rtc/rtc-pcap.c
··· 95 95 96 96 rtc_time_to_tm(secs, tm); 97 97 98 - return rtc_valid_tm(tm); 98 + return 0; 99 99 } 100 100 101 101 static int pcap_rtc_set_mmss(struct device *dev, unsigned long secs)
+1 -1
drivers/rtc/rtc-ps3.c
··· 41 41 static int ps3_get_time(struct device *dev, struct rtc_time *tm) 42 42 { 43 43 rtc_time_to_tm(read_rtc() + ps3_os_area_get_rtc_diff(), tm); 44 - return rtc_valid_tm(tm); 44 + return 0; 45 45 } 46 46 47 47 static int ps3_set_time(struct device *dev, struct rtc_time *tm)
+1 -1
drivers/rtc/rtc-starfire.c
··· 28 28 static int starfire_read_time(struct device *dev, struct rtc_time *tm) 29 29 { 30 30 rtc_time_to_tm(starfire_get_time(), tm); 31 - return rtc_valid_tm(tm); 31 + return 0; 32 32 } 33 33 34 34 static const struct rtc_class_ops starfire_rtc_ops = {
+1 -1
drivers/rtc/rtc-tps6586x.c
··· 90 90 seconds = ticks >> 10; 91 91 seconds += rtc->epoch_start; 92 92 rtc_time_to_tm(seconds, tm); 93 - return rtc_valid_tm(tm); 93 + return 0; 94 94 } 95 95 96 96 static int tps6586x_rtc_set_time(struct device *dev, struct rtc_time *tm)
+1 -1
drivers/rtc/rtc-tx4939.c
··· 112 112 sec = ((unsigned long)buf[5] << 24) | (buf[4] << 16) | 113 113 (buf[3] << 8) | buf[2]; 114 114 rtc_time_to_tm(sec, tm); 115 - return rtc_valid_tm(tm); 115 + return 0; 116 116 } 117 117 118 118 static int tx4939_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
+1 -1
drivers/rtc/rtc-wm831x.c
··· 156 156 u32 time = (time1[0] << 16) | time1[1]; 157 157 158 158 rtc_time_to_tm(time, tm); 159 - return rtc_valid_tm(tm); 159 + return 0; 160 160 } 161 161 162 162 } while (++count < WM831X_GET_TIME_RETRIES);
+1 -1
drivers/rtc/rtc-xgene.c
··· 60 60 struct xgene_rtc_dev *pdata = dev_get_drvdata(dev); 61 61 62 62 rtc_time_to_tm(readl(pdata->csr_base + RTC_CCVR), tm); 63 - return rtc_valid_tm(tm); 63 + return 0; 64 64 } 65 65 66 66 static int xgene_rtc_set_mmss(struct device *dev, unsigned long secs)