aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2011-12-14 18:26:15 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-12-14 18:26:15 -0500
commit15916a123e59b84d2fdfcccac84c99d1777f2a45 (patch)
treec6d233282f2e0e81d1bece77882e04b83247cabc /drivers/platform
parentfe5ff8b84c8b03348a2f64ea9d884348faec2217 (diff)
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 <mjg@redhat.com> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/ibm_rtl.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/platform/x86/ibm_rtl.c b/drivers/platform/x86/ibm_rtl.c
index 811d436cd677..42a7d603c870 100644
--- a/drivers/platform/x86/ibm_rtl.c
+++ b/drivers/platform/x86/ibm_rtl.c
@@ -28,7 +28,6 @@
28#include <linux/delay.h> 28#include <linux/delay.h>
29#include <linux/module.h> 29#include <linux/module.h>
30#include <linux/io.h> 30#include <linux/io.h>
31#include <linux/sysdev.h>
32#include <linux/dmi.h> 31#include <linux/dmi.h>
33#include <linux/efi.h> 32#include <linux/efi.h>
34#include <linux/mutex.h> 33#include <linux/mutex.h>
@@ -165,22 +164,22 @@ static int ibm_rtl_write(u8 value)
165 return ret; 164 return ret;
166} 165}
167 166
168static ssize_t rtl_show_version(struct sysdev_class * dev, 167static ssize_t rtl_show_version(struct device *dev,
169 struct sysdev_class_attribute *attr, 168 struct device_attribute *attr,
170 char *buf) 169 char *buf)
171{ 170{
172 return sprintf(buf, "%d\n", (int)ioread8(&rtl_table->version)); 171 return sprintf(buf, "%d\n", (int)ioread8(&rtl_table->version));
173} 172}
174 173
175static ssize_t rtl_show_state(struct sysdev_class *dev, 174static ssize_t rtl_show_state(struct device *dev,
176 struct sysdev_class_attribute *attr, 175 struct device_attribute *attr,
177 char *buf) 176 char *buf)
178{ 177{
179 return sprintf(buf, "%d\n", ioread8(&rtl_table->rt_status)); 178 return sprintf(buf, "%d\n", ioread8(&rtl_table->rt_status));
180} 179}
181 180
182static ssize_t rtl_set_state(struct sysdev_class *dev, 181static ssize_t rtl_set_state(struct device *dev,
183 struct sysdev_class_attribute *attr, 182 struct device_attribute *attr,
184 const char *buf, 183 const char *buf,
185 size_t count) 184 size_t count)
186{ 185{
@@ -205,27 +204,28 @@ static ssize_t rtl_set_state(struct sysdev_class *dev,
205 return ret; 204 return ret;
206} 205}
207 206
208static struct sysdev_class class_rtl = { 207static struct bus_type rtl_subsys = {
209 .name = "ibm_rtl", 208 .name = "ibm_rtl",
209 .dev_name = "ibm_rtl",
210}; 210};
211 211
212static SYSDEV_CLASS_ATTR(version, S_IRUGO, rtl_show_version, NULL); 212static DEVICE_ATTR(version, S_IRUGO, rtl_show_version, NULL);
213static SYSDEV_CLASS_ATTR(state, 0600, rtl_show_state, rtl_set_state); 213static DEVICE_ATTR(state, 0600, rtl_show_state, rtl_set_state);
214 214
215static struct sysdev_class_attribute *rtl_attributes[] = { 215static struct device_attribute *rtl_attributes[] = {
216 &attr_version, 216 &dev_attr_version,
217 &attr_state, 217 &dev_attr_state,
218 NULL 218 NULL
219}; 219};
220 220
221 221
222static int rtl_setup_sysfs(void) { 222static int rtl_setup_sysfs(void) {
223 int ret, i; 223 int ret, i;
224 ret = sysdev_class_register(&class_rtl);
225 224
225 ret = subsys_system_register(&rtl_subsys, NULL);
226 if (!ret) { 226 if (!ret) {
227 for (i = 0; rtl_attributes[i]; i ++) 227 for (i = 0; rtl_attributes[i]; i ++)
228 sysdev_class_create_file(&class_rtl, rtl_attributes[i]); 228 device_create_file(rtl_subsys.dev_root, rtl_attributes[i]);
229 } 229 }
230 return ret; 230 return ret;
231} 231}
@@ -233,8 +233,8 @@ static int rtl_setup_sysfs(void) {
233static void rtl_teardown_sysfs(void) { 233static void rtl_teardown_sysfs(void) {
234 int i; 234 int i;
235 for (i = 0; rtl_attributes[i]; i ++) 235 for (i = 0; rtl_attributes[i]; i ++)
236 sysdev_class_remove_file(&class_rtl, rtl_attributes[i]); 236 device_remove_file(rtl_subsys.dev_root, rtl_attributes[i]);
237 sysdev_class_unregister(&class_rtl); 237 bus_unregister(&rtl_subsys);
238} 238}
239 239
240 240