Commit 1c176d53 authored by Wolfram Sang's avatar Wolfram Sang Committed by Wolfram Sang

i2c: rcar: not everything needs to be a function

Very basic operations, just called once, can also go to the caller.
Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 90104d06
...@@ -312,18 +312,9 @@ static int rcar_i2c_clock_calculate(struct rcar_i2c_priv *priv, ...@@ -312,18 +312,9 @@ static int rcar_i2c_clock_calculate(struct rcar_i2c_priv *priv,
return 0; return 0;
} }
static void rcar_i2c_clock_start(struct rcar_i2c_priv *priv)
{
rcar_i2c_write(priv, ICCCR, priv->icccr);
}
/* /*
* status functions * status functions
*/ */
static u32 rcar_i2c_status_get(struct rcar_i2c_priv *priv)
{
return rcar_i2c_read(priv, ICMSR);
}
#define rcar_i2c_status_clear(priv) rcar_i2c_status_bit_clear(priv, 0xffffffff) #define rcar_i2c_status_clear(priv) rcar_i2c_status_bit_clear(priv, 0xffffffff)
static void rcar_i2c_status_bit_clear(struct rcar_i2c_priv *priv, u32 bit) static void rcar_i2c_status_bit_clear(struct rcar_i2c_priv *priv, u32 bit)
...@@ -480,7 +471,7 @@ static irqreturn_t rcar_i2c_irq(int irq, void *ptr) ...@@ -480,7 +471,7 @@ static irqreturn_t rcar_i2c_irq(int irq, void *ptr)
/*-------------- spin lock -----------------*/ /*-------------- spin lock -----------------*/
spin_lock(&priv->lock); spin_lock(&priv->lock);
msr = rcar_i2c_status_get(priv); msr = rcar_i2c_read(priv, ICMSR);
/* /*
* Arbitration lost * Arbitration lost
...@@ -554,7 +545,8 @@ static int rcar_i2c_master_xfer(struct i2c_adapter *adap, ...@@ -554,7 +545,8 @@ static int rcar_i2c_master_xfer(struct i2c_adapter *adap,
spin_lock_irqsave(&priv->lock, flags); spin_lock_irqsave(&priv->lock, flags);
rcar_i2c_init(priv); rcar_i2c_init(priv);
rcar_i2c_clock_start(priv); /* start clock */
rcar_i2c_write(priv, ICCCR, priv->icccr);
spin_unlock_irqrestore(&priv->lock, flags); spin_unlock_irqrestore(&priv->lock, flags);
/*-------------- spin unlock -----------------*/ /*-------------- spin unlock -----------------*/
......
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