lkml.org 
[lkml]   [2021]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 1/3] gpio: regmap: Support few IC specific operations
Date

On Fri, 2021-05-21 at 13:09 +0300, Andy Shevchenko wrote:
> On Fri, May 21, 2021 at 12:53 PM Matti Vaittinen
> <matti.vaittinen@fi.rohmeurope.com> wrote:
> > The set_config and init_valid_mask GPIO operations are usually very
> > IC
> > specific. Allow IC drivers to provide these custom operations at
> > gpio-regmap registration.
>
> Thanks for this. In general (from design p.o.v.) looks good to me,
> one
> question below, though.
>
> > Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
> >
> > ---
> > Changelog v2: (based on suggestions by Michael Walle)
> > - drop gpio_regmap_set_drvdata()
>
> But why do we have gpio_regmap_get_drvdata()

I was thinking the drivers might still need to get the drvdata. But now
I don't see how they could easily get it via this API. Yes, the
regmap_gpio struct (which is used to obtain the data via this API) is
returned by the registration - but the only place where IC driver could
store this is in the drvdata :) So yes, this is next to useless now.

Sure this API could be used in probe, after the registration - but
there the driver should have access to drvdata and config anyways.

I'll drop also the gpio_regmap_get_drvdata() in next version. Thanks
for pointing this out.

> and why is it different
> now to the new member handling?

Hmm. I am unsure what you mean by this?

>
> > - drop checks and WARN() for pretty much impossible cases

\
 
 \ /
  Last update: 2021-05-21 12:21    [W:0.074 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site