Message ID | 20220330145030.1562-6-andriy.shevchenko@linux.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | gpiolib: Two new helpers and way toward fwnode | expand |
Hi Andy,
I love your patch! Yet something to improve:
[auto build test ERROR on a67ba3cf9551f8c92d5ec9d7eae1aadbb9127b57]
url: https://github.com/intel-lab-lkp/linux/commits/Andy-Shevchenko/gpiolib-Two-new-helpers-and-way-toward-fwnode/20220330-225341
base: a67ba3cf9551f8c92d5ec9d7eae1aadbb9127b57
config: riscv-buildonly-randconfig-r006-20220330 (https://download.01.org/0day-ci/archive/20220331/202203310151.Iu2JvLIF-lkp@intel.com/config)
compiler: riscv32-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/3539d23dd289ca77a85d66fe8721e4febfc50ea4
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Andy-Shevchenko/gpiolib-Two-new-helpers-and-way-toward-fwnode/20220330-225341
git checkout 3539d23dd289ca77a85d66fe8721e4febfc50ea4
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=riscv SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
drivers/pinctrl/samsung/pinctrl-s3c64xx.c: In function 's3c64xx_eint_gpio_init':
>> drivers/pinctrl/samsung/pinctrl-s3c64xx.c:474:64: error: 'struct samsung_pin_bank' has no member named 'of_node'; did you mean 'fwnode'?
474 | bank->irq_domain = irq_domain_add_linear(bank->of_node,
| ^~~~~~~
| fwnode
drivers/pinctrl/samsung/pinctrl-s3c64xx.c: In function 's3c64xx_eint_eint0_init':
drivers/pinctrl/samsung/pinctrl-s3c64xx.c:746:64: error: 'struct samsung_pin_bank' has no member named 'of_node'; did you mean 'fwnode'?
746 | bank->irq_domain = irq_domain_add_linear(bank->of_node,
| ^~~~~~~
| fwnode
vim +474 drivers/pinctrl/samsung/pinctrl-s3c64xx.c
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 444
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 445 /**
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 446 * s3c64xx_eint_gpio_init() - setup handling of external gpio interrupts.
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 447 * @d: driver data of samsung pinctrl driver.
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 448 */
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 449 static int s3c64xx_eint_gpio_init(struct samsung_pinctrl_drv_data *d)
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 450 {
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 451 struct s3c64xx_eint_gpio_data *data;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 452 struct samsung_pin_bank *bank;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 453 struct device *dev = d->dev;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 454 unsigned int nr_domains;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 455 unsigned int i;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 456
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 457 if (!d->irq) {
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 458 dev_err(dev, "irq number not available\n");
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 459 return -EINVAL;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 460 }
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 461
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 462 nr_domains = 0;
1bf00d7a6dbff0 drivers/pinctrl/samsung/pinctrl-s3c64xx.c Tomasz Figa 2014-09-23 463 bank = d->pin_banks;
1bf00d7a6dbff0 drivers/pinctrl/samsung/pinctrl-s3c64xx.c Tomasz Figa 2014-09-23 464 for (i = 0; i < d->nr_banks; ++i, ++bank) {
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 465 unsigned int nr_eints;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 466 unsigned int mask;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 467
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 468 if (bank->eint_type != EINT_TYPE_GPIO)
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 469 continue;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 470
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 471 mask = bank->eint_mask;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 472 nr_eints = fls(mask);
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 473
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 @474 bank->irq_domain = irq_domain_add_linear(bank->of_node,
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 475 nr_eints, &s3c64xx_gpio_irqd_ops, bank);
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 476 if (!bank->irq_domain) {
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 477 dev_err(dev, "gpio irq domain add failed\n");
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 478 return -ENXIO;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 479 }
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 480
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 481 ++nr_domains;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 482 }
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 483
0ed2dd03b94b7b drivers/pinctrl/samsung/pinctrl-s3c64xx.c Kees Cook 2018-05-08 484 data = devm_kzalloc(dev, struct_size(data, domains, nr_domains),
0ed2dd03b94b7b drivers/pinctrl/samsung/pinctrl-s3c64xx.c Kees Cook 2018-05-08 485 GFP_KERNEL);
fa5c0f46e2b9a1 drivers/pinctrl/samsung/pinctrl-s3c64xx.c Marek Szyprowski 2017-01-19 486 if (!data)
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 487 return -ENOMEM;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 488 data->drvdata = d;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 489
1bf00d7a6dbff0 drivers/pinctrl/samsung/pinctrl-s3c64xx.c Tomasz Figa 2014-09-23 490 bank = d->pin_banks;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 491 nr_domains = 0;
1bf00d7a6dbff0 drivers/pinctrl/samsung/pinctrl-s3c64xx.c Tomasz Figa 2014-09-23 492 for (i = 0; i < d->nr_banks; ++i, ++bank) {
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 493 if (bank->eint_type != EINT_TYPE_GPIO)
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 494 continue;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 495
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 496 data->domains[nr_domains++] = bank->irq_domain;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 497 }
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 498
623a650ebc886f drivers/pinctrl/samsung/pinctrl-s3c64xx.c Thomas Gleixner 2015-06-21 499 irq_set_chained_handler_and_data(d->irq, s3c64xx_eint_gpio_irq, data);
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 500
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 501 return 0;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 502 }
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 503
Hi Andy,
I love your patch! Yet something to improve:
[auto build test ERROR on a67ba3cf9551f8c92d5ec9d7eae1aadbb9127b57]
url: https://github.com/intel-lab-lkp/linux/commits/Andy-Shevchenko/gpiolib-Two-new-helpers-and-way-toward-fwnode/20220330-225341
base: a67ba3cf9551f8c92d5ec9d7eae1aadbb9127b57
config: riscv-randconfig-r032-20220330 (https://download.01.org/0day-ci/archive/20220331/202203310240.Za1Wqczl-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0f6d9501cf49ce02937099350d08f20c4af86f3d)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/intel-lab-lkp/linux/commit/3539d23dd289ca77a85d66fe8721e4febfc50ea4
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Andy-Shevchenko/gpiolib-Two-new-helpers-and-way-toward-fwnode/20220330-225341
git checkout 3539d23dd289ca77a85d66fe8721e4febfc50ea4
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/pinctrl/samsung/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
>> drivers/pinctrl/samsung/pinctrl-s3c24xx.c:528:50: error: no member named 'of_node' in 'struct samsung_pin_bank'; did you mean 'fwnode'?
bank->irq_domain = irq_domain_add_linear(bank->of_node,
^~~~~~~
fwnode
drivers/pinctrl/samsung/pinctrl-samsung.h:168:24: note: 'fwnode' declared here
struct fwnode_handle *fwnode;
^
1 error generated.
vim +528 drivers/pinctrl/samsung/pinctrl-s3c24xx.c
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 457
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 458 static int s3c24xx_eint_init(struct samsung_pinctrl_drv_data *d)
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 459 {
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 460 struct device *dev = d->dev;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 461 const struct of_device_id *match;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 462 struct device_node *eint_np = NULL;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 463 struct device_node *np;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 464 struct samsung_pin_bank *bank;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 465 struct s3c24xx_eint_data *eint_data;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 466 const struct irq_domain_ops *ops;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 467 unsigned int i;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 468 bool eint0_3_parent_only;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 469 irq_flow_handler_t *handlers;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 470
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 471 for_each_child_of_node(dev->of_node, np) {
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 472 match = of_match_node(s3c24xx_eint_irq_ids, np);
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 473 if (match) {
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 474 eint_np = np;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 475 eint0_3_parent_only = (bool)match->data;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 476 break;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 477 }
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 478 }
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 479 if (!eint_np)
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 480 return -ENODEV;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 481
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 482 eint_data = devm_kzalloc(dev, sizeof(*eint_data), GFP_KERNEL);
6fbbcb050802d6 drivers/pinctrl/samsung/pinctrl-s3c24xx.c Krzysztof Kozlowski 2019-08-05 483 if (!eint_data) {
6fbbcb050802d6 drivers/pinctrl/samsung/pinctrl-s3c24xx.c Krzysztof Kozlowski 2019-08-05 484 of_node_put(eint_np);
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 485 return -ENOMEM;
6fbbcb050802d6 drivers/pinctrl/samsung/pinctrl-s3c24xx.c Krzysztof Kozlowski 2019-08-05 486 }
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 487
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 488 eint_data->drvdata = d;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 489
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 490 handlers = eint0_3_parent_only ? s3c2410_eint_handlers
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 491 : s3c2412_eint_handlers;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 492 for (i = 0; i < NUM_EINT_IRQ; ++i) {
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 493 unsigned int irq;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 494
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 495 irq = irq_of_parse_and_map(eint_np, i);
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 496 if (!irq) {
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 497 dev_err(dev, "failed to get wakeup EINT IRQ %d\n", i);
6fbbcb050802d6 drivers/pinctrl/samsung/pinctrl-s3c24xx.c Krzysztof Kozlowski 2019-08-05 498 of_node_put(eint_np);
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 499 return -ENXIO;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 500 }
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 501
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 502 eint_data->parents[i] = irq;
0cfc45cfdf5065 drivers/pinctrl/samsung/pinctrl-s3c24xx.c Thomas Gleixner 2015-06-21 503 irq_set_chained_handler_and_data(irq, handlers[i], eint_data);
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 504 }
6fbbcb050802d6 drivers/pinctrl/samsung/pinctrl-s3c24xx.c Krzysztof Kozlowski 2019-08-05 505 of_node_put(eint_np);
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 506
1bf00d7a6dbff0 drivers/pinctrl/samsung/pinctrl-s3c24xx.c Tomasz Figa 2014-09-23 507 bank = d->pin_banks;
1bf00d7a6dbff0 drivers/pinctrl/samsung/pinctrl-s3c24xx.c Tomasz Figa 2014-09-23 508 for (i = 0; i < d->nr_banks; ++i, ++bank) {
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 509 struct s3c24xx_eint_domain_data *ddata;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 510 unsigned int mask;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 511 unsigned int irq;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 512 unsigned int pin;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 513
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 514 if (bank->eint_type != EINT_TYPE_WKUP)
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 515 continue;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 516
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 517 ddata = devm_kzalloc(dev, sizeof(*ddata), GFP_KERNEL);
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 518 if (!ddata)
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 519 return -ENOMEM;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 520
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 521 ddata->bank = bank;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 522 ddata->eint_data = eint_data;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 523 ddata->eint0_3_parent_only = eint0_3_parent_only;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 524
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 525 ops = (bank->eint_offset == 0) ? &s3c24xx_gpf_irq_ops
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 526 : &s3c24xx_gpg_irq_ops;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 527
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 @528 bank->irq_domain = irq_domain_add_linear(bank->of_node,
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 529 bank->nr_pins, ops, ddata);
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 530 if (!bank->irq_domain) {
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 531 dev_err(dev, "wkup irq domain add failed\n");
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 532 return -ENXIO;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 533 }
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 534
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 535 irq = bank->eint_offset;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 536 mask = bank->eint_mask;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 537 for (pin = 0; mask; ++pin, mask >>= 1) {
774e2d981f517e drivers/pinctrl/pinctrl-s3c24xx.c Dan Carpenter 2013-08-27 538 if (irq >= NUM_EINT)
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 539 break;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 540 if (!(mask & 1))
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 541 continue;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 542 eint_data->domains[irq] = bank->irq_domain;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 543 ++irq;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 544 }
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 545 }
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 546
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 547 return 0;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 548 }
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 549
Hi Andy,
I love your patch! Yet something to improve:
[auto build test ERROR on a67ba3cf9551f8c92d5ec9d7eae1aadbb9127b57]
url: https://github.com/intel-lab-lkp/linux/commits/Andy-Shevchenko/gpiolib-Two-new-helpers-and-way-toward-fwnode/20220330-225341
base: a67ba3cf9551f8c92d5ec9d7eae1aadbb9127b57
config: alpha-randconfig-r013-20220330 (https://download.01.org/0day-ci/archive/20220331/202203310305.QZp98VzT-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/3539d23dd289ca77a85d66fe8721e4febfc50ea4
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Andy-Shevchenko/gpiolib-Two-new-helpers-and-way-toward-fwnode/20220330-225341
git checkout 3539d23dd289ca77a85d66fe8721e4febfc50ea4
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=alpha SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
drivers/pinctrl/samsung/pinctrl-s3c24xx.c: In function 's3c24xx_eint_init':
>> drivers/pinctrl/samsung/pinctrl-s3c24xx.c:528:64: error: 'struct samsung_pin_bank' has no member named 'of_node'; did you mean 'fwnode'?
528 | bank->irq_domain = irq_domain_add_linear(bank->of_node,
| ^~~~~~~
| fwnode
vim +528 drivers/pinctrl/samsung/pinctrl-s3c24xx.c
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 457
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 458 static int s3c24xx_eint_init(struct samsung_pinctrl_drv_data *d)
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 459 {
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 460 struct device *dev = d->dev;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 461 const struct of_device_id *match;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 462 struct device_node *eint_np = NULL;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 463 struct device_node *np;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 464 struct samsung_pin_bank *bank;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 465 struct s3c24xx_eint_data *eint_data;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 466 const struct irq_domain_ops *ops;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 467 unsigned int i;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 468 bool eint0_3_parent_only;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 469 irq_flow_handler_t *handlers;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 470
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 471 for_each_child_of_node(dev->of_node, np) {
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 472 match = of_match_node(s3c24xx_eint_irq_ids, np);
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 473 if (match) {
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 474 eint_np = np;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 475 eint0_3_parent_only = (bool)match->data;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 476 break;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 477 }
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 478 }
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 479 if (!eint_np)
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 480 return -ENODEV;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 481
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 482 eint_data = devm_kzalloc(dev, sizeof(*eint_data), GFP_KERNEL);
6fbbcb050802d6 drivers/pinctrl/samsung/pinctrl-s3c24xx.c Krzysztof Kozlowski 2019-08-05 483 if (!eint_data) {
6fbbcb050802d6 drivers/pinctrl/samsung/pinctrl-s3c24xx.c Krzysztof Kozlowski 2019-08-05 484 of_node_put(eint_np);
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 485 return -ENOMEM;
6fbbcb050802d6 drivers/pinctrl/samsung/pinctrl-s3c24xx.c Krzysztof Kozlowski 2019-08-05 486 }
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 487
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 488 eint_data->drvdata = d;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 489
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 490 handlers = eint0_3_parent_only ? s3c2410_eint_handlers
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 491 : s3c2412_eint_handlers;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 492 for (i = 0; i < NUM_EINT_IRQ; ++i) {
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 493 unsigned int irq;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 494
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 495 irq = irq_of_parse_and_map(eint_np, i);
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 496 if (!irq) {
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 497 dev_err(dev, "failed to get wakeup EINT IRQ %d\n", i);
6fbbcb050802d6 drivers/pinctrl/samsung/pinctrl-s3c24xx.c Krzysztof Kozlowski 2019-08-05 498 of_node_put(eint_np);
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 499 return -ENXIO;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 500 }
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 501
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 502 eint_data->parents[i] = irq;
0cfc45cfdf5065 drivers/pinctrl/samsung/pinctrl-s3c24xx.c Thomas Gleixner 2015-06-21 503 irq_set_chained_handler_and_data(irq, handlers[i], eint_data);
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 504 }
6fbbcb050802d6 drivers/pinctrl/samsung/pinctrl-s3c24xx.c Krzysztof Kozlowski 2019-08-05 505 of_node_put(eint_np);
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 506
1bf00d7a6dbff0 drivers/pinctrl/samsung/pinctrl-s3c24xx.c Tomasz Figa 2014-09-23 507 bank = d->pin_banks;
1bf00d7a6dbff0 drivers/pinctrl/samsung/pinctrl-s3c24xx.c Tomasz Figa 2014-09-23 508 for (i = 0; i < d->nr_banks; ++i, ++bank) {
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 509 struct s3c24xx_eint_domain_data *ddata;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 510 unsigned int mask;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 511 unsigned int irq;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 512 unsigned int pin;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 513
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 514 if (bank->eint_type != EINT_TYPE_WKUP)
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 515 continue;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 516
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 517 ddata = devm_kzalloc(dev, sizeof(*ddata), GFP_KERNEL);
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 518 if (!ddata)
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 519 return -ENOMEM;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 520
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 521 ddata->bank = bank;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 522 ddata->eint_data = eint_data;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 523 ddata->eint0_3_parent_only = eint0_3_parent_only;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 524
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 525 ops = (bank->eint_offset == 0) ? &s3c24xx_gpf_irq_ops
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 526 : &s3c24xx_gpg_irq_ops;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 527
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 @528 bank->irq_domain = irq_domain_add_linear(bank->of_node,
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 529 bank->nr_pins, ops, ddata);
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 530 if (!bank->irq_domain) {
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 531 dev_err(dev, "wkup irq domain add failed\n");
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 532 return -ENXIO;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 533 }
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 534
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 535 irq = bank->eint_offset;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 536 mask = bank->eint_mask;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 537 for (pin = 0; mask; ++pin, mask >>= 1) {
774e2d981f517e drivers/pinctrl/pinctrl-s3c24xx.c Dan Carpenter 2013-08-27 538 if (irq >= NUM_EINT)
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 539 break;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 540 if (!(mask & 1))
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 541 continue;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 542 eint_data->domains[irq] = bank->irq_domain;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 543 ++irq;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 544 }
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 545 }
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 546
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 547 return 0;
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 548 }
af99a7507469d4 drivers/pinctrl/pinctrl-s3c24xx.c Heiko Stuebner 2013-05-21 549
Hi Andy,
I love your patch! Yet something to improve:
[auto build test ERROR on a67ba3cf9551f8c92d5ec9d7eae1aadbb9127b57]
url: https://github.com/intel-lab-lkp/linux/commits/Andy-Shevchenko/gpiolib-Two-new-helpers-and-way-toward-fwnode/20220330-225341
base: a67ba3cf9551f8c92d5ec9d7eae1aadbb9127b57
config: riscv-randconfig-c006-20220331 (https://download.01.org/0day-ci/archive/20220401/202204010248.AB6ZnOyw-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 881350a92d821d4f8e4fa648443ed1d17e251188)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/intel-lab-lkp/linux/commit/3539d23dd289ca77a85d66fe8721e4febfc50ea4
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Andy-Shevchenko/gpiolib-Two-new-helpers-and-way-toward-fwnode/20220330-225341
git checkout 3539d23dd289ca77a85d66fe8721e4febfc50ea4
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/pinctrl/samsung/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
In file included from drivers/pinctrl/samsung/pinctrl-s3c64xx.c:15:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:464:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __raw_readb(PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:477:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
^
In file included from drivers/pinctrl/samsung/pinctrl-s3c64xx.c:15:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
^
In file included from drivers/pinctrl/samsung/pinctrl-s3c64xx.c:15:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:1024:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
~~~~~~~~~~ ^
>> drivers/pinctrl/samsung/pinctrl-s3c64xx.c:474:50: error: no member named 'of_node' in 'struct samsung_pin_bank'; did you mean 'fwnode'?
bank->irq_domain = irq_domain_add_linear(bank->of_node,
^~~~~~~
fwnode
drivers/pinctrl/samsung/pinctrl-samsung.h:168:24: note: 'fwnode' declared here
struct fwnode_handle *fwnode;
^
drivers/pinctrl/samsung/pinctrl-s3c64xx.c:746:50: error: no member named 'of_node' in 'struct samsung_pin_bank'; did you mean 'fwnode'?
bank->irq_domain = irq_domain_add_linear(bank->of_node,
^~~~~~~
fwnode
drivers/pinctrl/samsung/pinctrl-samsung.h:168:24: note: 'fwnode' declared here
struct fwnode_handle *fwnode;
^
7 warnings and 2 errors generated.
vim +474 drivers/pinctrl/samsung/pinctrl-s3c64xx.c
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 444
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 445 /**
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 446 * s3c64xx_eint_gpio_init() - setup handling of external gpio interrupts.
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 447 * @d: driver data of samsung pinctrl driver.
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 448 */
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 449 static int s3c64xx_eint_gpio_init(struct samsung_pinctrl_drv_data *d)
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 450 {
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 451 struct s3c64xx_eint_gpio_data *data;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 452 struct samsung_pin_bank *bank;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 453 struct device *dev = d->dev;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 454 unsigned int nr_domains;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 455 unsigned int i;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 456
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 457 if (!d->irq) {
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 458 dev_err(dev, "irq number not available\n");
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 459 return -EINVAL;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 460 }
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 461
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 462 nr_domains = 0;
1bf00d7a6dbff0 drivers/pinctrl/samsung/pinctrl-s3c64xx.c Tomasz Figa 2014-09-23 463 bank = d->pin_banks;
1bf00d7a6dbff0 drivers/pinctrl/samsung/pinctrl-s3c64xx.c Tomasz Figa 2014-09-23 464 for (i = 0; i < d->nr_banks; ++i, ++bank) {
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 465 unsigned int nr_eints;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 466 unsigned int mask;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 467
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 468 if (bank->eint_type != EINT_TYPE_GPIO)
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 469 continue;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 470
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 471 mask = bank->eint_mask;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 472 nr_eints = fls(mask);
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 473
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 @474 bank->irq_domain = irq_domain_add_linear(bank->of_node,
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 475 nr_eints, &s3c64xx_gpio_irqd_ops, bank);
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 476 if (!bank->irq_domain) {
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 477 dev_err(dev, "gpio irq domain add failed\n");
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 478 return -ENXIO;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 479 }
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 480
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 481 ++nr_domains;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 482 }
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 483
0ed2dd03b94b7b drivers/pinctrl/samsung/pinctrl-s3c64xx.c Kees Cook 2018-05-08 484 data = devm_kzalloc(dev, struct_size(data, domains, nr_domains),
0ed2dd03b94b7b drivers/pinctrl/samsung/pinctrl-s3c64xx.c Kees Cook 2018-05-08 485 GFP_KERNEL);
fa5c0f46e2b9a1 drivers/pinctrl/samsung/pinctrl-s3c64xx.c Marek Szyprowski 2017-01-19 486 if (!data)
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 487 return -ENOMEM;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 488 data->drvdata = d;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 489
1bf00d7a6dbff0 drivers/pinctrl/samsung/pinctrl-s3c64xx.c Tomasz Figa 2014-09-23 490 bank = d->pin_banks;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 491 nr_domains = 0;
1bf00d7a6dbff0 drivers/pinctrl/samsung/pinctrl-s3c64xx.c Tomasz Figa 2014-09-23 492 for (i = 0; i < d->nr_banks; ++i, ++bank) {
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 493 if (bank->eint_type != EINT_TYPE_GPIO)
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 494 continue;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 495
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 496 data->domains[nr_domains++] = bank->irq_domain;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 497 }
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 498
623a650ebc886f drivers/pinctrl/samsung/pinctrl-s3c64xx.c Thomas Gleixner 2015-06-21 499 irq_set_chained_handler_and_data(d->irq, s3c64xx_eint_gpio_irq, data);
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 500
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 501 return 0;
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 502 }
61dd7261317770 drivers/pinctrl/pinctrl-s3c64xx.c Tomasz Figa 2013-03-18 503
Hi Andy,
I love your patch! Yet something to improve:
[auto build test ERROR on a67ba3cf9551f8c92d5ec9d7eae1aadbb9127b57]
url: https://github.com/intel-lab-lkp/linux/commits/Andy-Shevchenko/gpiolib-Two-new-helpers-and-way-toward-fwnode/20220330-225341
base: a67ba3cf9551f8c92d5ec9d7eae1aadbb9127b57
config: arm-randconfig-c002-20220331 (https://download.01.org/0day-ci/archive/20220401/202204010610.Wk5CAkQ7-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 881350a92d821d4f8e4fa648443ed1d17e251188)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/intel-lab-lkp/linux/commit/3539d23dd289ca77a85d66fe8721e4febfc50ea4
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Andy-Shevchenko/gpiolib-Two-new-helpers-and-way-toward-fwnode/20220330-225341
git checkout 3539d23dd289ca77a85d66fe8721e4febfc50ea4
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
>> drivers/pinctrl/samsung/pinctrl-exynos.c:310:50: error: no member named 'of_node' in 'struct samsung_pin_bank'; did you mean 'fwnode'?
bank->irq_domain = irq_domain_add_linear(bank->of_node,
^~~~~~~
fwnode
drivers/pinctrl/samsung/pinctrl-samsung.h:168:24: note: 'fwnode' declared here
struct fwnode_handle *fwnode;
^
drivers/pinctrl/samsung/pinctrl-exynos.c:568:50: error: no member named 'of_node' in 'struct samsung_pin_bank'; did you mean 'fwnode'?
bank->irq_domain = irq_domain_add_linear(bank->of_node,
^~~~~~~
fwnode
drivers/pinctrl/samsung/pinctrl-samsung.h:168:24: note: 'fwnode' declared here
struct fwnode_handle *fwnode;
^
drivers/pinctrl/samsung/pinctrl-exynos.c:576:31: error: no member named 'of_node' in 'struct samsung_pin_bank'; did you mean 'fwnode'?
if (!of_find_property(bank->of_node, "interrupts", NULL)) {
^~~~~~~
fwnode
drivers/pinctrl/samsung/pinctrl-samsung.h:168:24: note: 'fwnode' declared here
struct fwnode_handle *fwnode;
^
drivers/pinctrl/samsung/pinctrl-exynos.c:591:37: error: no member named 'of_node' in 'struct samsung_pin_bank'; did you mean 'fwnode'?
irq = irq_of_parse_and_map(bank->of_node, idx);
^~~~~~~
fwnode
drivers/pinctrl/samsung/pinctrl-samsung.h:168:24: note: 'fwnode' declared here
struct fwnode_handle *fwnode;
^
4 errors generated.
vim +310 drivers/pinctrl/samsung/pinctrl-exynos.c
7ccbc60cd9c293 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2013-05-22 273
43b169db184184 drivers/pinctrl/pinctrl-exynos.c Thomas Abraham 2012-09-07 274 /*
43b169db184184 drivers/pinctrl/pinctrl-exynos.c Thomas Abraham 2012-09-07 275 * exynos_eint_gpio_init() - setup handling of external gpio interrupts.
43b169db184184 drivers/pinctrl/pinctrl-exynos.c Thomas Abraham 2012-09-07 276 * @d: driver data of samsung pinctrl driver.
43b169db184184 drivers/pinctrl/pinctrl-exynos.c Thomas Abraham 2012-09-07 277 */
85745c870a757c drivers/pinctrl/samsung/pinctrl-exynos.c Marek Szyprowski 2020-07-20 278 __init int exynos_eint_gpio_init(struct samsung_pinctrl_drv_data *d)
43b169db184184 drivers/pinctrl/pinctrl-exynos.c Thomas Abraham 2012-09-07 279 {
595be7268a8573 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2012-10-11 280 struct samsung_pin_bank *bank;
43b169db184184 drivers/pinctrl/pinctrl-exynos.c Thomas Abraham 2012-09-07 281 struct device *dev = d->dev;
7ccbc60cd9c293 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2013-05-22 282 int ret;
7ccbc60cd9c293 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2013-05-22 283 int i;
43b169db184184 drivers/pinctrl/pinctrl-exynos.c Thomas Abraham 2012-09-07 284
43b169db184184 drivers/pinctrl/pinctrl-exynos.c Thomas Abraham 2012-09-07 285 if (!d->irq) {
43b169db184184 drivers/pinctrl/pinctrl-exynos.c Thomas Abraham 2012-09-07 286 dev_err(dev, "irq number not available\n");
43b169db184184 drivers/pinctrl/pinctrl-exynos.c Thomas Abraham 2012-09-07 287 return -EINVAL;
43b169db184184 drivers/pinctrl/pinctrl-exynos.c Thomas Abraham 2012-09-07 288 }
43b169db184184 drivers/pinctrl/pinctrl-exynos.c Thomas Abraham 2012-09-07 289
43b169db184184 drivers/pinctrl/pinctrl-exynos.c Thomas Abraham 2012-09-07 290 ret = devm_request_irq(dev, d->irq, exynos_eint_gpio_irq,
43b169db184184 drivers/pinctrl/pinctrl-exynos.c Thomas Abraham 2012-09-07 291 0, dev_name(dev), d);
43b169db184184 drivers/pinctrl/pinctrl-exynos.c Thomas Abraham 2012-09-07 292 if (ret) {
43b169db184184 drivers/pinctrl/pinctrl-exynos.c Thomas Abraham 2012-09-07 293 dev_err(dev, "irq request failed\n");
43b169db184184 drivers/pinctrl/pinctrl-exynos.c Thomas Abraham 2012-09-07 294 return -ENXIO;
43b169db184184 drivers/pinctrl/pinctrl-exynos.c Thomas Abraham 2012-09-07 295 }
43b169db184184 drivers/pinctrl/pinctrl-exynos.c Thomas Abraham 2012-09-07 296
1bf00d7a6dbff0 drivers/pinctrl/samsung/pinctrl-exynos.c Tomasz Figa 2014-09-23 297 bank = d->pin_banks;
1bf00d7a6dbff0 drivers/pinctrl/samsung/pinctrl-exynos.c Tomasz Figa 2014-09-23 298 for (i = 0; i < d->nr_banks; ++i, ++bank) {
595be7268a8573 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2012-10-11 299 if (bank->eint_type != EINT_TYPE_GPIO)
595be7268a8573 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2012-10-11 300 continue;
85745c870a757c drivers/pinctrl/samsung/pinctrl-exynos.c Marek Szyprowski 2020-07-20 301
85745c870a757c drivers/pinctrl/samsung/pinctrl-exynos.c Marek Szyprowski 2020-07-20 302 bank->irq_chip = devm_kmemdup(dev, &exynos_gpio_irq_chip,
85745c870a757c drivers/pinctrl/samsung/pinctrl-exynos.c Marek Szyprowski 2020-07-20 303 sizeof(*bank->irq_chip), GFP_KERNEL);
85745c870a757c drivers/pinctrl/samsung/pinctrl-exynos.c Marek Szyprowski 2020-07-20 304 if (!bank->irq_chip) {
85745c870a757c drivers/pinctrl/samsung/pinctrl-exynos.c Marek Szyprowski 2020-07-20 305 ret = -ENOMEM;
85745c870a757c drivers/pinctrl/samsung/pinctrl-exynos.c Marek Szyprowski 2020-07-20 306 goto err_domains;
85745c870a757c drivers/pinctrl/samsung/pinctrl-exynos.c Marek Szyprowski 2020-07-20 307 }
85745c870a757c drivers/pinctrl/samsung/pinctrl-exynos.c Marek Szyprowski 2020-07-20 308 bank->irq_chip->chip.name = bank->name;
85745c870a757c drivers/pinctrl/samsung/pinctrl-exynos.c Marek Szyprowski 2020-07-20 309
595be7268a8573 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2012-10-11 @310 bank->irq_domain = irq_domain_add_linear(bank->of_node,
6f5e41bd8fc6d3 drivers/pinctrl/samsung/pinctrl-exynos.c Abhilash Kesavan 2014-10-09 311 bank->nr_pins, &exynos_eint_irqd_ops, bank);
595be7268a8573 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2012-10-11 312 if (!bank->irq_domain) {
595be7268a8573 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2012-10-11 313 dev_err(dev, "gpio irq domain add failed\n");
7ccbc60cd9c293 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2013-05-22 314 ret = -ENXIO;
7ccbc60cd9c293 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2013-05-22 315 goto err_domains;
7ccbc60cd9c293 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2013-05-22 316 }
7ccbc60cd9c293 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2013-05-22 317
7ccbc60cd9c293 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2013-05-22 318 bank->soc_priv = devm_kzalloc(d->dev,
7ccbc60cd9c293 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2013-05-22 319 sizeof(struct exynos_eint_gpio_save), GFP_KERNEL);
7ccbc60cd9c293 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2013-05-22 320 if (!bank->soc_priv) {
7ccbc60cd9c293 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2013-05-22 321 irq_domain_remove(bank->irq_domain);
7ccbc60cd9c293 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2013-05-22 322 ret = -ENOMEM;
7ccbc60cd9c293 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2013-05-22 323 goto err_domains;
43b169db184184 drivers/pinctrl/pinctrl-exynos.c Thomas Abraham 2012-09-07 324 }
0d3d30db936359 drivers/pinctrl/samsung/pinctrl-exynos.c Abhilash Kesavan 2014-10-09 325
595be7268a8573 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2012-10-11 326 }
43b169db184184 drivers/pinctrl/pinctrl-exynos.c Thomas Abraham 2012-09-07 327
43b169db184184 drivers/pinctrl/pinctrl-exynos.c Thomas Abraham 2012-09-07 328 return 0;
7ccbc60cd9c293 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2013-05-22 329
7ccbc60cd9c293 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2013-05-22 330 err_domains:
7ccbc60cd9c293 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2013-05-22 331 for (--i, --bank; i >= 0; --i, --bank) {
7ccbc60cd9c293 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2013-05-22 332 if (bank->eint_type != EINT_TYPE_GPIO)
7ccbc60cd9c293 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2013-05-22 333 continue;
7ccbc60cd9c293 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2013-05-22 334 irq_domain_remove(bank->irq_domain);
7ccbc60cd9c293 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2013-05-22 335 }
7ccbc60cd9c293 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2013-05-22 336
7ccbc60cd9c293 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2013-05-22 337 return ret;
43b169db184184 drivers/pinctrl/pinctrl-exynos.c Thomas Abraham 2012-09-07 338 }
43b169db184184 drivers/pinctrl/pinctrl-exynos.c Thomas Abraham 2012-09-07 339
diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index f610beab23a0..26d309d2516d 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -18,6 +18,7 @@ #include <linux/init.h> #include <linux/platform_device.h> #include <linux/io.h> +#include <linux/property.h> #include <linux/slab.h> #include <linux/err.h> #include <linux/gpio/driver.h> @@ -966,7 +967,7 @@ static int samsung_gpiolib_register(struct platform_device *pdev, gc->base = bank->grange.base; gc->ngpio = bank->nr_pins; gc->parent = &pdev->dev; - gc->of_node = bank->of_node; + gc->fwnode = bank->fwnode; gc->label = bank->name; ret = devm_gpiochip_add_data(&pdev->dev, gc, bank); @@ -1002,27 +1003,25 @@ samsung_pinctrl_get_soc_data_for_of_alias(struct platform_device *pdev) return &(of_data->ctrl[id]); } -static void samsung_banks_of_node_put(struct samsung_pinctrl_drv_data *d) +static void samsung_banks_node_put(struct samsung_pinctrl_drv_data *d) { struct samsung_pin_bank *bank; unsigned int i; bank = d->pin_banks; for (i = 0; i < d->nr_banks; ++i, ++bank) - of_node_put(bank->of_node); + fwnode_handle_put(bank->fwnode); } /* * Iterate over all driver pin banks to find one matching the name of node, * skipping optional "-gpio" node suffix. When found, assign node to the bank. */ -static void samsung_banks_of_node_get(struct device *dev, - struct samsung_pinctrl_drv_data *d, - struct device_node *node) +static void samsung_banks_node_get(struct device *dev, struct samsung_pinctrl_drv_data *d) { const char *suffix = "-gpio-bank"; struct samsung_pin_bank *bank; - struct device_node *child; + struct fwnode_handle *child; /* Pin bank names are up to 4 characters */ char node_name[20]; unsigned int i; @@ -1038,17 +1037,17 @@ static void samsung_banks_of_node_get(struct device *dev, continue; } - for_each_child_of_node(node, child) { - if (!of_find_property(child, "gpio-controller", NULL)) - continue; - if (of_node_name_eq(child, node_name)) + for_each_gpiochip_node(dev, child) { + struct device_node *np = to_of_node(child); + + if (of_node_name_eq(np, node_name)) break; - else if (of_node_name_eq(child, bank->name)) + if (of_node_name_eq(np, bank->name)) break; } if (child) - bank->of_node = child; + bank->fwnode = child; else dev_warn(dev, "Missing node for bank %s - invalid DTB\n", bank->name); @@ -1061,7 +1060,6 @@ static const struct samsung_pin_ctrl * samsung_pinctrl_get_soc_data(struct samsung_pinctrl_drv_data *d, struct platform_device *pdev) { - struct device_node *node = pdev->dev.of_node; const struct samsung_pin_bank_data *bdata; const struct samsung_pin_ctrl *ctrl; struct samsung_pin_bank *bank; @@ -1125,7 +1123,7 @@ samsung_pinctrl_get_soc_data(struct samsung_pinctrl_drv_data *d, */ d->virt_base = virt_base[0]; - samsung_banks_of_node_get(&pdev->dev, d, node); + samsung_banks_node_get(&pdev->dev, d); d->pin_base = pin_base; pin_base += d->nr_pins; @@ -1186,7 +1184,7 @@ static int samsung_pinctrl_probe(struct platform_device *pdev) err_unregister: samsung_pinctrl_unregister(pdev, drvdata); err_put_banks: - samsung_banks_of_node_put(drvdata); + samsung_banks_node_put(drvdata); return ret; } diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.h b/drivers/pinctrl/samsung/pinctrl-samsung.h index 5b32d3f30fcd..fc6f5199c548 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.h +++ b/drivers/pinctrl/samsung/pinctrl-samsung.h @@ -165,7 +165,7 @@ struct samsung_pin_bank { u32 pin_base; void *soc_priv; - struct device_node *of_node; + struct fwnode_handle *fwnode; struct samsung_pinctrl_drv_data *drvdata; struct irq_domain *irq_domain; struct gpio_chip gpio_chip;
Switch the code to use for_each_gpiochip_node() helper. While at it, in order to avoid additional churn in the future, switch to fwnode APIs where it makes sense. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> --- drivers/pinctrl/samsung/pinctrl-samsung.c | 30 +++++++++++------------ drivers/pinctrl/samsung/pinctrl-samsung.h | 2 +- 2 files changed, 15 insertions(+), 17 deletions(-)