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

Input: 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 of_property_read_bool().

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230310144708.1542751-1-robh@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Rob Herring and committed by
Dmitry Torokhov
12c7d0ae d26a3a6c

+5 -10
+2 -4
drivers/input/keyboard/matrix_keypad.c
··· 425 425 return ERR_PTR(-EINVAL); 426 426 } 427 427 428 - if (of_get_property(np, "linux,no-autorepeat", NULL)) 429 - pdata->no_autorepeat = true; 428 + pdata->no_autorepeat = of_property_read_bool(np, "linux,no-autorepeat"); 430 429 431 430 pdata->wakeup = of_property_read_bool(np, "wakeup-source") || 432 431 of_property_read_bool(np, "linux,wakeup"); /* legacy */ 433 432 434 - if (of_get_property(np, "gpio-activelow", NULL)) 435 - pdata->active_low = true; 433 + pdata->active_low = of_property_read_bool(np, "gpio-activelow"); 436 434 437 435 pdata->drive_inactive_cols = 438 436 of_property_read_bool(np, "drive-inactive-cols");
+1 -2
drivers/input/keyboard/omap4-keypad.c
··· 274 274 if (err) 275 275 return err; 276 276 277 - if (of_get_property(np, "linux,input-no-autorepeat", NULL)) 278 - keypad_data->no_autorepeat = true; 277 + keypad_data->no_autorepeat = of_property_read_bool(np, "linux,input-no-autorepeat"); 279 278 280 279 return 0; 281 280 }
+1 -2
drivers/input/keyboard/samsung-keypad.c
··· 291 291 *keymap++ = KEY(row, col, key_code); 292 292 } 293 293 294 - if (of_get_property(np, "linux,input-no-autorepeat", NULL)) 295 - pdata->no_autorepeat = true; 294 + pdata->no_autorepeat = of_property_read_bool(np, "linux,input-no-autorepeat"); 296 295 297 296 pdata->wakeup = of_property_read_bool(np, "wakeup-source") || 298 297 /* legacy name */
+1 -2
drivers/input/keyboard/tegra-kbc.c
··· 504 504 if (!of_property_read_u32(np, "nvidia,repeat-delay-ms", &prop)) 505 505 kbc->repeat_cnt = prop; 506 506 507 - if (of_find_property(np, "nvidia,needs-ghost-filter", NULL)) 508 - kbc->use_ghost_filter = true; 507 + kbc->use_ghost_filter = of_property_present(np, "nvidia,needs-ghost-filter"); 509 508 510 509 if (of_property_read_bool(np, "wakeup-source") || 511 510 of_property_read_bool(np, "nvidia,wakeup-source")) /* legacy */