Commit b372b57d authored by Tom 'spot' Callaway's avatar Tom 'spot' Callaway Committed by David S. Miller

[SPARC64]: Fix OBP version parsing on newer systems.

parent f727aff5
......@@ -36,6 +36,7 @@ void __init prom_init(void *cif_handler, void *cif_stack)
int ints[3];
int node;
int i = 0;
int bufferadj;
prom_vers = PROM_P1275;
......@@ -63,9 +64,19 @@ void __init prom_init(void *cif_handler, void *cif_stack)
if (strncmp (buffer, "OBP ", 4))
goto strange_version;
/* Version field is expected to be 'OBP xx.yy.zz date...' */
/*
* Version field is expected to be 'OBP xx.yy.zz date...'
* However, Sun can't stick to this format very well, so
* we need to check for 'OBP xx.yy.zz date...' and adjust
* accordingly. -spot
*/
p = buffer + 4;
if (strncmp (buffer, "OBP ", 5))
bufadjust = 4;
else
bufadjust = 5;
p = buffer + bufadjust;
while (p && isdigit(*p) && i < 3) {
ints[i++] = simple_strtoul(p, NULL, 0);
if ((p = strchr(p, '.')) != NULL)
......@@ -77,7 +88,7 @@ void __init prom_init(void *cif_handler, void *cif_stack)
prom_rev = ints[1];
prom_prev = (ints[0] << 16) | (ints[1] << 8) | ints[2];
printk ("PROMLIB: Sun IEEE Boot Prom %s\n", buffer + 4);
printk ("PROMLIB: Sun IEEE Boot Prom %s\n", buffer + bufadjust);
prom_meminit();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment