summaryrefslogtreecommitdiffstats
path: root/drivers/clocksource/h8300_timer8.c
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2015-11-08 17:46:54 +0100
committerDaniel Lezcano <daniel.lezcano@linaro.org>2015-12-15 09:42:13 +0100
commit1f058d52b3e32b919742d451c673b3ab71c487dc (patch)
tree32443b073b8ead72a075f157848a38e55a68bb72 /drivers/clocksource/h8300_timer8.c
parent7116ae437fc7380ffc0b9429438bba9de9681024 (diff)
downloadlinux-1f058d52b3e32b919742d451c673b3ab71c487dc.tar.gz
linux-1f058d52b3e32b919742d451c673b3ab71c487dc.tar.bz2
linux-1f058d52b3e32b919742d451c673b3ab71c487dc.zip
clocksource/drivers/h8300_timer8: Remove PERIODIC and ONESHOT macro
Specify the delta as parameter for the timer8_clock_event_start function instead of using a macro to tell PERIODIC or ONESHOT. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'drivers/clocksource/h8300_timer8.c')
-rw-r--r--drivers/clocksource/h8300_timer8.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/clocksource/h8300_timer8.c b/drivers/clocksource/h8300_timer8.c
index 88b9b0630fbe..2433325bd38f 100644
--- a/drivers/clocksource/h8300_timer8.c
+++ b/drivers/clocksource/h8300_timer8.c
@@ -28,9 +28,6 @@
#define FLAG_IRQCONTEXT (1 << 2)
#define FLAG_STARTED (1 << 3)
-#define ONESHOT 0
-#define PERIODIC 1
-
#define SCALE 64
struct timer8_priv {
@@ -147,7 +144,7 @@ static inline struct timer8_priv *ced_to_priv(struct clock_event_device *ced)
return container_of(ced, struct timer8_priv, ced);
}
-static void timer8_clock_event_start(struct timer8_priv *p, int periodic)
+static void timer8_clock_event_start(struct timer8_priv *p, unsigned long delta)
{
struct clock_event_device *ced = &p->ced;
@@ -158,7 +155,7 @@ static void timer8_clock_event_start(struct timer8_priv *p, int periodic)
ced->max_delta_ns = clockevent_delta2ns(0xffff, ced);
ced->min_delta_ns = clockevent_delta2ns(0x0001, ced);
- timer8_set_next(p, periodic?(p->rate + HZ/2) / HZ:0x10000);
+ timer8_set_next(p, delta);
}
static int timer8_clock_event_shutdown(struct clock_event_device *ced)
@@ -173,7 +170,7 @@ static int timer8_clock_event_periodic(struct clock_event_device *ced)
pr_info("%s: used for periodic clock events\n", ced->name);
timer8_stop(p);
- timer8_clock_event_start(p, PERIODIC);
+ timer8_clock_event_start(p, (p->rate + HZ/2) / HZ);
return 0;
}
@@ -184,7 +181,7 @@ static int timer8_clock_event_oneshot(struct clock_event_device *ced)
pr_info("%s: used for oneshot clock events\n", ced->name);
timer8_stop(p);
- timer8_clock_event_start(p, ONESHOT);
+ timer8_clock_event_start(p, 0x10000);
return 0;
}