mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 18:13:41 +02:00
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>
This commit is contained in:
parent
536e2fce89
commit
6ca8f8bf70
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user