aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2014-06-02 18:56:52 +0530
committerGary S. Robertson <gary.robertson@linaro.org>2015-01-07 15:40:13 -0600
commitef25dd3c07d94bfc5f1292f64204bac0af2127e8 (patch)
tree08396241750bcf0a1dd20cac1d864afb49fb871a /drivers
parent285974cd6e8edd90c7df98ec8ab9cd6e70fcf0f6 (diff)
clockevent: don't handle unsupported modes
Few clockevents drivers have 'switch cases' for ONESHOT or PERIODIC modes, when these modes aren't supported by '.features' field of 'struct clock_event_device'. These drivers are doing WARN()/BUG()/pr_err()/empty/etc for these cases. Its guaranteed that core wouldn't try to set PERIODIC/ONESHOT modes if they aren't specified by '.features' field for a particular driver. And if this happens due to some bug at driver/core, then we do have proper handling at core level (i.e. WARN_ON_ONCE()) while calling ->set_dev_mode(). Drivers can be simplified by removing code around these unsupported cases and fall-back to 'default case' and return -ENOSYS. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Santosh Shukla <santosh.shukla@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/clocksource/metag_generic.c4
-rw-r--r--drivers/clocksource/mxs_timer.c3
-rw-r--r--drivers/clocksource/timer-prima2.c3
-rw-r--r--drivers/clocksource/vt8500_timer.c1
-rw-r--r--drivers/clocksource/zevio-timer.c3
5 files changed, 0 insertions, 14 deletions
diff --git a/drivers/clocksource/metag_generic.c b/drivers/clocksource/metag_generic.c
index ba6e876d268a..501fff455ccf 100644
--- a/drivers/clocksource/metag_generic.c
+++ b/drivers/clocksource/metag_generic.c
@@ -68,10 +68,6 @@ static int metag_timer_set_mode(enum clock_event_mode mode,
/* We should disable the IRQ here */
break;
- case CLOCK_EVT_MODE_PERIODIC:
- case CLOCK_EVT_MODE_UNUSED:
- WARN_ON(1);
- break;
default:
return -ENOSYS;
};
diff --git a/drivers/clocksource/mxs_timer.c b/drivers/clocksource/mxs_timer.c
index ee58ea820a66..d7eb0ba91cd6 100644
--- a/drivers/clocksource/mxs_timer.c
+++ b/drivers/clocksource/mxs_timer.c
@@ -179,9 +179,6 @@ static int mxs_set_mode(enum clock_event_mode mode,
mxs_clockevent_mode = mode;
switch (mode) {
- case CLOCK_EVT_MODE_PERIODIC:
- pr_err("%s: Periodic mode is not implemented\n", __func__);
- break;
case CLOCK_EVT_MODE_ONESHOT:
timrot_irq_enable();
break;
diff --git a/drivers/clocksource/timer-prima2.c b/drivers/clocksource/timer-prima2.c
index 010179cbe57c..3f03b0516cf5 100644
--- a/drivers/clocksource/timer-prima2.c
+++ b/drivers/clocksource/timer-prima2.c
@@ -102,9 +102,6 @@ static int sirfsoc_timer_set_mode(enum clock_event_mode mode,
{
u32 val = readl_relaxed(sirfsoc_timer_base + SIRFSOC_TIMER_INT_EN);
switch (mode) {
- case CLOCK_EVT_MODE_PERIODIC:
- WARN_ON(1);
- break;
case CLOCK_EVT_MODE_ONESHOT:
writel_relaxed(val | BIT(0), sirfsoc_timer_base + SIRFSOC_TIMER_INT_EN);
break;
diff --git a/drivers/clocksource/vt8500_timer.c b/drivers/clocksource/vt8500_timer.c
index 228b94b2d86e..b2e20ec678dc 100644
--- a/drivers/clocksource/vt8500_timer.c
+++ b/drivers/clocksource/vt8500_timer.c
@@ -93,7 +93,6 @@ static int vt8500_timer_set_mode(enum clock_event_mode mode,
{
switch (mode) {
case CLOCK_EVT_MODE_RESUME:
- case CLOCK_EVT_MODE_PERIODIC:
break;
case CLOCK_EVT_MODE_ONESHOT:
case CLOCK_EVT_MODE_UNUSED:
diff --git a/drivers/clocksource/zevio-timer.c b/drivers/clocksource/zevio-timer.c
index 48cfe17f80a3..e5a6615fb393 100644
--- a/drivers/clocksource/zevio-timer.c
+++ b/drivers/clocksource/zevio-timer.c
@@ -98,9 +98,6 @@ static int zevio_timer_set_mode(enum clock_event_mode mode,
/* Stop timer */
writel(CNTL_STOP_TIMER, timer->timer1 + IO_CONTROL);
break;
- case CLOCK_EVT_MODE_PERIODIC:
- /* Unsupported */
- break;
default:
return -ENOSYS;
}