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

backlight: as3711: 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: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20230310144731.1546190-1-robh@kernel.org

authored by

Rob Herring and committed by
Lee Jones
fb200218 796bf946

+12 -12
+12 -12
drivers/video/backlight/as3711_bl.c
··· 286 286 if (ret < 0) 287 287 goto err_put_bl; 288 288 289 - if (of_find_property(bl, "su2-feedback-voltage", NULL)) { 289 + if (of_property_read_bool(bl, "su2-feedback-voltage")) { 290 290 pdata->su2_feedback = AS3711_SU2_VOLTAGE; 291 291 count++; 292 292 } 293 - if (of_find_property(bl, "su2-feedback-curr1", NULL)) { 293 + if (of_property_read_bool(bl, "su2-feedback-curr1")) { 294 294 pdata->su2_feedback = AS3711_SU2_CURR1; 295 295 count++; 296 296 } 297 - if (of_find_property(bl, "su2-feedback-curr2", NULL)) { 297 + if (of_property_read_bool(bl, "su2-feedback-curr2")) { 298 298 pdata->su2_feedback = AS3711_SU2_CURR2; 299 299 count++; 300 300 } 301 - if (of_find_property(bl, "su2-feedback-curr3", NULL)) { 301 + if (of_property_read_bool(bl, "su2-feedback-curr3")) { 302 302 pdata->su2_feedback = AS3711_SU2_CURR3; 303 303 count++; 304 304 } 305 - if (of_find_property(bl, "su2-feedback-curr-auto", NULL)) { 305 + if (of_property_read_bool(bl, "su2-feedback-curr-auto")) { 306 306 pdata->su2_feedback = AS3711_SU2_CURR_AUTO; 307 307 count++; 308 308 } ··· 312 312 } 313 313 314 314 count = 0; 315 - if (of_find_property(bl, "su2-fbprot-lx-sd4", NULL)) { 315 + if (of_property_read_bool(bl, "su2-fbprot-lx-sd4")) { 316 316 pdata->su2_fbprot = AS3711_SU2_LX_SD4; 317 317 count++; 318 318 } 319 - if (of_find_property(bl, "su2-fbprot-gpio2", NULL)) { 319 + if (of_property_read_bool(bl, "su2-fbprot-gpio2")) { 320 320 pdata->su2_fbprot = AS3711_SU2_GPIO2; 321 321 count++; 322 322 } 323 - if (of_find_property(bl, "su2-fbprot-gpio3", NULL)) { 323 + if (of_property_read_bool(bl, "su2-fbprot-gpio3")) { 324 324 pdata->su2_fbprot = AS3711_SU2_GPIO3; 325 325 count++; 326 326 } 327 - if (of_find_property(bl, "su2-fbprot-gpio4", NULL)) { 327 + if (of_property_read_bool(bl, "su2-fbprot-gpio4")) { 328 328 pdata->su2_fbprot = AS3711_SU2_GPIO4; 329 329 count++; 330 330 } ··· 334 334 } 335 335 336 336 count = 0; 337 - if (of_find_property(bl, "su2-auto-curr1", NULL)) { 337 + if (of_property_read_bool(bl, "su2-auto-curr1")) { 338 338 pdata->su2_auto_curr1 = true; 339 339 count++; 340 340 } 341 - if (of_find_property(bl, "su2-auto-curr2", NULL)) { 341 + if (of_property_read_bool(bl, "su2-auto-curr2")) { 342 342 pdata->su2_auto_curr2 = true; 343 343 count++; 344 344 } 345 - if (of_find_property(bl, "su2-auto-curr3", NULL)) { 345 + if (of_property_read_bool(bl, "su2-auto-curr3")) { 346 346 pdata->su2_auto_curr3 = true; 347 347 count++; 348 348 }