clk: Fix *bulk_get* return value documentation
Subsystems (2)
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
@@ -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
Stephen Boyd
maintainerQuoting Markus Schneider-Pargmann (2021-08-11 00:57:19)
Quoted 17 lines
Some of the
bulk_getvariants document that the return value is a validIS_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.
Signed-off-by Markus Schneider-Pargmann <[email protected]>--- include/linux/clk.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)include/linux/clk.h +0
-0
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?
Hi Stephen,
Quoted 13 lines · Stephen Boyd
Quoting Markus Schneider-Pargmann (2021-08-11 00:57:19)
Quoted 12 lines
Some of the
bulk_getvariants document that the return value is a validIS_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.
Signed-off-by Markus Schneider-Pargmann <[email protected]>--- 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@@ -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