Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: Unify "negative error number" terminology in comments

Previous commits cleaning up kerneldoc used the term "negative error
number" to refer to error condition return values. Update remaining
instances of other terminology such as "error code" or "errno" as
well so the whole regulator subsystem is unified.

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-11-wenst@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Chen-Yu Tsai and committed by
Mark Brown
98ce82a5 6eace77a

+18 -18
+1 -1
drivers/regulator/core.c
··· 3388 3388 * voltage selectors. 3389 3389 * 3390 3390 * On success, the output parameters @vsel_reg and @vsel_mask are filled in 3391 - * and 0 is returned, otherwise a negative errno is returned. 3391 + * and 0 is returned, otherwise a negative error number is returned. 3392 3392 */ 3393 3393 int regulator_get_hardware_vsel_register(struct regulator *regulator, 3394 3394 unsigned *vsel_reg,
+9 -9
drivers/regulator/devres.c
··· 163 163 * In cases where the supply is not strictly required, callers can check for 164 164 * -ENODEV error and handle it accordingly. 165 165 * 166 - * Returns: voltage in microvolts on success, or an error code on failure. 166 + * Returns: voltage in microvolts on success, or an negative error number on failure. 167 167 */ 168 168 int devm_regulator_get_enable_read_voltage(struct device *dev, const char *id) 169 169 { ··· 174 174 * Since we need a real voltage, we use devm_regulator_get_optional() 175 175 * rather than getting a dummy regulator with devm_regulator_get() and 176 176 * then letting regulator_get_voltage() fail with -EINVAL. This way, the 177 - * caller can handle the -ENODEV error code if needed instead of the 178 - * ambiguous -EINVAL. 177 + * caller can handle the -ENODEV negative error number if needed instead 178 + * of the ambiguous -EINVAL. 179 179 */ 180 180 r = devm_regulator_get_optional(dev, id); 181 181 if (IS_ERR(r)) ··· 276 276 * @num_consumers: number of consumers to register 277 277 * @consumers: configuration of consumers; clients are stored here. 278 278 * 279 - * @return 0 on success, an errno on failure. 279 + * @return 0 on success, a negative error number on failure. 280 280 * 281 281 * This helper function allows drivers to get several regulator 282 282 * consumers in one operation with management, the regulators will ··· 299 299 * @num_consumers: number of consumers to register 300 300 * @consumers: configuration of consumers; clients are stored here. 301 301 * 302 - * @return 0 on success, an errno on failure. 302 + * @return 0 on success, a negative error number on failure. 303 303 * 304 304 * This helper function allows drivers to exclusively get several 305 305 * regulator consumers in one operation with management, the regulators ··· 326 326 * This is a convenience function to allow bulk regulator configuration 327 327 * to be stored "static const" in files. 328 328 * 329 - * Return: 0 on success, an errno on failure. 329 + * Return: 0 on success, a negative error number on failure. 330 330 */ 331 331 int devm_regulator_bulk_get_const(struct device *dev, int num_consumers, 332 332 const struct regulator_bulk_data *in_consumers, ··· 393 393 * @num_consumers: number of consumers to register 394 394 * @id: list of supply names or regulator IDs 395 395 * 396 - * @return 0 on success, an errno on failure. 396 + * @return 0 on success, a negative error number on failure. 397 397 * 398 398 * This helper function allows drivers to get several regulator 399 399 * consumers in one operation with management, the regulators will ··· 574 574 * lookup the supply 575 575 * @num_id: number of aliases to register 576 576 * 577 - * @return 0 on success, an errno on failure. 577 + * @return 0 on success, a negative error number on failure. 578 578 * 579 579 * This helper function allows drivers to register several supply 580 580 * aliases in one operation, the aliases will be automatically ··· 726 726 * IRQ. 727 727 * @rdev_amount: Amount of regulators associated with this IRQ. 728 728 * 729 - * Return: handle to irq_helper or an ERR_PTR() encoded error code. 729 + * Return: handle to irq_helper or an ERR_PTR() encoded negative error number. 730 730 */ 731 731 void *devm_regulator_irq_helper(struct device *dev, 732 732 const struct regulator_irq_desc *d, int irq,
+1 -1
drivers/regulator/fixed.c
··· 129 129 * If it's an optional IRQ and not found, it returns 0. 130 130 * Otherwise, it attempts to request the threaded IRQ. 131 131 * 132 - * Return: 0 on success, or error code on failure. 132 + * Return: 0 on success, or a negative error number on failure. 133 133 */ 134 134 static int reg_fixed_get_irqs(struct device *dev, 135 135 struct fixed_voltage_data *priv)
+1 -1
drivers/regulator/irq_helpers.c
··· 333 333 * IRQ. 334 334 * @rdev_amount: Amount of regulators associated with this IRQ. 335 335 * 336 - * Return: handle to irq_helper or an ERR_PTR() encoded error code. 336 + * Return: handle to irq_helper or an ERR_PTR() encoded negative error number. 337 337 */ 338 338 void *regulator_irq_helper(struct device *dev, 339 339 const struct regulator_irq_desc *d, int irq,
+2 -2
drivers/regulator/max77802-regulator.c
··· 160 160 * Enable Control Logic3 by PWRREQ (LDO 3) 161 161 * 162 162 * If setting the regulator mode fails, the function only warns but does 163 - * not return an error code to avoid the regulator core to stop setting 164 - * the operating mode for the remaining regulators. 163 + * not return a negative error number to avoid the regulator core to stop 164 + * setting the operating mode for the remaining regulators. 165 165 */ 166 166 static int max77802_set_suspend_mode(struct regulator_dev *rdev, 167 167 unsigned int mode)
+3 -3
drivers/regulator/qcom-rpmh-regulator.c
··· 158 158 * @wait_for_ack: Boolean indicating if execution must wait until the 159 159 * request has been acknowledged as complete 160 160 * 161 - * Return: 0 on success, errno on failure 161 + * Return: 0 on success, or a negative error number on failure 162 162 */ 163 163 static int rpmh_regulator_send_request(struct rpmh_vreg *vreg, 164 164 struct tcs_cmd *cmd, bool wait_for_ack) ··· 317 317 * This function is used in the regulator_ops for VRM type RPMh regulator 318 318 * devices. 319 319 * 320 - * Return: 0 on success, errno on failure 320 + * Return: 0 on success, or a negative error number on failure 321 321 */ 322 322 static unsigned int rpmh_regulator_vrm_get_optimum_mode( 323 323 struct regulator_dev *rdev, int input_uV, int output_uV, int load_uA) ··· 409 409 * @pmic_rpmh_data: Pointer to a null-terminated array of rpmh-regulator 410 410 * resources defined for the top level PMIC device 411 411 * 412 - * Return: 0 on success, errno on failure 412 + * Return: 0 on success, or a negative error number on failure 413 413 */ 414 414 static int rpmh_regulator_init_vreg(struct rpmh_vreg *vreg, struct device *dev, 415 415 struct device_node *node, const char *pmic_id,
+1 -1
drivers/regulator/qcom_smd-regulator.c
··· 1386 1386 * @pmic_rpm_data: Pointer to a null-terminated array of qcom_smd-regulator 1387 1387 * resources defined for the top level PMIC device 1388 1388 * 1389 - * Return: 0 on success, errno on failure 1389 + * Return: 0 on success, or a negative error number on failure 1390 1390 */ 1391 1391 static int rpm_regulator_init_vreg(struct qcom_rpm_reg *vreg, struct device *dev, 1392 1392 struct device_node *node,