Re: [PATCH v7 02/11] mfd: Add max7360 support
From: Mathieu Dubois-Briand
Date: Fri May 02 2025 - 03:36:12 EST
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.
OK for all other points.
Thanks for your review,
Mathieu
--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com