forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 748e4f3d702def1a4bff191e0cf93b6a05340f01
kernel/arch/parisc/kernel/time.c
....@@ -40,7 +40,7 @@
4040
4141 #include <linux/timex.h>
4242
43
-static unsigned long clocktick __read_mostly; /* timer cycles per tick */
43
+static unsigned long clocktick __ro_after_init; /* timer cycles per tick */
4444
4545 /*
4646 * We keep time on PA-RISC Linux by using the Interval Timer which is
....@@ -180,9 +180,16 @@
180180 static int rtc_generic_set_time(struct device *dev, struct rtc_time *tm)
181181 {
182182 time64_t secs = rtc_tm_to_time64(tm);
183
+ int ret;
183184
184
- if (pdc_tod_set(secs, 0) < 0)
185
+ /* hppa has Y2K38 problem: pdc_tod_set() takes an u32 value! */
186
+ ret = pdc_tod_set(secs, 0);
187
+ if (ret != 0) {
188
+ pr_warn("pdc_tod_set(%lld) returned error %d\n", secs, ret);
189
+ if (ret == PDC_INVALID_ARG)
190
+ return -EINVAL;
185191 return -EOPNOTSUPP;
192
+ }
186193
187194 return 0;
188195 }