Skip to content

Commit faade09

Browse files
committed
parisc: Improve error return codes when setting rtc time
The HP 730 machine returned strange errors when I tried setting the rtc time. Add some debug code to improve the possibility to trace errors and document that hppa probably has as Y2k38 problem. Signed-off-by: Helge Deller <deller@gmx.de>
1 parent f989335 commit faade09

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

arch/parisc/kernel/time.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,16 @@ static int rtc_generic_get_time(struct device *dev, struct rtc_time *tm)
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-
184-
if (pdc_tod_set(secs, 0) < 0)
183+
int ret;
184+
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
}

0 commit comments

Comments
 (0)