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

misc: lis3lv02d: Use of_property_read_bool() for boolean properties

It is preferred to use typed property access functions (i.e.
of_property_read_<type> functions) rather than low-level
of_get_property/of_find_property functions for reading properties.
Convert reading boolean properties to to of_property_read_bool().

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230310144713.1543683-1-robh@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Rob Herring and committed by
Greg Kroah-Hartman
536e2fce d7d744ab

+32 -32
+32 -32
drivers/misc/lis3lv02d/lis3lv02d.c
··· 965 965 if (!pdata) 966 966 return -ENOMEM; 967 967 968 - if (of_get_property(np, "st,click-single-x", NULL)) 968 + if (of_property_read_bool(np, "st,click-single-x")) 969 969 pdata->click_flags |= LIS3_CLICK_SINGLE_X; 970 - if (of_get_property(np, "st,click-double-x", NULL)) 970 + if (of_property_read_bool(np, "st,click-double-x")) 971 971 pdata->click_flags |= LIS3_CLICK_DOUBLE_X; 972 972 973 - if (of_get_property(np, "st,click-single-y", NULL)) 973 + if (of_property_read_bool(np, "st,click-single-y")) 974 974 pdata->click_flags |= LIS3_CLICK_SINGLE_Y; 975 - if (of_get_property(np, "st,click-double-y", NULL)) 975 + if (of_property_read_bool(np, "st,click-double-y")) 976 976 pdata->click_flags |= LIS3_CLICK_DOUBLE_Y; 977 977 978 - if (of_get_property(np, "st,click-single-z", NULL)) 978 + if (of_property_read_bool(np, "st,click-single-z")) 979 979 pdata->click_flags |= LIS3_CLICK_SINGLE_Z; 980 - if (of_get_property(np, "st,click-double-z", NULL)) 980 + if (of_property_read_bool(np, "st,click-double-z")) 981 981 pdata->click_flags |= LIS3_CLICK_DOUBLE_Z; 982 982 983 983 if (!of_property_read_u32(np, "st,click-threshold-x", &val)) ··· 994 994 if (!of_property_read_u32(np, "st,click-window", &val)) 995 995 pdata->click_window = val; 996 996 997 - if (of_get_property(np, "st,irq1-disable", NULL)) 997 + if (of_property_read_bool(np, "st,irq1-disable")) 998 998 pdata->irq_cfg |= LIS3_IRQ1_DISABLE; 999 - if (of_get_property(np, "st,irq1-ff-wu-1", NULL)) 999 + if (of_property_read_bool(np, "st,irq1-ff-wu-1")) 1000 1000 pdata->irq_cfg |= LIS3_IRQ1_FF_WU_1; 1001 - if (of_get_property(np, "st,irq1-ff-wu-2", NULL)) 1001 + if (of_property_read_bool(np, "st,irq1-ff-wu-2")) 1002 1002 pdata->irq_cfg |= LIS3_IRQ1_FF_WU_2; 1003 - if (of_get_property(np, "st,irq1-data-ready", NULL)) 1003 + if (of_property_read_bool(np, "st,irq1-data-ready")) 1004 1004 pdata->irq_cfg |= LIS3_IRQ1_DATA_READY; 1005 - if (of_get_property(np, "st,irq1-click", NULL)) 1005 + if (of_property_read_bool(np, "st,irq1-click")) 1006 1006 pdata->irq_cfg |= LIS3_IRQ1_CLICK; 1007 1007 1008 - if (of_get_property(np, "st,irq2-disable", NULL)) 1008 + if (of_property_read_bool(np, "st,irq2-disable")) 1009 1009 pdata->irq_cfg |= LIS3_IRQ2_DISABLE; 1010 - if (of_get_property(np, "st,irq2-ff-wu-1", NULL)) 1010 + if (of_property_read_bool(np, "st,irq2-ff-wu-1")) 1011 1011 pdata->irq_cfg |= LIS3_IRQ2_FF_WU_1; 1012 - if (of_get_property(np, "st,irq2-ff-wu-2", NULL)) 1012 + if (of_property_read_bool(np, "st,irq2-ff-wu-2")) 1013 1013 pdata->irq_cfg |= LIS3_IRQ2_FF_WU_2; 1014 - if (of_get_property(np, "st,irq2-data-ready", NULL)) 1014 + if (of_property_read_bool(np, "st,irq2-data-ready")) 1015 1015 pdata->irq_cfg |= LIS3_IRQ2_DATA_READY; 1016 - if (of_get_property(np, "st,irq2-click", NULL)) 1016 + if (of_property_read_bool(np, "st,irq2-click")) 1017 1017 pdata->irq_cfg |= LIS3_IRQ2_CLICK; 1018 1018 1019 - if (of_get_property(np, "st,irq-open-drain", NULL)) 1019 + if (of_property_read_bool(np, "st,irq-open-drain")) 1020 1020 pdata->irq_cfg |= LIS3_IRQ_OPEN_DRAIN; 1021 - if (of_get_property(np, "st,irq-active-low", NULL)) 1021 + if (of_property_read_bool(np, "st,irq-active-low")) 1022 1022 pdata->irq_cfg |= LIS3_IRQ_ACTIVE_LOW; 1023 1023 1024 1024 if (!of_property_read_u32(np, "st,wu-duration-1", &val)) ··· 1026 1026 if (!of_property_read_u32(np, "st,wu-duration-2", &val)) 1027 1027 pdata->duration2 = val; 1028 1028 1029 - if (of_get_property(np, "st,wakeup-x-lo", NULL)) 1029 + if (of_property_read_bool(np, "st,wakeup-x-lo")) 1030 1030 pdata->wakeup_flags |= LIS3_WAKEUP_X_LO; 1031 - if (of_get_property(np, "st,wakeup-x-hi", NULL)) 1031 + if (of_property_read_bool(np, "st,wakeup-x-hi")) 1032 1032 pdata->wakeup_flags |= LIS3_WAKEUP_X_HI; 1033 - if (of_get_property(np, "st,wakeup-y-lo", NULL)) 1033 + if (of_property_read_bool(np, "st,wakeup-y-lo")) 1034 1034 pdata->wakeup_flags |= LIS3_WAKEUP_Y_LO; 1035 - if (of_get_property(np, "st,wakeup-y-hi", NULL)) 1035 + if (of_property_read_bool(np, "st,wakeup-y-hi")) 1036 1036 pdata->wakeup_flags |= LIS3_WAKEUP_Y_HI; 1037 - if (of_get_property(np, "st,wakeup-z-lo", NULL)) 1037 + if (of_property_read_bool(np, "st,wakeup-z-lo")) 1038 1038 pdata->wakeup_flags |= LIS3_WAKEUP_Z_LO; 1039 - if (of_get_property(np, "st,wakeup-z-hi", NULL)) 1039 + if (of_property_read_bool(np, "st,wakeup-z-hi")) 1040 1040 pdata->wakeup_flags |= LIS3_WAKEUP_Z_HI; 1041 1041 if (of_get_property(np, "st,wakeup-threshold", &val)) 1042 1042 pdata->wakeup_thresh = val; 1043 1043 1044 - if (of_get_property(np, "st,wakeup2-x-lo", NULL)) 1044 + if (of_property_read_bool(np, "st,wakeup2-x-lo")) 1045 1045 pdata->wakeup_flags2 |= LIS3_WAKEUP_X_LO; 1046 - if (of_get_property(np, "st,wakeup2-x-hi", NULL)) 1046 + if (of_property_read_bool(np, "st,wakeup2-x-hi")) 1047 1047 pdata->wakeup_flags2 |= LIS3_WAKEUP_X_HI; 1048 - if (of_get_property(np, "st,wakeup2-y-lo", NULL)) 1048 + if (of_property_read_bool(np, "st,wakeup2-y-lo")) 1049 1049 pdata->wakeup_flags2 |= LIS3_WAKEUP_Y_LO; 1050 - if (of_get_property(np, "st,wakeup2-y-hi", NULL)) 1050 + if (of_property_read_bool(np, "st,wakeup2-y-hi")) 1051 1051 pdata->wakeup_flags2 |= LIS3_WAKEUP_Y_HI; 1052 - if (of_get_property(np, "st,wakeup2-z-lo", NULL)) 1052 + if (of_property_read_bool(np, "st,wakeup2-z-lo")) 1053 1053 pdata->wakeup_flags2 |= LIS3_WAKEUP_Z_LO; 1054 - if (of_get_property(np, "st,wakeup2-z-hi", NULL)) 1054 + if (of_property_read_bool(np, "st,wakeup2-z-hi")) 1055 1055 pdata->wakeup_flags2 |= LIS3_WAKEUP_Z_HI; 1056 1056 if (of_get_property(np, "st,wakeup2-threshold", &val)) 1057 1057 pdata->wakeup_thresh2 = val; ··· 1073 1073 } 1074 1074 } 1075 1075 1076 - if (of_get_property(np, "st,hipass1-disable", NULL)) 1076 + if (of_property_read_bool(np, "st,hipass1-disable")) 1077 1077 pdata->hipass_ctrl |= LIS3_HIPASS1_DISABLE; 1078 - if (of_get_property(np, "st,hipass2-disable", NULL)) 1078 + if (of_property_read_bool(np, "st,hipass2-disable")) 1079 1079 pdata->hipass_ctrl |= LIS3_HIPASS2_DISABLE; 1080 1080 1081 1081 if (of_property_read_s32(np, "st,axis-x", &sval) == 0)