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

Input: tc3589x - use of_property_present()

Use of_property_present() to test for property presence rather than
of_get_property(). This is part of a larger effort to remove callers
of of_get_property() and similar functions. of_get_property() leaks
the DT property data pointer which is a problem for dynamically
allocated nodes which may be freed.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20240731191312.1710417-14-robh@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Rob Herring (Arm) and committed by
Dmitry Torokhov
8bd2aa85 3fe81a56

+1 -2
+1 -2
drivers/input/keyboard/tc3589x-keypad.c
··· 325 325 struct tc3589x_keypad_platform_data *plat; 326 326 u32 cols, rows; 327 327 u32 debounce_ms; 328 - int proplen; 329 328 330 329 if (!np) 331 330 return ERR_PTR(-ENODEV); ··· 345 346 return ERR_PTR(-EINVAL); 346 347 } 347 348 348 - if (!of_get_property(np, "linux,keymap", &proplen)) { 349 + if (!of_property_present(np, "linux,keymap")) { 349 350 dev_err(dev, "property linux,keymap not found\n"); 350 351 return ERR_PTR(-ENOENT); 351 352 }