Re: [PATCH 2/8] iio: imu: inv_icm45600: add I2C driver for inv_icm45600 driver

From: Andy Shevchenko
Date: Fri Apr 11 2025 - 15:22:31 EST


On Fri, Apr 11, 2025 at 4:28 PM Remi Buisson via B4 Relay
<devnull+remi.buisson.tdk.com@xxxxxxxxxx> wrote:
>
> From: Remi Buisson <remi.buisson@xxxxxxx>
>
> Add I2C driver for InvenSense ICM-456xxx devices.

...

> +/*
> + * Copyright (C) 2025 InvenSense, Inc.
> + */

One line (instead of 3), please! This will slightly help with these
rather longer files.

...

> +#include <linux/device.h>
> +#include <linux/i2c.h>
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/mod_devicetable.h>
> +#include <linux/property.h>
> +#include <linux/regmap.h>

Here and in the rest of the files the list of the header inclusions is
(semi-)random. You shouldn't use kernel.h and other "proxy" headers in
the code, please follow IWYU principle.

...

> + return -ENOTSUPP;

This is wrong. Please check what other drivers return in such cases.

...

> + regmap = devm_regmap_init_i2c(client, &inv_icm45600_regmap_config);
> + if (IS_ERR(regmap))
> + return PTR_ERR(regmap);

err.h is missing.

...

> +/*
> + * device id table is used to identify what device can be
> + * supported by this driver

Please, respect English grammar and punctuation in all multi-line comments.

> + */

...

> + .data = (void *)INV_CHIP_ICM45688P,

Just no. Please, use real pointers.

...

I'm not going to review anything else, the above already deserves a new version.

--
With Best Regards,
Andy Shevchenko