Re: [PATCH] drivers: Remove unused devm_*_put functions
From: Linus Walleij <hidden>
Date: 2014-01-02 13:07:28
Also in:
linux-pwm, lkml
On Sat, Dec 21, 2013 at 11:49 AM, Rashika Kheria [off-list ref] wrote:
Remove unused devm_*_put functions because none of them are used anywhere in the kernel and devm does automatic cleanup of resources and requires no manual cleanup. Signed-off-by: Rashika Kheria <redacted> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
drivers/gpio/devres.c | 25 ------------------------- include/linux/gpio/consumer.h | 9 ---------
Can you please split these two hunks on the patch into a separate patch I can apply to the GPIO tree?
-static int devm_gpiod_match(struct device *dev, void *res, void *data)
-{
- struct gpio_desc **this = res, **gpio = data;
-
- return *this == *gpio;
-}(...)
-/**
- * devm_gpiod_put - Resource-managed gpiod_put()
- * @desc: GPIO descriptor to dispose of
- *
- * Dispose of a GPIO descriptor obtained with devm_gpiod_get() or
- * devm_gpiod_get_index(). Normally this function will not be called as the GPIO
- * will be disposed of by the resource management code.
- */
-void devm_gpiod_put(struct device *dev, struct gpio_desc *desc)
-{
- WARN_ON(devres_release(dev, devm_gpiod_release, devm_gpiod_match,
- &desc));
-}
-EXPORT_SYMBOL(devm_gpiod_put);Alexandre what do you think about this? Can we think of a scenario where explicit garbage collection is going to be needed or should we remove this for now? Yours, Linus Walleij