Commit 2b038e78 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Bartosz Golaszewski

gpiolib: devres: Get rid of unused devm_gpio_free()

The last user, which in fact was a dead code, has gone a year ago,
previous one 3 years ago. On top of that we want to drop away the
legacy GPIO APIs in the kernel, so take a chance to get rid of
unused devm_gpio_free() and accompanying stuff.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarBartosz Golaszewski <brgl@bgdev.pl>
parent ff699273
...@@ -277,7 +277,6 @@ GPIO ...@@ -277,7 +277,6 @@ GPIO
devm_gpiochip_add_data() devm_gpiochip_add_data()
devm_gpio_request() devm_gpio_request()
devm_gpio_request_one() devm_gpio_request_one()
devm_gpio_free()
I2C I2C
devm_i2c_new_dummy_device() devm_i2c_new_dummy_device()
......
...@@ -375,9 +375,6 @@ void devm_gpiod_put_array(struct device *dev, struct gpio_descs *descs) ...@@ -375,9 +375,6 @@ void devm_gpiod_put_array(struct device *dev, struct gpio_descs *descs)
} }
EXPORT_SYMBOL_GPL(devm_gpiod_put_array); EXPORT_SYMBOL_GPL(devm_gpiod_put_array);
static void devm_gpio_release(struct device *dev, void *res) static void devm_gpio_release(struct device *dev, void *res)
{ {
unsigned *gpio = res; unsigned *gpio = res;
...@@ -385,13 +382,6 @@ static void devm_gpio_release(struct device *dev, void *res) ...@@ -385,13 +382,6 @@ static void devm_gpio_release(struct device *dev, void *res)
gpio_free(*gpio); gpio_free(*gpio);
} }
static int devm_gpio_match(struct device *dev, void *res, void *data)
{
unsigned *this = res, *gpio = data;
return *this == *gpio;
}
/** /**
* devm_gpio_request - request a GPIO for a managed device * devm_gpio_request - request a GPIO for a managed device
* @dev: device to request the GPIO for * @dev: device to request the GPIO for
...@@ -402,11 +392,7 @@ static int devm_gpio_match(struct device *dev, void *res, void *data) ...@@ -402,11 +392,7 @@ static int devm_gpio_match(struct device *dev, void *res, void *data)
* same arguments and performs the same function as * same arguments and performs the same function as
* gpio_request(). GPIOs requested with this function will be * gpio_request(). GPIOs requested with this function will be
* automatically freed on driver detach. * automatically freed on driver detach.
*
* If an GPIO allocated with this function needs to be freed
* separately, devm_gpio_free() must be used.
*/ */
int devm_gpio_request(struct device *dev, unsigned gpio, const char *label) int devm_gpio_request(struct device *dev, unsigned gpio, const char *label)
{ {
unsigned *dr; unsigned *dr;
...@@ -459,24 +445,6 @@ int devm_gpio_request_one(struct device *dev, unsigned gpio, ...@@ -459,24 +445,6 @@ int devm_gpio_request_one(struct device *dev, unsigned gpio,
} }
EXPORT_SYMBOL_GPL(devm_gpio_request_one); EXPORT_SYMBOL_GPL(devm_gpio_request_one);
/**
* devm_gpio_free - free a GPIO
* @dev: device to free GPIO for
* @gpio: GPIO to free
*
* Except for the extra @dev argument, this function takes the
* same arguments and performs the same function as gpio_free().
* This function instead of gpio_free() should be used to manually
* free GPIOs allocated with devm_gpio_request().
*/
void devm_gpio_free(struct device *dev, unsigned int gpio)
{
WARN_ON(devres_release(dev, devm_gpio_release, devm_gpio_match,
&gpio));
}
EXPORT_SYMBOL_GPL(devm_gpio_free);
static void devm_gpio_chip_release(void *data) static void devm_gpio_chip_release(void *data)
{ {
struct gpio_chip *gc = data; struct gpio_chip *gc = data;
......
...@@ -95,7 +95,6 @@ struct device; ...@@ -95,7 +95,6 @@ struct device;
int devm_gpio_request(struct device *dev, unsigned gpio, const char *label); int devm_gpio_request(struct device *dev, unsigned gpio, const char *label);
int devm_gpio_request_one(struct device *dev, unsigned gpio, int devm_gpio_request_one(struct device *dev, unsigned gpio,
unsigned long flags, const char *label); unsigned long flags, const char *label);
void devm_gpio_free(struct device *dev, unsigned int gpio);
#else /* ! CONFIG_GPIOLIB */ #else /* ! CONFIG_GPIOLIB */
...@@ -240,11 +239,6 @@ static inline int devm_gpio_request_one(struct device *dev, unsigned gpio, ...@@ -240,11 +239,6 @@ static inline int devm_gpio_request_one(struct device *dev, unsigned gpio,
return -EINVAL; return -EINVAL;
} }
static inline void devm_gpio_free(struct device *dev, unsigned int gpio)
{
WARN_ON(1);
}
#endif /* ! CONFIG_GPIOLIB */ #endif /* ! CONFIG_GPIOLIB */
#endif /* __LINUX_GPIO_H */ #endif /* __LINUX_GPIO_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment