diff mbox series

[2/8] regulator: core: Fix regulator_is_supported_voltage() kerneldoc return value

Message ID 20240827095550.675018-3-wenst@chromium.org (mailing list archive)
State Superseded, archived
Headers show
Series regulator: kerneldoc section fixes | expand

Commit Message

Chen-Yu Tsai Aug. 27, 2024, 9:55 a.m. UTC
The kerneldoc for regulator_is_supported_voltage() states that the
return value is a boolean. That is not correct, as it could return an
error number if the check failed.

Fix the description by expanding it to cover the true, false and error
conditions. The description is also converted to a proper "Return"
section.

Fixes: c5f3939b8fe0 ("regulator: core: Support fixed voltages in regulator_is_supported_voltage()")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
---
 drivers/regulator/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Andy Shevchenko Aug. 27, 2024, 2:35 p.m. UTC | #1
On Tue, Aug 27, 2024 at 05:55:42PM +0800, Chen-Yu Tsai wrote:
> The kerneldoc for regulator_is_supported_voltage() states that the
> return value is a boolean. That is not correct, as it could return an
> error number if the check failed.

I don't know what error number means. Is it positive? Negative?

s/error number/negative error code/g
(Here and everywhere else)


> Fix the description by expanding it to cover the true, false and error

true and false are not what is returned, right?

> conditions. The description is also converted to a proper "Return"
> section.

...

> - * Returns a boolean.
> + * Return: 1 if voltage range is support, 0 if not, or error number if

supported

> + *	   voltage can't be changed and voltage readback failed.
Chen-Yu Tsai Aug. 28, 2024, 7:59 a.m. UTC | #2
On Tue, Aug 27, 2024 at 10:35 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Tue, Aug 27, 2024 at 05:55:42PM +0800, Chen-Yu Tsai wrote:
> > The kerneldoc for regulator_is_supported_voltage() states that the
> > return value is a boolean. That is not correct, as it could return an
> > error number if the check failed.
>
> I don't know what error number means. Is it positive? Negative?
>
> s/error number/negative error code/g
> (Here and everywhere else)

Ack. I intended to unify them throughout the series. Looks like I missed
a couple spots.

> > Fix the description by expanding it to cover the true, false and error
>
> true and false are not what is returned, right?

What I meant to describe was true or false with regards to the function
name. I'll try to make it clear.

> > conditions. The description is also converted to a proper "Return"
> > section.
>
> ...
>
> > - * Returns a boolean.
> > + * Return: 1 if voltage range is support, 0 if not, or error number if
>
> supported

Ack.


Thanks
ChenYu

> > + *      voltage can't be changed and voltage readback failed.
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
diff mbox series

Patch

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 763048d6f1ed..3a1b6fd9780d 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -3456,7 +3456,8 @@  EXPORT_SYMBOL_GPL(regulator_get_linear_step);
  * @min_uV: Minimum required voltage in uV.
  * @max_uV: Maximum required voltage in uV.
  *
- * Returns a boolean.
+ * Return: 1 if voltage range is support, 0 if not, or error number if
+ *	   voltage can't be changed and voltage readback failed.
  */
 int regulator_is_supported_voltage(struct regulator *regulator,
 				   int min_uV, int max_uV)