aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/rtas.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/rtas.c')
-rw-r--r--arch/powerpc/kernel/rtas.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index 4a4cb5598402..10e10be324c9 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -177,10 +177,12 @@ void __init udbg_init_rtas_console(void)
177void rtas_progress(char *s, unsigned short hex) 177void rtas_progress(char *s, unsigned short hex)
178{ 178{
179 struct device_node *root; 179 struct device_node *root;
180 int width, *p; 180 int width;
181 const int *p;
181 char *os; 182 char *os;
182 static int display_character, set_indicator; 183 static int display_character, set_indicator;
183 static int display_width, display_lines, *row_width, form_feed; 184 static int display_width, display_lines, form_feed;
185 const static int *row_width;
184 static DEFINE_SPINLOCK(progress_lock); 186 static DEFINE_SPINLOCK(progress_lock);
185 static int current_line; 187 static int current_line;
186 static int pending_newline = 0; /* did last write end with unprinted newline? */ 188 static int pending_newline = 0; /* did last write end with unprinted newline? */
@@ -191,16 +193,16 @@ void rtas_progress(char *s, unsigned short hex)
191 if (display_width == 0) { 193 if (display_width == 0) {
192 display_width = 0x10; 194 display_width = 0x10;
193 if ((root = find_path_device("/rtas"))) { 195 if ((root = find_path_device("/rtas"))) {
194 if ((p = (unsigned int *)get_property(root, 196 if ((p = get_property(root,
195 "ibm,display-line-length", NULL))) 197 "ibm,display-line-length", NULL)))
196 display_width = *p; 198 display_width = *p;
197 if ((p = (unsigned int *)get_property(root, 199 if ((p = get_property(root,
198 "ibm,form-feed", NULL))) 200 "ibm,form-feed", NULL)))
199 form_feed = *p; 201 form_feed = *p;
200 if ((p = (unsigned int *)get_property(root, 202 if ((p = get_property(root,
201 "ibm,display-number-of-lines", NULL))) 203 "ibm,display-number-of-lines", NULL)))
202 display_lines = *p; 204 display_lines = *p;
203 row_width = (unsigned int *)get_property(root, 205 row_width = get_property(root,
204 "ibm,display-truncation-length", NULL); 206 "ibm,display-truncation-length", NULL);
205 } 207 }
206 display_character = rtas_token("display-character"); 208 display_character = rtas_token("display-character");
@@ -293,10 +295,10 @@ EXPORT_SYMBOL(rtas_progress); /* needed by rtas_flash module */
293 295
294int rtas_token(const char *service) 296int rtas_token(const char *service)
295{ 297{
296 int *tokp; 298 const int *tokp;
297 if (rtas.dev == NULL) 299 if (rtas.dev == NULL)
298 return RTAS_UNKNOWN_SERVICE; 300 return RTAS_UNKNOWN_SERVICE;
299 tokp = (int *) get_property(rtas.dev, service, NULL); 301 tokp = get_property(rtas.dev, service, NULL);
300 return tokp ? *tokp : RTAS_UNKNOWN_SERVICE; 302 return tokp ? *tokp : RTAS_UNKNOWN_SERVICE;
301} 303}
302EXPORT_SYMBOL(rtas_token); 304EXPORT_SYMBOL(rtas_token);
@@ -824,15 +826,15 @@ void __init rtas_initialize(void)
824 */ 826 */
825 rtas.dev = of_find_node_by_name(NULL, "rtas"); 827 rtas.dev = of_find_node_by_name(NULL, "rtas");
826 if (rtas.dev) { 828 if (rtas.dev) {
827 u32 *basep, *entryp; 829 const u32 *basep, *entryp, *sizep;
828 u32 *sizep;
829 830
830 basep = (u32 *)get_property(rtas.dev, "linux,rtas-base", NULL); 831 basep = get_property(rtas.dev, "linux,rtas-base", NULL);
831 sizep = (u32 *)get_property(rtas.dev, "rtas-size", NULL); 832 sizep = get_property(rtas.dev, "rtas-size", NULL);
832 if (basep != NULL && sizep != NULL) { 833 if (basep != NULL && sizep != NULL) {
833 rtas.base = *basep; 834 rtas.base = *basep;
834 rtas.size = *sizep; 835 rtas.size = *sizep;
835 entryp = (u32 *)get_property(rtas.dev, "linux,rtas-entry", NULL); 836 entryp = get_property(rtas.dev,
837 "linux,rtas-entry", NULL);
836 if (entryp == NULL) /* Ugh */ 838 if (entryp == NULL) /* Ugh */
837 rtas.entry = rtas.base; 839 rtas.entry = rtas.base;
838 else 840 else