diff mbox series

pinctrl: rza1: Remove unneeded spinlock acquisitions

Message ID 20190320102629.19865-1-geert+renesas@glider.be
State New
Headers show
Series pinctrl: rza1: Remove unneeded spinlock acquisitions | expand

Commit Message

Geert Uytterhoeven March 20, 2019, 10:26 a.m. UTC
rza1_get_bit() is just a single register read.  Hence there's no need to
synchronize it with other register writes to the same bank.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
To be queued in sh-pfc-for-v5.2.

 drivers/pinctrl/pinctrl-rza1.c | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

Comments

Jacopo Mondi March 21, 2019, 2:24 p.m. UTC | #1
Hi Geert,

On Wed, Mar 20, 2019 at 11:26:29AM +0100, Geert Uytterhoeven wrote:
> rza1_get_bit() is just a single register read.  Hence there's no need to
> synchronize it with other register writes to the same bank.
>

Thanks, no need to protect that single register access.
I assume you've been carrying this patch in your tree for your RSKRZA1
recent developments.

Acked-by: Jacopo Mondi <jacopo@jmondi.org>

Thanks
   j

> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> To be queued in sh-pfc-for-v5.2.
>
>  drivers/pinctrl/pinctrl-rza1.c | 18 ++----------------
>  1 file changed, 2 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/pinctrl/pinctrl-rza1.c b/drivers/pinctrl/pinctrl-rza1.c
> index 9cfe9d0520acaf61..021e37b7689e4fda 100644
> --- a/drivers/pinctrl/pinctrl-rza1.c
> +++ b/drivers/pinctrl/pinctrl-rza1.c
> @@ -620,14 +620,7 @@ static void rza1_pin_reset(struct rza1_port *port, unsigned int pin)
>  static inline int rza1_pin_get_direction(struct rza1_port *port,
>  					 unsigned int pin)
>  {
> -	unsigned long irqflags;
> -	int input;
> -
> -	spin_lock_irqsave(&port->lock, irqflags);
> -	input = rza1_get_bit(port, RZA1_PM_REG, pin);
> -	spin_unlock_irqrestore(&port->lock, irqflags);
> -
> -	return !!input;
> +	return !!rza1_get_bit(port, RZA1_PM_REG, pin);
>  }
>
>  /**
> @@ -671,14 +664,7 @@ static inline void rza1_pin_set(struct rza1_port *port, unsigned int pin,
>
>  static inline int rza1_pin_get(struct rza1_port *port, unsigned int pin)
>  {
> -	unsigned long irqflags;
> -	int val;
> -
> -	spin_lock_irqsave(&port->lock, irqflags);
> -	val = rza1_get_bit(port, RZA1_PPR_REG, pin);
> -	spin_unlock_irqrestore(&port->lock, irqflags);
> -
> -	return val;
> +	return rza1_get_bit(port, RZA1_PPR_REG, pin);
>  }
>
>  /**
> --
> 2.17.1
>
diff mbox series

Patch

diff --git a/drivers/pinctrl/pinctrl-rza1.c b/drivers/pinctrl/pinctrl-rza1.c
index 9cfe9d0520acaf61..021e37b7689e4fda 100644
--- a/drivers/pinctrl/pinctrl-rza1.c
+++ b/drivers/pinctrl/pinctrl-rza1.c
@@ -620,14 +620,7 @@  static void rza1_pin_reset(struct rza1_port *port, unsigned int pin)
 static inline int rza1_pin_get_direction(struct rza1_port *port,
 					 unsigned int pin)
 {
-	unsigned long irqflags;
-	int input;
-
-	spin_lock_irqsave(&port->lock, irqflags);
-	input = rza1_get_bit(port, RZA1_PM_REG, pin);
-	spin_unlock_irqrestore(&port->lock, irqflags);
-
-	return !!input;
+	return !!rza1_get_bit(port, RZA1_PM_REG, pin);
 }
 
 /**
@@ -671,14 +664,7 @@  static inline void rza1_pin_set(struct rza1_port *port, unsigned int pin,
 
 static inline int rza1_pin_get(struct rza1_port *port, unsigned int pin)
 {
-	unsigned long irqflags;
-	int val;
-
-	spin_lock_irqsave(&port->lock, irqflags);
-	val = rza1_get_bit(port, RZA1_PPR_REG, pin);
-	spin_unlock_irqrestore(&port->lock, irqflags);
-
-	return val;
+	return rza1_get_bit(port, RZA1_PPR_REG, pin);
 }
 
 /**