Skip to content

Commit 48207d7

Browse files
Uwe Kleine-KönigLinus Walleij
authored andcommitted
gpio: drop devm_gpiochip_remove()
There is hardly any reason to call devm_gpiochip_remove() because the driver core handles calling gpiochip_remove() automatically. To make it harder to introduce new (and probably unneeded) callers, drop the function. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 2545194 commit 48207d7

3 files changed

Lines changed: 1 addition & 19 deletions

File tree

‎Documentation/driver-model/devres.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ GPIO
255255
devm_gpiod_get_optional()
256256
devm_gpiod_put()
257257
devm_gpiochip_add_data()
258-
devm_gpiochip_remove()
259258
devm_gpio_request()
260259
devm_gpio_request_one()
261260
devm_gpio_free()

‎drivers/gpio/gpiolib.c‎

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,6 +1524,7 @@ static int devm_gpio_chip_match(struct device *dev, void *res, void *data)
15241524
return *r == data;
15251525
}
15261526

1527+
15271528
/**
15281529
* devm_gpiochip_add_data() - Resource manager gpiochip_add_data()
15291530
* @dev: pointer to the device that gpio_chip belongs to.
@@ -1563,23 +1564,6 @@ int devm_gpiochip_add_data(struct device *dev, struct gpio_chip *chip,
15631564
}
15641565
EXPORT_SYMBOL_GPL(devm_gpiochip_add_data);
15651566

1566-
/**
1567-
* devm_gpiochip_remove() - Resource manager of gpiochip_remove()
1568-
* @dev: device for which which resource was allocated
1569-
* @chip: the chip to remove
1570-
*
1571-
* A gpio_chip with any GPIOs still requested may not be removed.
1572-
*/
1573-
void devm_gpiochip_remove(struct device *dev, struct gpio_chip *chip)
1574-
{
1575-
int ret;
1576-
1577-
ret = devres_release(dev, devm_gpio_chip_release,
1578-
devm_gpio_chip_match, chip);
1579-
WARN_ON(ret);
1580-
}
1581-
EXPORT_SYMBOL_GPL(devm_gpiochip_remove);
1582-
15831567
/**
15841568
* gpiochip_find() - iterator for locating a specific gpio_chip
15851569
* @data: data to pass to match function

‎include/linux/gpio/driver.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,6 @@ static inline int gpiochip_add(struct gpio_chip *chip)
422422
extern void gpiochip_remove(struct gpio_chip *chip);
423423
extern int devm_gpiochip_add_data(struct device *dev, struct gpio_chip *chip,
424424
void *data);
425-
extern void devm_gpiochip_remove(struct device *dev, struct gpio_chip *chip);
426425

427426
extern struct gpio_chip *gpiochip_find(void *data,
428427
int (*match)(struct gpio_chip *chip, void *data));

0 commit comments

Comments
 (0)