Skip to content

Commit 973c171

Browse files
chunkeeylinusw
authored andcommitted
gpiolib: discourage gpiochip_add_pin[group]_range for DT pinctrls
This patch adds the stern warning to the kerneldoc text of both gpiochip_add_pin[group]_range() functions in hope of detering developers from ever using them in their DeviceTree-supported pinctrl drivers in the future. For anyone affected: Please refer to Section 2.1 of Documentation/devicetree/bindings/gpio/gpio.txt on how to bind pinctrl and gpio drivers via the "gpio-ranges" property. Signed-off-by: Christian Lamparter <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent a86caa9 commit 973c171

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/gpio/gpiolib.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2077,6 +2077,11 @@ EXPORT_SYMBOL_GPL(gpiochip_generic_config);
20772077
* @pctldev: the pin controller to map to
20782078
* @gpio_offset: the start offset in the current gpio_chip number space
20792079
* @pin_group: name of the pin group inside the pin controller
2080+
*
2081+
* Calling this function directly from a DeviceTree-supported
2082+
* pinctrl driver is DEPRECATED. Please see Section 2.1 of
2083+
* Documentation/devicetree/bindings/gpio/gpio.txt on how to
2084+
* bind pinctrl and gpio drivers via the "gpio-ranges" property.
20802085
*/
20812086
int gpiochip_add_pingroup_range(struct gpio_chip *chip,
20822087
struct pinctrl_dev *pctldev,
@@ -2130,6 +2135,11 @@ EXPORT_SYMBOL_GPL(gpiochip_add_pingroup_range);
21302135
*
21312136
* Returns:
21322137
* 0 on success, or a negative error-code on failure.
2138+
*
2139+
* Calling this function directly from a DeviceTree-supported
2140+
* pinctrl driver is DEPRECATED. Please see Section 2.1 of
2141+
* Documentation/devicetree/bindings/gpio/gpio.txt on how to
2142+
* bind pinctrl and gpio drivers via the "gpio-ranges" property.
21332143
*/
21342144
int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
21352145
unsigned int gpio_offset, unsigned int pin_offset,

0 commit comments

Comments
 (0)