Skip to content

Commit

Permalink
staging: mt7621-pinctrl: make use of pinctrl_utils_free_map
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sergio Paracuellos authored and Greg Kroah-Hartman committed Jul 6, 2018
1 parent a2a678b commit 39a30ef
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 39a30ef

Please sign in to comment.