[PATCH v2 2/6] iio: light: stk3310: Implement vdd supply and power it off during suspend
kernel test robot
lkp at intel.com
Wed Apr 24 05:34:03 PDT 2024
Hi Aren,
kernel test robot noticed the following build warnings:
[auto build test WARNING on jic23-iio/togreg]
[also build test WARNING on sunxi/sunxi/for-next robh/for-next linus/master v6.9-rc5 next-20240423]
[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/Aren-Moynihan/dt-bindings-iio-light-stk33xx-add-vdd-and-leda-regulators/20240424-064250
base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
patch link: https://lore.kernel.org/r/20240423223309.1468198-4-aren%40peacevolution.org
patch subject: [PATCH v2 2/6] iio: light: stk3310: Implement vdd supply and power it off during suspend
config: arm64-randconfig-001-20240424 (https://download.01.org/0day-ci/archive/20240424/202404242057.PUDY5RB1-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 5ef5eb66fb428aaf61fb51b709f065c069c11242)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240424/202404242057.PUDY5RB1-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 at intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202404242057.PUDY5RB1-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from drivers/iio/light/stk3310.c:10:
In file included from include/linux/i2c.h:19:
In file included from include/linux/regulator/consumer.h:35:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:21:
In file included from include/linux/mm.h:2208:
include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
>> drivers/iio/light/stk3310.c:615:38: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
615 | return dev_err_probe(&client->dev, ret, "get regulator vdd failed\n");
| ^~~
drivers/iio/light/stk3310.c:594:9: note: initialize the variable 'ret' to silence this warning
594 | int ret;
| ^
| = 0
2 warnings generated.
vim +/ret +615 drivers/iio/light/stk3310.c
591
592 static int stk3310_probe(struct i2c_client *client)
593 {
594 int ret;
595 struct iio_dev *indio_dev;
596 struct stk3310_data *data;
597
598 indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
599 if (!indio_dev) {
600 dev_err(&client->dev, "iio allocation failed!\n");
601 return -ENOMEM;
602 }
603
604 data = iio_priv(indio_dev);
605 data->client = client;
606 i2c_set_clientdata(client, indio_dev);
607
608 device_property_read_u32(&client->dev, "proximity-near-level",
609 &data->ps_near_level);
610
611 mutex_init(&data->lock);
612
613 data->vdd_reg = devm_regulator_get(&client->dev, "vdd");
614 if (IS_ERR(data->vdd_reg))
> 615 return dev_err_probe(&client->dev, ret, "get regulator vdd failed\n");
616
617 ret = stk3310_regmap_init(data);
618 if (ret < 0)
619 return ret;
620
621 indio_dev->info = &stk3310_info;
622 indio_dev->name = STK3310_DRIVER_NAME;
623 indio_dev->modes = INDIO_DIRECT_MODE;
624 indio_dev->channels = stk3310_channels;
625 indio_dev->num_channels = ARRAY_SIZE(stk3310_channels);
626
627 ret = regulator_enable(data->vdd_reg);
628 if (ret)
629 return dev_err_probe(&client->dev, ret,
630 "regulator vdd enable failed\n");
631
632 /* we need a short delay to allow the chip time to power on */
633 fsleep(1000);
634
635 ret = stk3310_init(indio_dev);
636 if (ret < 0)
637 goto err_vdd_disable;
638
639 if (client->irq > 0) {
640 ret = devm_request_threaded_irq(&client->dev, client->irq,
641 stk3310_irq_handler,
642 stk3310_irq_event_handler,
643 IRQF_TRIGGER_FALLING |
644 IRQF_ONESHOT,
645 STK3310_EVENT, indio_dev);
646 if (ret < 0) {
647 dev_err(&client->dev, "request irq %d failed\n",
648 client->irq);
649 goto err_standby;
650 }
651 }
652
653 ret = iio_device_register(indio_dev);
654 if (ret < 0) {
655 dev_err(&client->dev, "device_register failed\n");
656 goto err_standby;
657 }
658
659 return 0;
660
661 err_standby:
662 stk3310_set_state(data, STK3310_STATE_STANDBY);
663 err_vdd_disable:
664 regulator_disable(data->vdd_reg);
665 return ret;
666 }
667
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
More information about the linux-arm-kernel
mailing list