diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2011-12-14 18:28:51 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-12-14 18:28:51 -0500 |
commit | d369a5d8fc70710236ae2d06a0e42dce483712df (patch) | |
tree | 5f52ec10e01f46e575e358ec21302b3cc56693e2 /kernel/time | |
parent | 15916a123e59b84d2fdfcccac84c99d1777f2a45 (diff) |
clocksource: convert sysdev_class to a regular subsystem
After all sysdev classes are ported to regular driver core entities, the
sysdev implementation will be entirely removed from the kernel.
Cc: John Stultz <johnstul@us.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel/time')
-rw-r--r-- | kernel/time/clocksource.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index cf52fda2e096..3f5c8512c033 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c | |||
@@ -23,8 +23,8 @@ | |||
23 | * o Allow clocksource drivers to be unregistered | 23 | * o Allow clocksource drivers to be unregistered |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include <linux/device.h> | ||
26 | #include <linux/clocksource.h> | 27 | #include <linux/clocksource.h> |
27 | #include <linux/sysdev.h> | ||
28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
29 | #include <linux/module.h> | 29 | #include <linux/module.h> |
30 | #include <linux/sched.h> /* for spin_unlock_irq() using preempt_count() m68k */ | 30 | #include <linux/sched.h> /* for spin_unlock_irq() using preempt_count() m68k */ |
@@ -754,8 +754,8 @@ EXPORT_SYMBOL(clocksource_unregister); | |||
754 | * Provides sysfs interface for listing current clocksource. | 754 | * Provides sysfs interface for listing current clocksource. |
755 | */ | 755 | */ |
756 | static ssize_t | 756 | static ssize_t |
757 | sysfs_show_current_clocksources(struct sys_device *dev, | 757 | sysfs_show_current_clocksources(struct device *dev, |
758 | struct sysdev_attribute *attr, char *buf) | 758 | struct device_attribute *attr, char *buf) |
759 | { | 759 | { |
760 | ssize_t count = 0; | 760 | ssize_t count = 0; |
761 | 761 | ||
@@ -775,8 +775,8 @@ sysfs_show_current_clocksources(struct sys_device *dev, | |||
775 | * Takes input from sysfs interface for manually overriding the default | 775 | * Takes input from sysfs interface for manually overriding the default |
776 | * clocksource selection. | 776 | * clocksource selection. |
777 | */ | 777 | */ |
778 | static ssize_t sysfs_override_clocksource(struct sys_device *dev, | 778 | static ssize_t sysfs_override_clocksource(struct device *dev, |
779 | struct sysdev_attribute *attr, | 779 | struct device_attribute *attr, |
780 | const char *buf, size_t count) | 780 | const char *buf, size_t count) |
781 | { | 781 | { |
782 | size_t ret = count; | 782 | size_t ret = count; |
@@ -809,8 +809,8 @@ static ssize_t sysfs_override_clocksource(struct sys_device *dev, | |||
809 | * Provides sysfs interface for listing registered clocksources | 809 | * Provides sysfs interface for listing registered clocksources |
810 | */ | 810 | */ |
811 | static ssize_t | 811 | static ssize_t |
812 | sysfs_show_available_clocksources(struct sys_device *dev, | 812 | sysfs_show_available_clocksources(struct device *dev, |
813 | struct sysdev_attribute *attr, | 813 | struct device_attribute *attr, |
814 | char *buf) | 814 | char *buf) |
815 | { | 815 | { |
816 | struct clocksource *src; | 816 | struct clocksource *src; |
@@ -839,35 +839,36 @@ sysfs_show_available_clocksources(struct sys_device *dev, | |||
839 | /* | 839 | /* |
840 | * Sysfs setup bits: | 840 | * Sysfs setup bits: |
841 | */ | 841 | */ |
842 | static SYSDEV_ATTR(current_clocksource, 0644, sysfs_show_current_clocksources, | 842 | static DEVICE_ATTR(current_clocksource, 0644, sysfs_show_current_clocksources, |
843 | sysfs_override_clocksource); | 843 | sysfs_override_clocksource); |
844 | 844 | ||
845 | static SYSDEV_ATTR(available_clocksource, 0444, | 845 | static DEVICE_ATTR(available_clocksource, 0444, |
846 | sysfs_show_available_clocksources, NULL); | 846 | sysfs_show_available_clocksources, NULL); |
847 | 847 | ||
848 | static struct sysdev_class clocksource_sysclass = { | 848 | static struct bus_type clocksource_subsys = { |
849 | .name = "clocksource", | 849 | .name = "clocksource", |
850 | .dev_name = "clocksource", | ||
850 | }; | 851 | }; |
851 | 852 | ||
852 | static struct sys_device device_clocksource = { | 853 | static struct device device_clocksource = { |
853 | .id = 0, | 854 | .id = 0, |
854 | .cls = &clocksource_sysclass, | 855 | .bus = &clocksource_subsys, |
855 | }; | 856 | }; |
856 | 857 | ||
857 | static int __init init_clocksource_sysfs(void) | 858 | static int __init init_clocksource_sysfs(void) |
858 | { | 859 | { |
859 | int error = sysdev_class_register(&clocksource_sysclass); | 860 | int error = subsys_system_register(&clocksource_subsys, NULL); |
860 | 861 | ||
861 | if (!error) | 862 | if (!error) |
862 | error = sysdev_register(&device_clocksource); | 863 | error = device_register(&device_clocksource); |
863 | if (!error) | 864 | if (!error) |
864 | error = sysdev_create_file( | 865 | error = device_create_file( |
865 | &device_clocksource, | 866 | &device_clocksource, |
866 | &attr_current_clocksource); | 867 | &dev_attr_current_clocksource); |
867 | if (!error) | 868 | if (!error) |
868 | error = sysdev_create_file( | 869 | error = device_create_file( |
869 | &device_clocksource, | 870 | &device_clocksource, |
870 | &attr_available_clocksource); | 871 | &dev_attr_available_clocksource); |
871 | return error; | 872 | return error; |
872 | } | 873 | } |
873 | 874 | ||