Commit e3e89ae4 authored by Laurent Pinchart's avatar Laurent Pinchart

sh-pfc: Drop the sh_pfc_pinctrl spinlock

The spinlock is used to protect data that is only accessed sequentially
during initialization. Remove it.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 942785db
...@@ -37,8 +37,6 @@ struct sh_pfc_pinctrl { ...@@ -37,8 +37,6 @@ struct sh_pfc_pinctrl {
struct pinctrl_pin_desc *pads; struct pinctrl_pin_desc *pads;
unsigned int nr_pads; unsigned int nr_pads;
spinlock_t lock;
}; };
static int sh_pfc_get_groups_count(struct pinctrl_dev *pctldev) static int sh_pfc_get_groups_count(struct pinctrl_dev *pctldev)
...@@ -321,7 +319,6 @@ static void sh_pfc_map_one_gpio(struct sh_pfc *pfc, struct sh_pfc_pinctrl *pmx, ...@@ -321,7 +319,6 @@ static void sh_pfc_map_one_gpio(struct sh_pfc *pfc, struct sh_pfc_pinctrl *pmx,
struct pinmux_gpio *gpio, unsigned offset) struct pinmux_gpio *gpio, unsigned offset)
{ {
struct pinmux_data_reg *dummy; struct pinmux_data_reg *dummy;
unsigned long flags;
int bit; int bit;
gpio->flags &= ~PINMUX_FLAG_TYPE; gpio->flags &= ~PINMUX_FLAG_TYPE;
...@@ -330,10 +327,7 @@ static void sh_pfc_map_one_gpio(struct sh_pfc *pfc, struct sh_pfc_pinctrl *pmx, ...@@ -330,10 +327,7 @@ static void sh_pfc_map_one_gpio(struct sh_pfc *pfc, struct sh_pfc_pinctrl *pmx,
gpio->flags |= PINMUX_TYPE_GPIO; gpio->flags |= PINMUX_TYPE_GPIO;
else { else {
gpio->flags |= PINMUX_TYPE_FUNCTION; gpio->flags |= PINMUX_TYPE_FUNCTION;
spin_lock_irqsave(&pmx->lock, flags);
pmx->nr_functions++; pmx->nr_functions++;
spin_unlock_irqrestore(&pmx->lock, flags);
} }
} }
...@@ -381,7 +375,6 @@ static int sh_pfc_map_gpios(struct sh_pfc *pfc, struct sh_pfc_pinctrl *pmx) ...@@ -381,7 +375,6 @@ static int sh_pfc_map_gpios(struct sh_pfc *pfc, struct sh_pfc_pinctrl *pmx)
static int sh_pfc_map_functions(struct sh_pfc *pfc, struct sh_pfc_pinctrl *pmx) static int sh_pfc_map_functions(struct sh_pfc *pfc, struct sh_pfc_pinctrl *pmx)
{ {
unsigned long flags;
int i, fn; int i, fn;
pmx->functions = devm_kzalloc(pfc->dev, pmx->nr_functions * pmx->functions = devm_kzalloc(pfc->dev, pmx->nr_functions *
...@@ -389,8 +382,6 @@ static int sh_pfc_map_functions(struct sh_pfc *pfc, struct sh_pfc_pinctrl *pmx) ...@@ -389,8 +382,6 @@ static int sh_pfc_map_functions(struct sh_pfc *pfc, struct sh_pfc_pinctrl *pmx)
if (unlikely(!pmx->functions)) if (unlikely(!pmx->functions))
return -ENOMEM; return -ENOMEM;
spin_lock_irqsave(&pmx->lock, flags);
for (i = fn = 0; i < pmx->nr_pads; i++) { for (i = fn = 0; i < pmx->nr_pads; i++) {
struct pinmux_gpio *gpio = pfc->info->gpios + i; struct pinmux_gpio *gpio = pfc->info->gpios + i;
...@@ -398,8 +389,6 @@ static int sh_pfc_map_functions(struct sh_pfc *pfc, struct sh_pfc_pinctrl *pmx) ...@@ -398,8 +389,6 @@ static int sh_pfc_map_functions(struct sh_pfc *pfc, struct sh_pfc_pinctrl *pmx)
pmx->functions[fn++] = gpio; pmx->functions[fn++] = gpio;
} }
spin_unlock_irqrestore(&pmx->lock, flags);
return 0; return 0;
} }
...@@ -412,8 +401,6 @@ int sh_pfc_register_pinctrl(struct sh_pfc *pfc) ...@@ -412,8 +401,6 @@ int sh_pfc_register_pinctrl(struct sh_pfc *pfc)
if (unlikely(!pmx)) if (unlikely(!pmx))
return -ENOMEM; return -ENOMEM;
spin_lock_init(&pmx->lock);
pmx->pfc = pfc; pmx->pfc = pfc;
pfc->pinctrl = pmx; pfc->pinctrl = pmx;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment