Re: [PATCH 2/2] gpio: drop devm_gpiochip_remove()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Pavel,

On Sat, Oct 06, 2018 at 10:05:57PM +0200, Pavel Machek wrote:
> On Fri 2018-10-05 21:42:06, Uwe Kleine-König wrote:
> > 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@xxxxxxxxxxxxxx>
> > ---
> >  Documentation/driver-model/devres.txt |  1 -
> >  drivers/gpio/gpiolib.c                | 18 +-----------------
> >  include/linux/gpio/driver.h           |  1 -
> >  3 files changed, 1 insertion(+), 19 deletions(-)
> > 
> > diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt
> > index 7c1bb3d0c222..3f74d645abfa 100644
> > --- a/Documentation/driver-model/devres.txt
> > +++ b/Documentation/driver-model/devres.txt
> > @@ -254,7 +254,6 @@ GPIO
> >    devm_gpiod_get_optional()
> >    devm_gpiod_put()
> >    devm_gpiochip_add_data()
> > -  devm_gpiochip_remove()
> >    devm_gpio_request()
> >    devm_gpio_request_one()
> >    devm_gpio_free()
> 
> There's more than one "free" function here, and perhaps this is useful
> in some cases... Dunno. Renaming to make people think twice sounds ok,
> but I'm not sure if outright removal is good idea.

There is currently no user, so there is (IMHO) no good reason to spend
.text memory for it. If at some point there is a valid usecase for it,
it's a good hurdle to reintroduce this function to make reviewer check
if the case is really valid.

I also started grepping for devm_gpio_free, and it think the only user
(if we let staging aside) could also be fixed to not make use of it.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux