mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
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
This commit is contained in:
parent
796bf946c4
commit
fb200218b4
1 changed files with 12 additions and 12 deletions
|
@ -286,23 +286,23 @@ static int as3711_backlight_parse_dt(struct device *dev)
|
|||
if (ret < 0)
|
||||
goto err_put_bl;
|
||||
|
||||
if (of_find_property(bl, "su2-feedback-voltage", NULL)) {
|
||||
if (of_property_read_bool(bl, "su2-feedback-voltage")) {
|
||||
pdata->su2_feedback = AS3711_SU2_VOLTAGE;
|
||||
count++;
|
||||
}
|
||||
if (of_find_property(bl, "su2-feedback-curr1", NULL)) {
|
||||
if (of_property_read_bool(bl, "su2-feedback-curr1")) {
|
||||
pdata->su2_feedback = AS3711_SU2_CURR1;
|
||||
count++;
|
||||
}
|
||||
if (of_find_property(bl, "su2-feedback-curr2", NULL)) {
|
||||
if (of_property_read_bool(bl, "su2-feedback-curr2")) {
|
||||
pdata->su2_feedback = AS3711_SU2_CURR2;
|
||||
count++;
|
||||
}
|
||||
if (of_find_property(bl, "su2-feedback-curr3", NULL)) {
|
||||
if (of_property_read_bool(bl, "su2-feedback-curr3")) {
|
||||
pdata->su2_feedback = AS3711_SU2_CURR3;
|
||||
count++;
|
||||
}
|
||||
if (of_find_property(bl, "su2-feedback-curr-auto", NULL)) {
|
||||
if (of_property_read_bool(bl, "su2-feedback-curr-auto")) {
|
||||
pdata->su2_feedback = AS3711_SU2_CURR_AUTO;
|
||||
count++;
|
||||
}
|
||||
|
@ -312,19 +312,19 @@ static int as3711_backlight_parse_dt(struct device *dev)
|
|||
}
|
||||
|
||||
count = 0;
|
||||
if (of_find_property(bl, "su2-fbprot-lx-sd4", NULL)) {
|
||||
if (of_property_read_bool(bl, "su2-fbprot-lx-sd4")) {
|
||||
pdata->su2_fbprot = AS3711_SU2_LX_SD4;
|
||||
count++;
|
||||
}
|
||||
if (of_find_property(bl, "su2-fbprot-gpio2", NULL)) {
|
||||
if (of_property_read_bool(bl, "su2-fbprot-gpio2")) {
|
||||
pdata->su2_fbprot = AS3711_SU2_GPIO2;
|
||||
count++;
|
||||
}
|
||||
if (of_find_property(bl, "su2-fbprot-gpio3", NULL)) {
|
||||
if (of_property_read_bool(bl, "su2-fbprot-gpio3")) {
|
||||
pdata->su2_fbprot = AS3711_SU2_GPIO3;
|
||||
count++;
|
||||
}
|
||||
if (of_find_property(bl, "su2-fbprot-gpio4", NULL)) {
|
||||
if (of_property_read_bool(bl, "su2-fbprot-gpio4")) {
|
||||
pdata->su2_fbprot = AS3711_SU2_GPIO4;
|
||||
count++;
|
||||
}
|
||||
|
@ -334,15 +334,15 @@ static int as3711_backlight_parse_dt(struct device *dev)
|
|||
}
|
||||
|
||||
count = 0;
|
||||
if (of_find_property(bl, "su2-auto-curr1", NULL)) {
|
||||
if (of_property_read_bool(bl, "su2-auto-curr1")) {
|
||||
pdata->su2_auto_curr1 = true;
|
||||
count++;
|
||||
}
|
||||
if (of_find_property(bl, "su2-auto-curr2", NULL)) {
|
||||
if (of_property_read_bool(bl, "su2-auto-curr2")) {
|
||||
pdata->su2_auto_curr2 = true;
|
||||
count++;
|
||||
}
|
||||
if (of_find_property(bl, "su2-auto-curr3", NULL)) {
|
||||
if (of_property_read_bool(bl, "su2-auto-curr3")) {
|
||||
pdata->su2_auto_curr3 = true;
|
||||
count++;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue