pinctrl: nuvoton: Use pinconf_generic_dt_node_to_map_all()
authorGeert Uytterhoeven <geert+renesas@glider.be>
Thu, 24 Aug 2023 10:07:44 +0000 (12:07 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 11 Sep 2023 13:47:05 +0000 (15:47 +0200)
Use the pinconf_generic_dt_node_to_map_all() helper instead of
open-coding the same operation, to avoid having to provide custom
pinctrl_ops.dt_node_to_map() callbacks.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Link: https://lore.kernel.org/r/81e9ab48f78d63153b23a163b3349b3059d2b7fc.1692871558.git.geert+renesas@glider.be
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c
drivers/pinctrl/nuvoton/pinctrl-wpcm450.c

index 843ffcd9687747744c10eb5711c7895978594b00..8bdd0124e2eb94679ff20a395172455f8f987429 100644 (file)
@@ -1588,19 +1588,6 @@ static int npcm7xx_get_group_pins(struct pinctrl_dev *pctldev,
        return 0;
 }
 
-static int npcm7xx_dt_node_to_map(struct pinctrl_dev *pctldev,
-                                 struct device_node *np_config,
-                                 struct pinctrl_map **map,
-                                 u32 *num_maps)
-{
-       struct npcm7xx_pinctrl *npcm = pinctrl_dev_get_drvdata(pctldev);
-
-       dev_dbg(npcm->dev, "dt_node_to_map: %s\n", np_config->name);
-       return pinconf_generic_dt_node_to_map(pctldev, np_config,
-                                             map, num_maps,
-                                             PIN_MAP_TYPE_INVALID);
-}
-
 static void npcm7xx_dt_free_map(struct pinctrl_dev *pctldev,
                                struct pinctrl_map *map, u32 num_maps)
 {
@@ -1612,7 +1599,7 @@ static const struct pinctrl_ops npcm7xx_pinctrl_ops = {
        .get_group_name = npcm7xx_get_group_name,
        .get_group_pins = npcm7xx_get_group_pins,
        .pin_dbg_show = npcm7xx_pin_dbg_show,
-       .dt_node_to_map = npcm7xx_dt_node_to_map,
+       .dt_node_to_map = pinconf_generic_dt_node_to_map_all,
        .dt_free_map = npcm7xx_dt_free_map,
 };
 
index 2d1c1652cfd9d373dc5afde3a1a5cbddb50a4a56..6e88ef1ed020fa88788528f5d6036093fc6651a6 100644 (file)
@@ -858,16 +858,6 @@ static int wpcm450_get_group_pins(struct pinctrl_dev *pctldev,
        return 0;
 }
 
-static int wpcm450_dt_node_to_map(struct pinctrl_dev *pctldev,
-                                 struct device_node *np_config,
-                                 struct pinctrl_map **map,
-                                 u32 *num_maps)
-{
-       return pinconf_generic_dt_node_to_map(pctldev, np_config,
-                                             map, num_maps,
-                                             PIN_MAP_TYPE_INVALID);
-}
-
 static void wpcm450_dt_free_map(struct pinctrl_dev *pctldev,
                                struct pinctrl_map *map, u32 num_maps)
 {
@@ -878,7 +868,7 @@ static const struct pinctrl_ops wpcm450_pinctrl_ops = {
        .get_groups_count = wpcm450_get_groups_count,
        .get_group_name = wpcm450_get_group_name,
        .get_group_pins = wpcm450_get_group_pins,
-       .dt_node_to_map = wpcm450_dt_node_to_map,
+       .dt_node_to_map = pinconf_generic_dt_node_to_map_all,
        .dt_free_map = wpcm450_dt_free_map,
 };