Skip to content

Commit b10af50

Browse files
nathanlynchmpe
authored andcommitted
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: 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]
1 parent 336e255 commit b10af50

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

arch/powerpc/kernel/rtasd.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <linux/errno.h>
1010
#include <linux/sched.h>
1111
#include <linux/kernel.h>
12+
#include <linux/of.h>
1213
#include <linux/poll.h>
1314
#include <linux/proc_fs.h>
1415
#include <linux/init.h>
@@ -499,6 +500,8 @@ EXPORT_SYMBOL_GPL(rtas_cancel_event_scan);
499500

500501
static int __init rtas_event_scan_init(void)
501502
{
503+
int err;
504+
502505
if (!machine_is(pseries) && !machine_is(chrp))
503506
return 0;
504507

@@ -509,8 +512,8 @@ static int __init rtas_event_scan_init(void)
509512
return -ENODEV;
510513
}
511514

512-
rtas_event_scan_rate = rtas_token("rtas-event-scan-rate");
513-
if (rtas_event_scan_rate == RTAS_UNKNOWN_SERVICE) {
515+
err = of_property_read_u32(rtas.dev, "rtas-event-scan-rate", &rtas_event_scan_rate);
516+
if (err) {
514517
printk(KERN_ERR "rtasd: no rtas-event-scan-rate on system\n");
515518
return -ENODEV;
516519
}

0 commit comments

Comments
 (0)