Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[linux-drm-fsl-dcu.git] / kernel / time / clocksource.c
index a9f387ea83b0a52181b0f10ddb10c63ccd1ea2e7..d9ef176c4e092eebf93acc31dd14dcbd362603c0 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/sysdev.h>
 #include <linux/init.h>
 #include <linux/module.h>
+#include <linux/sched.h> /* for spin_unlock_irq() using preempt_count() m68k */
 
 /* XXX - Would like a better way for initializing curr_clocksource */
 extern struct clocksource clocksource_jiffies;
@@ -65,10 +66,10 @@ static int __init clocksource_done_booting(void)
 late_initcall(clocksource_done_booting);
 
 /**
- * get_next_clocksource - Returns the selected clocksource
+ * clocksource_get_next - Returns the selected clocksource
  *
  */
-struct clocksource *get_next_clocksource(void)
+struct clocksource *clocksource_get_next(void)
 {
        unsigned long flags;
 
@@ -142,12 +143,12 @@ static int is_registered_source(struct clocksource *c)
 }
 
 /**
- * register_clocksource - Used to install new clocksources
+ * clocksource_register - Used to install new clocksources
  * @t:         clocksource to be registered
  *
  * Returns -EBUSY if registration fails, zero otherwise.
  */
-int register_clocksource(struct clocksource *c)
+int clocksource_register(struct clocksource *c)
 {
        int ret = 0;
        unsigned long flags;
@@ -156,7 +157,7 @@ int register_clocksource(struct clocksource *c)
        /* check if clocksource is already registered */
        if (is_registered_source(c)) {
                printk("register_clocksource: Cannot register %s. "
-                       "Already registered!", c->name);
+                      "Already registered!", c->name);
                ret = -EBUSY;
        } else {
                /* register it */
@@ -167,17 +168,16 @@ int register_clocksource(struct clocksource *c)
        spin_unlock_irqrestore(&clocksource_lock, flags);
        return ret;
 }
-
-EXPORT_SYMBOL(register_clocksource);
+EXPORT_SYMBOL(clocksource_register);
 
 /**
- * reselect_clocksource - Rescan list for next clocksource
+ * clocksource_reselect - Rescan list for next clocksource
  *
  * A quick helper function to be used if a clocksource changes its
  * rating. Forces the clocksource list to be re-scanned for the best
  * clocksource.
  */
-void reselect_clocksource(void)
+void clocksource_reselect(void)
 {
        unsigned long flags;
 
@@ -185,7 +185,9 @@ void reselect_clocksource(void)
        next_clocksource = select_clocksource();
        spin_unlock_irqrestore(&clocksource_lock, flags);
 }
+EXPORT_SYMBOL(clocksource_reselect);
 
+#ifdef CONFIG_SYSFS
 /**
  * sysfs_show_current_clocksources - sysfs interface for current clocksource
  * @dev:       unused
@@ -275,10 +277,10 @@ sysfs_show_available_clocksources(struct sys_device *dev, char *buf)
  * Sysfs setup bits:
  */
 static SYSDEV_ATTR(current_clocksource, 0600, sysfs_show_current_clocksources,
-                       sysfs_override_clocksource);
+                  sysfs_override_clocksource);
 
 static SYSDEV_ATTR(available_clocksource, 0600,
-                       sysfs_show_available_clocksources, NULL);
+                  sysfs_show_available_clocksources, NULL);
 
 static struct sysdev_class clocksource_sysclass = {
        set_kset_name("clocksource"),
@@ -307,6 +309,7 @@ static int __init init_clocksource_sysfs(void)
 }
 
 device_initcall(init_clocksource_sysfs);
+#endif /* CONFIG_SYSFS */
 
 /**
  * boot_override_clocksource - boot clock override