diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2014-06-02 23:41:46 +0530 |
---|---|---|
committer | Santosh Shukla <sshukla@mvista.com> | 2014-11-11 18:55:23 +0530 |
commit | 90994cb7c178bf9dd08a06a18f14152901c45daa (patch) | |
tree | e9df0b1d4d3e2b17dd7cebab8408338bffb32c0c /drivers/clocksource/time-armada-370-xp.c | |
parent | 977569516ada0b78f6a0d4fc195198e51c23cd53 (diff) |
clockevent: drivers: don't disable events for unsupported modestick/oneshot-stopped
'->set_dev_mode()' callback of clockevent drivers gets called when core tries to
change 'mode' of a clockevent device. Clockevent drivers should change to the
requested mode unless mode isn't supported by driver.
Ideally, drivers shouldn't change state/mode of clockevent devices when the
requested mode isn't supported by driver and the clockevent device should
continue to work as if nothing happened.
But, few clockevent drivers are always disabling events from their
->set_dev_mode() callbacks and they stay disabled for 'default case' (we reach
here for unsupported modes only) as well.
For these drivers, clockevents core wouldn't be sure about state/mode of
clockevent device once ->set_dev_mode() failed and we *may* see some strange
behavior as the clockevent device isn't configured to the right mode by kernel
again.
This patch tries to make sure such drivers don't left events disabled for
unsupported modes.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Santosh Shukla <sshukla@mvista.com>
Diffstat (limited to 'drivers/clocksource/time-armada-370-xp.c')
-rw-r--r-- | drivers/clocksource/time-armada-370-xp.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/clocksource/time-armada-370-xp.c b/drivers/clocksource/time-armada-370-xp.c index c0683ee323f9..60e585dc18cd 100644 --- a/drivers/clocksource/time-armada-370-xp.c +++ b/drivers/clocksource/time-armada-370-xp.c @@ -130,8 +130,6 @@ static int armada_370_xp_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev) { - int ret = 0; - switch (mode) { case CLOCK_EVT_MODE_PERIODIC: /* @@ -145,8 +143,6 @@ armada_370_xp_clkevt_mode(enum clock_event_mode mode, */ local_timer_ctrl_clrset(0, TIMER0_RELOAD_EN | enable_mask); break; - default: - ret = -ENOSYS; case CLOCK_EVT_MODE_ONESHOT: case CLOCK_EVT_MODE_UNUSED: case CLOCK_EVT_MODE_SHUTDOWN: @@ -162,8 +158,10 @@ armada_370_xp_clkevt_mode(enum clock_event_mode mode, */ writel(TIMER0_CLR_MASK, local_base + LCL_TIMER_EVENTS_STATUS); break; + default: + return -ENOSYS; } - return ret; + return 0; } static int armada_370_xp_clkevt_irq; |