Commit 254d8b5d authored by Daniel Lezcano's avatar Daniel Lezcano

clocksource/drivers/h8300_timer8: Remove irq and lock legacy code

The time framawork takes care of disabling the interrupts and takes a lock
to prevent races.

Remove the legacy code in the driver taking care of the races.
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
parent 7053fdac
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
struct timer8_priv { struct timer8_priv {
struct clock_event_device ced; struct clock_event_device ced;
unsigned long mapbase; unsigned long mapbase;
raw_spinlock_t lock;
unsigned long flags; unsigned long flags;
unsigned int rate; unsigned int rate;
unsigned int tcora; unsigned int tcora;
...@@ -78,10 +77,8 @@ static irqreturn_t timer8_interrupt(int irq, void *dev_id) ...@@ -78,10 +77,8 @@ static irqreturn_t timer8_interrupt(int irq, void *dev_id)
static void timer8_set_next(struct timer8_priv *p, unsigned long delta) static void timer8_set_next(struct timer8_priv *p, unsigned long delta)
{ {
unsigned long flags;
unsigned long now; unsigned long now;
raw_spin_lock_irqsave(&p->lock, flags);
if (delta >= 0x10000) if (delta >= 0x10000)
pr_warn("delta out of range\n"); pr_warn("delta out of range\n");
now = timer8_get_counter(p); now = timer8_get_counter(p);
...@@ -91,8 +88,6 @@ static void timer8_set_next(struct timer8_priv *p, unsigned long delta) ...@@ -91,8 +88,6 @@ static void timer8_set_next(struct timer8_priv *p, unsigned long delta)
ctrl_outw(delta, p->mapbase + TCORA); ctrl_outw(delta, p->mapbase + TCORA);
else else
ctrl_outw(now + 1, p->mapbase + TCORA); ctrl_outw(now + 1, p->mapbase + TCORA);
raw_spin_unlock_irqrestore(&p->lock, flags);
} }
static int timer8_enable(struct timer8_priv *p) static int timer8_enable(struct timer8_priv *p)
...@@ -108,9 +103,6 @@ static int timer8_enable(struct timer8_priv *p) ...@@ -108,9 +103,6 @@ static int timer8_enable(struct timer8_priv *p)
static int timer8_start(struct timer8_priv *p) static int timer8_start(struct timer8_priv *p)
{ {
int ret = 0; int ret = 0;
unsigned long flags;
raw_spin_lock_irqsave(&p->lock, flags);
if (!(p->flags & FLAG_STARTED)) if (!(p->flags & FLAG_STARTED))
ret = timer8_enable(p); ret = timer8_enable(p);
...@@ -120,20 +112,12 @@ static int timer8_start(struct timer8_priv *p) ...@@ -120,20 +112,12 @@ static int timer8_start(struct timer8_priv *p)
p->flags |= FLAG_STARTED; p->flags |= FLAG_STARTED;
out: out:
raw_spin_unlock_irqrestore(&p->lock, flags);
return ret; return ret;
} }
static void timer8_stop(struct timer8_priv *p) static void timer8_stop(struct timer8_priv *p)
{ {
unsigned long flags;
raw_spin_lock_irqsave(&p->lock, flags);
ctrl_outw(0x0000, p->mapbase + _8TCR); ctrl_outw(0x0000, p->mapbase + _8TCR);
raw_spin_unlock_irqrestore(&p->lock, flags);
} }
static inline struct timer8_priv *ced_to_priv(struct clock_event_device *ced) static inline struct timer8_priv *ced_to_priv(struct clock_event_device *ced)
......
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