diff mbox series

clk: Fix *bulk_get* return value documentation

Message ID 20210811075719.1716886-1-msp@baylibre.com (mailing list archive)
State Changes Requested, archived
Headers show
Series clk: Fix *bulk_get* return value documentation | expand

Commit Message

Markus Schneider-Pargmann Aug. 11, 2021, 7:57 a.m. UTC
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.

Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
---
 include/linux/clk.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Stephen Boyd Aug. 12, 2021, 7:25 p.m. UTC | #1
Quoting Markus Schneider-Pargmann (2021-08-11 00:57:19)
> 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.
> 
> Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
> ---
>  include/linux/clk.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/include/linux/clk.h b/include/linux/clk.h
> index 266e8de3cb51..56a741903963 100644
> --- a/include/linux/clk.h
> +++ b/include/linux/clk.h
> @@ -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?
Markus Schneider-Pargmann Aug. 17, 2021, 7:26 a.m. UTC | #2
Hi Stephen,

On Thu, Aug 12, 2021 at 12:25:38PM -0700, Stephen Boyd wrote:
> Quoting Markus Schneider-Pargmann (2021-08-11 00:57:19)
> > 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.
> > 
> > Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
> > ---
> >  include/linux/clk.h | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/include/linux/clk.h b/include/linux/clk.h
> > index 266e8de3cb51..56a741903963 100644
> > --- a/include/linux/clk.h
> > +++ b/include/linux/clk.h
> > @@ -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
diff mbox series

Patch

diff --git a/include/linux/clk.h b/include/linux/clk.h
index 266e8de3cb51..56a741903963 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -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.