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] [day] [month] [year] [list]
Message-ID: <CACRpkdaZ=3AsT9NiOKrwEDWXReDX0w_PsdgwC6fqSb4Yecry-g@mail.gmail.com>
Date:   Tue, 25 May 2021 02:06:43 +0200
From:   Linus Walleij <linus.walleij@...aro.org>
To:     Jianqun Xu <jay.xu@...k-chips.com>
Cc:     Heiko Stübner <heiko@...ech.de>,
        Rob Herring <robh+dt@...nel.org>,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        "open list:ARM/Rockchip SoC..." <linux-rockchip@...ts.infradead.org>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/7] gpio: separate gpio driver from pinctrl-rockchip driver

On Mon, May 10, 2021 at 8:36 AM Jianqun Xu <jay.xu@...k-chips.com> wrote:

> Separate the gpio driver from the pinctrl driver.
>
> Signed-off-by: Jianqun Xu <jay.xu@...k-chips.com>

Overall this is very good and should be applied.

> +#include "../pinctrl/core.h"
> +#include "../pinctrl/pinctrl-rockchip.h"

Please explain in a comment exactly why you need to include
these files. I think it should be the goal to get rid of this dependency.

It seems that the driver can be further simplified using GPIO_GENERIC
but we can deal with this later, once it is separate.

> +static int rockchip_gpio_set_config(struct gpio_chip *gc, unsigned int offset,
> +                                 unsigned long config)
> +{
> +       enum pin_config_param param = pinconf_to_config_param(config);
> +
> +       switch (param) {
> +       case PIN_CONFIG_INPUT_DEBOUNCE:
> +               rockchip_gpio_set_debounce(gc, offset, true);
(...)
> +       .set_config = rockchip_gpio_set_config,

Can't you just use gpiochip_generic_config() and rely on the pinctrl
back-end to deal with this?

> +       .to_irq = rockchip_gpio_to_irq,

Normally this should not be needed with GPIOLIB_IRQCHIP but
since you are refactoring an existing driver it is acceptable to
keep for now.

Yours,
Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ