patch-2.4.22 linux-2.4.22/arch/sparc64/prom/init.c

Next file: linux-2.4.22/arch/x86_64/Makefile
Previous file: linux-2.4.22/arch/sparc64/prom/bootstr.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/arch/sparc64/prom/init.c linux-2.4.22/arch/sparc64/prom/init.c
@@ -36,6 +36,7 @@
 	int ints[3];
 	int node;
 	int i = 0;
+	int bufadjust;
 
 	prom_vers = PROM_P1275;
 
@@ -63,9 +64,19 @@
 	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
+	 */
+
+	if (strncmp (buffer, "OBP  ", 5))
+		bufadjust = 4;
+	else
+		bufadjust = 5;
 
-	p = buffer + 4;
+	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 @@
 	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();
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)