diff options
author | Rob Herring <robh@kernel.org> | 2023-03-10 17:47:13 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-17 17:23:32 +0300 |
commit | 6ca8f8bf706d874090b74f811194e94ebbc560df (patch) | |
tree | 16b62e8af474204bad854c1238ec3238b10bd38b /drivers/misc | |
parent | 536e2fce8980c84247ee52e737d24bd1ffdb0d7f (diff) | |
download | linux-6ca8f8bf706d874090b74f811194e94ebbc560df.tar.xz |
misc: lis3lv02d: Fix reading 'st,default-rate' property
The property 'st,default-rate' is tested for presence, but the value is
ignored and the 'default_rate' value is updated with a stale 'val'
value. Fix this by using of_property_read_u32().
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230310144713.1543613-1-robh@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/lis3lv02d/lis3lv02d.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/lis3lv02d/lis3lv02d.c b/drivers/misc/lis3lv02d/lis3lv02d.c index 3e11f4d0b454..299d316f1bda 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d.c +++ b/drivers/misc/lis3lv02d/lis3lv02d.c @@ -1085,7 +1085,7 @@ int lis3lv02d_init_dt(struct lis3lv02d *lis3) if (of_property_read_s32(np, "st,axis-z", &sval) == 0) pdata->axis_z = sval; - if (of_get_property(np, "st,default-rate", NULL)) + if (of_property_read_u32(np, "st,default-rate", &val) == 0) pdata->default_rate = val; if (of_property_read_s32(np, "st,min-limit-x", &sval) == 0) |