Re: [PATCH v7 02/11] mfd: Add max7360 support

From: Lee Jones
Date: Fri May 02 2025 - 04:27:18 EST


On Fri, 02 May 2025, Mathieu Dubois-Briand wrote:

> On Thu May 1, 2025 at 2:59 PM CEST, Lee Jones wrote:
> > On Mon, 28 Apr 2025, mathieu.dubois-briand@xxxxxxxxxxx wrote:
> >
> >> From: Kamel Bouhara <kamel.bouhara@xxxxxxxxxxx>
> >> +static int max7360_probe(struct i2c_client *client)
> >> +{
> >> + struct device *dev = &client->dev;
> >> + struct regmap *regmap;
> >> + int ret;
> >> +
> >> + regmap = devm_regmap_init_i2c(client, &max7360_regmap_config);
> >> + if (IS_ERR(regmap))
> >> + return dev_err_probe(dev, PTR_ERR(regmap), "Failed to initialise regmap\n");
> >
> > dev_err_ptr_probe()
> >
>
> I believe dev_err_ptr_probe() is meant to be used for the opposite case,
> where the variable holding the error is an int but the function has to
> return a pointer. Here regmap is a pointer but we have to return an int,
> so I believe neither dev_err_ptr_probe() or any similar macro can really
> help us.

Ah yes, you're right. Disregard.

--
Lee Jones [李琼斯]