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

gpiolib: of: remove of_get_gpio[_flags]() and of_get_named_gpio_flags()

There are no more users of these APIs in the mainline kernel, remove
them. This leaves of_get_named_gpio() as the only legacy OF-specific
API.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

authored by

Dmitry Torokhov and committed by
Bartosz Golaszewski
40fc56ee f9792ba0

+17 -45
+13 -4
drivers/gpio/gpiolib-of.c
··· 365 365 return desc; 366 366 } 367 367 368 - int of_get_named_gpio_flags(const struct device_node *np, const char *list_name, 369 - int index, enum of_gpio_flags *flags) 368 + /** 369 + * of_get_named_gpio() - Get a GPIO number to use with GPIO API 370 + * @np: device node to get GPIO from 371 + * @propname: Name of property containing gpio specifier(s) 372 + * @index: index of the GPIO 373 + * 374 + * Returns GPIO number to use with Linux generic GPIO API, or one of the errno 375 + * value on the error condition. 376 + */ 377 + int of_get_named_gpio(const struct device_node *np, const char *propname, 378 + int index) 370 379 { 371 380 struct gpio_desc *desc; 372 381 373 - desc = of_get_named_gpiod_flags(np, list_name, index, flags); 382 + desc = of_get_named_gpiod_flags(np, propname, index, NULL); 374 383 375 384 if (IS_ERR(desc)) 376 385 return PTR_ERR(desc); 377 386 else 378 387 return desc_to_gpio(desc); 379 388 } 380 - EXPORT_SYMBOL_GPL(of_get_named_gpio_flags); 389 + EXPORT_SYMBOL_GPL(of_get_named_gpio); 381 390 382 391 /* Converts gpio_lookup_flags into bitmask of GPIO_* values */ 383 392 static unsigned long of_convert_gpio_flags(enum of_gpio_flags flags)
+4 -41
include/linux/of_gpio.h
··· 50 50 return container_of(gc, struct of_mm_gpio_chip, gc); 51 51 } 52 52 53 - extern int of_get_named_gpio_flags(const struct device_node *np, 54 - const char *list_name, int index, enum of_gpio_flags *flags); 53 + extern int of_get_named_gpio(const struct device_node *np, 54 + const char *list_name, int index); 55 55 56 56 extern int of_mm_gpiochip_add_data(struct device_node *np, 57 57 struct of_mm_gpio_chip *mm_gc, ··· 68 68 #include <linux/errno.h> 69 69 70 70 /* Drivers may not strictly depend on the GPIO support, so let them link. */ 71 - static inline int of_get_named_gpio_flags(const struct device_node *np, 72 - const char *list_name, int index, enum of_gpio_flags *flags) 71 + static inline int of_get_named_gpio(const struct device_node *np, 72 + const char *propname, int index) 73 73 { 74 - if (flags) 75 - *flags = 0; 76 - 77 74 return -ENOSYS; 78 75 } 79 76 80 77 #endif /* CONFIG_OF_GPIO */ 81 - 82 - static inline int of_get_gpio_flags(const struct device_node *np, int index, 83 - enum of_gpio_flags *flags) 84 - { 85 - return of_get_named_gpio_flags(np, "gpios", index, flags); 86 - } 87 - 88 - /** 89 - * of_get_named_gpio() - Get a GPIO number to use with GPIO API 90 - * @np: device node to get GPIO from 91 - * @propname: Name of property containing gpio specifier(s) 92 - * @index: index of the GPIO 93 - * 94 - * Returns GPIO number to use with Linux generic GPIO API, or one of the errno 95 - * value on the error condition. 96 - */ 97 - static inline int of_get_named_gpio(const struct device_node *np, 98 - const char *propname, int index) 99 - { 100 - return of_get_named_gpio_flags(np, propname, index, NULL); 101 - } 102 - 103 - /** 104 - * of_get_gpio() - Get a GPIO number to use with GPIO API 105 - * @np: device node to get GPIO from 106 - * @index: index of the GPIO 107 - * 108 - * Returns GPIO number to use with Linux generic GPIO API, or one of the errno 109 - * value on the error condition. 110 - */ 111 - static inline int of_get_gpio(const struct device_node *np, int index) 112 - { 113 - return of_get_gpio_flags(np, index, NULL); 114 - } 115 78 116 79 #endif /* __LINUX_OF_GPIO_H */