[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202410290245.0RC0cDV4-lkp@intel.com>
Date: Tue, 29 Oct 2024 02:32:42 +0800
From: kernel test robot <lkp@...el.com>
To: ahaslam@...libre.com, lars@...afoo.de, Michael.Hennerich@...log.com,
jic23@...nel.org, robh@...nel.org, krzk+dt@...nel.org,
conor+dt@...nel.org, nuno.sa@...log.com, dlechner@...libre.com
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, Axel Haslam <ahaslam@...libre.com>
Subject: Re: [PATCH 5/6] iio: dac: ad5791: Use
devm_regulator_get_enable_read_voltage
Hi,
kernel test robot noticed the following build warnings:
[auto build test WARNING on jic23-iio/togreg]
[also build test WARNING on linus/master v6.12-rc5 next-20241028]
[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/ahaslam-baylibre-com/dt-bindings-iio-dac-ad5791-Add-optional-reset-clr-and-ldac-gpios/20241028-151319
base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
patch link: https://lore.kernel.org/r/20241028071118.699951-6-ahaslam%40baylibre.com
patch subject: [PATCH 5/6] iio: dac: ad5791: Use devm_regulator_get_enable_read_voltage
config: x86_64-buildonly-randconfig-004-20241028 (https://download.01.org/0day-ci/archive/20241029/202410290245.0RC0cDV4-lkp@intel.com/config)
compiler: clang version 19.1.2 (https://github.com/llvm/llvm-project 7ba7d8e2f7b6445b60679da826210cdde29eaf8b)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241029/202410290245.0RC0cDV4-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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410290245.0RC0cDV4-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from drivers/iio/dac/ad5791.c:14:
In file included from include/linux/spi/spi.h:17:
In file included from include/linux/scatterlist.h:8:
In file included from include/linux/mm.h:2213:
include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
518 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
>> drivers/iio/dac/ad5791.c:370:35: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
370 | return dev_err_probe(&spi->dev, ret, "failed to get vdd voltage\n");
| ^~~
drivers/iio/dac/ad5791.c:336:9: note: initialize the variable 'ret' to silence this warning
336 | int ret, pos_voltage_uv = 0, neg_voltage_uv = 0;
| ^
| = 0
2 warnings generated.
vim +/ret +370 drivers/iio/dac/ad5791.c
330
331 static int ad5791_probe(struct spi_device *spi)
332 {
333 const struct ad5791_platform_data *pdata = dev_get_platdata(&spi->dev);
334 struct iio_dev *indio_dev;
335 struct ad5791_state *st;
336 int ret, pos_voltage_uv = 0, neg_voltage_uv = 0;
337 bool use_rbuf_gain2;
338
339 indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
340 if (!indio_dev)
341 return -ENOMEM;
342 st = iio_priv(indio_dev);
343
344 st->gpio_reset = devm_gpiod_get_optional(&spi->dev, "reset",
345 GPIOD_OUT_HIGH);
346 if (IS_ERR(st->gpio_reset))
347 return PTR_ERR(st->gpio_reset);
348
349 st->gpio_clear = devm_gpiod_get_optional(&spi->dev, "clear",
350 GPIOD_OUT_LOW);
351 if (IS_ERR(st->gpio_clear))
352 return PTR_ERR(st->gpio_clear);
353
354 st->gpio_ldac = devm_gpiod_get_optional(&spi->dev, "ldac",
355 GPIOD_OUT_HIGH);
356 if (IS_ERR(st->gpio_ldac))
357 return PTR_ERR(st->gpio_ldac);
358
359 st->pwr_down = true;
360 st->spi = spi;
361
362 if (pdata)
363 use_rbuf_gain2 = pdata->use_rbuf_gain2;
364 else
365 use_rbuf_gain2 = device_property_read_bool(&spi->dev,
366 "adi,rbuf-gain2-en");
367
368 pos_voltage_uv = devm_regulator_get_enable_read_voltage(&spi->dev, "vdd");
369 if (pos_voltage_uv < 0 && pos_voltage_uv != -ENODEV)
> 370 return dev_err_probe(&spi->dev, ret, "failed to get vdd voltage\n");
371
372 neg_voltage_uv = devm_regulator_get_enable_read_voltage(&spi->dev, "vss");
373 if (neg_voltage_uv < 0 && neg_voltage_uv != -ENODEV)
374 return dev_err_probe(&spi->dev, ret, "failed to get vss voltage\n");
375
376 if (neg_voltage_uv >= 0 && pos_voltage_uv >= 0) {
377 st->vref_mv = (pos_voltage_uv + neg_voltage_uv) / 1000;
378 st->vref_neg_mv = neg_voltage_uv / 1000;
379 } else if (pdata) {
380 st->vref_mv = pdata->vref_pos_mv + pdata->vref_neg_mv;
381 st->vref_neg_mv = pdata->vref_neg_mv;
382 } else {
383 dev_warn(&spi->dev, "reference voltage unspecified\n");
384 }
385
386 if (st->gpio_reset) {
387 fsleep(20);
388 gpiod_set_value_cansleep(st->gpio_reset, 0);
389 } else {
390 ret = ad5791_spi_write(st, AD5791_ADDR_SW_CTRL, AD5791_SWCTRL_RESET);
391 if (ret)
392 return dev_err_probe(&spi->dev, ret, "fail to reset\n");
393 }
394
395 st->chip_info = spi_get_device_match_data(spi);
396 if (!st->chip_info)
397 return dev_err_probe(&spi->dev, -EINVAL, "no chip info\n");
398
399 st->ctrl = AD5761_CTRL_LINCOMP(st->chip_info->get_lin_comp(st->vref_mv))
400 | (use_rbuf_gain2 ? 0 : AD5791_CTRL_RBUF) |
401 AD5791_CTRL_BIN2SC;
402
403 ret = ad5791_spi_write(st, AD5791_ADDR_CTRL, st->ctrl |
404 AD5791_CTRL_OPGND | AD5791_CTRL_DACTRI);
405 if (ret)
406 return dev_err_probe(&spi->dev, ret, "fail to write ctrl register\n");
407
408 spi_set_drvdata(spi, indio_dev);
409 indio_dev->info = &ad5791_info;
410 indio_dev->modes = INDIO_DIRECT_MODE;
411 indio_dev->channels = &st->chip_info->channel;
412 indio_dev->num_channels = 1;
413 indio_dev->name = st->chip_info->name;
414 ret = iio_device_register(indio_dev);
415 if (ret)
416 return dev_err_probe(&spi->dev, ret, "unable to register iio device\n");
417
418 return 0;
419 }
420
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists