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

Configure Feed

Select the types of activity you want to include in your feed.

mfd: various: 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>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20230310144712.1543449-1-robh@kernel.org

authored by

Rob Herring and committed by
Lee Jones
01330edc 1ba58fbb

+6 -16
+1 -2
drivers/mfd/88pm860x-core.c
··· 1117 1117 { 1118 1118 int ret; 1119 1119 1120 - if (of_get_property(np, "marvell,88pm860x-irq-read-clr", NULL)) 1121 - pdata->irq_mode = 1; 1120 + pdata->irq_mode = of_property_read_bool(np, "marvell,88pm860x-irq-read-clr"); 1122 1121 ret = of_property_read_u32(np, "marvell,88pm860x-slave-addr", 1123 1122 &pdata->companion_addr); 1124 1123 if (ret) {
+5 -14
drivers/mfd/wm8994-core.c
··· 279 279 of_property_read_u32_array(np, "wlf,micbias-cfg", pdata->micbias, 280 280 ARRAY_SIZE(pdata->micbias)); 281 281 282 - pdata->lineout1_diff = true; 283 - pdata->lineout2_diff = true; 284 - if (of_find_property(np, "wlf,lineout1-se", NULL)) 285 - pdata->lineout1_diff = false; 286 - if (of_find_property(np, "wlf,lineout2-se", NULL)) 287 - pdata->lineout2_diff = false; 288 - 289 - if (of_find_property(np, "wlf,lineout1-feedback", NULL)) 290 - pdata->lineout1fb = true; 291 - if (of_find_property(np, "wlf,lineout2-feedback", NULL)) 292 - pdata->lineout2fb = true; 293 - 294 - if (of_find_property(np, "wlf,ldoena-always-driven", NULL)) 295 - pdata->lineout2fb = true; 282 + pdata->lineout1_diff = !of_property_read_bool(np, "wlf,lineout1-se"); 283 + pdata->lineout2_diff = !of_property_read_bool(np, "wlf,lineout2-se"); 284 + pdata->lineout1fb = of_property_read_bool(np, "wlf,lineout1-feedback"); 285 + pdata->lineout2fb = of_property_read_bool(np, "wlf,lineout2-feedback") || 286 + of_property_read_bool(np, "wlf,ldoena-always-driven"); 296 287 297 288 pdata->spkmode_pu = of_property_read_bool(np, "wlf,spkmode-pu"); 298 289