Skip to content

Commit 1d2c884

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

2 files changed

Lines changed: 17 additions & 29 deletions

File tree

drivers/pinctrl/core.c

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -819,29 +819,6 @@ int pinctrl_gpio_request_new(struct gpio_chip *gc, unsigned int offset)
819819
}
820820
EXPORT_SYMBOL_GPL(pinctrl_gpio_request_new);
821821

822-
/* This function is deprecated and will be removed. Don't use. */
823-
void pinctrl_gpio_free(unsigned gpio)
824-
{
825-
struct pinctrl_dev *pctldev;
826-
struct pinctrl_gpio_range *range;
827-
int ret;
828-
int pin;
829-
830-
ret = pinctrl_get_device_gpio_range(gpio, &pctldev, &range);
831-
if (ret) {
832-
return;
833-
}
834-
mutex_lock(&pctldev->mutex);
835-
836-
/* Convert to the pin controllers number space */
837-
pin = gpio_to_pin(range, gpio);
838-
839-
pinmux_free_gpio(pctldev, pin, range);
840-
841-
mutex_unlock(&pctldev->mutex);
842-
}
843-
EXPORT_SYMBOL_GPL(pinctrl_gpio_free);
844-
845822
/**
846823
* pinctrl_gpio_free_new() - free control on a single pin, currently used as GPIO
847824
* @gc: GPIO chip structure from the GPIO subsystem
@@ -853,7 +830,23 @@ EXPORT_SYMBOL_GPL(pinctrl_gpio_free);
853830
*/
854831
void pinctrl_gpio_free_new(struct gpio_chip *gc, unsigned int offset)
855832
{
856-
return pinctrl_gpio_free(gc->base + offset);
833+
struct pinctrl_gpio_range *range;
834+
struct pinctrl_dev *pctldev;
835+
int ret, pin;
836+
837+
ret = pinctrl_get_device_gpio_range(gc->base + offset, &pctldev,
838+
&range);
839+
if (ret)
840+
return;
841+
842+
mutex_lock(&pctldev->mutex);
843+
844+
/* Convert to the pin controllers number space */
845+
pin = gpio_to_pin(range, gc->base + offset);
846+
847+
pinmux_free_gpio(pctldev, pin, range);
848+
849+
mutex_unlock(&pctldev->mutex);
857850
}
858851
EXPORT_SYMBOL_GPL(pinctrl_gpio_free_new);
859852

include/linux/pinctrl/consumer.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ struct pinctrl_state;
2828
/* External interface to pin control */
2929
bool pinctrl_gpio_can_use_line_new(struct gpio_chip *gc, unsigned int offset);
3030
int pinctrl_gpio_request_new(struct gpio_chip *gc, unsigned int offset);
31-
void pinctrl_gpio_free(unsigned gpio);
3231
void pinctrl_gpio_free_new(struct gpio_chip *gc, unsigned int offset);
3332
int pinctrl_gpio_direction_input(unsigned gpio);
3433
int pinctrl_gpio_direction_input_new(struct gpio_chip *gc,
@@ -83,10 +82,6 @@ pinctrl_gpio_request_new(struct gpio_chip *gc, unsigned int offset)
8382
return 0;
8483
}
8584

86-
static inline void pinctrl_gpio_free(unsigned gpio)
87-
{
88-
}
89-
9085
static inline void
9186
pinctrl_gpio_free_new(struct gpio_chip *gc, unsigned int offset)
9287
{

0 commit comments

Comments
 (0)