Skip to contentSkip to conversation

of/platform: fix of_platform_device_destroy comment

PATCH In review Johan Hovold 2 participants 3 messages Nov 1, 2016 – Nov 10, 2016 Device tree

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 of/platform: fix of_platform_device_destroy comment

Update the comment to of_platform_device_destroy() to reflect that it no longer returns a status value.

Fixes 75f353b61342 ("of/platform: Fix of_platform_device_destroy...")
---
 drivers/of/platform.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/of/platform.c +0 -3
index e4bf07d20f9b..cb4c7800f37d 100644
@@ -558,9 +558,6 @@ static int of_platform_device_destroy(struct device *dev, void *data)
  * of the given device (and, recurrently, their children) that have been
  * created from their respective device tree nodes (and only those,
  * leaving others - eg. manually created - unharmed).
- *
- * Returns 0 when all children devices have been removed or
- * -EBUSY when some children remained.
  */
 void of_platform_depopulate(struct device *parent)
 {
Signature · 6 lines
2.7.3

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#1 lore raw

PATCH 2/2 of/platform: clarify of_find_device_by_node refcounting

Add comment clarifying that of_find_device_by_node() takes a reference to the embedded struct device which needs to be dropped after use.

Note that most current users fail to do so.

---
 drivers/of/platform.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/of/platform.c +3 -0
index cb4c7800f37d..b8064bc2b6eb 100644
@@ -45,6 +45,9 @@ static int of_dev_node_match(struct device *dev, void *data)
  * of_find_device_by_node - Find the platform_device associated with a node
  * @np: Pointer to device tree node
  *
+ * Takes a reference to the embedded struct device which needs to be dropped
+ * after use.
+ *
  * Returns platform_device pointer, or NULL if not found
  */
 struct platform_device *of_find_device_by_node(struct device_node *np)
Signature · 1 line
2.7.3
maintainer
#2 lore raw
In reply to Johan Hovold
Quoted 8 lines · Johan Hovold

Update the comment to of_platform_device_destroy() to reflect that it no longer returns a status value.

Fixes 75f353b61342 ("of/platform: Fix of_platform_device_destroy...")
---
 drivers/of/platform.c | 3 ---
 1 file changed, 3 deletions(-)

Both patches applied.

Rob