~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/powerpc/kernel/rtas-rtc.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
#include <linux/init.h>
5
5
#include <linux/rtc.h>
6
6
#include <linux/delay.h>
 
7
#include <linux/ratelimit.h>
7
8
#include <asm/prom.h>
8
9
#include <asm/rtas.h>
9
10
#include <asm/time.h>
29
30
                }
30
31
        } while (wait_time && (get_tb() < max_wait_tb));
31
32
 
32
 
        if (error != 0 && printk_ratelimit()) {
33
 
                printk(KERN_WARNING "error: reading the clock failed (%d)\n",
34
 
                        error);
 
33
        if (error != 0) {
 
34
                printk_ratelimited(KERN_WARNING
 
35
                                   "error: reading the clock failed (%d)\n",
 
36
                                   error);
35
37
                return 0;
36
38
        }
37
39
 
55
57
 
56
58
                wait_time = rtas_busy_delay_time(error);
57
59
                if (wait_time) {
58
 
                        if (in_interrupt() && printk_ratelimit()) {
 
60
                        if (in_interrupt()) {
59
61
                                memset(rtc_tm, 0, sizeof(struct rtc_time));
60
 
                                printk(KERN_WARNING "error: reading clock"
61
 
                                       " would delay interrupt\n");
 
62
                                printk_ratelimited(KERN_WARNING
 
63
                                                   "error: reading clock "
 
64
                                                   "would delay interrupt\n");
62
65
                                return; /* delay not allowed */
63
66
                        }
64
67
                        msleep(wait_time);
65
68
                }
66
69
        } while (wait_time && (get_tb() < max_wait_tb));
67
70
 
68
 
        if (error != 0 && printk_ratelimit()) {
69
 
                printk(KERN_WARNING "error: reading the clock failed (%d)\n",
70
 
                       error);
 
71
        if (error != 0) {
 
72
                printk_ratelimited(KERN_WARNING
 
73
                                   "error: reading the clock failed (%d)\n",
 
74
                                   error);
71
75
                return;
72
76
        }
73
77
 
99
103
                }
100
104
        } while (wait_time && (get_tb() < max_wait_tb));
101
105
 
102
 
        if (error != 0 && printk_ratelimit())
103
 
                printk(KERN_WARNING "error: setting the clock failed (%d)\n",
104
 
                       error);
 
106
        if (error != 0)
 
107
                printk_ratelimited(KERN_WARNING
 
108
                                   "error: setting the clock failed (%d)\n",
 
109
                                   error);
105
110
 
106
111
        return 0;
107
112
}