diff options
author | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> | 2014-09-14 16:20:19 -0400 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2014-09-29 16:41:18 -0400 |
commit | aa5beaf62588d095398415af5d0e14c79e2478a3 (patch) | |
tree | cdf1548680ed529ab8273090a13c371dc784958e /drivers/i2c | |
parent | 7c7117ffe08fd54d4129e378b46a812c717bae48 (diff) |
i2c: rcar: check for no IRQ in rcar_i2c_irq()
Check if the ICMSR register (masked with the ICMIER register) evaluates to 0 in
the driver's interrupt handler and return IRQ_NONE in that case, like many other
drivers do.
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-rcar.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c index c49b33e99d68..b694cba63807 100644 --- a/drivers/i2c/busses/i2c-rcar.c +++ b/drivers/i2c/busses/i2c-rcar.c | |||
@@ -363,6 +363,7 @@ static int rcar_i2c_irq_recv(struct rcar_i2c_priv *priv, u32 msr) | |||
363 | static irqreturn_t rcar_i2c_irq(int irq, void *ptr) | 363 | static irqreturn_t rcar_i2c_irq(int irq, void *ptr) |
364 | { | 364 | { |
365 | struct rcar_i2c_priv *priv = ptr; | 365 | struct rcar_i2c_priv *priv = ptr; |
366 | irqreturn_t result = IRQ_HANDLED; | ||
366 | u32 msr; | 367 | u32 msr; |
367 | 368 | ||
368 | /*-------------- spin lock -----------------*/ | 369 | /*-------------- spin lock -----------------*/ |
@@ -372,6 +373,10 @@ static irqreturn_t rcar_i2c_irq(int irq, void *ptr) | |||
372 | 373 | ||
373 | /* Only handle interrupts that are currently enabled */ | 374 | /* Only handle interrupts that are currently enabled */ |
374 | msr &= rcar_i2c_read(priv, ICMIER); | 375 | msr &= rcar_i2c_read(priv, ICMIER); |
376 | if (!msr) { | ||
377 | result = IRQ_NONE; | ||
378 | goto exit; | ||
379 | } | ||
375 | 380 | ||
376 | /* Arbitration lost */ | 381 | /* Arbitration lost */ |
377 | if (msr & MAL) { | 382 | if (msr & MAL) { |
@@ -406,10 +411,11 @@ out: | |||
406 | wake_up(&priv->wait); | 411 | wake_up(&priv->wait); |
407 | } | 412 | } |
408 | 413 | ||
414 | exit: | ||
409 | spin_unlock(&priv->lock); | 415 | spin_unlock(&priv->lock); |
410 | /*-------------- spin unlock -----------------*/ | 416 | /*-------------- spin unlock -----------------*/ |
411 | 417 | ||
412 | return IRQ_HANDLED; | 418 | return result; |
413 | } | 419 | } |
414 | 420 | ||
415 | static int rcar_i2c_master_xfer(struct i2c_adapter *adap, | 421 | static int rcar_i2c_master_xfer(struct i2c_adapter *adap, |