Re: [PATCH v6 3/4] iio : Add cm3218 smbus ara and acpi support

From: kbuild test robot
Date: Tue Dec 26 2017 - 01:35:48 EST


Hi Marc,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on wsa/i2c/for-next]
[also build test ERROR on v4.15-rc5 next-20171222]
[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/i2c-core-acpi-Add-i2c_acpi_set_connection/20171226-083729
base: https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/for-next
config: i386-randconfig-c0-12261310 (attached as .config)
compiler: gcc-7 (Debian 7.2.0-12) 7.2.1 20171025
reproduce:
# save the attached .config to linux build tree
make ARCH=i386

All errors (new ones prefixed by >>):

drivers/iio/light/cm32181.o: In function `cm32181_irq':
>> drivers/iio/light/cm32181.c:336: undefined reference to `i2c_smbus_alert_event'
drivers/iio/light/cm32181.o: In function `cm32181_probe':
>> drivers/iio/light/cm32181.c:405: undefined reference to `i2c_require_smbus_alert'
drivers/iio/light/cm32181.o: In function `cm32181_reg_init':
drivers/iio/light/cm32181.c:95: undefined reference to `i2c_smbus_alert_event'

vim +336 drivers/iio/light/cm32181.c

329
330 static irqreturn_t cm32181_irq(int irq, void *d)
331 {
332 struct cm32181_chip *cm32181 = d;
333
334 if (cm32181->chip_id == CM3218_ID) {
335 /* This is cm3218 chip irq, so handle the smbus alert */
> 336 i2c_smbus_alert_event(cm32181->client);
337 }
338
339 return IRQ_HANDLED;
340 }
341
342 static int cm32181_probe(struct i2c_client *client,
343 const struct i2c_device_id *id)
344 {
345 struct cm32181_chip *cm32181;
346 struct iio_dev *indio_dev;
347 int ret;
348 const struct of_device_id *of_id;
349 const struct acpi_device_id *acpi_id;
350
351 indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*cm32181));
352 if (!indio_dev) {
353 dev_err(&client->dev, "devm_iio_device_alloc failed\n");
354 return -ENOMEM;
355 }
356
357 cm32181 = iio_priv(indio_dev);
358 i2c_set_clientdata(client, indio_dev);
359 cm32181->client = client;
360
361 mutex_init(&cm32181->lock);
362 indio_dev->dev.parent = &client->dev;
363 indio_dev->channels = cm32181_channels;
364 indio_dev->num_channels = ARRAY_SIZE(cm32181_channels);
365 indio_dev->info = &cm32181_info;
366 indio_dev->name = id->name;
367 indio_dev->modes = INDIO_DIRECT_MODE;
368
369 /* Lookup for chip ID from platform, acpi or of device table */
370 if (id) {
371 cm32181->chip_id = id->driver_data;
372 } else if (ACPI_COMPANION(&client->dev)) {
373 acpi_id = acpi_match_device(client->dev.driver->acpi_match_table,
374 &client->dev);
375 if (!acpi_id)
376 return -ENODEV;
377
378 cm32181->chip_id = (kernel_ulong_t)acpi_id->driver_data;
379 } else if (client->dev.of_node) {
380 of_id = of_match_device(client->dev.driver->of_match_table,
381 &client->dev);
382 if (!of_id)
383 return -ENODEV;
384
385 cm32181->chip_id = (kernel_ulong_t)of_id->data;
386 } else {
387 return -ENODEV;
388 }
389
390 if (cm32181->chip_id == CM3218_ID) {
391 if (ACPI_COMPANION(&client->dev) &&
392 client->addr == SMBUS_ARA_ADDR) {
393 /*
394 * In case this device as been enumerated by acpi
395 * with the reserved smbus ARA address (first acpi
396 * connection), request change of address to the second
397 * connection.
398 */
399 ret = i2c_acpi_set_connection(client, 1);
400 if (ret)
401 return ret;
402 }
403
404 /* cm3218 chip require an ara device on his adapter */
> 405 ret = i2c_require_smbus_alert(client);
406 if (ret < 0)
407 return ret;
408
409 /*
410 * If irq is given, request a threaded irq handler to manage
411 * smbus alert.
412 */
413 if (client->irq > 0) {
414 ret = devm_request_threaded_irq(&client->dev,
415 client->irq,
416 NULL, cm32181_irq,
417 IRQF_ONESHOT,
418 "cm32181", cm32181);
419 if (ret)
420 return ret;
421 }
422 }
423
424 ret = cm32181_reg_init(cm32181);
425 if (ret) {
426 dev_err(&client->dev,
427 "%s: register init failed\n",
428 __func__);
429 return ret;
430 }
431
432 ret = devm_iio_device_register(&client->dev, indio_dev);
433 if (ret) {
434 dev_err(&client->dev,
435 "%s: regist device failed\n",
436 __func__);
437 return ret;
438 }
439
440 return 0;
441 }
442

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

Attachment: .config.gz
Description: application/gzip