* [linux-next:master 2084/7844] drivers/iio/adc/ti-ads1100.c:347 ads1100_probe() warn: passing zero to 'PTR_ERR'
@ 2023-03-31 2:11 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-03-31 2:11 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp, Dan Carpenter
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Mike Looijmans <mike.looijmans@topic.nl>
CC: Jonathan Cameron <Jonathan.Cameron@huawei.com>
CC: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: a6d9e3034536ba4b68ac34490c02267e6eec9c05
commit: 541880542f2baa7c485b40c1ecad1855315418f6 [2084/7844] iio: adc: Add TI ADS1100 and ADS1000
:::::: branch date: 22 hours ago
:::::: commit date: 3 weeks ago
config: s390-randconfig-m031-20230329 (https://download.01.org/0day-ci/archive/20230331/202303311053.RB8KIUTR-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 12.1.0
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Link: https://lore.kernel.org/r/202303311053.RB8KIUTR-lkp@intel.com/
smatch warnings:
drivers/iio/adc/ti-ads1100.c:347 ads1100_probe() warn: passing zero to 'PTR_ERR'
vim +/PTR_ERR +347 drivers/iio/adc/ti-ads1100.c
541880542f2baa Mike Looijmans 2023-03-07 317
541880542f2baa Mike Looijmans 2023-03-07 318 static int ads1100_probe(struct i2c_client *client)
541880542f2baa Mike Looijmans 2023-03-07 319 {
541880542f2baa Mike Looijmans 2023-03-07 320 struct iio_dev *indio_dev;
541880542f2baa Mike Looijmans 2023-03-07 321 struct ads1100_data *data;
541880542f2baa Mike Looijmans 2023-03-07 322 struct device *dev = &client->dev;
541880542f2baa Mike Looijmans 2023-03-07 323 int ret;
541880542f2baa Mike Looijmans 2023-03-07 324
541880542f2baa Mike Looijmans 2023-03-07 325 indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
541880542f2baa Mike Looijmans 2023-03-07 326 if (!indio_dev)
541880542f2baa Mike Looijmans 2023-03-07 327 return -ENOMEM;
541880542f2baa Mike Looijmans 2023-03-07 328
541880542f2baa Mike Looijmans 2023-03-07 329 data = iio_priv(indio_dev);
541880542f2baa Mike Looijmans 2023-03-07 330 dev_set_drvdata(dev, data);
541880542f2baa Mike Looijmans 2023-03-07 331 data->client = client;
541880542f2baa Mike Looijmans 2023-03-07 332 mutex_init(&data->lock);
541880542f2baa Mike Looijmans 2023-03-07 333
541880542f2baa Mike Looijmans 2023-03-07 334 indio_dev->name = "ads1100";
541880542f2baa Mike Looijmans 2023-03-07 335 indio_dev->modes = INDIO_DIRECT_MODE;
541880542f2baa Mike Looijmans 2023-03-07 336 indio_dev->channels = &ads1100_channel;
541880542f2baa Mike Looijmans 2023-03-07 337 indio_dev->num_channels = 1;
541880542f2baa Mike Looijmans 2023-03-07 338 indio_dev->info = &ads1100_info;
541880542f2baa Mike Looijmans 2023-03-07 339
541880542f2baa Mike Looijmans 2023-03-07 340 data->reg_vdd = devm_regulator_get(dev, "vdd");
541880542f2baa Mike Looijmans 2023-03-07 341 if (IS_ERR(data->reg_vdd))
541880542f2baa Mike Looijmans 2023-03-07 342 return dev_err_probe(dev, PTR_ERR(data->reg_vdd),
541880542f2baa Mike Looijmans 2023-03-07 343 "Failed to get vdd regulator\n");
541880542f2baa Mike Looijmans 2023-03-07 344
541880542f2baa Mike Looijmans 2023-03-07 345 ret = regulator_enable(data->reg_vdd);
541880542f2baa Mike Looijmans 2023-03-07 346 if (ret < 0)
541880542f2baa Mike Looijmans 2023-03-07 @347 return dev_err_probe(dev, PTR_ERR(data->reg_vdd),
541880542f2baa Mike Looijmans 2023-03-07 348 "Failed to enable vdd regulator\n");
541880542f2baa Mike Looijmans 2023-03-07 349
541880542f2baa Mike Looijmans 2023-03-07 350 ret = devm_add_action_or_reset(dev, ads1100_reg_disable, data->reg_vdd);
541880542f2baa Mike Looijmans 2023-03-07 351 if (ret)
541880542f2baa Mike Looijmans 2023-03-07 352 return ret;
541880542f2baa Mike Looijmans 2023-03-07 353
541880542f2baa Mike Looijmans 2023-03-07 354 ret = ads1100_setup(data);
541880542f2baa Mike Looijmans 2023-03-07 355 if (ret)
541880542f2baa Mike Looijmans 2023-03-07 356 return dev_err_probe(dev, ret,
541880542f2baa Mike Looijmans 2023-03-07 357 "Failed to communicate with device\n");
541880542f2baa Mike Looijmans 2023-03-07 358
541880542f2baa Mike Looijmans 2023-03-07 359 ret = devm_add_action_or_reset(dev, ads1100_disable_continuous, data);
541880542f2baa Mike Looijmans 2023-03-07 360 if (ret)
541880542f2baa Mike Looijmans 2023-03-07 361 return ret;
541880542f2baa Mike Looijmans 2023-03-07 362
541880542f2baa Mike Looijmans 2023-03-07 363 ads1100_calc_scale_avail(data);
541880542f2baa Mike Looijmans 2023-03-07 364
541880542f2baa Mike Looijmans 2023-03-07 365 pm_runtime_set_autosuspend_delay(dev, ADS1100_SLEEP_DELAY_MS);
541880542f2baa Mike Looijmans 2023-03-07 366 pm_runtime_use_autosuspend(dev);
541880542f2baa Mike Looijmans 2023-03-07 367 pm_runtime_set_active(dev);
541880542f2baa Mike Looijmans 2023-03-07 368 ret = devm_pm_runtime_enable(dev);
541880542f2baa Mike Looijmans 2023-03-07 369 if (ret)
541880542f2baa Mike Looijmans 2023-03-07 370 return dev_err_probe(dev, ret, "Failed to enable pm_runtime\n");
541880542f2baa Mike Looijmans 2023-03-07 371
541880542f2baa Mike Looijmans 2023-03-07 372 ret = devm_iio_device_register(dev, indio_dev);
541880542f2baa Mike Looijmans 2023-03-07 373 if (ret)
541880542f2baa Mike Looijmans 2023-03-07 374 return dev_err_probe(dev, ret,
541880542f2baa Mike Looijmans 2023-03-07 375 "Failed to register IIO device\n");
541880542f2baa Mike Looijmans 2023-03-07 376
541880542f2baa Mike Looijmans 2023-03-07 377 return 0;
541880542f2baa Mike Looijmans 2023-03-07 378 }
541880542f2baa Mike Looijmans 2023-03-07 379
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-03-31 2:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-31 2:11 [linux-next:master 2084/7844] drivers/iio/adc/ti-ads1100.c:347 ads1100_probe() warn: passing zero to 'PTR_ERR' kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.