Skip to content

Commit

Permalink
powerpc/rtasd: use correct OF API for event scan rate
Browse files Browse the repository at this point in the history
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: Nathan Lynch <[email protected]>
Reviewed-by: Andrew Donnellan <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
nathanlynch authored and mpe committed Dec 7, 2022
1 parent 336e255 commit b10af50
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions arch/powerpc/kernel/rtasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/of.h>
#include <linux/poll.h>
#include <linux/proc_fs.h>
#include <linux/init.h>
Expand Down Expand Up @@ -499,6 +500,8 @@ EXPORT_SYMBOL_GPL(rtas_cancel_event_scan);

static int __init rtas_event_scan_init(void)
{
int err;

if (!machine_is(pseries) && !machine_is(chrp))
return 0;

Expand All @@ -509,8 +512,8 @@ static int __init rtas_event_scan_init(void)
return -ENODEV;
}

rtas_event_scan_rate = rtas_token("rtas-event-scan-rate");
if (rtas_event_scan_rate == RTAS_UNKNOWN_SERVICE) {
err = of_property_read_u32(rtas.dev, "rtas-event-scan-rate", &rtas_event_scan_rate);
if (err) {
printk(KERN_ERR "rtasd: no rtas-event-scan-rate on system\n");
return -ENODEV;
}
Expand Down

0 comments on commit b10af50

Please sign in to comment.