Skip to content

Commit b6420bd

Browse files
vimuxxBartosz Golaszewski
authored andcommitted
gpio: remove of_get_named_gpio() and <linux/of_gpio.h>
All in-tree consumers have been converted to the descriptor-based API. Remove the deprecated of_get_named_gpio() helper, delete the <linux/of_gpio.h> header, and drop the corresponding entry from MAINTAINERS. Also remove the completed TODO item for this cleanup. Signed-off-by: Jialu Xu <xujialu@vimux.org> Reviewed-by: Linus Walleij <linusw@kernel.org> Link: https://patch.msgid.link/02ABDA1F9E3FAF1F+20260307030623.3495092-6-xujialu@vimux.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
1 parent 253350d commit b6420bd

4 files changed

Lines changed: 0 additions & 94 deletions

File tree

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10959,7 +10959,6 @@ F: drivers/gpio/
1095910959
F: include/dt-bindings/gpio/
1096010960
F: include/linux/gpio.h
1096110961
F: include/linux/gpio/
10962-
F: include/linux/of_gpio.h
1096310962
K: (devm_)?gpio_(request|free|direction|get|set)
1096410963
K: GPIOD_FLAGS_BIT_NONEXCLUSIVE
1096510964
K: devm_gpiod_unhinge

drivers/gpio/TODO

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -58,34 +58,6 @@ Work items:
5858

5959
-------------------------------------------------------------------------------
6060

61-
Get rid of <linux/of_gpio.h>
62-
63-
This header and helpers appeared at one point when there was no proper
64-
driver infrastructure for doing simpler MMIO GPIO devices and there was
65-
no core support for parsing device tree GPIOs from the core library with
66-
the [devm_]gpiod_get() calls we have today that will implicitly go into
67-
the device tree back-end. It is legacy and should not be used in new code.
68-
69-
Work items:
70-
71-
- Change all consumer drivers that #include <linux/of_gpio.h> to
72-
#include <linux/gpio/consumer.h> and stop doing custom parsing of the
73-
GPIO lines from the device tree. This can be tricky and often involves
74-
changing board files, etc.
75-
76-
- Pull semantics for legacy device tree (OF) GPIO lookups into
77-
gpiolib-of.c: in some cases subsystems are doing custom flags and
78-
lookups for polarity inversion, open drain and what not. As we now
79-
handle this with generic OF bindings, pull all legacy handling into
80-
gpiolib so the library API becomes narrow and deep and handle all
81-
legacy bindings internally. (See e.g. commits 6953c57ab172,
82-
6a537d48461d etc)
83-
84-
- Delete <linux/of_gpio.h> when all the above is complete and everything
85-
uses <linux/gpio/consumer.h> or <linux/gpio/driver.h> instead.
86-
87-
-------------------------------------------------------------------------------
88-
8961
Collect drivers
9062

9163
Collect GPIO drivers from arch/* and other places that should be placed

drivers/gpio/gpiolib-of.c

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <linux/module.h>
1515
#include <linux/of.h>
1616
#include <linux/of_address.h>
17-
#include <linux/of_gpio.h>
1817
#include <linux/pinctrl/pinctrl.h>
1918
#include <linux/slab.h>
2019
#include <linux/string.h>
@@ -446,32 +445,6 @@ static struct gpio_desc *of_get_named_gpiod_flags(const struct device_node *np,
446445
return desc;
447446
}
448447

449-
/**
450-
* of_get_named_gpio() - Get a GPIO number to use with GPIO API
451-
* @np: device node to get GPIO from
452-
* @propname: Name of property containing gpio specifier(s)
453-
* @index: index of the GPIO
454-
*
455-
* **DEPRECATED** This function is deprecated and must not be used in new code.
456-
*
457-
* Returns:
458-
* GPIO number to use with Linux generic GPIO API, or one of the errno
459-
* value on the error condition.
460-
*/
461-
int of_get_named_gpio(const struct device_node *np, const char *propname,
462-
int index)
463-
{
464-
struct gpio_desc *desc;
465-
466-
desc = of_get_named_gpiod_flags(np, propname, index, NULL);
467-
468-
if (IS_ERR(desc))
469-
return PTR_ERR(desc);
470-
else
471-
return desc_to_gpio(desc);
472-
}
473-
EXPORT_SYMBOL_GPL(of_get_named_gpio);
474-
475448
/* Converts gpio_lookup_flags into bitmask of GPIO_* values */
476449
static unsigned long of_convert_gpio_flags(enum of_gpio_flags flags)
477450
{

include/linux/of_gpio.h

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)