[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Ve4BYRbFsJRiwA2D-gJzVBj7JD2dfGhHSP3NDYwhAQyMg@mail.gmail.com>
Date: Sun, 17 Jun 2018 19:51:17 +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 2/5] pinctrl: pinmux: Return selector to the pinctrl driver
On Fri, Jun 15, 2018 at 2:15 PM Tony Lindgren <tony@...mide.com> wrote:
>
> We must return the selector from pinmux_generic_add_function() 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: a76edc89b100 ("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/pinmux.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c
> --- a/drivers/pinctrl/pinmux.c
> +++ b/drivers/pinctrl/pinmux.c
> @@ -775,6 +775,7 @@ int pinmux_generic_add_function(struct pinctrl_dev *pctldev,
> void *data)
> {
> struct function_desc *function;
> + int selector = pctldev->num_functions;
>
> function = devm_kzalloc(pctldev->dev, sizeof(*function), GFP_KERNEL);
> if (!function)
> @@ -785,12 +786,12 @@ int pinmux_generic_add_function(struct pinctrl_dev *pctldev,
> function->num_group_names = num_groups;
> function->data = data;
>
> - radix_tree_insert(&pctldev->pin_function_tree, pctldev->num_functions,
> + radix_tree_insert(&pctldev->pin_function_tree, selector,
> function);
Same nit: One line now?
>
> pctldev->num_functions++;
>
> - return 0;
> + return selector;
> }
> EXPORT_SYMBOL_GPL(pinmux_generic_add_function);
>
> --
> 2.17.1
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists