]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
regulator: core: Fix regulator_is_supported_voltage() kerneldoc return value
authorChen-Yu Tsai <wenst@chromium.org>
Thu, 29 Aug 2024 08:51:22 +0000 (16:51 +0800)
committerMark Brown <broonie@kernel.org>
Thu, 29 Aug 2024 13:20:23 +0000 (14:20 +0100)
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 valid return values 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>
Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20240829085131.1361701-3-wenst@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/core.c

index 763048d6f1ed115bf040caefb01f46589e340146..0ce3fe1774fea3818b4e11d3ea45d48b20782881 100644 (file)
@@ -3456,7 +3456,9 @@ 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 the voltage range is supported, 0 if not, or a negative error
+ *        number if @regulator's voltage can't be changed and voltage readback
+ *        failed.
  */
 int regulator_is_supported_voltage(struct regulator *regulator,
                                   int min_uV, int max_uV)