.release = rtc_release,
};
-static struct miscdevice rtc_dev=
-{
- RTC_MINOR,
- "rtc",
- &rtc_fops
+static struct miscdevice rtc_dev = {
+ .minor = RTC_MINOR,
+ .name = "rtc",
+ .fops = &rtc_fops
};
static int __init rtc_init(void)
return retval;
#ifdef CONFIG_PROC_FS
- if (create_proc_read_entry ("driver/rtc", 0, NULL, rtc_read_proc, NULL) == NULL)
+ if (create_proc_read_entry("driver/rtc", 0, NULL, rtc_read_proc, NULL)
+ == NULL) {
misc_deregister(&rtc_dev);
return -ENOMEM;
+ }
#endif
printk(KERN_INFO "i/pSeries Real Time Clock Driver v" RTC_VERSION "\n");
if (piranha_simulator)
return;
- mf_getRtc(rtc_tm);
+ mf_get_rtc(rtc_tm);
rtc_tm->tm_mon--;
}
*/
int iSeries_set_rtc_time(struct rtc_time *tm)
{
- mf_setRtc(tm);
+ mf_set_rtc(tm);
return 0;
}
}
} while (error == RTAS_CLOCK_BUSY && (__get_tb() < max_wait_tb));
- if (error != 0) {
+ if (error != 0 && printk_ratelimit()) {
printk(KERN_WARNING "error: reading the clock failed (%d)\n",
error);
return;
do {
error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret);
if (error == RTAS_CLOCK_BUSY || rtas_is_extended_busy(error)) {
- if (in_interrupt()) {
+ if (in_interrupt() && printk_ratelimit()) {
printk(KERN_WARNING "error: reading clock would delay interrupt\n");
return; /* delay not allowed */
}
}
} while (error == RTAS_CLOCK_BUSY && (__get_tb() < max_wait_tb));
- if (error != 0) {
+ if (error != 0 && printk_ratelimit()) {
printk(KERN_WARNING "error: reading the clock failed (%d)\n",
error);
return;
}
} while (error == RTAS_CLOCK_BUSY && (__get_tb() < max_wait_tb));
- if (error != 0)
+ if (error != 0 && printk_ratelimit())
printk(KERN_WARNING "error: setting the clock failed (%d)\n",
error);