Re: [PATCH v4 3/5] iio: mcp9600: Recognize chip id for mcp9601
From: Andy Shevchenko
Date: Thu Aug 21 2025 - 05:33:36 EST
On Sun, Aug 17, 2025 at 11:50:51PM -0400, Ben Collins wrote:
> The current driver works with mcp9601, but emits a warning because it
> does not recognize the chip id.
>
> MCP9601 is a superset of MCP9600. The drivers works without changes
> on this chipset.
>
> However, the 9601 chip supports open/closed-circuit detection if wired
> properly, so we'll need to be able to differentiate between them.
...
> static int mcp9600_probe(struct i2c_client *client)
> {
> + const struct mcp_chip_info *chip_info = i2c_get_match_data(client);
I believe I have commented on this already, please, split assignment...
> struct iio_dev *indio_dev;
> struct mcp9600_data *data;
> - int ret, ch_sel;
> + int ch_sel, dev_id, ret;
...and put it here.
> + if (chip_info == NULL)
> + return dev_err_probe(&client->dev, -EINVAL,
> + "No chip-info found for device\n");
Wrong indentation.
Besides that I have commented as well on
struct device *dev = &client->dev;
at the top that helps to make the code neater.
...
Since it seems the comments were ignored, I stopped here. Please, find previous
emails, take your time and fine grain the result for the next version.
--
With Best Regards,
Andy Shevchenko