vserver 1.9.5.x5
[linux-2.6.git] / arch / ppc64 / kernel / rtc.c
index 536a499..f941278 100644 (file)
@@ -185,11 +185,10 @@ static struct file_operations rtc_fops = {
        .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)
@@ -201,9 +200,11 @@ 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");
@@ -275,7 +276,7 @@ void iSeries_get_rtc_time(struct rtc_time *rtc_tm)
        if (piranha_simulator)
                return;
 
-       mf_getRtc(rtc_tm);
+       mf_get_rtc(rtc_tm);
        rtc_tm->tm_mon--;
 }
 
@@ -285,7 +286,7 @@ void iSeries_get_rtc_time(struct rtc_time *rtc_tm)
  */
 int iSeries_set_rtc_time(struct rtc_time *tm)
 {
-       mf_setRtc(tm);
+       mf_set_rtc(tm);
        return 0;
 }
 
@@ -356,7 +357,7 @@ void pSeries_get_boot_time(struct rtc_time *rtc_tm)
                }
        } 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;
@@ -384,7 +385,7 @@ void pSeries_get_rtc_time(struct rtc_time *rtc_tm)
        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 */
                        }
@@ -395,7 +396,7 @@ void pSeries_get_rtc_time(struct rtc_time *rtc_tm)
                }
        } 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;
@@ -430,7 +431,7 @@ int pSeries_set_rtc_time(struct rtc_time *tm)
                }
        } 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);