Skip to content

Commit fb20021

Browse files
robherringlag-linaro
authored andcommitted
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
1 parent 796bf94 commit fb20021

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

drivers/video/backlight/as3711_bl.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -286,23 +286,23 @@ static int as3711_backlight_parse_dt(struct device *dev)
286286
if (ret < 0)
287287
goto err_put_bl;
288288

289-
if (of_find_property(bl, "su2-feedback-voltage", NULL)) {
289+
if (of_property_read_bool(bl, "su2-feedback-voltage")) {
290290
pdata->su2_feedback = AS3711_SU2_VOLTAGE;
291291
count++;
292292
}
293-
if (of_find_property(bl, "su2-feedback-curr1", NULL)) {
293+
if (of_property_read_bool(bl, "su2-feedback-curr1")) {
294294
pdata->su2_feedback = AS3711_SU2_CURR1;
295295
count++;
296296
}
297-
if (of_find_property(bl, "su2-feedback-curr2", NULL)) {
297+
if (of_property_read_bool(bl, "su2-feedback-curr2")) {
298298
pdata->su2_feedback = AS3711_SU2_CURR2;
299299
count++;
300300
}
301-
if (of_find_property(bl, "su2-feedback-curr3", NULL)) {
301+
if (of_property_read_bool(bl, "su2-feedback-curr3")) {
302302
pdata->su2_feedback = AS3711_SU2_CURR3;
303303
count++;
304304
}
305-
if (of_find_property(bl, "su2-feedback-curr-auto", NULL)) {
305+
if (of_property_read_bool(bl, "su2-feedback-curr-auto")) {
306306
pdata->su2_feedback = AS3711_SU2_CURR_AUTO;
307307
count++;
308308
}
@@ -312,19 +312,19 @@ static int as3711_backlight_parse_dt(struct device *dev)
312312
}
313313

314314
count = 0;
315-
if (of_find_property(bl, "su2-fbprot-lx-sd4", NULL)) {
315+
if (of_property_read_bool(bl, "su2-fbprot-lx-sd4")) {
316316
pdata->su2_fbprot = AS3711_SU2_LX_SD4;
317317
count++;
318318
}
319-
if (of_find_property(bl, "su2-fbprot-gpio2", NULL)) {
319+
if (of_property_read_bool(bl, "su2-fbprot-gpio2")) {
320320
pdata->su2_fbprot = AS3711_SU2_GPIO2;
321321
count++;
322322
}
323-
if (of_find_property(bl, "su2-fbprot-gpio3", NULL)) {
323+
if (of_property_read_bool(bl, "su2-fbprot-gpio3")) {
324324
pdata->su2_fbprot = AS3711_SU2_GPIO3;
325325
count++;
326326
}
327-
if (of_find_property(bl, "su2-fbprot-gpio4", NULL)) {
327+
if (of_property_read_bool(bl, "su2-fbprot-gpio4")) {
328328
pdata->su2_fbprot = AS3711_SU2_GPIO4;
329329
count++;
330330
}
@@ -334,15 +334,15 @@ static int as3711_backlight_parse_dt(struct device *dev)
334334
}
335335

336336
count = 0;
337-
if (of_find_property(bl, "su2-auto-curr1", NULL)) {
337+
if (of_property_read_bool(bl, "su2-auto-curr1")) {
338338
pdata->su2_auto_curr1 = true;
339339
count++;
340340
}
341-
if (of_find_property(bl, "su2-auto-curr2", NULL)) {
341+
if (of_property_read_bool(bl, "su2-auto-curr2")) {
342342
pdata->su2_auto_curr2 = true;
343343
count++;
344344
}
345-
if (of_find_property(bl, "su2-auto-curr3", NULL)) {
345+
if (of_property_read_bool(bl, "su2-auto-curr3")) {
346346
pdata->su2_auto_curr3 = true;
347347
count++;
348348
}

0 commit comments

Comments
 (0)