lkml.org 
[lkml]   [2022]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/4] Input: adp5588-keys - switch to using managed resources
On Sat, May 28, 2022 at 10:22:07PM -0700, Dmitry Torokhov wrote:
> On Sat, May 28, 2022 at 09:37:55PM +0200, Uwe Kleine-König wrote:
> > On Fri, May 27, 2022 at 09:56:30PM -0700, Dmitry Torokhov wrote:
> > > This simplifies error handling in probe() and reduces amount of explicit
> > > code in remove().
> > >
> > > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > > ---
> > > drivers/input/keyboard/adp5588-keys.c | 111 +++++++++++---------------
> > > 1 file changed, 45 insertions(+), 66 deletions(-)
> > >
> > > diff --git a/drivers/input/keyboard/adp5588-keys.c b/drivers/input/keyboard/adp5588-keys.c
> > > index ac21873ba1d7..df84a2998ed2 100644
> > > --- a/drivers/input/keyboard/adp5588-keys.c
> > > +++ b/drivers/input/keyboard/adp5588-keys.c
> > > @@ -182,6 +182,21 @@ static int adp5588_build_gpiomap(struct adp5588_kpad *kpad,
> > > return n_unused;
> > > }
> > >
> > > +static void adp5588_gpio_do_teardown(void *_kpad)
> > > +{
> > > + struct adp5588_kpad *kpad = _kpad;
> > > + struct device *dev = &kpad->client->dev;
> > > + const struct adp5588_kpad_platform_data *pdata = dev_get_platdata(dev);
> > > + const struct adp5588_gpio_platform_data *gpio_data = pdata->gpio_data;
> > > + int error;
> > > +
> > > + error = gpio_data->teardown(kpad->client,
> > > + kpad->gc.base, kpad->gc.ngpio,
> > > + gpio_data->context);
> > > + if (error)
> > > + dev_warn(&kpad->client->dev, "teardown failed %d\n", error);
> > > +}
> >
> > I think the more sensible approach is to drop support for setup and
> > teardown. Maybe even rip all usage of adp5588_gpio_platform_data.
>
> That will come with the transition to device tree/device properties. For
> now wanted to keep existing functionality intact.

That's up to you. I wouldn't spend an effort to clean up a feature that
is about to be removed.

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2022-05-29 08:12    [W:0.049 / U:1.812 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site