Skip to contentSkip to conversation

clk: Fix *bulk_get* return value documentation

PATCH In review Markus Schneider-Pargmann 2 participants 3 messages Aug 11, 2021 – Aug 17, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: Fix *bulk_get* return value documentation

Some of the bulk_get variants document that the return value is a valid IS_ERR() condition but it is not. These functions return an errno directly if an error occures.

This patch fixes that documentation and documents that the return value is 0 or errno.

---
 include/linux/clk.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/clk.h +3 -3
index 266e8de3cb51..56a741903963 100644
@@ -340,7 +340,7 @@ struct clk *clk_get(struct device *dev, const char *id);
  * that were obtained will be freed before returning to the caller.
  *
  * Returns 0 if all clocks specified in clk_bulk_data table are obtained
- * successfully, or valid IS_ERR() condition containing errno.
+ * successfully, or an errno otherwise.
  * The implementation uses @dev and @clk_bulk_data.id to determine the
  * clock consumer, and thereby the clock producer.
  * The clock returned is stored in each @clk_bulk_data.clk field.
@@ -409,8 +409,8 @@ int __must_check devm_clk_bulk_get(struct device *dev, int num_clks,
  * NULL for given clk. It is assumed all clocks in clk_bulk_data are optional.
  *
  * Returns 0 if all clocks specified in clk_bulk_data table are obtained
- * successfully or for any clk there was no clk provider available, otherwise
- * returns valid IS_ERR() condition containing errno.
+ * successfully or for any clk there was no clk provider available, or an errno
+ * otherwise.
  * The implementation uses @dev and @clk_bulk_data.id to determine the
  * clock consumer, and thereby the clock producer.
  * The clock returned is stored in each @clk_bulk_data.clk field.
Signature · 1 line
2.32.0
maintainer
#1 lore raw

Quoting Markus Schneider-Pargmann (2021-08-11 00:57:19)

Quoted 17 lines

Some of the bulk_get variants document that the return value is a valid IS_ERR() condition but it is not. These functions return an errno directly if an error occures.

This patch fixes that documentation and documents that the return value is 0 or errno.

---
 include/linux/clk.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/clk.h +0 -0
index 266e8de3cb51..56a741903963 100644

include/linux/clk.h struct clk *clk_get(struct device *dev, const char *id); · line 346

Quoted 8 lines
include/linux/clk.h +1 -1
@@ -340,7 +340,7 @@ struct clk *clk_get(struct device *dev, const char *id);
  * that were obtained will be freed before returning to the caller.
  *
  * Returns 0 if all clocks specified in clk_bulk_data table are obtained
- * successfully, or valid IS_ERR() condition containing errno.
+ * successfully, or an errno otherwise.
  * The implementation uses @dev and @clk_bulk_data.id to determine the
  * clock consumer, and thereby the clock producer.
  * The clock returned is stored in each @clk_bulk_data.clk field.

While you're here can you also use the Return: syntax so it isn't freeform and doc generation can split it out?

#2 lore raw

Hi Stephen,

Quoted 13 lines · Stephen Boyd

Quoting Markus Schneider-Pargmann (2021-08-11 00:57:19)

Quoted 12 lines

Some of the bulk_get variants document that the return value is a valid IS_ERR() condition but it is not. These functions return an errno directly if an error occures.

This patch fixes that documentation and documents that the return value is 0 or errno.

---
 include/linux/clk.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Quoted 16 lines

include/linux/clk.h struct clk *clk_get(struct device *dev, const char *id); · line 346

Quoted 13 lines
include/linux/clk.h +1 -1
index 266e8de3cb51..56a741903963 100644
@@ -340,7 +340,7 @@ struct clk *clk_get(struct device *dev, const char *id);
  * that were obtained will be freed before returning to the caller.
  *
  * Returns 0 if all clocks specified in clk_bulk_data table are obtained
- * successfully, or valid IS_ERR() condition containing errno.
+ * successfully, or an errno otherwise.
  * The implementation uses @dev and @clk_bulk_data.id to determine the
  * clock consumer, and thereby the clock producer.
  * The clock returned is stored in each @clk_bulk_data.clk field.

While you're here can you also use the Return: syntax so it isn't freeform and doc generation can split it out?

thanks, good idea. Will do that.

Best,
Markus