* [gpio:devel-gpio-driver-isolation 51/59] drivers/net//phy/spi_ks8995.c:467:2: note: in expansion of macro 'if'
@ 2019-08-30 17:47 kbuild test robot
0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2019-08-30 17:47 UTC (permalink / raw)
To: Linus Walleij; +Cc: kbuild-all, linux-gpio
[-- Attachment #1: Type: text/plain, Size: 9101 bytes --]
tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/linusw/linux-gpio.git devel-gpio-driver-isolation
head: 913bead035f39e059ce462d3bbd137d2a223bb0c
commit: 2e7bfc286b22879e076690e121e967a89cf48ae6 [51/59] gpio: Drop driver header from legacy header include
config: x86_64-randconfig-c001-201934 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-11) 7.4.0
reproduce:
git checkout 2e7bfc286b22879e076690e121e967a89cf48ae6
# save the attached .config to linux build tree
make ARCH=x86_64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
In file included from include/linux/export.h:45:0,
from include/linux/linkage.h:7,
from include/linux/kernel.h:8,
from drivers/net//phy/spi_ks8995.c:14:
drivers/net//phy/spi_ks8995.c: In function 'ks8995_probe':
drivers/net//phy/spi_ks8995.c:467:19: error: implicit declaration of function 'gpio_is_valid'; did you mean 'uuid_is_valid'? [-Werror=implicit-function-declaration]
if (ks->pdata && gpio_is_valid(ks->pdata->reset_gpio)) {
^
include/linux/compiler.h:58:52: note: in definition of macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^~~~
>> drivers/net//phy/spi_ks8995.c:467:2: note: in expansion of macro 'if'
if (ks->pdata && gpio_is_valid(ks->pdata->reset_gpio)) {
^~
drivers/net//phy/spi_ks8995.c:471:5: error: 'GPIOF_ACTIVE_LOW' undeclared (first use in this function); did you mean 'OF_GPIO_ACTIVE_LOW'?
GPIOF_ACTIVE_LOW : 0);
^~~~~~~~~~~~~~~~
OF_GPIO_ACTIVE_LOW
drivers/net//phy/spi_ks8995.c:471:5: note: each undeclared identifier is reported only once for each function it appears in
drivers/net//phy/spi_ks8995.c:473:9: error: implicit declaration of function 'devm_gpio_request_one'; did you mean 'devm_gpiod_get_optional'? [-Werror=implicit-function-declaration]
err = devm_gpio_request_one(&spi->dev,
^~~~~~~~~~~~~~~~~~~~~
devm_gpiod_get_optional
cc1: some warnings being treated as errors
vim +/if +467 drivers/net//phy/spi_ks8995.c
a8e510f682fe6d Frederic LAMBERT 2011-12-18 431
a8e510f682fe6d Frederic LAMBERT 2011-12-18 432 /* ------------------------------------------------------------------------ */
633d1594974b33 Bill Pemberton 2012-12-03 433 static int ks8995_probe(struct spi_device *spi)
a8e510f682fe6d Frederic LAMBERT 2011-12-18 434 {
a8e510f682fe6d Frederic LAMBERT 2011-12-18 435 struct ks8995_switch *ks;
a8e510f682fe6d Frederic LAMBERT 2011-12-18 436 int err;
aa54c8da9a8e48 Helmut Buchsbaum 2016-02-09 437 int variant = spi_get_device_id(spi)->driver_data;
a8e510f682fe6d Frederic LAMBERT 2011-12-18 438
aa54c8da9a8e48 Helmut Buchsbaum 2016-02-09 439 if (variant >= max_variant) {
aa54c8da9a8e48 Helmut Buchsbaum 2016-02-09 440 dev_err(&spi->dev, "bad chip variant %d\n", variant);
aa54c8da9a8e48 Helmut Buchsbaum 2016-02-09 441 return -ENODEV;
aa54c8da9a8e48 Helmut Buchsbaum 2016-02-09 442 }
aa54c8da9a8e48 Helmut Buchsbaum 2016-02-09 443
b32a8b6410b9e7 Himangi Saraogi 2014-08-03 444 ks = devm_kzalloc(&spi->dev, sizeof(*ks), GFP_KERNEL);
e68ed8f0d8f5b0 Joe Perches 2013-02-03 445 if (!ks)
a8e510f682fe6d Frederic LAMBERT 2011-12-18 446 return -ENOMEM;
a8e510f682fe6d Frederic LAMBERT 2011-12-18 447
a8e510f682fe6d Frederic LAMBERT 2011-12-18 448 mutex_init(&ks->lock);
a1459c1c9ebcd7 Mark Brown 2016-04-20 449 ks->spi = spi;
aa54c8da9a8e48 Helmut Buchsbaum 2016-02-09 450 ks->chip = &ks8995_chip[variant];
aa54c8da9a8e48 Helmut Buchsbaum 2016-02-09 451
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 452 if (ks->spi->dev.of_node) {
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 453 ks->pdata = devm_kzalloc(&spi->dev, sizeof(*ks->pdata),
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 454 GFP_KERNEL);
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 455 if (!ks->pdata)
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 456 return -ENOMEM;
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 457
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 458 ks->pdata->reset_gpio = -1;
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 459
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 460 ks8995_parse_dt(ks);
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 461 }
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 462
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 463 if (!ks->pdata)
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 464 ks->pdata = spi->dev.platform_data;
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 465
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 466 /* de-assert switch reset */
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 @467 if (ks->pdata && gpio_is_valid(ks->pdata->reset_gpio)) {
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 468 unsigned long flags;
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 469
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 470 flags = (ks->pdata->reset_gpio_flags == OF_GPIO_ACTIVE_LOW ?
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 471 GPIOF_ACTIVE_LOW : 0);
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 472
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 473 err = devm_gpio_request_one(&spi->dev,
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 474 ks->pdata->reset_gpio,
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 475 flags, "switch-reset");
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 476 if (err) {
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 477 dev_err(&spi->dev,
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 478 "failed to get reset-gpios: %d\n", err);
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 479 return -EIO;
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 480 }
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 481
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 482 gpiod_set_value(gpio_to_desc(ks->pdata->reset_gpio), 0);
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 483 }
cd6f288cbaab65 Helmut Buchsbaum 2016-02-09 484
5d5f18460f451d Jingoo Han 2013-04-05 485 spi_set_drvdata(spi, ks);
a8e510f682fe6d Frederic LAMBERT 2011-12-18 486
a8e510f682fe6d Frederic LAMBERT 2011-12-18 487 spi->mode = SPI_MODE_0;
a8e510f682fe6d Frederic LAMBERT 2011-12-18 488 spi->bits_per_word = 8;
a8e510f682fe6d Frederic LAMBERT 2011-12-18 489 err = spi_setup(spi);
a8e510f682fe6d Frederic LAMBERT 2011-12-18 490 if (err) {
a8e510f682fe6d Frederic LAMBERT 2011-12-18 491 dev_err(&spi->dev, "spi_setup failed, err=%d\n", err);
b32a8b6410b9e7 Himangi Saraogi 2014-08-03 492 return err;
a8e510f682fe6d Frederic LAMBERT 2011-12-18 493 }
a8e510f682fe6d Frederic LAMBERT 2011-12-18 494
484e36ff18341c Helmut Buchsbaum 2016-02-09 495 err = ks8995_get_revision(ks);
484e36ff18341c Helmut Buchsbaum 2016-02-09 496 if (err)
b32a8b6410b9e7 Himangi Saraogi 2014-08-03 497 return err;
a8e510f682fe6d Frederic LAMBERT 2011-12-18 498
240a12d58e3935 Philipp Zabel 2014-04-03 499 memcpy(&ks->regs_attr, &ks8995_registers_attr, sizeof(ks->regs_attr));
239870f2a0ebf7 Blomme, Maarten 2017-03-02 500 ks->regs_attr.size = ks->chip->regs_size;
240a12d58e3935 Philipp Zabel 2014-04-03 501
a8e510f682fe6d Frederic LAMBERT 2011-12-18 502 err = ks8995_reset(ks);
a8e510f682fe6d Frederic LAMBERT 2011-12-18 503 if (err)
b32a8b6410b9e7 Himangi Saraogi 2014-08-03 504 return err;
a8e510f682fe6d Frederic LAMBERT 2011-12-18 505
4342696df764ec Blomme, Maarten 2017-03-02 506 sysfs_attr_init(&ks->regs_attr.attr);
240a12d58e3935 Philipp Zabel 2014-04-03 507 err = sysfs_create_bin_file(&spi->dev.kobj, &ks->regs_attr);
a8e510f682fe6d Frederic LAMBERT 2011-12-18 508 if (err) {
a8e510f682fe6d Frederic LAMBERT 2011-12-18 509 dev_err(&spi->dev, "unable to create sysfs file, err=%d\n",
a8e510f682fe6d Frederic LAMBERT 2011-12-18 510 err);
b32a8b6410b9e7 Himangi Saraogi 2014-08-03 511 return err;
a8e510f682fe6d Frederic LAMBERT 2011-12-18 512 }
a8e510f682fe6d Frederic LAMBERT 2011-12-18 513
484e36ff18341c Helmut Buchsbaum 2016-02-09 514 dev_info(&spi->dev, "%s device found, Chip ID:%x, Revision:%x\n",
484e36ff18341c Helmut Buchsbaum 2016-02-09 515 ks->chip->name, ks->chip->chip_id, ks->revision_id);
a8e510f682fe6d Frederic LAMBERT 2011-12-18 516
a8e510f682fe6d Frederic LAMBERT 2011-12-18 517 return 0;
a8e510f682fe6d Frederic LAMBERT 2011-12-18 518 }
a8e510f682fe6d Frederic LAMBERT 2011-12-18 519
:::::: The code at line 467 was first introduced by commit
:::::: cd6f288cbaab656cebd524c5ef2388c11378c827 net: phy: spi_ks8995: add support for resetting switch using GPIO
:::::: TO: Helmut Buchsbaum <helmut.buchsbaum@gmail.com>
:::::: CC: David S. Miller <davem@davemloft.net>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34097 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-08-30 17:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-30 17:47 [gpio:devel-gpio-driver-isolation 51/59] drivers/net//phy/spi_ks8995.c:467:2: note: in expansion of macro 'if' kbuild test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox