From 15916a123e59b84d2fdfcccac84c99d1777f2a45 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 14 Dec 2011 15:26:15 -0800 Subject: ibm_rtl: 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: Matthew Garrett Signed-off-by: Kay Sievers Signed-off-by: Greg Kroah-Hartman --- drivers/platform/x86/ibm_rtl.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'drivers/platform') diff --git a/drivers/platform/x86/ibm_rtl.c b/drivers/platform/x86/ibm_rtl.c index 811d436cd67..42a7d603c87 100644 --- a/drivers/platform/x86/ibm_rtl.c +++ b/drivers/platform/x86/ibm_rtl.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -165,22 +164,22 @@ static int ibm_rtl_write(u8 value) return ret; } -static ssize_t rtl_show_version(struct sysdev_class * dev, - struct sysdev_class_attribute *attr, +static ssize_t rtl_show_version(struct device *dev, + struct device_attribute *attr, char *buf) { return sprintf(buf, "%d\n", (int)ioread8(&rtl_table->version)); } -static ssize_t rtl_show_state(struct sysdev_class *dev, - struct sysdev_class_attribute *attr, +static ssize_t rtl_show_state(struct device *dev, + struct device_attribute *attr, char *buf) { return sprintf(buf, "%d\n", ioread8(&rtl_table->rt_status)); } -static ssize_t rtl_set_state(struct sysdev_class *dev, - struct sysdev_class_attribute *attr, +static ssize_t rtl_set_state(struct device *dev, + struct device_attribute *attr, const char *buf, size_t count) { @@ -205,27 +204,28 @@ static ssize_t rtl_set_state(struct sysdev_class *dev, return ret; } -static struct sysdev_class class_rtl = { +static struct bus_type rtl_subsys = { .name = "ibm_rtl", + .dev_name = "ibm_rtl", }; -static SYSDEV_CLASS_ATTR(version, S_IRUGO, rtl_show_version, NULL); -static SYSDEV_CLASS_ATTR(state, 0600, rtl_show_state, rtl_set_state); +static DEVICE_ATTR(version, S_IRUGO, rtl_show_version, NULL); +static DEVICE_ATTR(state, 0600, rtl_show_state, rtl_set_state); -static struct sysdev_class_attribute *rtl_attributes[] = { - &attr_version, - &attr_state, +static struct device_attribute *rtl_attributes[] = { + &dev_attr_version, + &dev_attr_state, NULL }; static int rtl_setup_sysfs(void) { int ret, i; - ret = sysdev_class_register(&class_rtl); + ret = subsys_system_register(&rtl_subsys, NULL); if (!ret) { for (i = 0; rtl_attributes[i]; i ++) - sysdev_class_create_file(&class_rtl, rtl_attributes[i]); + device_create_file(rtl_subsys.dev_root, rtl_attributes[i]); } return ret; } @@ -233,8 +233,8 @@ static int rtl_setup_sysfs(void) { static void rtl_teardown_sysfs(void) { int i; for (i = 0; rtl_attributes[i]; i ++) - sysdev_class_remove_file(&class_rtl, rtl_attributes[i]); - sysdev_class_unregister(&class_rtl); + device_remove_file(rtl_subsys.dev_root, rtl_attributes[i]); + bus_unregister(&rtl_subsys); } -- cgit v1.2.3 From edbaa603eb801655e80808a9cf3d3b622e8ac66b Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 21 Dec 2011 16:26:03 -0800 Subject: driver-core: remove sysdev.h usage. The sysdev.h file should not be needed by any in-kernel code, so remove the .h file from these random files that seem to still want to include it. The sysdev code will be going away soon, so this include needs to be removed no matter what. Cc: Jiandong Zheng Cc: Scott Branden Cc: Russell King Cc: Kukjin Kim Cc: David Brown Cc: Daniel Walker Cc: Bryan Huntsman Cc: Ben Dooks Cc: Wan ZongShun Cc: Haavard Skinnemoen Cc: Hans-Christian Egtvedt Cc: Guan Xuetao Cc: "Venkatesh Pallipadi Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Grant Likely Cc: Richard Purdie Cc: Matthew Garrett Signed-off-by: Kay Sievers --- drivers/platform/x86/intel_scu_ipc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/platform') diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c index 48870e50423..f00d0d1e065 100644 --- a/drivers/platform/x86/intel_scu_ipc.c +++ b/drivers/platform/x86/intel_scu_ipc.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include -- cgit v1.2.3