Commit b10af504 authored by Nathan Lynch's avatar Nathan Lynch Committed by Michael Ellerman

powerpc/rtasd: use correct OF API for event scan rate

rtas_token() should be used only for properties that are RTAS function
tokens. "rtas-event-scan-rate" does not contain a function token, but it
has the same size/format as token properties so reading it with
rtas_token() happens to work.

Convert to of_property_read_u32().
Signed-off-by: default avatarNathan Lynch <nathanl@linux.ibm.com>
Reviewed-by: default avatarAndrew Donnellan <ajd@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20221118150751.469393-3-nathanl@linux.ibm.com
parent 336e2554
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/of.h>
#include <linux/poll.h> #include <linux/poll.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -499,6 +500,8 @@ EXPORT_SYMBOL_GPL(rtas_cancel_event_scan); ...@@ -499,6 +500,8 @@ EXPORT_SYMBOL_GPL(rtas_cancel_event_scan);
static int __init rtas_event_scan_init(void) static int __init rtas_event_scan_init(void)
{ {
int err;
if (!machine_is(pseries) && !machine_is(chrp)) if (!machine_is(pseries) && !machine_is(chrp))
return 0; return 0;
...@@ -509,8 +512,8 @@ static int __init rtas_event_scan_init(void) ...@@ -509,8 +512,8 @@ static int __init rtas_event_scan_init(void)
return -ENODEV; return -ENODEV;
} }
rtas_event_scan_rate = rtas_token("rtas-event-scan-rate"); err = of_property_read_u32(rtas.dev, "rtas-event-scan-rate", &rtas_event_scan_rate);
if (rtas_event_scan_rate == RTAS_UNKNOWN_SERVICE) { if (err) {
printk(KERN_ERR "rtasd: no rtas-event-scan-rate on system\n"); printk(KERN_ERR "rtasd: no rtas-event-scan-rate on system\n");
return -ENODEV; return -ENODEV;
} }
......
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