Hi Jianqun, Thank you for the patch! Yet something to improve: [auto build test ERROR on rockchip/for-next] [also build test ERROR on rafael-pm/linux-next brgl/gpio/for-next linus/master v6.0-rc4 next-20220909] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Jianqun-Xu/gpio-rockchip-support-acpi/20220909-170917 base: https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git for-next config: openrisc-randconfig-r015-20220907 compiler: or1k-linux-gcc (GCC) 12.1.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/49cfab100d90f21d176a0433211e5b5b996afa17 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Jianqun-Xu/gpio-rockchip-support-acpi/20220909-170917 git checkout 49cfab100d90f21d176a0433211e5b5b996afa17 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=openrisc SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot All errors (new ones prefixed by >>): or1k-linux-ld: drivers/gpio/gpio-rockchip.o: in function `rockchip_gpio_probe': >> drivers/gpio/gpio-rockchip.c:746: undefined reference to `get_pinctrl_dev_from_devname' drivers/gpio/gpio-rockchip.c:746:(.text+0xb88): relocation truncated to fit: R_OR1K_INSN_REL_26 against undefined symbol `get_pinctrl_dev_from_devname' or1k-linux-ld: drivers/gpio/gpio-rockchip.o: in function `rockchip_gpio_find_bank': >> drivers/gpio/gpio-rockchip.c:703: undefined reference to `pinctrl_dev_get_drvdata' drivers/gpio/gpio-rockchip.c:703:(.text+0xb9c): relocation truncated to fit: R_OR1K_INSN_REL_26 against undefined symbol `pinctrl_dev_get_drvdata' pahole: .tmp_vmlinux.btf: No such file or directory .btf.vmlinux.bin.o: file not recognized: file format not recognized vim +746 drivers/gpio/gpio-rockchip.c 695 696 static struct rockchip_pin_bank * 697 rockchip_gpio_find_bank(struct pinctrl_dev *pctldev, int id) 698 { 699 struct rockchip_pinctrl *info; 700 struct rockchip_pin_bank *bank; 701 int i, found = 0; 702 > 703 info = pinctrl_dev_get_drvdata(pctldev); 704 bank = info->ctrl->pin_banks; 705 for (i = 0; i < info->ctrl->nr_banks; i++, bank++) { 706 if (bank->bank_num == id) { 707 found = 1; 708 break; 709 } 710 } 711 712 return found ? bank : NULL; 713 } 714 715 static int rockchip_gpio_get_bank_id(struct device *dev) 716 { 717 struct fwnode_handle *fwnode = dev_fwnode(dev); 718 int bank_id = -EINVAL; 719 u64 uid; 720 static int gpio; 721 722 if (is_acpi_node(fwnode)) { 723 if (!acpi_dev_uid_to_integer(ACPI_COMPANION(dev), &uid)) 724 bank_id = (int)uid; 725 } else { 726 bank_id = of_alias_get_id(to_of_node(fwnode), "gpio"); 727 if (bank_id < 0) 728 bank_id = gpio++; 729 } 730 731 return bank_id; 732 } 733 734 static int rockchip_gpio_probe(struct platform_device *pdev) 735 { 736 struct device *dev = &pdev->dev; 737 struct rockchip_pin_bank *bank; 738 struct pinctrl_dev *pctldev; 739 int bank_id; 740 int ret; 741 742 bank_id = rockchip_gpio_get_bank_id(dev); 743 if (bank_id < 0) 744 return bank_id; 745 > 746 pctldev = get_pinctrl_dev_from_devname("pinctrl"); 747 if (pctldev) { 748 bank = rockchip_gpio_find_bank(pctldev, bank_id); 749 if (!bank) 750 return -ENODEV; 751 } else { 752 bank = devm_kzalloc(dev, sizeof(*bank), GFP_KERNEL); 753 if (!bank) 754 return -ENOMEM; 755 } 756 757 bank->bank_num = bank_id; 758 bank->dev = dev; 759 760 bank->reg_base = devm_platform_ioremap_resource(pdev, 0); 761 if (IS_ERR(bank->reg_base)) 762 return PTR_ERR(bank->reg_base); 763 764 bank->irq = platform_get_irq(pdev, 0); 765 if (bank->irq < 0) 766 return bank->irq; 767 768 ret = rockchip_gpio_get_clocks(bank); 769 if (ret) 770 return ret; 771 772 raw_spin_lock_init(&bank->slock); 773 rockchip_gpio_set_regs(bank); 774 775 /* 776 * Prevent clashes with a deferred output setting 777 * being added right at this moment. 778 */ 779 mutex_lock(&bank->deferred_lock); 780 781 ret = rockchip_gpiolib_register(bank, pctldev); 782 if (ret) { 783 dev_err(bank->dev, "Failed to register gpio %d\n", ret); 784 goto err_unlock; 785 } 786 787 while (!list_empty(&bank->deferred_pins)) { 788 struct rockchip_pin_deferred *cfg; 789 790 cfg = list_first_entry(&bank->deferred_pins, 791 struct rockchip_pin_deferred, head); 792 if (!cfg) 793 break; 794 795 list_del(&cfg->head); 796 797 switch (cfg->param) { 798 case PIN_CONFIG_OUTPUT: 799 ret = rockchip_gpio_direction_output(&bank->gpio_chip, cfg->pin, cfg->arg); 800 if (ret) 801 dev_warn(dev, "setting output pin %u to %u failed\n", cfg->pin, 802 cfg->arg); 803 break; 804 case PIN_CONFIG_INPUT_ENABLE: 805 ret = rockchip_gpio_direction_input(&bank->gpio_chip, cfg->pin); 806 if (ret) 807 dev_warn(dev, "setting input pin %u failed\n", cfg->pin); 808 break; 809 default: 810 dev_warn(dev, "unknown deferred config param %d\n", cfg->param); 811 break; 812 } 813 kfree(cfg); 814 } 815 816 mutex_unlock(&bank->deferred_lock); 817 818 platform_set_drvdata(pdev, bank); 819 dev_info(dev, "probed %pfw\n", dev_fwnode(dev)); 820 821 return 0; 822 err_unlock: 823 mutex_unlock(&bank->deferred_lock); 824 clk_disable_unprepare(bank->clk); 825 clk_disable_unprepare(bank->db_clk); 826 827 return ret; 828 } 829 -- 0-DAY CI Kernel Test Service https://01.org/lkp