Re: [PATCH 4/9] regulator: da9121: Add device variant details and respective regmaps

From: Mark Brown
Date: Fri Nov 20 2020 - 07:46:15 EST


On Fri, Nov 20, 2020 at 12:14:54PM +0000, Adam Ward wrote:

> Add ability to probe device and validate configuration, then apply a regmap
> configuration for a single or dual buck device accordingly.

This looks like it might benefit from being multiple commits - "X then
Y" type commit logs are often a warning sign of this, it's quite
difficult to review as it's doing several different things.

> +static int da9121_i2c_reg_read(struct i2c_client *client, u8 addr,
> + u8 *buf, int count)
> +{
> + struct i2c_msg xfer[2];
> + int ret;

Why is this open coding register I/O?

> + name = of_get_property(chip->dev->of_node, "compatible", NULL);
> + if (!name) {
> + dev_err(chip->dev, "Cannot get device not compatible string.\n");
> + goto error;
> + }

You shouldn't need to query the compatible string as a property, why is
the code doing this? You know what compatible was used from probe().

Attachment: signature.asc
Description: PGP signature