summaryrefslogtreecommitdiff
path: root/drivers/staging/mt7621-pinctrl
diff options
context:
space:
mode:
authorSergio Paracuellos <sergio.paracuellos@gmail.com>2018-06-28 21:03:02 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-07-06 17:33:43 +0200
commit39a30ef33f99d4c685dd202be01c15ea496c7282 (patch)
tree760d38c3db6cfa100b3cebdf4ea85168afc7cf12 /drivers/staging/mt7621-pinctrl
parenta2a678b6972ce59dcffefd5d0a86bff07e67a9a2 (diff)
staging: mt7621-pinctrl: make use of pinctrl_utils_free_map
There was a custom 'rt2880_pinctrl_dt_free_map' function which it was doing the same as pinctrl_utils_free_map defined in 'pinctrl-utils.h' header file. Use it instead avoiding code duplications. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/mt7621-pinctrl')
-rw-r--r--drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
index bdee65c8f805..d08386601c73 100644
--- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
+++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
@@ -20,6 +20,7 @@
#include <asm/mach-ralink/mt7620.h>
#include "core.h"
+#include "pinctrl-utils.h"
#define SYSC_REG_GPIO_MODE 0x60
#define SYSC_REG_GPIO_MODE2 0x64
@@ -75,19 +76,6 @@ static int rt2880_get_group_pins(struct pinctrl_dev *pctrldev,
return 0;
}
-static void rt2880_pinctrl_dt_free_map(struct pinctrl_dev *pctrldev,
- struct pinctrl_map *map,
- unsigned int num_maps)
-{
- int i;
-
- for (i = 0; i < num_maps; i++)
- if (map[i].type == PIN_MAP_TYPE_CONFIGS_PIN ||
- map[i].type == PIN_MAP_TYPE_CONFIGS_GROUP)
- kfree(map[i].data.configs.configs);
- kfree(map);
-}
-
static void rt2880_pinctrl_pin_dbg_show(struct pinctrl_dev *pctrldev,
struct seq_file *s,
unsigned int offset)
@@ -158,7 +146,7 @@ static const struct pinctrl_ops rt2880_pctrl_ops = {
.get_group_pins = rt2880_get_group_pins,
.pin_dbg_show = rt2880_pinctrl_pin_dbg_show,
.dt_node_to_map = rt2880_pinctrl_dt_node_to_map,
- .dt_free_map = rt2880_pinctrl_dt_free_map,
+ .dt_free_map = pinctrl_utils_free_map,
};
static int rt2880_pmx_func_count(struct pinctrl_dev *pctrldev)