diff mbox

[v2,3/3] i2c-rcar: make rcar_i2c_irq_recv() *void*

Message ID 19871938.mRdZLUD6Mv@wasted.cogentembedded.com (mailing list archive)
State Awaiting Upstream
Headers show

Commit Message

Sergei Shtylyov Sept. 14, 2014, 8:17 p.m. UTC
rcar_i2c_irq_recv() always returns 0, so we can make this function return
*void* and also remove rcar_i2c_flags_set() invocation in rcar_i2c_irq().

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
Changes in version 2:
- refreshed patch.

 drivers/i2c/busses/i2c-rcar.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Wolfram Sang Sept. 20, 2014, 9:45 a.m. UTC | #1
On Mon, Sep 15, 2014 at 12:17:34AM +0400, Sergei Shtylyov wrote:
> rcar_i2c_irq_recv() always returns 0, so we can make this function return
> *void* and also remove rcar_i2c_flags_set() invocation in rcar_i2c_irq().
> 
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

I prefer to skip this patch to have more similarity between the
send_irq and recv_irq routines.
diff mbox

Patch

Index: linux/drivers/i2c/busses/i2c-rcar.c
===================================================================
--- linux.orig/drivers/i2c/busses/i2c-rcar.c
+++ linux/drivers/i2c/busses/i2c-rcar.c
@@ -319,7 +319,7 @@  static int rcar_i2c_irq_send(struct rcar
 	return 0;
 }
 
-static int rcar_i2c_irq_recv(struct rcar_i2c_priv *priv, u32 msr)
+static void rcar_i2c_irq_recv(struct rcar_i2c_priv *priv, u32 msr)
 {
 	struct i2c_msg *msg = priv->msg;
 
@@ -329,7 +329,7 @@  static int rcar_i2c_irq_recv(struct rcar
 	 * Do nothing
 	 */
 	if (!(msr & MDR))
-		return 0;
+		return;
 
 	if (msr & MAT) {
 		/*
@@ -356,8 +356,6 @@  static int rcar_i2c_irq_recv(struct rcar
 		rcar_i2c_write(priv, ICMCR, RCAR_BUS_PHASE_DATA);
 
 	rcar_i2c_write(priv, ICMSR, RCAR_IRQ_ACK_RECV);
-
-	return 0;
 }
 
 static irqreturn_t rcar_i2c_irq(int irq, void *ptr)
@@ -395,7 +393,7 @@  static irqreturn_t rcar_i2c_irq(int irq,
 	}
 
 	if (rcar_i2c_is_recv(priv))
-		rcar_i2c_flags_set(priv, rcar_i2c_irq_recv(priv, msr));
+		rcar_i2c_irq_recv(priv, msr);
 	else
 		rcar_i2c_flags_set(priv, rcar_i2c_irq_send(priv, msr));