Commit eef7635a authored by Viresh Kumar's avatar Viresh Kumar Committed by Ingo Molnar

clockevents: Remove unused set_mode() callback

All users are migrated to the per-state callbacks, get rid of the
unused interface and the core support code.
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: linaro-kernel@lists.linaro.org
Cc: John Stultz <john.stultz@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/fd60de14cf6d125489c031207567bb255ad946f6.1441943991.git.viresh.kumar@linaro.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 2619d7e9
...@@ -18,15 +18,6 @@ ...@@ -18,15 +18,6 @@
struct clock_event_device; struct clock_event_device;
struct module; struct module;
/* Clock event mode commands for legacy ->set_mode(): OBSOLETE */
enum clock_event_mode {
CLOCK_EVT_MODE_UNUSED,
CLOCK_EVT_MODE_SHUTDOWN,
CLOCK_EVT_MODE_PERIODIC,
CLOCK_EVT_MODE_ONESHOT,
CLOCK_EVT_MODE_RESUME,
};
/* /*
* Possible states of a clock event device. * Possible states of a clock event device.
* *
...@@ -86,16 +77,14 @@ enum clock_event_state { ...@@ -86,16 +77,14 @@ enum clock_event_state {
* @min_delta_ns: minimum delta value in ns * @min_delta_ns: minimum delta value in ns
* @mult: nanosecond to cycles multiplier * @mult: nanosecond to cycles multiplier
* @shift: nanoseconds to cycles divisor (power of two) * @shift: nanoseconds to cycles divisor (power of two)
* @mode: operating mode, relevant only to ->set_mode(), OBSOLETE
* @state_use_accessors:current state of the device, assigned by the core code * @state_use_accessors:current state of the device, assigned by the core code
* @features: features * @features: features
* @retries: number of forced programming retries * @retries: number of forced programming retries
* @set_mode: legacy set mode function, only for modes <= CLOCK_EVT_MODE_RESUME. * @set_state_periodic: switch state to periodic
* @set_state_periodic: switch state to periodic, if !set_mode * @set_state_oneshot: switch state to oneshot
* @set_state_oneshot: switch state to oneshot, if !set_mode * @set_state_oneshot_stopped: switch state to oneshot_stopped
* @set_state_oneshot_stopped: switch state to oneshot_stopped, if !set_mode * @set_state_shutdown: switch state to shutdown
* @set_state_shutdown: switch state to shutdown, if !set_mode * @tick_resume: resume clkevt device
* @tick_resume: resume clkevt device, if !set_mode
* @broadcast: function to broadcast events * @broadcast: function to broadcast events
* @min_delta_ticks: minimum delta value in ticks stored for reconfiguration * @min_delta_ticks: minimum delta value in ticks stored for reconfiguration
* @max_delta_ticks: maximum delta value in ticks stored for reconfiguration * @max_delta_ticks: maximum delta value in ticks stored for reconfiguration
...@@ -116,18 +105,10 @@ struct clock_event_device { ...@@ -116,18 +105,10 @@ struct clock_event_device {
u64 min_delta_ns; u64 min_delta_ns;
u32 mult; u32 mult;
u32 shift; u32 shift;
enum clock_event_mode mode;
enum clock_event_state state_use_accessors; enum clock_event_state state_use_accessors;
unsigned int features; unsigned int features;
unsigned long retries; unsigned long retries;
/*
* State transition callback(s): Only one of the two groups should be
* defined:
* - set_mode(), only for modes <= CLOCK_EVT_MODE_RESUME.
* - set_state_{shutdown|periodic|oneshot|oneshot_stopped}(), tick_resume().
*/
void (*set_mode)(enum clock_event_mode mode, struct clock_event_device *);
int (*set_state_periodic)(struct clock_event_device *); int (*set_state_periodic)(struct clock_event_device *);
int (*set_state_oneshot)(struct clock_event_device *); int (*set_state_oneshot)(struct clock_event_device *);
int (*set_state_oneshot_stopped)(struct clock_event_device *); int (*set_state_oneshot_stopped)(struct clock_event_device *);
......
...@@ -97,20 +97,6 @@ EXPORT_SYMBOL_GPL(clockevent_delta2ns); ...@@ -97,20 +97,6 @@ EXPORT_SYMBOL_GPL(clockevent_delta2ns);
static int __clockevents_switch_state(struct clock_event_device *dev, static int __clockevents_switch_state(struct clock_event_device *dev,
enum clock_event_state state) enum clock_event_state state)
{ {
/* Transition with legacy set_mode() callback */
if (dev->set_mode) {
/* Legacy callback doesn't support new modes */
if (state > CLOCK_EVT_STATE_ONESHOT)
return -ENOSYS;
/*
* 'clock_event_state' and 'clock_event_mode' have 1-to-1
* mapping until *_ONESHOT, and so a simple cast will work.
*/
dev->set_mode((enum clock_event_mode)state, dev);
dev->mode = (enum clock_event_mode)state;
return 0;
}
if (dev->features & CLOCK_EVT_FEAT_DUMMY) if (dev->features & CLOCK_EVT_FEAT_DUMMY)
return 0; return 0;
...@@ -204,12 +190,8 @@ int clockevents_tick_resume(struct clock_event_device *dev) ...@@ -204,12 +190,8 @@ int clockevents_tick_resume(struct clock_event_device *dev)
{ {
int ret = 0; int ret = 0;
if (dev->set_mode) { if (dev->tick_resume)
dev->set_mode(CLOCK_EVT_MODE_RESUME, dev);
dev->mode = CLOCK_EVT_MODE_RESUME;
} else if (dev->tick_resume) {
ret = dev->tick_resume(dev); ret = dev->tick_resume(dev);
}
return ret; return ret;
} }
...@@ -460,26 +442,6 @@ int clockevents_unbind_device(struct clock_event_device *ced, int cpu) ...@@ -460,26 +442,6 @@ int clockevents_unbind_device(struct clock_event_device *ced, int cpu)
} }
EXPORT_SYMBOL_GPL(clockevents_unbind_device); EXPORT_SYMBOL_GPL(clockevents_unbind_device);
/* Sanity check of state transition callbacks */
static int clockevents_sanity_check(struct clock_event_device *dev)
{
/* Legacy set_mode() callback */
if (dev->set_mode) {
/* We shouldn't be supporting new modes now */
WARN_ON(dev->set_state_periodic || dev->set_state_oneshot ||
dev->set_state_shutdown || dev->tick_resume ||
dev->set_state_oneshot_stopped);
BUG_ON(dev->mode != CLOCK_EVT_MODE_UNUSED);
return 0;
}
if (dev->features & CLOCK_EVT_FEAT_DUMMY)
return 0;
return 0;
}
/** /**
* clockevents_register_device - register a clock event device * clockevents_register_device - register a clock event device
* @dev: device to register * @dev: device to register
...@@ -488,8 +450,6 @@ void clockevents_register_device(struct clock_event_device *dev) ...@@ -488,8 +450,6 @@ void clockevents_register_device(struct clock_event_device *dev)
{ {
unsigned long flags; unsigned long flags;
BUG_ON(clockevents_sanity_check(dev));
/* Initialize state to DETACHED */ /* Initialize state to DETACHED */
clockevent_set_state(dev, CLOCK_EVT_STATE_DETACHED); clockevent_set_state(dev, CLOCK_EVT_STATE_DETACHED);
......
...@@ -398,7 +398,6 @@ void tick_shutdown(unsigned int cpu) ...@@ -398,7 +398,6 @@ void tick_shutdown(unsigned int cpu)
* the set mode function! * the set mode function!
*/ */
clockevent_set_state(dev, CLOCK_EVT_STATE_DETACHED); clockevent_set_state(dev, CLOCK_EVT_STATE_DETACHED);
dev->mode = CLOCK_EVT_MODE_UNUSED;
clockevents_exchange_device(dev, NULL); clockevents_exchange_device(dev, NULL);
dev->event_handler = clockevents_handle_noop; dev->event_handler = clockevents_handle_noop;
td->evtdev = NULL; td->evtdev = NULL;
......
...@@ -225,7 +225,7 @@ print_tickdevice(struct seq_file *m, struct tick_device *td, int cpu) ...@@ -225,7 +225,7 @@ print_tickdevice(struct seq_file *m, struct tick_device *td, int cpu)
(unsigned long long) dev->min_delta_ns); (unsigned long long) dev->min_delta_ns);
SEQ_printf(m, " mult: %u\n", dev->mult); SEQ_printf(m, " mult: %u\n", dev->mult);
SEQ_printf(m, " shift: %u\n", dev->shift); SEQ_printf(m, " shift: %u\n", dev->shift);
SEQ_printf(m, " mode: %d\n", dev->mode); SEQ_printf(m, " mode: %d\n", clockevent_get_state(dev));
SEQ_printf(m, " next_event: %Ld nsecs\n", SEQ_printf(m, " next_event: %Ld nsecs\n",
(unsigned long long) ktime_to_ns(dev->next_event)); (unsigned long long) ktime_to_ns(dev->next_event));
...@@ -233,11 +233,6 @@ print_tickdevice(struct seq_file *m, struct tick_device *td, int cpu) ...@@ -233,11 +233,6 @@ print_tickdevice(struct seq_file *m, struct tick_device *td, int cpu)
print_name_offset(m, dev->set_next_event); print_name_offset(m, dev->set_next_event);
SEQ_printf(m, "\n"); SEQ_printf(m, "\n");
if (dev->set_mode) {
SEQ_printf(m, " set_mode: ");
print_name_offset(m, dev->set_mode);
SEQ_printf(m, "\n");
} else {
if (dev->set_state_shutdown) { if (dev->set_state_shutdown) {
SEQ_printf(m, " shutdown: "); SEQ_printf(m, " shutdown: ");
print_name_offset(m, dev->set_state_shutdown); print_name_offset(m, dev->set_state_shutdown);
...@@ -267,7 +262,6 @@ print_tickdevice(struct seq_file *m, struct tick_device *td, int cpu) ...@@ -267,7 +262,6 @@ print_tickdevice(struct seq_file *m, struct tick_device *td, int cpu)
print_name_offset(m, dev->tick_resume); print_name_offset(m, dev->tick_resume);
SEQ_printf(m, "\n"); SEQ_printf(m, "\n");
} }
}
SEQ_printf(m, " event_handler: "); SEQ_printf(m, " event_handler: ");
print_name_offset(m, dev->event_handler); print_name_offset(m, dev->event_handler);
......
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