tree: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git gpio-descriptors-fwnode-children head: 55b47eb8946e57984fb62d80539ceae6f039058e commit: 55b47eb8946e57984fb62d80539ceae6f039058e [1/1] slask config: xtensa-allmodconfig (attached as .config) compiler: xtensa-linux-gcc (GCC) 7.2.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross git checkout 55b47eb8946e57984fb62d80539ceae6f039058e # save the attached .config to linux build tree make.cross ARCH=xtensa All errors (new ones prefixed by >>): drivers/gpio/gpiolib.c: In function 'fwnode_get_named_gpiod': >> drivers/gpio/gpiolib.c:3692:27: error: 'con_id' undeclared (first use in this function); did you mean 'zone_id'? desc = gpiod_find(NULL, con_id, idx, &lookupflags); ^~~~~~ zone_id drivers/gpio/gpiolib.c:3692:27: note: each undeclared identifier is reported only once for each function it appears in >> drivers/gpio/gpiolib.c:3692:35: error: 'idx' undeclared (first use in this function); did you mean 'ida'? desc = gpiod_find(NULL, con_id, idx, &lookupflags); ^~~ ida vim +3692 drivers/gpio/gpiolib.c 3631 3632 /** 3633 * fwnode_get_named_gpiod - obtain a GPIO from firmware node 3634 * @fwnode: handle of the firmware node 3635 * @propname: name of the firmware property representing the GPIO 3636 * @index: index of the GPIO to obtain in the consumer 3637 * @dflags: GPIO initialization flags 3638 * @label: label to attach to the requested GPIO 3639 * 3640 * This function can be used for drivers that get their configuration 3641 * from firmware. 3642 * 3643 * Function properly finds the corresponding GPIO using whatever is the 3644 * underlying firmware interface and then makes sure that the GPIO 3645 * descriptor is requested before it is returned to the caller. 3646 * 3647 * Returns: 3648 * On successful request the GPIO pin is configured in accordance with 3649 * provided @dflags. 3650 * 3651 * In case of error an ERR_PTR() is returned. 3652 */ 3653 struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode, 3654 const char *propname, int index, 3655 enum gpiod_flags dflags, 3656 const char *label) 3657 { 3658 struct gpio_desc *desc = ERR_PTR(-ENODEV); 3659 unsigned long lflags = 0; 3660 bool active_low = false; 3661 bool single_ended = false; 3662 bool open_drain = false; 3663 int ret; 3664 3665 if (!fwnode) 3666 return ERR_PTR(-EINVAL); 3667 3668 if (is_of_node(fwnode)) { 3669 enum of_gpio_flags flags; 3670 3671 desc = of_get_named_gpiod_flags(to_of_node(fwnode), propname, 3672 index, &flags); 3673 if (!IS_ERR(desc)) { 3674 active_low = flags & OF_GPIO_ACTIVE_LOW; 3675 single_ended = flags & OF_GPIO_SINGLE_ENDED; 3676 open_drain = flags & OF_GPIO_OPEN_DRAIN; 3677 } 3678 } else if (is_acpi_node(fwnode)) { 3679 struct acpi_gpio_info info; 3680 3681 desc = acpi_node_get_gpiod(fwnode, propname, index, &info); 3682 if (!IS_ERR(desc)) { 3683 active_low = info.polarity == GPIO_ACTIVE_LOW; 3684 ret = acpi_gpio_update_gpiod_flags(&dflags, info.flags); 3685 if (ret) 3686 pr_debug("Override GPIO initialization flags\n"); 3687 } 3688 } else { 3689 /* This is with static definitions in a board file */ 3690 enum gpio_lookup_flags lookupflags = 0; 3691 > 3692 desc = gpiod_find(NULL, con_id, idx, &lookupflags); 3693 if (!IS_ERR(desc)) { 3694 } 3695 } 3696 3697 if (IS_ERR(desc)) 3698 return desc; 3699 3700 ret = gpiod_request(desc, label); 3701 if (ret) 3702 return ERR_PTR(ret); 3703 3704 if (active_low) 3705 lflags |= GPIO_ACTIVE_LOW; 3706 3707 if (single_ended) { 3708 if (open_drain) 3709 lflags |= GPIO_OPEN_DRAIN; 3710 else 3711 lflags |= GPIO_OPEN_SOURCE; 3712 } 3713 3714 ret = gpiod_configure_flags(desc, propname, lflags, dflags); 3715 if (ret < 0) { 3716 gpiod_put(desc); 3717 return ERR_PTR(ret); 3718 } 3719 3720 return desc; 3721 } 3722 EXPORT_SYMBOL_GPL(fwnode_get_named_gpiod); 3723 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip