| .. | .. |
|---|
| 40 | 40 | |
|---|
| 41 | 41 | #include <linux/timex.h> |
|---|
| 42 | 42 | |
|---|
| 43 | | -static unsigned long clocktick __read_mostly; /* timer cycles per tick */ |
|---|
| 43 | +static unsigned long clocktick __ro_after_init; /* timer cycles per tick */ |
|---|
| 44 | 44 | |
|---|
| 45 | 45 | /* |
|---|
| 46 | 46 | * We keep time on PA-RISC Linux by using the Interval Timer which is |
|---|
| .. | .. |
|---|
| 180 | 180 | static int rtc_generic_set_time(struct device *dev, struct rtc_time *tm) |
|---|
| 181 | 181 | { |
|---|
| 182 | 182 | time64_t secs = rtc_tm_to_time64(tm); |
|---|
| 183 | + int ret; |
|---|
| 183 | 184 | |
|---|
| 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; |
|---|
| 185 | 191 | return -EOPNOTSUPP; |
|---|
| 192 | + } |
|---|
| 186 | 193 | |
|---|
| 187 | 194 | return 0; |
|---|
| 188 | 195 | } |
|---|