devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: ahaslam@baylibre.com, lars@metafoo.de,
	Michael.Hennerich@analog.com, jic23@kernel.org, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org, nuno.sa@analog.com,
	dlechner@baylibre.com
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, Axel Haslam <ahaslam@baylibre.com>
Subject: Re: [PATCH 5/6] iio: dac: ad5791: Use devm_regulator_get_enable_read_voltage
Date: Tue, 29 Oct 2024 02:32:42 +0800	[thread overview]
Message-ID: <202410290245.0RC0cDV4-lkp@intel.com> (raw)
In-Reply-To: <20241028071118.699951-6-ahaslam@baylibre.com>

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@intel.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

  reply	other threads:[~2024-10-28 18:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-28  7:11 [PATCH 0/6] Improvements and Enhancements for AD5791 DAC Driver ahaslam
2024-10-28  7:11 ` [PATCH 1/6] dt-bindings: iio: dac: ad5791: Add optional reset, clr and ldac gpios ahaslam
2024-10-28  7:42   ` Krzysztof Kozlowski
2024-10-28  7:11 ` [PATCH 2/6] dt-bindings: iio: dac: ad5791: Add required voltage supplies ahaslam
2024-10-28  8:06   ` Krzysztof Kozlowski
2024-10-28 23:07     ` Axel Haslam
2024-10-29  6:27   ` Krzysztof Kozlowski
2024-10-28  7:11 ` [PATCH 3/6] iio: dac: ad5791: Include chip_info in device match tables ahaslam
2024-10-28 16:38   ` kernel test robot
2024-10-28 20:22   ` Jonathan Cameron
2024-10-28  7:11 ` [PATCH 4/6] iio: dac: ad5791: Add reset, clr and ldac gpios ahaslam
2024-10-28 18:46   ` kernel test robot
2024-10-28  7:11 ` [PATCH 5/6] iio: dac: ad5791: Use devm_regulator_get_enable_read_voltage ahaslam
2024-10-28 18:32   ` kernel test robot [this message]
2024-10-28  7:11 ` [PATCH 6/6] iio: dac: ad5791: Use devm_iio_device_register ahaslam
2024-10-28 20:25   ` Jonathan Cameron
  -- strict thread matches above, loose matches on Subject: below --
2024-10-29  7:38 [PATCH 0/6] Improvements and Enhancements for AD5791 DAC Driver ahaslam
2024-10-29  7:38 ` [PATCH 5/6] iio: dac: ad5791: Use devm_regulator_get_enable_read_voltage ahaslam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202410290245.0RC0cDV4-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=ahaslam@baylibre.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=nuno.sa@analog.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).