Skip to contentSkip to conversation

media: v4l: cci: Fix devm_cci_regmap_init_i2c() kernel-doc return value

PATCH In review Karl Mehltretter 2 participants 2 messages Sep 12 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: v4l: cci: Fix devm_cci_regmap_init_i2c() kernel-doc return value

devm_cci_regmap_init_i2c() returns a struct regmap pointer (or an ERR_PTR() from devm_regmap_init_i2c()), but its kernel-doc says "%0 on success", which was never true. Describe the pointer.

Fixes 613cbb91e9ce ("media: Add MIPI CCI register access helper functions")
Assisted-by LLM
---
 include/media/v4l2-cci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/media/v4l2-cci.h +1 -1
index 4e96e90ee6369f14b43e012cd7044d14bcc5a7f0..a603d419ecaa2cc3771da41ddf5f27270318dbf5 100644
@@ -132,7 +132,7 @@ int cci_multi_reg_write(struct regmap *map, const struct cci_reg_sequence *regs,
  *
  * Note the memory for the created regmap is devm() managed, tied to the client.
  *
- * Return: %0 on success or a negative error code on failure.
+ * Return: the regmap on success or an ERR_PTR() on failure.
  */
 struct regmap *devm_cci_regmap_init_i2c(struct i2c_client *client,
 					int reg_addr_bits);
Signature · 1 line
2.39.5 (Apple Git-154)
#1 lore raw
Quoted 4 lines · Karl Mehltretter

devm_cci_regmap_init_i2c() returns a struct regmap pointer (or an ERR_PTR() from devm_regmap_init_i2c()), but its kernel-doc says "%0 on success", which was never true. Describe the pointer.

...

Quoted 5 lines

* Note the memory for the created regmap is devm() managed, tied to the client. *
- * Return: %0 on success or a negative error code on failure.
+ * Return: the regmap on success or an ERR_PTR() on failure.
*/

What about

* Return: An error pointer on failure or a valid pointer
* to a struct regmap. The regmap will be automatically freed by the
* device management code.
*/

?

The part of the proposed text is taken from other v4l2 header files.

--
With Best Regards,
Andy Shevchenko