Re: [PATCH 09/21] power: supply: max8925: Use devm_power_supply_register() helper

kernel test robot
2024-01-26T12:29:19Z

Hi Andrew,

kernel test robot noticed the following build warnings:

[auto build test WARNING on sre-power-supply/for-next]
[also build test WARNING on linus/master v6.8-rc1 next-20240125]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Andrew-Davis/power-supply-da9030-Use-devm_power_supply_register-helper/20240124-004253
base: https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next
patch link: https://lore.kernel.org/r/20240123163653.384385-10-afd%40ti.com
patch subject: [PATCH 09/21] power: supply: max8925: Use devm_power_supply_register() helper
config: i386-buildonly-randconfig-001-20240126 (https://download.01.org/0day-ci/archive/20240126/202401262006.hqYtlg6E-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240126/202401262006.hqYtlg6E-lkp@intel.com/reproduce)

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>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401262006.hqYtlg6E-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/power/supply/max8925_power.c:510:6: warning: unused variable 'ret' [-Wunused-variable]
510 | int ret;
| ^~~
1 warning generated.

vim +/ret +510 drivers/power/supply/max8925_power.c

eba3b670a9166a drivers/power/max8925_power.c Qing Xu 2012-11-19 503
c8afa6406e60ae drivers/power/max8925_power.c Bill Pemberton 2012-11-19 504 static int max8925_power_probe(struct platform_device *pdev)
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 505 {
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 506 struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent);
2dc9215d7c94f7 drivers/power/max8925_power.c Krzysztof Kozlowski 2015-03-12 507 struct power_supply_config psy_cfg = {}; /* Only for ac and usb */
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 508 struct max8925_power_pdata *pdata = NULL;
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 509 struct max8925_power_info *info;
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 @510 int ret;
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 511
eba3b670a9166a drivers/power/max8925_power.c Qing Xu 2012-11-19 512 pdata = max8925_power_dt_init(pdev);
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 513 if (!pdata) {
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 514 dev_err(&pdev->dev, "platform data isn't assigned to "
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 515 "power supply\n");
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 516 return -EINVAL;
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 517 }
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 518
feeb3a92b1f4e4 drivers/power/max8925_power.c Jingoo Han 2013-03-11 519 info = devm_kzalloc(&pdev->dev, sizeof(struct max8925_power_info),
feeb3a92b1f4e4 drivers/power/max8925_power.c Jingoo Han 2013-03-11 520 GFP_KERNEL);
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 521 if (!info)
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 522 return -ENOMEM;
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 523 info->chip = chip;
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 524 info->gpm = chip->i2c;
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 525 info->adc = chip->adc;
2402ca5e300db0 drivers/power/max8925_power.c Haojian Zhuang 2011-04-18 526 platform_set_drvdata(pdev, info);
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 527
2dc9215d7c94f7 drivers/power/max8925_power.c Krzysztof Kozlowski 2015-03-12 528 psy_cfg.supplied_to = pdata->supplied_to;
2dc9215d7c94f7 drivers/power/max8925_power.c Krzysztof Kozlowski 2015-03-12 529 psy_cfg.num_supplicants = pdata->num_supplicants;
2dc9215d7c94f7 drivers/power/max8925_power.c Krzysztof Kozlowski 2015-03-12 530
fec07f69a3e201 drivers/power/supply/max8925_power.c Andrew Davis 2024-01-23 531 info->ac = devm_power_supply_register(&pdev->dev, &ac_desc, &psy_cfg);
fec07f69a3e201 drivers/power/supply/max8925_power.c Andrew Davis 2024-01-23 532 if (IS_ERR(info->ac))
fec07f69a3e201 drivers/power/supply/max8925_power.c Andrew Davis 2024-01-23 533 return PTR_ERR(info->ac);
297d716f6260cc drivers/power/max8925_power.c Krzysztof Kozlowski 2015-03-12 534 info->ac->dev.parent = &pdev->dev;
e7a5f6d55991fb drivers/power/max8925_power.c Philip Rakity 2011-08-29 535
fec07f69a3e201 drivers/power/supply/max8925_power.c Andrew Davis 2024-01-23 536 info->usb = devm_power_supply_register(&pdev->dev, &usb_desc, &psy_cfg);
fec07f69a3e201 drivers/power/supply/max8925_power.c Andrew Davis 2024-01-23 537 if (IS_ERR(info->usb))
fec07f69a3e201 drivers/power/supply/max8925_power.c Andrew Davis 2024-01-23 538 return PTR_ERR(info->usb);
297d716f6260cc drivers/power/max8925_power.c Krzysztof Kozlowski 2015-03-12 539 info->usb->dev.parent = &pdev->dev;
297d716f6260cc drivers/power/max8925_power.c Krzysztof Kozlowski 2015-03-12 540
fec07f69a3e201 drivers/power/supply/max8925_power.c Andrew Davis 2024-01-23 541 info->battery = devm_power_supply_register(&pdev->dev, &battery_desc, NULL);
fec07f69a3e201 drivers/power/supply/max8925_power.c Andrew Davis 2024-01-23 542 if (IS_ERR(info->battery))
fec07f69a3e201 drivers/power/supply/max8925_power.c Andrew Davis 2024-01-23 543 return PTR_ERR(info->battery);
297d716f6260cc drivers/power/max8925_power.c Krzysztof Kozlowski 2015-03-12 544 info->battery->dev.parent = &pdev->dev;
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 545
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 546 info->batt_detect = pdata->batt_detect;
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 547 info->topoff_threshold = pdata->topoff_threshold;
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 548 info->fast_charge = pdata->fast_charge;
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 549 info->set_charger = pdata->set_charger;
92de378b739115 drivers/power/max8925_power.c Philip Rakity 2011-11-25 550 info->no_temp_support = pdata->no_temp_support;
5ba1fa0ae288e9 drivers/power/max8925_power.c Philip Rakity 2011-11-25 551 info->no_insert_detect = pdata->no_insert_detect;
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 552
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 553 max8925_init_charger(chip, info);
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 554 return 0;
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 555 }
28db38888b2a53 drivers/power/max8925_power.c Haojian Zhuang 2010-01-25 556

--
0-DAY CI Kernel Test Service