lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VfK6Z+Dw44Z4eP-45hK4ipCxrkbj1ifJnmZ3ooZ+ksP-A@mail.gmail.com>
Date:   Tue, 3 Oct 2023 18:08:15 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Bartosz Golaszewski <brgl@...ev.pl>
Cc:     Linus Walleij <linus.walleij@...aro.org>,
        Andy Shevchenko <andy@...nel.org>, linux-gpio@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH 02/36] pinctrl: provide new GPIO-to-pinctrl glue helpers

On Tue, Oct 3, 2023 at 5:51 PM Bartosz Golaszewski <brgl@...ev.pl> wrote:
>
> From: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
>
> Currently the pinctrl GPIO helpers all take a number from the global
> GPIO numberspace - of which we're trying to get rid of as argument.
>
> These helpers are almost universally called from GPIOLIB driver
> callbacks which take a pointer to the backing gpio_chip and the
> controller-relative offset as arguments.
>
> Let's provide improved variants of these functions that match the
> GPIOLIB signatures as the first step in removing the older flavor.

...

> +#include <linux/gpio/driver.h>

+ blank line here

>  #include <linux/pinctrl/consumer.h>
>  #include <linux/pinctrl/devinfo.h>
>  #include <linux/pinctrl/machine.h>

...

>  EXPORT_SYMBOL_GPL(pinctrl_gpio_can_use_line);

> +/* This function is deprecated and will be removed. Don't use. */

Shouldn't the same / similar comment be added to
pinctrl_gpio_can_use_line() above?

...

> + * pinctrl_gpio_request_new() - request a single pin to be used as GPIO

"new" is too broad and too odd suffix, what I would see as a better
alternative(s) is (are):

pinctrl_gpiochip_request()
pinctrl_gpio_chip_request()
pinctrl_gc_request()

(sorted by personal preference from high to low).

The similar comment to all of them.

...

>   * This function should *ONLY* be used from gpiolib-based GPIO drivers,
> - * as part of their gpio_free() semantics, platforms and individual drivers
> - * shall *NOT* request GPIO pins to be muxed out.
> + * as part of their gpio_request() semantics, platforms and individual drivers
> + * shall *NOT* request GPIO pins to be muxed in.

Hmm... This looks like a fix to the previous code that can even be backported.

>   */

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ