Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Rob Herring and committed by
Greg Kroah-Hartman
6ca8f8bf 536e2fce

+1 -1
+1 -1
drivers/misc/lis3lv02d/lis3lv02d.c
··· 1085 1085 if (of_property_read_s32(np, "st,axis-z", &sval) == 0) 1086 1086 pdata->axis_z = sval; 1087 1087 1088 - if (of_get_property(np, "st,default-rate", NULL)) 1088 + if (of_property_read_u32(np, "st,default-rate", &val) == 0) 1089 1089 pdata->default_rate = val; 1090 1090 1091 1091 if (of_property_read_s32(np, "st,min-limit-x", &sval) == 0)