svn commit: r222294 - projects/pseries/powerpc/ofw

Nathan Whitehorn nwhitehorn at FreeBSD.org
Wed May 25 21:53:25 UTC 2011


Author: nwhitehorn
Date: Wed May 25 21:53:25 2011
New Revision: 222294
URL: http://svn.freebsd.org/changeset/base/222294

Log:
  Add some better error handling/reporting.

Modified:
  projects/pseries/powerpc/ofw/rtas.c

Modified: projects/pseries/powerpc/ofw/rtas.c
==============================================================================
--- projects/pseries/powerpc/ofw/rtas.c	Wed May 25 21:49:56 2011	(r222293)
+++ projects/pseries/powerpc/ofw/rtas.c	Wed May 25 21:53:25 2011	(r222294)
@@ -77,12 +77,17 @@ rtas_setup(void *junk)
 	int result;
 
 	rtas = OF_finddevice("/rtas");
-	if (rtas == -1)
+	if (rtas == -1) {
+		rtas = 0;
 		return;
+	}
 	OF_package_to_path(rtas, path, sizeof(path));
 	rtasi = OF_open(path);
-	if (rtasi == -1 || rtasi == 0)
+	if (rtasi == -1 || rtasi == 0) {
+		rtas = 0;
+		printf("Error initializing RTAS: could not open node\n");
 		return;
+	}
 
 	mtx_init(&rtas_mtx, "RTAS", MTX_DEF, 0);
 
@@ -123,7 +128,7 @@ rtas_setup(void *junk)
 	if (result != 0) {
 		rtas = 0;
 		rtas_ptr = 0;
-		printf("Error initializing RTAS\n");
+		printf("Error initializing RTAS (%d)\n", result);
 		return;
 	}
 


More information about the svn-src-projects mailing list