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

Configure Feed

Select the types of activity you want to include in your feed.

device property: Document how to check for the property presence

Currently it's unclear if one may or may not rely on the error codes
returned from the property getters to check for the property presence.
Clarify this by updating kernel-doc for fwnode_property_*() and
device_property_*() where it's applicable.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Closes: https://lore.kernel.org/r/4b24f1f4-b395-467a-81b7-1334a2d48845@roeck-us.net
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Link: https://patch.msgid.link/20260318142404.2526642-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Andy Shevchenko and committed by
Greg Kroah-Hartman
70fa0c30 7215e455

+11 -3
+11 -3
drivers/base/property.c
··· 38 38 * @propname: Name of the property 39 39 * 40 40 * Check if property @propname is present in the device firmware description. 41 + * This function is the unambiguous way to check that given property is present 42 + * in the device firmware description. 41 43 * 42 44 * Return: true if property @propname is present. Otherwise, returns false. 43 45 */ ··· 53 51 * fwnode_property_present - check if a property of a firmware node is present 54 52 * @fwnode: Firmware node whose property to check 55 53 * @propname: Name of the property 54 + * 55 + * Check if property @propname is present in the firmware node description. 56 + * This function is the unambiguous way to check that given property is present 57 + * in the firmware node description. 56 58 * 57 59 * Return: true if property @propname is present. Otherwise, returns false. 58 60 */ ··· 81 75 * @dev: Device whose property is being checked 82 76 * @propname: Name of the property 83 77 * 84 - * Return if property @propname is true or false in the device firmware description. 78 + * Use device_property_present() to check for the property presence. 85 79 * 86 - * Return: true if property @propname is present. Otherwise, returns false. 80 + * Return: if property @propname is true or false in the device firmware description. 87 81 */ 88 82 bool device_property_read_bool(const struct device *dev, const char *propname) 89 83 { ··· 96 90 * @fwnode: Firmware node whose property to check 97 91 * @propname: Name of the property 98 92 * 99 - * Return if property @propname is true or false in the firmware description. 93 + * Use fwnode_property_present() to check for the property presence. 94 + * 95 + * Return: if property @propname is true or false in the firmware node description. 100 96 */ 101 97 bool fwnode_property_read_bool(const struct fwnode_handle *fwnode, 102 98 const char *propname)