Skip to content

Commit ab56e2b

Browse files
author
Bartosz Golaszewski
committed
pinctrl: remove pinctrl_gpio_set_config()
There are no more users of pinctrl_gpio_set_config() so remove it. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 45d2055 commit ab56e2b

2 files changed

Lines changed: 15 additions & 27 deletions

File tree

drivers/pinctrl/core.c

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -904,42 +904,36 @@ int pinctrl_gpio_direction_output_new(struct gpio_chip *gc, unsigned int offset)
904904
}
905905
EXPORT_SYMBOL_GPL(pinctrl_gpio_direction_output_new);
906906

907-
/* This function is deprecated and will be removed. Don't use. */
908-
int pinctrl_gpio_set_config(unsigned gpio, unsigned long config)
907+
/**
908+
* pinctrl_gpio_set_config_new() - Apply config to given GPIO pin
909+
* @gc: GPIO chip structure from the GPIO subsystem
910+
* @offset: hardware offset of the GPIO relative to the controller
911+
* @config: the configuration to apply to the GPIO
912+
*
913+
* This function should *ONLY* be used from gpiolib-based GPIO drivers, if
914+
* they need to call the underlying pin controller to change GPIO config
915+
* (for example set debounce time).
916+
*/
917+
int pinctrl_gpio_set_config_new(struct gpio_chip *gc, unsigned int offset,
918+
unsigned long config)
909919
{
910920
unsigned long configs[] = { config };
911921
struct pinctrl_gpio_range *range;
912922
struct pinctrl_dev *pctldev;
913923
int ret, pin;
914924

915-
ret = pinctrl_get_device_gpio_range(gpio, &pctldev, &range);
925+
ret = pinctrl_get_device_gpio_range(gc->base + offset, &pctldev,
926+
&range);
916927
if (ret)
917928
return ret;
918929

919930
mutex_lock(&pctldev->mutex);
920-
pin = gpio_to_pin(range, gpio);
931+
pin = gpio_to_pin(range, gc->base + offset);
921932
ret = pinconf_set_config(pctldev, pin, configs, ARRAY_SIZE(configs));
922933
mutex_unlock(&pctldev->mutex);
923934

924935
return ret;
925936
}
926-
EXPORT_SYMBOL_GPL(pinctrl_gpio_set_config);
927-
928-
/**
929-
* pinctrl_gpio_set_config_new() - Apply config to given GPIO pin
930-
* @gc: GPIO chip structure from the GPIO subsystem
931-
* @offset: hardware offset of the GPIO relative to the controller
932-
* @config: the configuration to apply to the GPIO
933-
*
934-
* This function should *ONLY* be used from gpiolib-based GPIO drivers, if
935-
* they need to call the underlying pin controller to change GPIO config
936-
* (for example set debounce time).
937-
*/
938-
int pinctrl_gpio_set_config_new(struct gpio_chip *gc, unsigned int offset,
939-
unsigned long config)
940-
{
941-
return pinctrl_gpio_set_config(gc->base + offset, config);
942-
}
943937
EXPORT_SYMBOL_GPL(pinctrl_gpio_set_config_new);
944938

945939
static struct pinctrl_state *find_state(struct pinctrl *p,

include/linux/pinctrl/consumer.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ int pinctrl_gpio_direction_input_new(struct gpio_chip *gc,
3333
unsigned int offset);
3434
int pinctrl_gpio_direction_output_new(struct gpio_chip *gc,
3535
unsigned int offset);
36-
int pinctrl_gpio_set_config(unsigned gpio, unsigned long config);
3736
int pinctrl_gpio_set_config_new(struct gpio_chip *gc, unsigned int offset,
3837
unsigned long config);
3938

@@ -97,11 +96,6 @@ pinctrl_gpio_direction_output_new(struct gpio_chip *gc, unsigned int offset)
9796
return 0;
9897
}
9998

100-
static inline int pinctrl_gpio_set_config(unsigned gpio, unsigned long config)
101-
{
102-
return 0;
103-
}
104-
10599
static inline int
106100
pinctrl_gpio_set_config_new(struct gpio_chip *gc, unsigned int offset,
107101
unsigned long config)

0 commit comments

Comments
 (0)