Re: [PATCH v4 3/3] drivers: iio: adc: add support for ad777x family

From: Dan Carpenter
Date: Mon Jul 29 2024 - 11:31:41 EST


Hi Ramona,

kernel test robot noticed the following build warnings:

https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Ramona-Alexandra-Nechita/dt-bindings-iio-adc-add-a7779-doc/20240725-000001
base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
patch link: https://lore.kernel.org/r/20240724155517.12470-5-ramona.nechita%40analog.com
patch subject: [PATCH v4 3/3] drivers: iio: adc: add support for ad777x family
config: hexagon-randconfig-r081-20240728 (https://download.01.org/0day-ci/archive/20240729/202407290151.pCUNfKeG-lkp@xxxxxxxxx/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project ccae7b461be339e717d02f99ac857cf0bc7d17fc)

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@xxxxxxxxx>
| Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
| Closes: https://lore.kernel.org/r/202407290151.pCUNfKeG-lkp@xxxxxxxxx/

smatch warnings:
drivers/iio/adc/ad7779.c:779 ad7779_probe() error: uninitialized symbol 'ret'.

vim +/ret +779 drivers/iio/adc/ad7779.c

ed8e3886f0d748 Ramona Alexandra Nechita 2024-07-24 761 static int ad7779_probe(struct spi_device *spi)
ed8e3886f0d748 Ramona Alexandra Nechita 2024-07-24 762 {
ed8e3886f0d748 Ramona Alexandra Nechita 2024-07-24 763 struct iio_dev *indio_dev;
ed8e3886f0d748 Ramona Alexandra Nechita 2024-07-24 764 struct ad7779_state *st;
ed8e3886f0d748 Ramona Alexandra Nechita 2024-07-24 765 struct gpio_desc *reset_gpio, *start_gpio;
ed8e3886f0d748 Ramona Alexandra Nechita 2024-07-24 766 int ret;
ed8e3886f0d748 Ramona Alexandra Nechita 2024-07-24 767
ed8e3886f0d748 Ramona Alexandra Nechita 2024-07-24 768 indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
ed8e3886f0d748 Ramona Alexandra Nechita 2024-07-24 769 if (!indio_dev)
ed8e3886f0d748 Ramona Alexandra Nechita 2024-07-24 770 return -ENOMEM;
ed8e3886f0d748 Ramona Alexandra Nechita 2024-07-24 771
ed8e3886f0d748 Ramona Alexandra Nechita 2024-07-24 772 st = iio_priv(indio_dev);
ed8e3886f0d748 Ramona Alexandra Nechita 2024-07-24 773
ed8e3886f0d748 Ramona Alexandra Nechita 2024-07-24 774 st->mclk = devm_clk_get_enabled(&spi->dev, "mclk");
ed8e3886f0d748 Ramona Alexandra Nechita 2024-07-24 775 if (IS_ERR(st->mclk))
ed8e3886f0d748 Ramona Alexandra Nechita 2024-07-24 776 return PTR_ERR(st->mclk);
ed8e3886f0d748 Ramona Alexandra Nechita 2024-07-24 777
ed8e3886f0d748 Ramona Alexandra Nechita 2024-07-24 778 if (!spi->irq)
ed8e3886f0d748 Ramona Alexandra Nechita 2024-07-24 @779 return dev_err_probe(&spi->dev, ret,
^^^
s/ret/-EINVAL/

ed8e3886f0d748 Ramona Alexandra Nechita 2024-07-24 780 "DRDY irq not present\n");
ed8e3886f0d748 Ramona Alexandra Nechita 2024-07-24 781
ed8e3886f0d748 Ramona Alexandra Nechita 2024-07-24 782 reset_gpio = devm_gpiod_get_optional(&spi->dev, "reset", GPIOD_OUT_LOW);
ed8e3886f0d748 Ramona Alexandra Nechita 2024-07-24 783 if (IS_ERR(reset_gpio))

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki