Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

gpiolib: make fwnode_get_named_gpiod() static

There are no external users of fwnode_get_named_gpiod() anymore, so
let's stop exporting it and mark it as static.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>

authored by

Dmitry Torokhov and committed by
Bartosz Golaszewski
0eadd36d 6ae8e1d0

+66 -79
+66 -66
drivers/gpio/gpiolib.c
··· 3799 3799 } 3800 3800 3801 3801 /** 3802 + * fwnode_get_named_gpiod - obtain a GPIO from firmware node 3803 + * @fwnode: handle of the firmware node 3804 + * @propname: name of the firmware property representing the GPIO 3805 + * @index: index of the GPIO to obtain for the consumer 3806 + * @dflags: GPIO initialization flags 3807 + * @label: label to attach to the requested GPIO 3808 + * 3809 + * This function can be used for drivers that get their configuration 3810 + * from opaque firmware. 3811 + * 3812 + * The function properly finds the corresponding GPIO using whatever is the 3813 + * underlying firmware interface and then makes sure that the GPIO 3814 + * descriptor is requested before it is returned to the caller. 3815 + * 3816 + * Returns: 3817 + * On successful request the GPIO pin is configured in accordance with 3818 + * provided @dflags. 3819 + * 3820 + * In case of error an ERR_PTR() is returned. 3821 + */ 3822 + static struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode, 3823 + const char *propname, int index, 3824 + enum gpiod_flags dflags, 3825 + const char *label) 3826 + { 3827 + unsigned long lflags = GPIO_LOOKUP_FLAGS_DEFAULT; 3828 + struct gpio_desc *desc = ERR_PTR(-ENODEV); 3829 + int ret; 3830 + 3831 + if (is_of_node(fwnode)) { 3832 + desc = gpiod_get_from_of_node(to_of_node(fwnode), 3833 + propname, index, 3834 + dflags, 3835 + label); 3836 + return desc; 3837 + } else if (is_acpi_node(fwnode)) { 3838 + struct acpi_gpio_info info; 3839 + 3840 + desc = acpi_node_get_gpiod(fwnode, propname, index, &info); 3841 + if (IS_ERR(desc)) 3842 + return desc; 3843 + 3844 + acpi_gpio_update_gpiod_flags(&dflags, &info); 3845 + acpi_gpio_update_gpiod_lookup_flags(&lflags, &info); 3846 + } else { 3847 + return ERR_PTR(-EINVAL); 3848 + } 3849 + 3850 + /* Currently only ACPI takes this path */ 3851 + ret = gpiod_request(desc, label); 3852 + if (ret) 3853 + return ERR_PTR(ret); 3854 + 3855 + ret = gpiod_configure_flags(desc, propname, lflags, dflags); 3856 + if (ret < 0) { 3857 + gpiod_put(desc); 3858 + return ERR_PTR(ret); 3859 + } 3860 + 3861 + blocking_notifier_call_chain(&desc->gdev->notifier, 3862 + GPIOLINE_CHANGED_REQUESTED, desc); 3863 + 3864 + return desc; 3865 + } 3866 + 3867 + /** 3802 3868 * fwnode_gpiod_get_index - obtain a GPIO from firmware node 3803 3869 * @fwnode: handle of the firmware node 3804 3870 * @con_id: function within the GPIO consumer ··· 4128 4062 return desc; 4129 4063 } 4130 4064 EXPORT_SYMBOL_GPL(gpiod_get_index); 4131 - 4132 - /** 4133 - * fwnode_get_named_gpiod - obtain a GPIO from firmware node 4134 - * @fwnode: handle of the firmware node 4135 - * @propname: name of the firmware property representing the GPIO 4136 - * @index: index of the GPIO to obtain for the consumer 4137 - * @dflags: GPIO initialization flags 4138 - * @label: label to attach to the requested GPIO 4139 - * 4140 - * This function can be used for drivers that get their configuration 4141 - * from opaque firmware. 4142 - * 4143 - * The function properly finds the corresponding GPIO using whatever is the 4144 - * underlying firmware interface and then makes sure that the GPIO 4145 - * descriptor is requested before it is returned to the caller. 4146 - * 4147 - * Returns: 4148 - * On successful request the GPIO pin is configured in accordance with 4149 - * provided @dflags. 4150 - * 4151 - * In case of error an ERR_PTR() is returned. 4152 - */ 4153 - struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode, 4154 - const char *propname, int index, 4155 - enum gpiod_flags dflags, 4156 - const char *label) 4157 - { 4158 - unsigned long lflags = GPIO_LOOKUP_FLAGS_DEFAULT; 4159 - struct gpio_desc *desc = ERR_PTR(-ENODEV); 4160 - int ret; 4161 - 4162 - if (is_of_node(fwnode)) { 4163 - desc = gpiod_get_from_of_node(to_of_node(fwnode), 4164 - propname, index, 4165 - dflags, 4166 - label); 4167 - return desc; 4168 - } else if (is_acpi_node(fwnode)) { 4169 - struct acpi_gpio_info info; 4170 - 4171 - desc = acpi_node_get_gpiod(fwnode, propname, index, &info); 4172 - if (IS_ERR(desc)) 4173 - return desc; 4174 - 4175 - acpi_gpio_update_gpiod_flags(&dflags, &info); 4176 - acpi_gpio_update_gpiod_lookup_flags(&lflags, &info); 4177 - } else 4178 - return ERR_PTR(-EINVAL); 4179 - 4180 - /* Currently only ACPI takes this path */ 4181 - ret = gpiod_request(desc, label); 4182 - if (ret) 4183 - return ERR_PTR(ret); 4184 - 4185 - ret = gpiod_configure_flags(desc, propname, lflags, dflags); 4186 - if (ret < 0) { 4187 - gpiod_put(desc); 4188 - return ERR_PTR(ret); 4189 - } 4190 - 4191 - blocking_notifier_call_chain(&desc->gdev->notifier, 4192 - GPIOLINE_CHANGED_REQUESTED, desc); 4193 - 4194 - return desc; 4195 - } 4196 - EXPORT_SYMBOL_GPL(fwnode_get_named_gpiod); 4197 4065 4198 4066 /** 4199 4067 * gpiod_get_index_optional - obtain an optional GPIO from a multi-index GPIO
-13
include/linux/gpio/consumer.h
··· 174 174 /* Child properties interface */ 175 175 struct fwnode_handle; 176 176 177 - struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode, 178 - const char *propname, int index, 179 - enum gpiod_flags dflags, 180 - const char *label); 181 177 struct gpio_desc *fwnode_gpiod_get_index(struct fwnode_handle *fwnode, 182 178 const char *con_id, int index, 183 179 enum gpiod_flags flags, ··· 548 552 549 553 /* Child properties interface */ 550 554 struct fwnode_handle; 551 - 552 - static inline 553 - struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode, 554 - const char *propname, int index, 555 - enum gpiod_flags dflags, 556 - const char *label) 557 - { 558 - return ERR_PTR(-ENOSYS); 559 - } 560 555 561 556 static inline 562 557 struct gpio_desc *fwnode_gpiod_get_index(struct fwnode_handle *fwnode,