* [linusw-gpio:b4/descriptors-regulators 3/6] drivers/regulator/da9055-regulator.c:481 da9055_gpio_init() error: uninitialized symbol 'ret'.
@ 2024-02-19 22:14 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2024-02-19 22:14 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp, Dan Carpenter
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-gpio@vger.kernel.org
TO: Linus Walleij <linus.walleij@linaro.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git b4/descriptors-regulators
head: 70f1ac1c0e32e3d7fb546eac70f113bd57b659fa
commit: db93c3de09384ee1d48a99bb103a49938f80e046 [3/6] regulator: da9055: Fully convert to GPIO descriptors
:::::: branch date: 22 hours ago
:::::: commit date: 4 days ago
config: nios2-randconfig-r071-20240219 (https://download.01.org/0day-ci/archive/20240220/202402200604.tilWhpaa-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 13.2.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202402200604.tilWhpaa-lkp@intel.com/
smatch warnings:
drivers/regulator/da9055-regulator.c:481 da9055_gpio_init() error: uninitialized symbol 'ret'.
vim +/ret +481 drivers/regulator/da9055-regulator.c
f6130be652d0b4 Ashish Jangam 2012-11-01 409
f6130be652d0b4 Ashish Jangam 2012-11-01 410 /*
f6130be652d0b4 Ashish Jangam 2012-11-01 411 * Configures regulator to be controlled either through GPIO 1 or 2.
f6130be652d0b4 Ashish Jangam 2012-11-01 412 * GPIO can control regulator state and/or select the regulator register
f6130be652d0b4 Ashish Jangam 2012-11-01 413 * set A/B for voltage ramping.
f6130be652d0b4 Ashish Jangam 2012-11-01 414 */
db93c3de09384e Linus Walleij 2024-02-15 415 static int da9055_gpio_init(struct device *dev,
db93c3de09384e Linus Walleij 2024-02-15 416 struct da9055_regulator *regulator,
f6130be652d0b4 Ashish Jangam 2012-11-01 417 struct regulator_config *config,
f6130be652d0b4 Ashish Jangam 2012-11-01 418 struct da9055_pdata *pdata, int id)
f6130be652d0b4 Ashish Jangam 2012-11-01 419 {
f6130be652d0b4 Ashish Jangam 2012-11-01 420 struct da9055_regulator_info *info = regulator->info;
db93c3de09384e Linus Walleij 2024-02-15 421 struct gpio_desc *ren;
db93c3de09384e Linus Walleij 2024-02-15 422 struct gpio_desc *ena;
db93c3de09384e Linus Walleij 2024-02-15 423 struct gpio_desc *rsel;
db93c3de09384e Linus Walleij 2024-02-15 424 int ret;
f6130be652d0b4 Ashish Jangam 2012-11-01 425
db93c3de09384e Linus Walleij 2024-02-15 426 /* Look for "regulator-enable-gpios" GPIOs in the regulator node */
db93c3de09384e Linus Walleij 2024-02-15 427 ren = devm_gpiod_get_optional(dev, "regulator-enable", GPIOD_IN);
db93c3de09384e Linus Walleij 2024-02-15 428 if (IS_ERR(ren))
db93c3de09384e Linus Walleij 2024-02-15 429 return PTR_ERR(ren);
8b61a28d616a34 Adam Thomson 2014-02-06 430
db93c3de09384e Linus Walleij 2024-02-15 431 if (ren) {
db93c3de09384e Linus Walleij 2024-02-15 432 /* This GPIO is not optional at this point */
db93c3de09384e Linus Walleij 2024-02-15 433 ena = devm_gpiod_get(dev, "enable", GPIOD_OUT_HIGH);
db93c3de09384e Linus Walleij 2024-02-15 434 if (IS_ERR(ena))
db93c3de09384e Linus Walleij 2024-02-15 435 return PTR_ERR(ena);
f6130be652d0b4 Ashish Jangam 2012-11-01 436
db93c3de09384e Linus Walleij 2024-02-15 437 config->ena_gpiod = ena;
f6130be652d0b4 Ashish Jangam 2012-11-01 438
f6130be652d0b4 Ashish Jangam 2012-11-01 439 /*
f6130be652d0b4 Ashish Jangam 2012-11-01 440 * GPI pin is muxed with regulator to control the
f6130be652d0b4 Ashish Jangam 2012-11-01 441 * regulator state.
f6130be652d0b4 Ashish Jangam 2012-11-01 442 */
db93c3de09384e Linus Walleij 2024-02-15 443 gpiod_set_consumer_name(ren, "DA9055 ren GPI");
f6130be652d0b4 Ashish Jangam 2012-11-01 444
f6130be652d0b4 Ashish Jangam 2012-11-01 445 /*
f6130be652d0b4 Ashish Jangam 2012-11-01 446 * Let the regulator know that its state is controlled
f6130be652d0b4 Ashish Jangam 2012-11-01 447 * through GPI.
f6130be652d0b4 Ashish Jangam 2012-11-01 448 */
f6130be652d0b4 Ashish Jangam 2012-11-01 449 ret = da9055_reg_update(regulator->da9055, info->conf.reg,
f6130be652d0b4 Ashish Jangam 2012-11-01 450 DA9055_E_GPI_MASK,
f6130be652d0b4 Ashish Jangam 2012-11-01 451 pdata->reg_ren[id]
f6130be652d0b4 Ashish Jangam 2012-11-01 452 << DA9055_E_GPI_SHIFT);
f6130be652d0b4 Ashish Jangam 2012-11-01 453 if (ret < 0)
db93c3de09384e Linus Walleij 2024-02-15 454 return ret;
f6130be652d0b4 Ashish Jangam 2012-11-01 455 }
f6130be652d0b4 Ashish Jangam 2012-11-01 456
db93c3de09384e Linus Walleij 2024-02-15 457 /* Look for "regulator-select-gpios" GPIOs in the regulator node */
db93c3de09384e Linus Walleij 2024-02-15 458 rsel = devm_gpiod_get_optional(dev, "regulator-select", GPIOD_IN);
db93c3de09384e Linus Walleij 2024-02-15 459 if (IS_ERR(rsel))
db93c3de09384e Linus Walleij 2024-02-15 460 return PTR_ERR(rsel);
f6130be652d0b4 Ashish Jangam 2012-11-01 461
db93c3de09384e Linus Walleij 2024-02-15 462 if (rsel) {
f6130be652d0b4 Ashish Jangam 2012-11-01 463 regulator->reg_rselect = pdata->reg_rsel[id];
f6130be652d0b4 Ashish Jangam 2012-11-01 464
f6130be652d0b4 Ashish Jangam 2012-11-01 465 /*
f6130be652d0b4 Ashish Jangam 2012-11-01 466 * GPI pin is muxed with regulator to select the
f6130be652d0b4 Ashish Jangam 2012-11-01 467 * regulator register set A/B for voltage ramping.
f6130be652d0b4 Ashish Jangam 2012-11-01 468 */
db93c3de09384e Linus Walleij 2024-02-15 469 gpiod_set_consumer_name(rsel, "DA9055 rsel GPI");
f6130be652d0b4 Ashish Jangam 2012-11-01 470
f6130be652d0b4 Ashish Jangam 2012-11-01 471 /*
f6130be652d0b4 Ashish Jangam 2012-11-01 472 * Let the regulator know that its register set A/B
f6130be652d0b4 Ashish Jangam 2012-11-01 473 * will be selected through GPI for voltage ramping.
f6130be652d0b4 Ashish Jangam 2012-11-01 474 */
f6130be652d0b4 Ashish Jangam 2012-11-01 475 ret = da9055_reg_update(regulator->da9055, info->conf.reg,
f6130be652d0b4 Ashish Jangam 2012-11-01 476 DA9055_V_GPI_MASK,
f6130be652d0b4 Ashish Jangam 2012-11-01 477 pdata->reg_rsel[id]
f6130be652d0b4 Ashish Jangam 2012-11-01 478 << DA9055_V_GPI_SHIFT);
f6130be652d0b4 Ashish Jangam 2012-11-01 479 }
f6130be652d0b4 Ashish Jangam 2012-11-01 480
f6130be652d0b4 Ashish Jangam 2012-11-01 @481 return ret;
f6130be652d0b4 Ashish Jangam 2012-11-01 482 }
f6130be652d0b4 Ashish Jangam 2012-11-01 483
:::::: The code at line 481 was first introduced by commit
:::::: f6130be652d0b4fbf710d83a816298c007e59ed1 regulator: DA9055 regulator driver
:::::: TO: Ashish Jangam <ashish.jangam@kpitcummins.com>
:::::: CC: Mark Brown <broonie@opensource.wolfsonmicro.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread* [linusw-gpio:b4/descriptors-regulators 3/6] drivers/regulator/da9055-regulator.c:481 da9055_gpio_init() error: uninitialized symbol 'ret'.
@ 2024-02-20 5:15 Dan Carpenter
0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2024-02-20 5:15 UTC (permalink / raw)
To: oe-kbuild, Linus Walleij; +Cc: lkp, oe-kbuild-all, linux-gpio
tree: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git b4/descriptors-regulators
head: 70f1ac1c0e32e3d7fb546eac70f113bd57b659fa
commit: db93c3de09384ee1d48a99bb103a49938f80e046 [3/6] regulator: da9055: Fully convert to GPIO descriptors
config: nios2-randconfig-r071-20240219 (https://download.01.org/0day-ci/archive/20240220/202402200604.tilWhpaa-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 13.2.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202402200604.tilWhpaa-lkp@intel.com/
smatch warnings:
drivers/regulator/da9055-regulator.c:481 da9055_gpio_init() error: uninitialized symbol 'ret'.
vim +/ret +481 drivers/regulator/da9055-regulator.c
db93c3de09384e Linus Walleij 2024-02-15 415 static int da9055_gpio_init(struct device *dev,
db93c3de09384e Linus Walleij 2024-02-15 416 struct da9055_regulator *regulator,
f6130be652d0b4 Ashish Jangam 2012-11-01 417 struct regulator_config *config,
f6130be652d0b4 Ashish Jangam 2012-11-01 418 struct da9055_pdata *pdata, int id)
f6130be652d0b4 Ashish Jangam 2012-11-01 419 {
f6130be652d0b4 Ashish Jangam 2012-11-01 420 struct da9055_regulator_info *info = regulator->info;
db93c3de09384e Linus Walleij 2024-02-15 421 struct gpio_desc *ren;
db93c3de09384e Linus Walleij 2024-02-15 422 struct gpio_desc *ena;
db93c3de09384e Linus Walleij 2024-02-15 423 struct gpio_desc *rsel;
db93c3de09384e Linus Walleij 2024-02-15 424 int ret;
f6130be652d0b4 Ashish Jangam 2012-11-01 425
db93c3de09384e Linus Walleij 2024-02-15 426 /* Look for "regulator-enable-gpios" GPIOs in the regulator node */
db93c3de09384e Linus Walleij 2024-02-15 427 ren = devm_gpiod_get_optional(dev, "regulator-enable", GPIOD_IN);
If both devm_gpiod_get_optional() calls return NULL then "ret" ends up
being uninitialized.
db93c3de09384e Linus Walleij 2024-02-15 428 if (IS_ERR(ren))
db93c3de09384e Linus Walleij 2024-02-15 429 return PTR_ERR(ren);
8b61a28d616a34 Adam Thomson 2014-02-06 430
db93c3de09384e Linus Walleij 2024-02-15 431 if (ren) {
db93c3de09384e Linus Walleij 2024-02-15 432 /* This GPIO is not optional at this point */
db93c3de09384e Linus Walleij 2024-02-15 433 ena = devm_gpiod_get(dev, "enable", GPIOD_OUT_HIGH);
db93c3de09384e Linus Walleij 2024-02-15 434 if (IS_ERR(ena))
db93c3de09384e Linus Walleij 2024-02-15 435 return PTR_ERR(ena);
f6130be652d0b4 Ashish Jangam 2012-11-01 436
db93c3de09384e Linus Walleij 2024-02-15 437 config->ena_gpiod = ena;
f6130be652d0b4 Ashish Jangam 2012-11-01 438
f6130be652d0b4 Ashish Jangam 2012-11-01 439 /*
f6130be652d0b4 Ashish Jangam 2012-11-01 440 * GPI pin is muxed with regulator to control the
f6130be652d0b4 Ashish Jangam 2012-11-01 441 * regulator state.
f6130be652d0b4 Ashish Jangam 2012-11-01 442 */
db93c3de09384e Linus Walleij 2024-02-15 443 gpiod_set_consumer_name(ren, "DA9055 ren GPI");
f6130be652d0b4 Ashish Jangam 2012-11-01 444
f6130be652d0b4 Ashish Jangam 2012-11-01 445 /*
f6130be652d0b4 Ashish Jangam 2012-11-01 446 * Let the regulator know that its state is controlled
f6130be652d0b4 Ashish Jangam 2012-11-01 447 * through GPI.
f6130be652d0b4 Ashish Jangam 2012-11-01 448 */
f6130be652d0b4 Ashish Jangam 2012-11-01 449 ret = da9055_reg_update(regulator->da9055, info->conf.reg,
f6130be652d0b4 Ashish Jangam 2012-11-01 450 DA9055_E_GPI_MASK,
f6130be652d0b4 Ashish Jangam 2012-11-01 451 pdata->reg_ren[id]
f6130be652d0b4 Ashish Jangam 2012-11-01 452 << DA9055_E_GPI_SHIFT);
f6130be652d0b4 Ashish Jangam 2012-11-01 453 if (ret < 0)
db93c3de09384e Linus Walleij 2024-02-15 454 return ret;
f6130be652d0b4 Ashish Jangam 2012-11-01 455 }
f6130be652d0b4 Ashish Jangam 2012-11-01 456
db93c3de09384e Linus Walleij 2024-02-15 457 /* Look for "regulator-select-gpios" GPIOs in the regulator node */
db93c3de09384e Linus Walleij 2024-02-15 458 rsel = devm_gpiod_get_optional(dev, "regulator-select", GPIOD_IN);
db93c3de09384e Linus Walleij 2024-02-15 459 if (IS_ERR(rsel))
db93c3de09384e Linus Walleij 2024-02-15 460 return PTR_ERR(rsel);
f6130be652d0b4 Ashish Jangam 2012-11-01 461
db93c3de09384e Linus Walleij 2024-02-15 462 if (rsel) {
f6130be652d0b4 Ashish Jangam 2012-11-01 463 regulator->reg_rselect = pdata->reg_rsel[id];
f6130be652d0b4 Ashish Jangam 2012-11-01 464
f6130be652d0b4 Ashish Jangam 2012-11-01 465 /*
f6130be652d0b4 Ashish Jangam 2012-11-01 466 * GPI pin is muxed with regulator to select the
f6130be652d0b4 Ashish Jangam 2012-11-01 467 * regulator register set A/B for voltage ramping.
f6130be652d0b4 Ashish Jangam 2012-11-01 468 */
db93c3de09384e Linus Walleij 2024-02-15 469 gpiod_set_consumer_name(rsel, "DA9055 rsel GPI");
f6130be652d0b4 Ashish Jangam 2012-11-01 470
f6130be652d0b4 Ashish Jangam 2012-11-01 471 /*
f6130be652d0b4 Ashish Jangam 2012-11-01 472 * Let the regulator know that its register set A/B
f6130be652d0b4 Ashish Jangam 2012-11-01 473 * will be selected through GPI for voltage ramping.
f6130be652d0b4 Ashish Jangam 2012-11-01 474 */
f6130be652d0b4 Ashish Jangam 2012-11-01 475 ret = da9055_reg_update(regulator->da9055, info->conf.reg,
f6130be652d0b4 Ashish Jangam 2012-11-01 476 DA9055_V_GPI_MASK,
f6130be652d0b4 Ashish Jangam 2012-11-01 477 pdata->reg_rsel[id]
f6130be652d0b4 Ashish Jangam 2012-11-01 478 << DA9055_V_GPI_SHIFT);
f6130be652d0b4 Ashish Jangam 2012-11-01 479 }
f6130be652d0b4 Ashish Jangam 2012-11-01 480
f6130be652d0b4 Ashish Jangam 2012-11-01 @481 return ret;
f6130be652d0b4 Ashish Jangam 2012-11-01 482 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-02-20 5:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-19 22:14 [linusw-gpio:b4/descriptors-regulators 3/6] drivers/regulator/da9055-regulator.c:481 da9055_gpio_init() error: uninitialized symbol 'ret' kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2024-02-20 5:15 Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.