Re: [PATCH 3/3] pinctrl: bcm: Use pinconf_generic_dt_free_map in brcmstb
From: Andrea della Porta
Date: Thu Nov 12 2026 - 07:30:35 EST
Hi Wang,
On 07:06 Fri 06 Nov , Wang Xiaolei wrote:
> Replace the hand-written dt_free_map callback with the generic
> pinconf_generic_dt_free_map() helper, which wraps
> pinctrl_utils_free_map(). This drops the duplicated free loop and
> pairs the callback with the pinconf_generic_dt_node_to_map_all()
> already used for dt_node_to_map.
>
> The driver already selects GENERIC_PINCONF, so no Kconfig change is
> needed.
>
> Cc: Jonathan Bell <jonathan@xxxxxxxxxxxxxxx>
> Cc: Phil Elwell <phil@xxxxxxxxxxxxxxx>
> Signed-off-by: Wang Xiaolei <wangxiaolei01@xxxxxxxxxxx>
Please CC:stable.
Reviewed-by: Andrea della Porta <andrea.porta@xxxxxxxx>
Many thanks,
Andrea
> ---
> drivers/pinctrl/bcm/pinctrl-brcmstb.c | 15 +--------------
> 1 file changed, 1 insertion(+), 14 deletions(-)
>
> diff --git a/drivers/pinctrl/bcm/pinctrl-brcmstb.c b/drivers/pinctrl/bcm/pinctrl-brcmstb.c
> index 2b942ca7196b..e81c5b295a05 100644
> --- a/drivers/pinctrl/bcm/pinctrl-brcmstb.c
> +++ b/drivers/pinctrl/bcm/pinctrl-brcmstb.c
> @@ -180,26 +180,13 @@ static void brcmstb_pctl_pin_dbg_show(struct pinctrl_dev *pctldev,
> seq_printf(s, "function %s", fname);
> }
>
> -static void brcmstb_pctl_dt_free_map(struct pinctrl_dev *pctldev,
> - struct pinctrl_map *maps,
> - unsigned int num_maps)
> -{
> - int i;
> -
> - for (i = 0; i < num_maps; i++)
> - if (maps[i].type == PIN_MAP_TYPE_CONFIGS_PIN)
> - kfree(maps[i].data.configs.configs);
> -
> - kfree(maps);
> -}
> -
> static const struct pinctrl_ops brcmstb_pctl_ops = {
> .get_groups_count = brcmstb_pctl_get_groups_count,
> .get_group_name = brcmstb_pctl_get_group_name,
> .get_group_pins = brcmstb_pctl_get_group_pins,
> .pin_dbg_show = brcmstb_pctl_pin_dbg_show,
> .dt_node_to_map = pinconf_generic_dt_node_to_map_all,
> - .dt_free_map = brcmstb_pctl_dt_free_map,
> + .dt_free_map = pinconf_generic_dt_free_map,
> };
>
> static int brcmstb_pmx_free(struct pinctrl_dev *pctldev, unsigned int offset)
> --
> 2.34.1
>