Skip to content

Commit 699f078

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

2 files changed

Lines changed: 17 additions & 30 deletions

File tree

drivers/pinctrl/core.c

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -783,47 +783,40 @@ bool pinctrl_gpio_can_use_line_new(struct gpio_chip *gc, unsigned int offset)
783783
}
784784
EXPORT_SYMBOL_GPL(pinctrl_gpio_can_use_line_new);
785785

786-
/* This function is deprecated and will be removed. Don't use. */
787-
int pinctrl_gpio_request(unsigned gpio)
786+
/**
787+
* pinctrl_gpio_request_new() - request a single pin to be used as GPIO
788+
* @gc: GPIO chip structure from the GPIO subsystem
789+
* @offset: hardware offset of the GPIO relative to the controller
790+
*
791+
* This function should *ONLY* be used from gpiolib-based GPIO drivers,
792+
* as part of their gpio_request() semantics, platforms and individual drivers
793+
* shall *NOT* request GPIO pins to be muxed in.
794+
*/
795+
int pinctrl_gpio_request_new(struct gpio_chip *gc, unsigned int offset)
788796
{
789-
struct pinctrl_dev *pctldev;
790797
struct pinctrl_gpio_range *range;
791-
int ret;
792-
int pin;
798+
struct pinctrl_dev *pctldev;
799+
int ret, pin;
793800

794-
ret = pinctrl_get_device_gpio_range(gpio, &pctldev, &range);
801+
ret = pinctrl_get_device_gpio_range(gc->base + offset, &pctldev,
802+
&range);
795803
if (ret) {
796-
if (pinctrl_ready_for_gpio_range(gpio))
804+
if (pinctrl_ready_for_gpio_range(gc->base + offset))
797805
ret = 0;
798806
return ret;
799807
}
800808

801809
mutex_lock(&pctldev->mutex);
802810

803811
/* Convert to the pin controllers number space */
804-
pin = gpio_to_pin(range, gpio);
812+
pin = gpio_to_pin(range, gc->base + offset);
805813

806-
ret = pinmux_request_gpio(pctldev, range, pin, gpio);
814+
ret = pinmux_request_gpio(pctldev, range, pin, gc->base + offset);
807815

808816
mutex_unlock(&pctldev->mutex);
809817

810818
return ret;
811819
}
812-
EXPORT_SYMBOL_GPL(pinctrl_gpio_request);
813-
814-
/**
815-
* pinctrl_gpio_request_new() - request a single pin to be used as GPIO
816-
* @gc: GPIO chip structure from the GPIO subsystem
817-
* @offset: hardware offset of the GPIO relative to the controller
818-
*
819-
* This function should *ONLY* be used from gpiolib-based GPIO drivers,
820-
* as part of their gpio_request() semantics, platforms and individual drivers
821-
* shall *NOT* request GPIO pins to be muxed in.
822-
*/
823-
int pinctrl_gpio_request_new(struct gpio_chip *gc, unsigned int offset)
824-
{
825-
return pinctrl_gpio_request(gc->base + offset);
826-
}
827820
EXPORT_SYMBOL_GPL(pinctrl_gpio_request_new);
828821

829822
/* This function is deprecated and will be removed. Don't use. */

include/linux/pinctrl/consumer.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ struct pinctrl_state;
2727

2828
/* External interface to pin control */
2929
bool pinctrl_gpio_can_use_line_new(struct gpio_chip *gc, unsigned int offset);
30-
int pinctrl_gpio_request(unsigned gpio);
3130
int pinctrl_gpio_request_new(struct gpio_chip *gc, unsigned int offset);
3231
void pinctrl_gpio_free(unsigned gpio);
3332
void pinctrl_gpio_free_new(struct gpio_chip *gc, unsigned int offset);
@@ -78,11 +77,6 @@ pinctrl_gpio_can_use_line_new(struct gpio_chip *gc, unsigned int offset)
7877
return true;
7978
}
8079

81-
static inline int pinctrl_gpio_request(unsigned gpio)
82-
{
83-
return 0;
84-
}
85-
8680
static inline int
8781
pinctrl_gpio_request_new(struct gpio_chip *gc, unsigned int offset)
8882
{

0 commit comments

Comments
 (0)