]> Git Repo - J-linux.git/commitdiff
misc: lis3lv02d: Fix reading 'st,default-rate' property
authorRob Herring <[email protected]>
Fri, 10 Mar 2023 14:47:13 +0000 (08:47 -0600)
committerGreg Kroah-Hartman <[email protected]>
Fri, 17 Mar 2023 14:23:32 +0000 (15:23 +0100)
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/misc/lis3lv02d/lis3lv02d.c

index 3e11f4d0b454a20dc96f12fdd3cd56d0117cf352..299d316f1bdab51687ca6b122f63845d4728d3b0 100644 (file)
@@ -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)
This page took 0.055286 seconds and 4 git commands to generate.