iio: imu: inv_mpu6050: fix kernel-doc warnings
Subsystems (2)
PATCH 1/1 iio: imu: inv_mpu6050: fix kernel-doc warnings
scripts/kernel-doc -Wall reports several warnings for the inv_mpu6050 driver:
- inv_mpu_magn_get_scale() only describes @st, not @chan, @val and @val2.
- Eight functions use "Returns ..." in the body instead of a "Return:" section, and inv_mpu6050_set_enable() and inv_mpu_data_rdy_trigger_set_state() do not describe their return value at all, e.g.:
Warning: .../inv_mpu_aux.c:87 No description found for return value of 'inv_mpu_aux_init'
- int_pin_cfg in struct inv_mpu6050_reg_map is documented with a ';' instead of a ':' after the name, so kernel-doc does not see it, and user_ctrl in struct inv_mpu6050_chip_config and startup_time in struct inv_mpu6050_hw are not documented.
Describe the missing parameters, members and return values, and convert the return value descriptions to "Return:" sections. Where the return value was described before the long description, move it after it, so the description is not parsed as part of the return value section.
With this change, scripts/kernel-doc -Wall reports no warnings for drivers/iio/imu/inv_mpu6050/. Comment-only change.
---
Comment-only change, checked with scripts/kernel-doc -Wall.
drivers/iio/imu/inv_mpu6050/inv_mpu_aux.c | 6 +++--- drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c | 2 +- drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h | 4 +++- drivers/iio/imu/inv_mpu6050/inv_mpu_magn.c | 14 +++++++------- drivers/iio/imu/inv_mpu6050/inv_mpu_magn.h | 5 ++++- drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c | 4 ++++ 6 files changed, 22 insertions(+), 13 deletions(-)
drivers/iio/imu/inv_mpu6050/inv_mpu_aux.c +3 -3
@@ -82,7 +82,7 @@ static int inv_mpu_i2c_master_xfer(const struct inv_mpu6050_state *st)* inv_mpu_aux_init() - init i2c auxiliary bus * @st: driver internal state * -* Returns 0 on success, a negative error code otherwise. +* Return: 0 on success, a negative error code otherwise. */ int inv_mpu_aux_init (const struct inv_mpu6050_state *st) {
@@ -130,7 +130,7 @@ int inv_mpu_aux_init(const struct inv_mpu6050_state *st)* @val: buffer for storing read bytes * @size: number of bytes to read * -* Returns 0 on success, a negative error code otherwise. +* Return: 0 on success, a negative error code otherwise. */ int inv_mpu_aux_read (const struct inv_mpu6050_state *st,uint8_t addr,uint8_t reg,uint8_t *val,size_t size)
@@ -170,7 +170,7 @@ int inv_mpu_aux_read(const struct inv_mpu6050_state *st, uint8_t addr,* @reg: chip register address * @val: 1 byte value to write * -* Returns 0 on success, a negative error code otherwise. +* Return: 0 on success, a negative error code otherwise. */ int inv_mpu_aux_write (const struct inv_mpu6050_state *st,uint8_t addr,uint8_t reg,uint8_t val)
drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c +1 -1
@@ -93,7 +93,7 @@ static int inv_mpu_i2c_aux_setup(struct iio_dev *indio_dev)* inv_mpu_probe() - probe function. * @client: i2c client. * -* Returns 0 on success, a negative error code otherwise. +* Return: 0 on success, a negative error code otherwise. */ static int inv_mpu_probe (struct i2c_client *client) {
drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h +3 -1
@@ -39,7 +39,7 @@* @int_status: Interrupt status register. * @pwr_mgmt_1: Controls chip's power state and clock source. * @pwr_mgmt_2: Controls power state of individual sensors. -* @int_pin_cfg; Controls interrupt pin configuration. +* @int_pin_cfg: Controls interrupt pin configuration. * @accl_offset: Controls the accelerometer calibration offset. * @gyro_offset: Controls the gyroscope calibration offset. * @i2c_if: Controls the i2c interface
@@ -114,6 +114,7 @@ enum inv_devices {* @temp_fifo_enable: enable temp data output * @magn_fifo_enable: enable magn data output * @divider: chip sample rate divider (sample rate divider - 1) +* @user_ctrl: cached value of the USER_CTRL register * @roc_threshold: save ROC threshold (WoM) set value */ struct inv_mpu6050_chip_config {
@@ -150,6 +151,7 @@ struct inv_mpu6050_chip_config {* @config: configuration of the chip. * @fifo_size: size of the FIFO in bytes. * @temp: offset and scale to apply to raw temperature. +* @startup_time: accel and gyro startup times in milliseconds. */ struct inv_mpu6050_hw {u8 whoami;
drivers/iio/imu/inv_mpu6050/inv_mpu_magn.c +7 -7
@@ -144,10 +144,10 @@ static int inv_magn_init(struct inv_mpu6050_state *st)* inv_mpu_magn_probe() - probe and setup magnetometer chip * @st: driver internal state * -* Returns 0 on success, a negative error code otherwise -* * It is probing the chip and setting up all needed i2c transfers. * Noop if there is no magnetometer in the chip. +* +* Return: 0 on success, a negative error code otherwise. */ int inv_mpu_magn_probe (struct inv_mpu6050_state *st) {
@@ -225,11 +225,11 @@ int inv_mpu_magn_probe(struct inv_mpu6050_state *st)* @st: driver internal state * @fifo_rate: mpu set fifo rate * -* Returns 0 on success, a negative error code otherwise -* * Limit sampling frequency to the maximum value supported by the * magnetometer chip. Resulting in duplicated data for higher frequencies. * Noop if there is no magnetometer in the chip. +* +* Return: 0 on success, a negative error code otherwise. */ int inv_mpu_magn_set_rate (const struct inv_mpu6050_state *st,int fifo_rate) {
@@ -255,9 +255,9 @@ int inv_mpu_magn_set_rate(const struct inv_mpu6050_state *st, int fifo_rate)* inv_mpu_magn_set_orient() - fill magnetometer mounting matrix * @st: driver internal state * -* Returns 0 on success, a negative error code otherwise -* * Fill magnetometer mounting matrix using the provided chip matrix. +* +* Return: 0 on success, a negative error code otherwise. */ int inv_mpu_magn_set_orient (struct inv_mpu6050_state *st) {
@@ -317,7 +317,7 @@ int inv_mpu_magn_set_orient(struct inv_mpu6050_state *st)* @axis: IIO modifier axis value * @val: store corresponding axis value * -* Returns 0 on success, a negative error code otherwise +* Return: 0 on success, a negative error code otherwise. */ int inv_mpu_magn_read (struct inv_mpu6050_state *st,int axis,int *val) {
drivers/iio/imu/inv_mpu6050/inv_mpu_magn.h +4 -1
@@ -18,8 +18,11 @@ int inv_mpu_magn_probe(struct inv_mpu6050_state *st);/** * inv_mpu_magn_get_scale() - get magnetometer scale value * @st: driver internal state +* @chan: magnetometer channel to get the scale for +* @val: integer part of the scale, always 0 +* @val2: micro part of the scale, the raw to Gauss conversion coefficient * -* Returns IIO data format. +* Return: IIO_VAL_INT_PLUS_MICRO, the IIO format of @val and @val2. */ static inline int inv_mpu_magn_get_scale(const struct inv_mpu6050_state *st, const struct iio_chan_spec *chan,
drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c +4 -0
@@ -159,6 +159,8 @@ int inv_mpu6050_prepare_fifo(struct inv_mpu6050_state *st, bool enable)* inv_mpu6050_set_enable() - enable chip functions. * @indio_dev: Device driver instance. * @enable: enable/disable +* +* Return: 0 on success, a negative error code otherwise. */ static int inv_mpu6050_set_enable (struct iio_dev *indio_dev,bool enable) {
@@ -208,6 +210,8 @@ static int inv_mpu6050_set_enable(struct iio_dev *indio_dev, bool enable)* inv_mpu_data_rdy_trigger_set_state() - set data ready interrupt state * @trig: Trigger instance * @state: Desired trigger state +* +* Return: 0 on success, a negative error code otherwise. */ static int inv_mpu_data_rdy_trigger_set_state (struct iio_trigger *trig,bool state)
Signature · 1 line
2.53.0
Quoted 22 lines · On Sun, 11 Oct 2026 10:27:49 +0530 Arnav Kapoor <[email protected]> wrote:
scripts/kernel-doc-Wall reports several warnings for theinv_mpu6050driver:-
inv_mpu_magn_get_scale()only describes @st, not @chan, @val and @val2.
- Eight functions use "Returns ..." in the body instead of a "Return:" section, andinv_mpu6050_set_enable()andinv_mpu_data_rdy_trigger_set_state()do not describe their return value at all, e.g.:Warning:
.../inv_mpu_aux.c:87No description found for return value of 'inv_mpu_aux_init'-
int_pin_cfgin structinv_mpu6050_reg_mapis documented with a ';' instead of a ':' after the name, so kernel-doc does not see it, anduser_ctrlin structinv_mpu6050_chip_configandstartup_timein structinv_mpu6050_hware not documented.Describe the missing parameters, members and return values, and convert the return value descriptions to "Return:" sections. Where the return value was described before the long description, move it after it, so the description is not parsed as part of the return value section.
Quoted 6 lines
With this change,
scripts/kernel-doc-Wall reports no warnings fordrivers/iio/imu/inv_mpu6050/. Comment-only change.Assisted-by LLMSigned-off-by Arnav Kapoor <[email protected]>---
Signature · 2 lines
Kind regards, Joshua Crofts
Quoted 25 lines · On Sun, 11 Oct 2026 19:33:57 +0200 Joshua Crofts <[email protected]>…
Quoted 22 lines · On Sun, 11 Oct 2026 10:27:49 +0530 Arnav Kapoor <[email protected]> wrote:
scripts/kernel-doc-Wall reports several warnings for theinv_mpu6050driver:-
inv_mpu_magn_get_scale()only describes @st, not @chan, @val and @val2.
- Eight functions use "Returns ..." in the body instead of a "Return:" section, andinv_mpu6050_set_enable()andinv_mpu_data_rdy_trigger_set_state()do not describe their return value at all, e.g.:Warning:
.../inv_mpu_aux.c:87No description found for return value of 'inv_mpu_aux_init'-
int_pin_cfgin structinv_mpu6050_reg_mapis documented with a ';' instead of a ':' after the name, so kernel-doc does not see it, anduser_ctrlin structinv_mpu6050_chip_configandstartup_timein structinv_mpu6050_hware not documented.Describe the missing parameters, members and return values, and convert the return value descriptions to "Return:" sections. Where the return value was described before the long description, move it after it, so the description is not parsed as part of the return value section.
Quoted 9 lines
Quoted 6 lines
With this change,
scripts/kernel-doc-Wall reports no warnings fordrivers/iio/imu/inv_mpu6050/. Comment-only change.Assisted-by LLMSigned-off-by Arnav Kapoor <[email protected]>---
Reviewed-by Joshua Crofts <[email protected]>
Applied. Thanks,
J