Re: [PATCH 2/5] pinctrl: pinmux: Return selector to the pinctrl driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 15, 2018 at 2:15 PM Tony Lindgren <tony@xxxxxxxxxxx> 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@xxxxxxxxxxxxx>
> Cc: Haojian Zhuang <haojian.zhuang@xxxxxxxxxx>
> Cc: Jacopo Mondi <jacopo+renesas@xxxxxxxxxx>
> Cc: Paul Cercueil <paul@xxxxxxxxxxxxxxx>
> Cc: Sean Wang <sean.wang@xxxxxxxxxxxx>
> Signed-off-by: Tony Lindgren <tony@xxxxxxxxxxx>
> ---
>  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
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux