aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2014-05-28 03:44:43 -0400
committerWolfram Sang <wsa@the-dreams.de>2014-06-01 16:22:47 -0400
commit150b8be3cda54412ad7b54f5392b513b25c0aaa7 (patch)
tree24cbe0ce27e4474798d999e4acae2bbba7a3857b
parent3c95de674496e08d3b373f85af4aa59c23ddb8d6 (diff)
i2c: rcar: remove spinlock
The i2c core has per-adapter locks, so no need to protect again. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
-rw-r--r--drivers/i2c/busses/i2c-rcar.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
index 07256a6b56fa..e16784124a41 100644
--- a/drivers/i2c/busses/i2c-rcar.c
+++ b/drivers/i2c/busses/i2c-rcar.c
@@ -36,7 +36,6 @@
36#include <linux/platform_device.h> 36#include <linux/platform_device.h>
37#include <linux/pm_runtime.h> 37#include <linux/pm_runtime.h>
38#include <linux/slab.h> 38#include <linux/slab.h>
39#include <linux/spinlock.h>
40 39
41/* register offsets */ 40/* register offsets */
42#define ICSCR 0x00 /* slave ctrl */ 41#define ICSCR 0x00 /* slave ctrl */
@@ -110,7 +109,6 @@ struct rcar_i2c_priv {
110 struct i2c_msg *msg; 109 struct i2c_msg *msg;
111 struct clk *clk; 110 struct clk *clk;
112 111
113 spinlock_t lock;
114 wait_queue_head_t wait; 112 wait_queue_head_t wait;
115 113
116 int pos; 114 int pos;
@@ -394,9 +392,6 @@ static irqreturn_t rcar_i2c_irq(int irq, void *ptr)
394 struct device *dev = rcar_i2c_priv_to_dev(priv); 392 struct device *dev = rcar_i2c_priv_to_dev(priv);
395 u32 msr; 393 u32 msr;
396 394
397 /*-------------- spin lock -----------------*/
398 spin_lock(&priv->lock);
399
400 msr = rcar_i2c_read(priv, ICMSR); 395 msr = rcar_i2c_read(priv, ICMSR);
401 396
402 /* 397 /*
@@ -450,9 +445,6 @@ out:
450 wake_up(&priv->wait); 445 wake_up(&priv->wait);
451 } 446 }
452 447
453 spin_unlock(&priv->lock);
454 /*-------------- spin unlock -----------------*/
455
456 return IRQ_HANDLED; 448 return IRQ_HANDLED;
457} 449}
458 450
@@ -462,21 +454,14 @@ static int rcar_i2c_master_xfer(struct i2c_adapter *adap,
462{ 454{
463 struct rcar_i2c_priv *priv = i2c_get_adapdata(adap); 455 struct rcar_i2c_priv *priv = i2c_get_adapdata(adap);
464 struct device *dev = rcar_i2c_priv_to_dev(priv); 456 struct device *dev = rcar_i2c_priv_to_dev(priv);
465 unsigned long flags;
466 int i, ret, timeout; 457 int i, ret, timeout;
467 458
468 pm_runtime_get_sync(dev); 459 pm_runtime_get_sync(dev);
469 460
470 /*-------------- spin lock -----------------*/
471 spin_lock_irqsave(&priv->lock, flags);
472
473 rcar_i2c_init(priv); 461 rcar_i2c_init(priv);
474 /* start clock */ 462 /* start clock */
475 rcar_i2c_write(priv, ICCCR, priv->icccr); 463 rcar_i2c_write(priv, ICCCR, priv->icccr);
476 464
477 spin_unlock_irqrestore(&priv->lock, flags);
478 /*-------------- spin unlock -----------------*/
479
480 ret = rcar_i2c_bus_barrier(priv); 465 ret = rcar_i2c_bus_barrier(priv);
481 if (ret < 0) 466 if (ret < 0)
482 goto out; 467 goto out;
@@ -488,9 +473,6 @@ static int rcar_i2c_master_xfer(struct i2c_adapter *adap,
488 break; 473 break;
489 } 474 }
490 475
491 /*-------------- spin lock -----------------*/
492 spin_lock_irqsave(&priv->lock, flags);
493
494 /* init each data */ 476 /* init each data */
495 priv->msg = &msgs[i]; 477 priv->msg = &msgs[i];
496 priv->pos = 0; 478 priv->pos = 0;
@@ -500,9 +482,6 @@ static int rcar_i2c_master_xfer(struct i2c_adapter *adap,
500 482
501 ret = rcar_i2c_prepare_msg(priv); 483 ret = rcar_i2c_prepare_msg(priv);
502 484
503 spin_unlock_irqrestore(&priv->lock, flags);
504 /*-------------- spin unlock -----------------*/
505
506 if (ret < 0) 485 if (ret < 0)
507 break; 486 break;
508 487
@@ -614,7 +593,6 @@ static int rcar_i2c_probe(struct platform_device *pdev)
614 593
615 irq = platform_get_irq(pdev, 0); 594 irq = platform_get_irq(pdev, 0);
616 init_waitqueue_head(&priv->wait); 595 init_waitqueue_head(&priv->wait);
617 spin_lock_init(&priv->lock);
618 596
619 adap = &priv->adap; 597 adap = &priv->adap;
620 adap->nr = pdev->id; 598 adap->nr = pdev->id;