diff options
author | Rob Herring <robh@kernel.org> | 2023-03-10 20:27:10 -0800 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2023-03-17 04:17:29 -0700 |
commit | 12c7d0aeb3beecc8b8f570d82c4d8509def71a6e (patch) | |
tree | 836cfe13413861cb3d53c99adcbf73e6df3d91eb /drivers/input/keyboard/matrix_keypad.c | |
parent | d26a3a6ce7e02f9c056ad992bcd9624735022337 (diff) |
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>
Diffstat (limited to 'drivers/input/keyboard/matrix_keypad.c')
-rw-r--r-- | drivers/input/keyboard/matrix_keypad.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c index 203310727d88..a1b037891af2 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -425,14 +425,12 @@ matrix_keypad_parse_dt(struct device *dev) return ERR_PTR(-EINVAL); } - if (of_get_property(np, "linux,no-autorepeat", NULL)) - pdata->no_autorepeat = true; + pdata->no_autorepeat = of_property_read_bool(np, "linux,no-autorepeat"); pdata->wakeup = of_property_read_bool(np, "wakeup-source") || of_property_read_bool(np, "linux,wakeup"); /* legacy */ - if (of_get_property(np, "gpio-activelow", NULL)) - pdata->active_low = true; + pdata->active_low = of_property_read_bool(np, "gpio-activelow"); pdata->drive_inactive_cols = of_property_read_bool(np, "drive-inactive-cols"); |