[PATCH 2/6] pseries: use rtas_token instead of hand-rolled code

Linas Vepstas linas at austin.ibm.com
Thu Aug 9 06:02:10 EST 2007


The rtas_token() call does the same thing as this hand-rolled code.
This makes the code easier to read.

Signed-off-by: Linas Vepstas <linas at austin.ibm.com>

----
 arch/powerpc/platforms/pseries/rtasd.c |   13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

Index: linux-2.6.22-git2/arch/powerpc/platforms/pseries/rtasd.c
===================================================================
--- linux-2.6.22-git2.orig/arch/powerpc/platforms/pseries/rtasd.c	2007-08-07 17:57:13.000000000 -0500
+++ linux-2.6.22-git2/arch/powerpc/platforms/pseries/rtasd.c	2007-08-07 17:57:49.000000000 -0500
@@ -361,26 +361,17 @@ static int enable_surveillance(int timeo
 
 static int get_eventscan_parms(void)
 {
-	struct device_node *node;
-	const int *ip;
-
-	node = of_find_node_by_path("/rtas");
-
-	ip = of_get_property(node, "rtas-event-scan-rate", NULL);
-	if (ip == NULL) {
+	rtas_event_scan_rate = rtas_token("rtas-event-scan-rate");
+	if (rtas_event_scan_rate == RTAS_UNKNOWN_SERVICE) {
 		printk(KERN_ERR "rtasd: no rtas-event-scan-rate\n");
-		of_node_put(node);
 		return -1;
 	}
-	rtas_event_scan_rate = *ip;
 	DEBUG("rtas-event-scan-rate %d\n", rtas_event_scan_rate);
 
 	/* Make room for the sequence number */
 	rtas_error_log_max = rtas_get_error_log_max();
 	rtas_error_log_buffer_max = rtas_error_log_max + sizeof(int);
 
-	of_node_put(node);
-
 	return 0;
 }
 



More information about the Linuxppc-dev mailing list