aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/txx9/generic
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2011-12-21 18:09:53 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-12-21 18:09:53 -0500
commit0e38eaf34e0d9955aeaaed9648b2cfaba3076fee (patch)
tree27e329f1ccf0f592ab0e0dfe37ccc9c8446808fb /arch/mips/txx9/generic
parentdc6876a288cc6a446a6617ccfcb96082f67fa0c4 (diff)
mips: 7segled - 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: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/mips/txx9/generic')
-rw-r--r--arch/mips/txx9/generic/7segled.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/arch/mips/txx9/generic/7segled.c b/arch/mips/txx9/generic/7segled.c
index 7f8416f86222..8e93b2122524 100644
--- a/arch/mips/txx9/generic/7segled.c
+++ b/arch/mips/txx9/generic/7segled.c
@@ -9,7 +9,7 @@
9 * (C) Copyright TOSHIBA CORPORATION 2005-2007 9 * (C) Copyright TOSHIBA CORPORATION 2005-2007
10 * All Rights Reserved. 10 * All Rights Reserved.
11 */ 11 */
12#include <linux/sysdev.h> 12#include <linux/device.h>
13#include <linux/slab.h> 13#include <linux/slab.h>
14#include <linux/map_to_7segment.h> 14#include <linux/map_to_7segment.h>
15#include <asm/txx9/generic.h> 15#include <asm/txx9/generic.h>
@@ -37,8 +37,8 @@ int txx9_7segled_putc(unsigned int pos, char c)
37 return 0; 37 return 0;
38} 38}
39 39
40static ssize_t ascii_store(struct sys_device *dev, 40static ssize_t ascii_store(struct device *dev,
41 struct sysdev_attribute *attr, 41 struct device_attribute *attr,
42 const char *buf, size_t size) 42 const char *buf, size_t size)
43{ 43{
44 unsigned int ch = dev->id; 44 unsigned int ch = dev->id;
@@ -46,8 +46,8 @@ static ssize_t ascii_store(struct sys_device *dev,
46 return size; 46 return size;
47} 47}
48 48
49static ssize_t raw_store(struct sys_device *dev, 49static ssize_t raw_store(struct device *dev,
50 struct sysdev_attribute *attr, 50 struct device_attribute *attr,
51 const char *buf, size_t size) 51 const char *buf, size_t size)
52{ 52{
53 unsigned int ch = dev->id; 53 unsigned int ch = dev->id;
@@ -55,19 +55,19 @@ static ssize_t raw_store(struct sys_device *dev,
55 return size; 55 return size;
56} 56}
57 57
58static SYSDEV_ATTR(ascii, 0200, NULL, ascii_store); 58static DEVICE_ATTR(ascii, 0200, NULL, ascii_store);
59static SYSDEV_ATTR(raw, 0200, NULL, raw_store); 59static DEVICE_ATTR(raw, 0200, NULL, raw_store);
60 60
61static ssize_t map_seg7_show(struct sysdev_class *class, 61static ssize_t map_seg7_show(struct device *dev,
62 struct sysdev_class_attribute *attr, 62 struct device_attribute *attr,
63 char *buf) 63 char *buf)
64{ 64{
65 memcpy(buf, &txx9_seg7map, sizeof(txx9_seg7map)); 65 memcpy(buf, &txx9_seg7map, sizeof(txx9_seg7map));
66 return sizeof(txx9_seg7map); 66 return sizeof(txx9_seg7map);
67} 67}
68 68
69static ssize_t map_seg7_store(struct sysdev_class *class, 69static ssize_t map_seg7_store(struct device *dev,
70 struct sysdev_class_attribute *attr, 70 struct device_attribute *attr,
71 const char *buf, size_t size) 71 const char *buf, size_t size)
72{ 72{
73 if (size != sizeof(txx9_seg7map)) 73 if (size != sizeof(txx9_seg7map))
@@ -76,10 +76,11 @@ static ssize_t map_seg7_store(struct sysdev_class *class,
76 return size; 76 return size;
77} 77}
78 78
79static SYSDEV_CLASS_ATTR(map_seg7, 0600, map_seg7_show, map_seg7_store); 79static DEVICE_ATTR(map_seg7, 0600, map_seg7_show, map_seg7_store);
80 80
81static struct sysdev_class tx_7segled_sysdev_class = { 81static struct bus_type tx_7segled_subsys = {
82 .name = "7segled", 82 .name = "7segled",
83 .dev_name = "7segled",
83}; 84};
84 85
85static int __init tx_7segled_init_sysfs(void) 86static int __init tx_7segled_init_sysfs(void)
@@ -87,26 +88,25 @@ static int __init tx_7segled_init_sysfs(void)
87 int error, i; 88 int error, i;
88 if (!tx_7segled_num) 89 if (!tx_7segled_num)
89 return -ENODEV; 90 return -ENODEV;
90 error = sysdev_class_register(&tx_7segled_sysdev_class); 91 error = subsys_system_register(&tx_7segled_subsys, NULL);
91 if (error) 92 if (error)
92 return error; 93 return error;
93 error = sysdev_class_create_file(&tx_7segled_sysdev_class, 94 error = device_create_file(tx_7segled_subsys.dev_root, &dev_attr_map_seg7);
94 &attr_map_seg7);
95 if (error) 95 if (error)
96 return error; 96 return error;
97 for (i = 0; i < tx_7segled_num; i++) { 97 for (i = 0; i < tx_7segled_num; i++) {
98 struct sys_device *dev; 98 struct device *dev;
99 dev = kzalloc(sizeof(*dev), GFP_KERNEL); 99 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
100 if (!dev) { 100 if (!dev) {
101 error = -ENODEV; 101 error = -ENODEV;
102 break; 102 break;
103 } 103 }
104 dev->id = i; 104 dev->id = i;
105 dev->cls = &tx_7segled_sysdev_class; 105 dev->dev = &tx_7segled_subsys;
106 error = sysdev_register(dev); 106 error = device_register(dev);
107 if (!error) { 107 if (!error) {
108 sysdev_create_file(dev, &attr_ascii); 108 device_create_file(dev, &dev_attr_ascii);
109 sysdev_create_file(dev, &attr_raw); 109 device_create_file(dev, &dev_attr_raw);
110 } 110 }
111 } 111 }
112 return error; 112 return error;