Re: [PATCH] gpio: adp5588: Remove support for platform setup and teardown callbacks

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

 



On Mon, May 23, 2022 at 11:09 AM Uwe Kleine-König
<u.kleine-koenig@xxxxxxxxxxxxxx> wrote:
> On Mon, May 23, 2022 at 10:43:20AM +0200, Linus Walleij wrote:
> > On Mon, May 23, 2022 at 10:40 AM Uwe Kleine-König
> > <u.kleine-koenig@xxxxxxxxxxxxxx> wrote:
> >
> > > If the teardown callback failed in the gpio driver, it fails to free the
> > > irq (if there is one). The device is removed anyhow. If later on the irq
> > > triggers, all sorts of unpleasant things might happen (e.g. accessing
> > > the struct adp5588_gpio which is already freed in the meantime or starting
> > > i2c bus transfers for an unregistered device). Even before irq support was
> > > added to this driver, exiting early was wrong; back then it failed to
> > > unregister the gpiochip.
> > >
> > > Fortunately these callbacks aren't used any more since at least blackfin
> > > was removed in 2018. So just drop them.
> > >
> > > Note that they are not removed from struct adp5588_gpio_platform_data
> > > because the keyboard driver adp5588-keys.c also makes use of them.
> > > (I didn't check if the callbacks might have been called twice, maybe there
> > > is another reason hidden to better not call these functions.)
> > >
> > > This patch is a preparation for making i2c remove callbacks return void.
> > >
> > > Fixes: 80884094e344 ("gpio: adp5588-gpio: new driver for ADP5588 GPIO expanders")
> > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
> >
> > Good riddance!
> > But also remove the setup and teardown prototypes in
> > include/linux/platform_data/adp5588.h
>
> Please reread the commit log. They were not remove on purpose. If you
> missed that part, you also missed half of the "fun". :-P

Ugh never review patches before the second cup of coffee.
What a weird reuse of callbacks. Oh well they are not so weird after
this.
Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>

Yours,
Linus Walleij




[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