drivers/power/supply/qcom_pmi8998_charger.c:565 smb2_status_change_work() error: uninitialized symbol 'usb_online'.
kernel test robot
build botBCC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Caleb Connolly <[email protected]>
CC: Sebastian Reichel <[email protected]>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 57012c57536f8814dec92e74197ee96c3498d24e commit: 8648aeb5d7b70e13264ff5f444f22081d37d4670 power: supply: add Qualcomm PMI8998 SMB2 Charger driver date: 7 weeks ago
:::::: branch date: 3 hours ago
:::::: commit date: 7 weeks ago
config: arm-randconfig-m041-20230727 (https://download.01.org/0day-ci/archive/20230728/[email protected]/config)
compiler: arm-linux-gnueabi-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230728/[email protected]/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 <[email protected]> | Reported-by: Dan Carpenter <[email protected]> | Closes: https://lore.kernel.org/r/[email protected]/
smatch warnings:drivers/power/supply/qcom_pmi8998_charger.c:565 smb2_status_change_work() error: uninitialized symbol 'usb_online'.
vim +/usb_online +565 drivers/power/supply/qcom_pmi8998_charger.c
8648aeb5d7b70e Caleb Connolly 2023-05-26 555
8648aeb5d7b70e Caleb Connolly 2023-05-26 556 static void smb2_status_change_work(struct work_struct *work)
8648aeb5d7b70e Caleb Connolly 2023-05-26 557 {
8648aeb5d7b70e Caleb Connolly 2023-05-26 558 unsigned int charger_type, current_ua;
8648aeb5d7b70e Caleb Connolly 2023-05-26 559 int usb_online, count, rc;
8648aeb5d7b70e Caleb Connolly 2023-05-26 560 struct smb2_chip *chip;
8648aeb5d7b70e Caleb Connolly 2023-05-26 561
8648aeb5d7b70e Caleb Connolly 2023-05-26 562 chip = container_of(work, struct smb2_chip, status_change_work.work);
8648aeb5d7b70e Caleb Connolly 2023-05-26 563
8648aeb5d7b70e Caleb Connolly 2023-05-26 564 smb2_get_prop_usb_online(chip, &usb_online);
8648aeb5d7b70e Caleb Connolly 2023-05-26 @565 if (!usb_online)
8648aeb5d7b70e Caleb Connolly 2023-05-26 566 return;
8648aeb5d7b70e Caleb Connolly 2023-05-26 567
8648aeb5d7b70e Caleb Connolly 2023-05-26 568 for (count = 0; count < 3; count++) {
8648aeb5d7b70e Caleb Connolly 2023-05-26 569 dev_dbg(chip->dev, "get charger type retry %d\n", count);
8648aeb5d7b70e Caleb Connolly 2023-05-26 570 rc = smb2_apsd_get_charger_type(chip, &charger_type);
8648aeb5d7b70e Caleb Connolly 2023-05-26 571 if (rc != -EAGAIN)
8648aeb5d7b70e Caleb Connolly 2023-05-26 572 break;
8648aeb5d7b70e Caleb Connolly 2023-05-26 573 msleep(100);
8648aeb5d7b70e Caleb Connolly 2023-05-26 574 }
8648aeb5d7b70e Caleb Connolly 2023-05-26 575
8648aeb5d7b70e Caleb Connolly 2023-05-26 576 if (rc < 0 && rc != -EAGAIN) {
8648aeb5d7b70e Caleb Connolly 2023-05-26 577 dev_err(chip->dev, "get charger type failed: %d\n", rc);
8648aeb5d7b70e Caleb Connolly 2023-05-26 578 return;
8648aeb5d7b70e Caleb Connolly 2023-05-26 579 }
8648aeb5d7b70e Caleb Connolly 2023-05-26 580
8648aeb5d7b70e Caleb Connolly 2023-05-26 581 if (rc < 0) {
8648aeb5d7b70e Caleb Connolly 2023-05-26 582 rc = regmap_update_bits(chip->regmap, chip->base + CMD_APSD,
8648aeb5d7b70e Caleb Connolly 2023-05-26 583 APSD_RERUN_BIT, APSD_RERUN_BIT);
8648aeb5d7b70e Caleb Connolly 2023-05-26 584 schedule_delayed_work(&chip->status_change_work,
8648aeb5d7b70e Caleb Connolly 2023-05-26 585 msecs_to_jiffies(1000));
8648aeb5d7b70e Caleb Connolly 2023-05-26 586 dev_dbg(chip->dev, "get charger type failed, rerun apsd\n");
8648aeb5d7b70e Caleb Connolly 2023-05-26 587 return;
8648aeb5d7b70e Caleb Connolly 2023-05-26 588 }
8648aeb5d7b70e Caleb Connolly 2023-05-26 589
8648aeb5d7b70e Caleb Connolly 2023-05-26 590 switch (charger_type) {
8648aeb5d7b70e Caleb Connolly 2023-05-26 591 case POWER_SUPPLY_USB_TYPE_CDP:
8648aeb5d7b70e Caleb Connolly 2023-05-26 592 current_ua = CDP_CURRENT_UA;
8648aeb5d7b70e Caleb Connolly 2023-05-26 593 break;
8648aeb5d7b70e Caleb Connolly 2023-05-26 594 case POWER_SUPPLY_USB_TYPE_DCP:
8648aeb5d7b70e Caleb Connolly 2023-05-26 595 current_ua = DCP_CURRENT_UA;
8648aeb5d7b70e Caleb Connolly 2023-05-26 596 break;
8648aeb5d7b70e Caleb Connolly 2023-05-26 597 case POWER_SUPPLY_USB_TYPE_SDP:
8648aeb5d7b70e Caleb Connolly 2023-05-26 598 default:
8648aeb5d7b70e Caleb Connolly 2023-05-26 599 current_ua = SDP_CURRENT_UA;
8648aeb5d7b70e Caleb Connolly 2023-05-26 600 break;
8648aeb5d7b70e Caleb Connolly 2023-05-26 601 }
8648aeb5d7b70e Caleb Connolly 2023-05-26 602
8648aeb5d7b70e Caleb Connolly 2023-05-26 603 smb2_set_current_limit(chip, current_ua);
8648aeb5d7b70e Caleb Connolly 2023-05-26 604 power_supply_changed(chip->chg_psy);
8648aeb5d7b70e Caleb Connolly 2023-05-26 605 }
8648aeb5d7b70e Caleb Connolly 2023-05-26 606 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki