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: <CAHp75Vdi-9pEPYy3+hh9rw1-sMvmh7vahz_idug0XcMaCQh6=Q@mail.gmail.com>
Date:   Sun, 17 Jun 2018 19:50:46 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Tony Lindgren <tony@...mide.com>
Cc:     Linus Walleij <linus.walleij@...aro.org>,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Haojian Zhuang <haojian.zhuang@...aro.org>,
        Jacopo Mondi <jacopo+renesas@...ndi.org>,
        Paul Cercueil <paul@...pouillou.net>, sean.wang@...iatek.com
Subject: Re: [PATCH 1/5] pinctrl: core: Return selector to the pinctrl driver

On Fri, Jun 15, 2018 at 2:14 PM Tony Lindgren <tony@...mide.com> wrote:
>
> We must return the selector from pinctrl_generic_add_group() so
> pin controller device drivers can remove the right group if needed
> for deferred probe for example.
>
> Note that fixes are also needed for the pin controller drivers to
> use the selector value.
>
> Fixes: c7059c5ac70a ("pinctrl: core: Add generic pinctrl functions
> for managing groups")
> Reported-by: H. Nikolaus Schaller <hns@...delico.com>
> Cc: Haojian Zhuang <haojian.zhuang@...aro.org>
> Cc: Jacopo Mondi <jacopo+renesas@...ndi.org>
> Cc: Paul Cercueil <paul@...pouillou.net>
> Cc: Sean Wang <sean.wang@...iatek.com>
> Signed-off-by: Tony Lindgren <tony@...mide.com>
> ---
>  drivers/pinctrl/core.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
> --- a/drivers/pinctrl/core.c
> +++ b/drivers/pinctrl/core.c
> @@ -631,6 +631,7 @@ int pinctrl_generic_add_group(struct pinctrl_dev *pctldev, const char *name,
>                               int *pins, int num_pins, void *data)
>  {
>         struct group_desc *group;
> +       int selector = pctldev->num_groups;
>
>         group = devm_kzalloc(pctldev->dev, sizeof(*group), GFP_KERNEL);
>         if (!group)
> @@ -641,12 +642,12 @@ int pinctrl_generic_add_group(struct pinctrl_dev *pctldev, const char *name,
>         group->num_pins = num_pins;
>         group->data = data;
>
> -       radix_tree_insert(&pctldev->pin_group_tree, pctldev->num_groups,
> +       radix_tree_insert(&pctldev->pin_group_tree, selector,
>                           group);

A nit: Can it be now one line?

>
>         pctldev->num_groups++;
>
> -       return 0;
> +       return selector;
>  }
>  EXPORT_SYMBOL_GPL(pinctrl_generic_add_group);
>
> --
> 2.17.1



-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ