Commit ba28cc09 authored by Linas Vepstas's avatar Linas Vepstas Committed by Paul Mackerras

[POWERPC] pseries: Use rtas_token instead of hand-rolled code

The rtas_token() call does the same thing as this hand-rolled code.
This makes the code easier to read.
Signed-off-by: default avatarLinas Vepstas <linas@austin.ibm.com>

----
 arch/powerpc/platforms/pseries/rtasd.c |   13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent a4fc3a3c
...@@ -361,26 +361,17 @@ static int enable_surveillance(int timeout) ...@@ -361,26 +361,17 @@ static int enable_surveillance(int timeout)
static int get_eventscan_parms(void) static int get_eventscan_parms(void)
{ {
struct device_node *node; rtas_event_scan_rate = rtas_token("rtas-event-scan-rate");
const int *ip; if (rtas_event_scan_rate == RTAS_UNKNOWN_SERVICE) {
node = of_find_node_by_path("/rtas");
ip = of_get_property(node, "rtas-event-scan-rate", NULL);
if (ip == NULL) {
printk(KERN_ERR "rtasd: no rtas-event-scan-rate\n"); printk(KERN_ERR "rtasd: no rtas-event-scan-rate\n");
of_node_put(node);
return -1; return -1;
} }
rtas_event_scan_rate = *ip;
DEBUG("rtas-event-scan-rate %d\n", rtas_event_scan_rate); DEBUG("rtas-event-scan-rate %d\n", rtas_event_scan_rate);
/* Make room for the sequence number */ /* Make room for the sequence number */
rtas_error_log_max = rtas_get_error_log_max(); rtas_error_log_max = rtas_get_error_log_max();
rtas_error_log_buffer_max = rtas_error_log_max + sizeof(int); rtas_error_log_buffer_max = rtas_error_log_max + sizeof(int);
of_node_put(node);
return 0; return 0;
} }
......
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