Re: [PATCH v8 3/7] mfd: Add base driver for Netronix embedded controller

From: Jonathan Neuschäfer
Date: Sun Jan 17 2021 - 19:50:55 EST


On Sun, Jan 17, 2021 at 09:22:01AM +0800, kernel test robot wrote:
[...]
> >> drivers/mfd/ntxec.c:127:10: warning: variable 'res' is uninitialized when used here [-Wuninitialized]
> return res;
> ^~~
> drivers/mfd/ntxec.c:116:9: note: initialize the variable 'res' to silence this warning
> int res;
> ^
> = 0
> 1 warning generated.
[...]
> 124 ec->regmap = devm_regmap_init_i2c(client, &regmap_config);
> 125 if (IS_ERR(ec->regmap)) {
> 126 dev_err(ec->dev, "Failed to set up regmap for device\n");
> > 127 return res;
> 128 }

Ah well, that's a bug (present since v2 of the patchset). The return
statement should be:

return PTR_ERR(ec->regmap);


Thanks,
Jonathan Neuschäfer

Attachment: signature.asc
Description: PGP signature