Skip to content

Commit 70fa0c3

Browse files
andy-shevgregkh
authored andcommitted
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>
1 parent 7215e45 commit 70fa0c3

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

drivers/base/property.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ EXPORT_SYMBOL_GPL(__dev_fwnode_const);
3838
* @propname: Name of the property
3939
*
4040
* 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.
4143
*
4244
* Return: true if property @propname is present. Otherwise, returns false.
4345
*/
@@ -52,6 +54,10 @@ EXPORT_SYMBOL_GPL(device_property_present);
5254
* @fwnode: Firmware node whose property to check
5355
* @propname: Name of the property
5456
*
57+
* Check if property @propname is present in the firmware node description.
58+
* This function is the unambiguous way to check that given property is present
59+
* in the firmware node description.
60+
*
5561
* Return: true if property @propname is present. Otherwise, returns false.
5662
*/
5763
bool fwnode_property_present(const struct fwnode_handle *fwnode,
@@ -75,9 +81,9 @@ EXPORT_SYMBOL_GPL(fwnode_property_present);
7581
* @dev: Device whose property is being checked
7682
* @propname: Name of the property
7783
*
78-
* Return if property @propname is true or false in the device firmware description.
84+
* Use device_property_present() to check for the property presence.
7985
*
80-
* Return: true if property @propname is present. Otherwise, returns false.
86+
* Return: if property @propname is true or false in the device firmware description.
8187
*/
8288
bool device_property_read_bool(const struct device *dev, const char *propname)
8389
{
@@ -90,7 +96,9 @@ EXPORT_SYMBOL_GPL(device_property_read_bool);
9096
* @fwnode: Firmware node whose property to check
9197
* @propname: Name of the property
9298
*
93-
* Return if property @propname is true or false in the firmware description.
99+
* Use fwnode_property_present() to check for the property presence.
100+
*
101+
* Return: if property @propname is true or false in the firmware node description.
94102
*/
95103
bool fwnode_property_read_bool(const struct fwnode_handle *fwnode,
96104
const char *propname)

0 commit comments

Comments
 (0)