aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2018-02-19 10:23:55 -0500
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2018-03-01 04:49:41 -0500
commitab62670e57174c547abbecacf6df78d3dcf03f26 (patch)
tree5ca67c1fca5b03d229b17e2194d9ecca910dbb7a
parent146d21bd9dc167d75bed4c0fdfe790db7565e99b (diff)
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>
-rw-r--r--drivers/rtc/rtc-ab8500.c2
-rw-r--r--drivers/rtc/rtc-coh901331.c2
-rw-r--r--drivers/rtc/rtc-jz4740.c2
-rw-r--r--drivers/rtc/rtc-lpc32xx.c2
-rw-r--r--drivers/rtc/rtc-ls1x.c2
-rw-r--r--drivers/rtc/rtc-mpc5121.c2
-rw-r--r--drivers/rtc/rtc-pcap.c2
-rw-r--r--drivers/rtc/rtc-ps3.c2
-rw-r--r--drivers/rtc/rtc-starfire.c2
-rw-r--r--drivers/rtc/rtc-tps6586x.c2
-rw-r--r--drivers/rtc/rtc-tx4939.c2
-rw-r--r--drivers/rtc/rtc-wm831x.c2
-rw-r--r--drivers/rtc/rtc-xgene.c2
13 files changed, 13 insertions, 13 deletions
diff --git a/drivers/rtc/rtc-ab8500.c b/drivers/rtc/rtc-ab8500.c
index 24a0af650a1b..98c7123cd7ba 100644
--- a/drivers/rtc/rtc-ab8500.c
+++ b/drivers/rtc/rtc-ab8500.c
@@ -131,7 +131,7 @@ static int ab8500_rtc_read_time(struct device *dev, struct rtc_time *tm)
131 secs += get_elapsed_seconds(AB8500_RTC_EPOCH); 131 secs += get_elapsed_seconds(AB8500_RTC_EPOCH);
132 132
133 rtc_time_to_tm(secs, tm); 133 rtc_time_to_tm(secs, tm);
134 return rtc_valid_tm(tm); 134 return 0;
135} 135}
136 136
137static int ab8500_rtc_set_time(struct device *dev, struct rtc_time *tm) 137static int ab8500_rtc_set_time(struct device *dev, struct rtc_time *tm)
diff --git a/drivers/rtc/rtc-coh901331.c b/drivers/rtc/rtc-coh901331.c
index cfc4141d99cd..2fc517498a5d 100644
--- a/drivers/rtc/rtc-coh901331.c
+++ b/drivers/rtc/rtc-coh901331.c
@@ -82,7 +82,7 @@ static int coh901331_read_time(struct device *dev, struct rtc_time *tm)
82 if (readl(rtap->virtbase + COH901331_VALID)) { 82 if (readl(rtap->virtbase + COH901331_VALID)) {
83 rtc_time_to_tm(readl(rtap->virtbase + COH901331_CUR_TIME), tm); 83 rtc_time_to_tm(readl(rtap->virtbase + COH901331_CUR_TIME), tm);
84 clk_disable(rtap->clk); 84 clk_disable(rtap->clk);
85 return rtc_valid_tm(tm); 85 return 0;
86 } 86 }
87 clk_disable(rtap->clk); 87 clk_disable(rtap->clk);
88 return -EINVAL; 88 return -EINVAL;
diff --git a/drivers/rtc/rtc-jz4740.c b/drivers/rtc/rtc-jz4740.c
index ff65a7d2b9c9..d0a891777f44 100644
--- a/drivers/rtc/rtc-jz4740.c
+++ b/drivers/rtc/rtc-jz4740.c
@@ -173,7 +173,7 @@ static int jz4740_rtc_read_time(struct device *dev, struct rtc_time *time)
173 173
174 rtc_time_to_tm(secs, time); 174 rtc_time_to_tm(secs, time);
175 175
176 return rtc_valid_tm(time); 176 return 0;
177} 177}
178 178
179static int jz4740_rtc_set_mmss(struct device *dev, unsigned long secs) 179static int jz4740_rtc_set_mmss(struct device *dev, unsigned long secs)
diff --git a/drivers/rtc/rtc-lpc32xx.c b/drivers/rtc/rtc-lpc32xx.c
index 887871c3d526..3ba87239aacc 100644
--- a/drivers/rtc/rtc-lpc32xx.c
+++ b/drivers/rtc/rtc-lpc32xx.c
@@ -70,7 +70,7 @@ static int lpc32xx_rtc_read_time(struct device *dev, struct rtc_time *time)
70 elapsed_sec = rtc_readl(rtc, LPC32XX_RTC_UCOUNT); 70 elapsed_sec = rtc_readl(rtc, LPC32XX_RTC_UCOUNT);
71 rtc_time_to_tm(elapsed_sec, time); 71 rtc_time_to_tm(elapsed_sec, time);
72 72
73 return rtc_valid_tm(time); 73 return 0;
74} 74}
75 75
76static int lpc32xx_rtc_set_mmss(struct device *dev, unsigned long secs) 76static int lpc32xx_rtc_set_mmss(struct device *dev, unsigned long secs)
diff --git a/drivers/rtc/rtc-ls1x.c b/drivers/rtc/rtc-ls1x.c
index e04ca54f21e2..045af1135e48 100644
--- a/drivers/rtc/rtc-ls1x.c
+++ b/drivers/rtc/rtc-ls1x.c
@@ -98,7 +98,7 @@ static int ls1x_rtc_read_time(struct device *dev, struct rtc_time *rtm)
98 ls1x_get_min(v), ls1x_get_sec(v)); 98 ls1x_get_min(v), ls1x_get_sec(v));
99 rtc_time_to_tm(t, rtm); 99 rtc_time_to_tm(t, rtm);
100 100
101 return rtc_valid_tm(rtm); 101 return 0;
102} 102}
103 103
104static int ls1x_rtc_set_time(struct device *dev, struct rtc_time *rtm) 104static int ls1x_rtc_set_time(struct device *dev, struct rtc_time *rtm)
diff --git a/drivers/rtc/rtc-mpc5121.c b/drivers/rtc/rtc-mpc5121.c
index 4ca4daa0b8f3..dd0364293bc0 100644
--- a/drivers/rtc/rtc-mpc5121.c
+++ b/drivers/rtc/rtc-mpc5121.c
@@ -122,7 +122,7 @@ static int mpc5121_rtc_read_time(struct device *dev, struct rtc_time *tm)
122 */ 122 */
123 mpc5121_rtc_update_smh(regs, tm); 123 mpc5121_rtc_update_smh(regs, tm);
124 124
125 return rtc_valid_tm(tm); 125 return 0;
126} 126}
127 127
128static int mpc5121_rtc_set_time(struct device *dev, struct rtc_time *tm) 128static int mpc5121_rtc_set_time(struct device *dev, struct rtc_time *tm)
diff --git a/drivers/rtc/rtc-pcap.c b/drivers/rtc/rtc-pcap.c
index c4433240d8a9..c05f524ba9af 100644
--- a/drivers/rtc/rtc-pcap.c
+++ b/drivers/rtc/rtc-pcap.c
@@ -95,7 +95,7 @@ static int pcap_rtc_read_time(struct device *dev, struct rtc_time *tm)
95 95
96 rtc_time_to_tm(secs, tm); 96 rtc_time_to_tm(secs, tm);
97 97
98 return rtc_valid_tm(tm); 98 return 0;
99} 99}
100 100
101static int pcap_rtc_set_mmss(struct device *dev, unsigned long secs) 101static int pcap_rtc_set_mmss(struct device *dev, unsigned long secs)
diff --git a/drivers/rtc/rtc-ps3.c b/drivers/rtc/rtc-ps3.c
index 6a8f5d758eac..347288bff438 100644
--- a/drivers/rtc/rtc-ps3.c
+++ b/drivers/rtc/rtc-ps3.c
@@ -41,7 +41,7 @@ static u64 read_rtc(void)
41static int ps3_get_time(struct device *dev, struct rtc_time *tm) 41static int ps3_get_time(struct device *dev, struct rtc_time *tm)
42{ 42{
43 rtc_time_to_tm(read_rtc() + ps3_os_area_get_rtc_diff(), tm); 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
47static int ps3_set_time(struct device *dev, struct rtc_time *tm) 47static int ps3_set_time(struct device *dev, struct rtc_time *tm)
diff --git a/drivers/rtc/rtc-starfire.c b/drivers/rtc/rtc-starfire.c
index 7fc36973fa33..a7d49329d626 100644
--- a/drivers/rtc/rtc-starfire.c
+++ b/drivers/rtc/rtc-starfire.c
@@ -28,7 +28,7 @@ static u32 starfire_get_time(void)
28static int starfire_read_time(struct device *dev, struct rtc_time *tm) 28static int starfire_read_time(struct device *dev, struct rtc_time *tm)
29{ 29{
30 rtc_time_to_tm(starfire_get_time(), tm); 30 rtc_time_to_tm(starfire_get_time(), tm);
31 return rtc_valid_tm(tm); 31 return 0;
32} 32}
33 33
34static const struct rtc_class_ops starfire_rtc_ops = { 34static const struct rtc_class_ops starfire_rtc_ops = {
diff --git a/drivers/rtc/rtc-tps6586x.c b/drivers/rtc/rtc-tps6586x.c
index a3418a8a3796..d7785ae0a2b4 100644
--- a/drivers/rtc/rtc-tps6586x.c
+++ b/drivers/rtc/rtc-tps6586x.c
@@ -90,7 +90,7 @@ static int tps6586x_rtc_read_time(struct device *dev, struct rtc_time *tm)
90 seconds = ticks >> 10; 90 seconds = ticks >> 10;
91 seconds += rtc->epoch_start; 91 seconds += rtc->epoch_start;
92 rtc_time_to_tm(seconds, tm); 92 rtc_time_to_tm(seconds, tm);
93 return rtc_valid_tm(tm); 93 return 0;
94} 94}
95 95
96static int tps6586x_rtc_set_time(struct device *dev, struct rtc_time *tm) 96static int tps6586x_rtc_set_time(struct device *dev, struct rtc_time *tm)
diff --git a/drivers/rtc/rtc-tx4939.c b/drivers/rtc/rtc-tx4939.c
index 3b83cdb0b828..08dbefc79520 100644
--- a/drivers/rtc/rtc-tx4939.c
+++ b/drivers/rtc/rtc-tx4939.c
@@ -112,7 +112,7 @@ static int tx4939_rtc_read_time(struct device *dev, struct rtc_time *tm)
112 sec = ((unsigned long)buf[5] << 24) | (buf[4] << 16) | 112 sec = ((unsigned long)buf[5] << 24) | (buf[4] << 16) |
113 (buf[3] << 8) | buf[2]; 113 (buf[3] << 8) | buf[2];
114 rtc_time_to_tm(sec, tm); 114 rtc_time_to_tm(sec, tm);
115 return rtc_valid_tm(tm); 115 return 0;
116} 116}
117 117
118static int tx4939_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) 118static int tx4939_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
diff --git a/drivers/rtc/rtc-wm831x.c b/drivers/rtc/rtc-wm831x.c
index 75aea4c4d334..7b824dabf104 100644
--- a/drivers/rtc/rtc-wm831x.c
+++ b/drivers/rtc/rtc-wm831x.c
@@ -156,7 +156,7 @@ static int wm831x_rtc_readtime(struct device *dev, struct rtc_time *tm)
156 u32 time = (time1[0] << 16) | time1[1]; 156 u32 time = (time1[0] << 16) | time1[1];
157 157
158 rtc_time_to_tm(time, tm); 158 rtc_time_to_tm(time, tm);
159 return rtc_valid_tm(tm); 159 return 0;
160 } 160 }
161 161
162 } while (++count < WM831X_GET_TIME_RETRIES); 162 } while (++count < WM831X_GET_TIME_RETRIES);
diff --git a/drivers/rtc/rtc-xgene.c b/drivers/rtc/rtc-xgene.c
index 0c34d3b81279..153820876a82 100644
--- a/drivers/rtc/rtc-xgene.c
+++ b/drivers/rtc/rtc-xgene.c
@@ -60,7 +60,7 @@ static int xgene_rtc_read_time(struct device *dev, struct rtc_time *tm)
60 struct xgene_rtc_dev *pdata = dev_get_drvdata(dev); 60 struct xgene_rtc_dev *pdata = dev_get_drvdata(dev);
61 61
62 rtc_time_to_tm(readl(pdata->csr_base + RTC_CCVR), tm); 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
66static int xgene_rtc_set_mmss(struct device *dev, unsigned long secs) 66static int xgene_rtc_set_mmss(struct device *dev, unsigned long secs)