Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 May 2011 21:53:25 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r222294 - projects/pseries/powerpc/ofw
Message-ID:  <201105252153.p4PLrPCW031806@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105252153.p4PLrPCW031806>