Re: [PATCH v3] iio : Add cm3218 smbus ara and acpi support

From: kbuild test robot
Date: Tue Oct 31 2017 - 04:39:35 EST


Hi Marc,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on iio/togreg]
[also build test WARNING on v4.14-rc7 next-20171018]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Marc-CAPDEVILLE/iio-Add-cm3218-smbus-ara-and-acpi-support/20171030-195025
base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
config: x86_64-randconfig-b0-10311428 (attached as .config)
compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64

All warnings (new ones prefixed by >>):

drivers/iio/light/cm32181.c: In function 'cm32181_probe':
drivers/iio/light/cm32181.c:424: error: 'clients' undeclared (first use in this function)
drivers/iio/light/cm32181.c:424: error: (Each undeclared identifier is reported only once
drivers/iio/light/cm32181.c:424: error: for each function it appears in.)
>> drivers/iio/light/cm32181.c:391: warning: unused variable 'ara_setup'

vim +/ara_setup +391 drivers/iio/light/cm32181.c

384
385 static int cm32181_probe(struct i2c_client *client,
386 const struct i2c_device_id *id)
387 {
388 struct cm32181_chip *cm32181;
389 struct iio_dev *indio_dev;
390 int ret;
> 391 struct i2c_smbus_alert_setup ara_setup;
392 const struct of_device_id *of_id;
393 const struct acpi_device_id *acpi_id;
394
395 indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*cm32181));
396 if (!indio_dev) {
397 dev_err(&client->dev, "devm_iio_device_alloc failed\n");
398 return -ENOMEM;
399 }
400
401 cm32181 = iio_priv(indio_dev);
402 i2c_set_clientdata(client, indio_dev);
403 cm32181->client = client;
404
405 mutex_init(&cm32181->lock);
406 indio_dev->dev.parent = &client->dev;
407 indio_dev->channels = cm32181_channels;
408 indio_dev->num_channels = ARRAY_SIZE(cm32181_channels);
409 indio_dev->info = &cm32181_info;
410 indio_dev->name = id->name;
411 indio_dev->modes = INDIO_DIRECT_MODE;
412
413 /* Lookup for chip ID from platform, acpi or of device table */
414 if (id) {
415 cm32181->chip_id = id->driver_data;
416 } else if (ACPI_COMPANION(&client->dev)) {
417 acpi_id = acpi_match_device(client->dev.driver->acpi_match_table,
418 &client->dev);
419 if (!acpi_id)
420 return -ENODEV;
421
422 cm32181->chip_id = (kernel_ulong_t)acpi_id->driver_data;
423 } else if (client->dev.of_node) {
> 424 of_id = of_match_device(clients->dev.driver->of_match_table,
425 &client->dev);
426 if (!of_id)
427 return -ENODEV;
428
429 cm32181->chip_id = (kernel_ulong_t)of_id->data;
430 } else {
431 return -ENODEV;
432 }
433
434 if (cm32181->chip_id == CM3218_ID) {
435 if (client->addr == CM3218_ARA_ADDR) {
436 /*
437 * In case first address is the ARA device
438 * lookup for a second one in acpi resources if
439 * this client is enumerated on acpi
440 */
441 ret = cm3218_acpi_get_address(client);
442 if (ret < 0)
443 return -ENODEV;
444 }
445

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip