lkml.org 
[lkml]   [2013]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/3] clocksource: orion: Use atomic access for shared registers
Date
Replace the driver-specific thread-safe shared register API
by the recently introduced atomic_io_clear_set().

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
---
drivers/clocksource/time-orion.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/clocksource/time-orion.c b/drivers/clocksource/time-orion.c
index ecbeb68..4334ea7 100644
--- a/drivers/clocksource/time-orion.c
+++ b/drivers/clocksource/time-orion.c
@@ -35,20 +35,15 @@
#define ORION_ONESHOT_MAX 0xfffffffe

static void __iomem *timer_base;
-static DEFINE_SPINLOCK(timer_ctrl_lock);

/*
* Thread-safe access to TIMER_CTRL register
* (shared with watchdog timer)
*/
-void orion_timer_ctrl_clrset(u32 clr, u32 set)
+static void orion_timer_ctrl_clrset(u32 clr, u32 set)
{
- spin_lock(&timer_ctrl_lock);
- writel((readl(timer_base + TIMER_CTRL) & ~clr) | set,
- timer_base + TIMER_CTRL);
- spin_unlock(&timer_ctrl_lock);
+ atomic_io_clear_set(timer_base + TIMER_CTRL, clr, set);
}
-EXPORT_SYMBOL(orion_timer_ctrl_clrset);

/*
* Free-running clocksource handling.
--
1.8.1.5


\
 
 \ /
  Last update: 2013-08-10 15:01    [W:0.083 / U:0.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site