Re: [PATCH v1 2/2] iio: adc: ti-ads1119: Add driver

From: Dan Carpenter
Date: Wed May 29 2024 - 10:36:36 EST


Hi Francesco,

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/Francesco-Dolcini/dt-bindings-iio-adc-add-ti-ads1119/20240527-234431
base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
patch link: https://lore.kernel.org/r/20240527154050.24975-3-francesco%40dolcini.it
patch subject: [PATCH v1 2/2] iio: adc: ti-ads1119: Add driver
config: openrisc-randconfig-r071-20240529 (https://download.01.org/0day-ci/archive/20240529/202405291150.r5z8TZYu-lkp@xxxxxxxxx/config)
compiler: or1k-linux-gcc (GCC) 13.2.0

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/202405291150.r5z8TZYu-lkp@xxxxxxxxx/

New smatch warnings:
drivers/iio/adc/ti-ads1119.c:653 ads1119_get_configs() warn: passing zero to 'PTR_ERR'

vim +629 drivers/iio/adc/ti-ads1119.c

14caaeae0e22b3 João Paulo Gonçalves 2024-05-27 642 static int ads1119_get_configs(struct ads1119_state *st)
14caaeae0e22b3 João Paulo Gonçalves 2024-05-27 643 {
14caaeae0e22b3 João Paulo Gonçalves 2024-05-27 644 struct device *dev = &st->client->dev;
14caaeae0e22b3 João Paulo Gonçalves 2024-05-27 645
14caaeae0e22b3 João Paulo Gonçalves 2024-05-27 646 st->vref = devm_regulator_get_optional(dev, "vref");
14caaeae0e22b3 João Paulo Gonçalves 2024-05-27 647 if (IS_ERR(st->vref))
14caaeae0e22b3 João Paulo Gonçalves 2024-05-27 648 return dev_err_probe(dev, PTR_ERR(st->vref),
14caaeae0e22b3 João Paulo Gonçalves 2024-05-27 649 "Failed to get vref\n");
14caaeae0e22b3 João Paulo Gonçalves 2024-05-27 650
14caaeae0e22b3 João Paulo Gonçalves 2024-05-27 651 st->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
14caaeae0e22b3 João Paulo Gonçalves 2024-05-27 652 if (IS_ERR(st->reset_gpio))
14caaeae0e22b3 João Paulo Gonçalves 2024-05-27 @653 return dev_err_probe(dev, PTR_ERR(st->vref),
^^^^^^^^
st->reset_gpio was intended.

14caaeae0e22b3 João Paulo Gonçalves 2024-05-27 654 "Failed to get reset gpio\n");
14caaeae0e22b3 João Paulo Gonçalves 2024-05-27 655
14caaeae0e22b3 João Paulo Gonçalves 2024-05-27 656 return ads1119_alloc_and_config_channels(st);
14caaeae0e22b3 João Paulo Gonçalves 2024-05-27 657 }

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