[lkml]   [2020]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v4 02/13] gpiolib: have a single place of calling set_config()
On Mon, Jan 20, 2020 at 09:44:43AM +0100, Geert Uytterhoeven wrote:
> On Tue, Dec 24, 2019 at 1:08 PM Bartosz Golaszewski <> wrote:
> > From: Bartosz Golaszewski <>
> >
> > Instead of calling the gpiochip's set_config() callback directly and
> > checking its existence every time - just add a new routine that performs
> > this check internally. Call it in gpio_set_config() and
> > gpiod_set_transitory(). Also call it in gpiod_set_debounce() and drop
> > the check for chip->set() as it's irrelevant to this config option.


> > config = PIN_CONF_PACKED(mode, arg);
> > - return gc->set_config ? gc->set_config(gc, offset, config) : -ENOTSUPP;
> > + return gpio_do_set_config(gc, offset, mode);
> These two lines are not equivalent: the new code no longer uses the
> packed value of mode and arg!

Good catch!
It's a regression (pin control drivers expects arg to be 1 in case it has been
called thru GPIO framework to set "default" values in terms of certain driver)
and below mentioned commits must be reverted. This one seems has a typo which
must be fixed.

> Hence this leads to subsequent cleanups in commits e5e42ad224a040f9
> ("gpiolib: remove set but not used variable 'config'") and d18fddff061d2796
> ("gpiolib: Remove duplicated function gpio_do_set_config()").

> However, what was the purpose of the PIN_CONF_PACKED() translation?
> Why is it no longer needed?

With Best Regards,
Andy Shevchenko

 \ /
  Last update: 2020-01-20 10:55    [W:0.368 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site