Skip to content

Commit d369a5d

Browse files
kaysieversgregkh
authored andcommitted
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>
1 parent 15916a1 commit d369a5d

1 file changed

Lines changed: 19 additions & 18 deletions

File tree

‎kernel/time/clocksource.c‎

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
* o Allow clocksource drivers to be unregistered
2424
*/
2525

26+
#include <linux/device.h>
2627
#include <linux/clocksource.h>
27-
#include <linux/sysdev.h>
2828
#include <linux/init.h>
2929
#include <linux/module.h>
3030
#include <linux/sched.h> /* for spin_unlock_irq() using preempt_count() m68k */
@@ -754,8 +754,8 @@ EXPORT_SYMBOL(clocksource_unregister);
754754
* Provides sysfs interface for listing current clocksource.
755755
*/
756756
static ssize_t
757-
sysfs_show_current_clocksources(struct sys_device *dev,
758-
struct sysdev_attribute *attr, char *buf)
757+
sysfs_show_current_clocksources(struct device *dev,
758+
struct device_attribute *attr, char *buf)
759759
{
760760
ssize_t count = 0;
761761

@@ -775,8 +775,8 @@ sysfs_show_current_clocksources(struct sys_device *dev,
775775
* Takes input from sysfs interface for manually overriding the default
776776
* clocksource selection.
777777
*/
778-
static ssize_t sysfs_override_clocksource(struct sys_device *dev,
779-
struct sysdev_attribute *attr,
778+
static ssize_t sysfs_override_clocksource(struct device *dev,
779+
struct device_attribute *attr,
780780
const char *buf, size_t count)
781781
{
782782
size_t ret = count;
@@ -809,8 +809,8 @@ static ssize_t sysfs_override_clocksource(struct sys_device *dev,
809809
* Provides sysfs interface for listing registered clocksources
810810
*/
811811
static ssize_t
812-
sysfs_show_available_clocksources(struct sys_device *dev,
813-
struct sysdev_attribute *attr,
812+
sysfs_show_available_clocksources(struct device *dev,
813+
struct device_attribute *attr,
814814
char *buf)
815815
{
816816
struct clocksource *src;
@@ -839,35 +839,36 @@ sysfs_show_available_clocksources(struct sys_device *dev,
839839
/*
840840
* Sysfs setup bits:
841841
*/
842-
static SYSDEV_ATTR(current_clocksource, 0644, sysfs_show_current_clocksources,
842+
static DEVICE_ATTR(current_clocksource, 0644, sysfs_show_current_clocksources,
843843
sysfs_override_clocksource);
844844

845-
static SYSDEV_ATTR(available_clocksource, 0444,
845+
static DEVICE_ATTR(available_clocksource, 0444,
846846
sysfs_show_available_clocksources, NULL);
847847

848-
static struct sysdev_class clocksource_sysclass = {
848+
static struct bus_type clocksource_subsys = {
849849
.name = "clocksource",
850+
.dev_name = "clocksource",
850851
};
851852

852-
static struct sys_device device_clocksource = {
853+
static struct device device_clocksource = {
853854
.id = 0,
854-
.cls = &clocksource_sysclass,
855+
.bus = &clocksource_subsys,
855856
};
856857

857858
static int __init init_clocksource_sysfs(void)
858859
{
859-
int error = sysdev_class_register(&clocksource_sysclass);
860+
int error = subsys_system_register(&clocksource_subsys, NULL);
860861

861862
if (!error)
862-
error = sysdev_register(&device_clocksource);
863+
error = device_register(&device_clocksource);
863864
if (!error)
864-
error = sysdev_create_file(
865+
error = device_create_file(
865866
&device_clocksource,
866-
&attr_current_clocksource);
867+
&dev_attr_current_clocksource);
867868
if (!error)
868-
error = sysdev_create_file(
869+
error = device_create_file(
869870
&device_clocksource,
870-
&attr_available_clocksource);
871+
&dev_attr_available_clocksource);
871872
return error;
872873
}
873874

0 commit comments

Comments
 (0)