diff options
Diffstat (limited to 'arch/tile/kernel/sysfs.c')
-rw-r--r-- | arch/tile/kernel/sysfs.c | 61 |
1 files changed, 30 insertions, 31 deletions
diff --git a/arch/tile/kernel/sysfs.c b/arch/tile/kernel/sysfs.c index b671a86f4515..e7ce2a5161b8 100644 --- a/arch/tile/kernel/sysfs.c +++ b/arch/tile/kernel/sysfs.c | |||
@@ -14,7 +14,7 @@ | |||
14 | * /sys entry support. | 14 | * /sys entry support. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include <linux/sysdev.h> | 17 | #include <linux/device.h> |
18 | #include <linux/cpu.h> | 18 | #include <linux/cpu.h> |
19 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
20 | #include <linux/smp.h> | 20 | #include <linux/smp.h> |
@@ -31,55 +31,55 @@ static ssize_t get_hv_confstr(char *page, int query) | |||
31 | return n; | 31 | return n; |
32 | } | 32 | } |
33 | 33 | ||
34 | static ssize_t chip_width_show(struct sysdev_class *dev, | 34 | static ssize_t chip_width_show(struct device *dev, |
35 | struct sysdev_class_attribute *attr, | 35 | struct device_attribute *attr, |
36 | char *page) | 36 | char *page) |
37 | { | 37 | { |
38 | return sprintf(page, "%u\n", smp_width); | 38 | return sprintf(page, "%u\n", smp_width); |
39 | } | 39 | } |
40 | static SYSDEV_CLASS_ATTR(chip_width, 0444, chip_width_show, NULL); | 40 | static DEVICE_ATTR(chip_width, 0444, chip_width_show, NULL); |
41 | 41 | ||
42 | static ssize_t chip_height_show(struct sysdev_class *dev, | 42 | static ssize_t chip_height_show(struct device *dev, |
43 | struct sysdev_class_attribute *attr, | 43 | struct device_attribute *attr, |
44 | char *page) | 44 | char *page) |
45 | { | 45 | { |
46 | return sprintf(page, "%u\n", smp_height); | 46 | return sprintf(page, "%u\n", smp_height); |
47 | } | 47 | } |
48 | static SYSDEV_CLASS_ATTR(chip_height, 0444, chip_height_show, NULL); | 48 | static DEVICE_ATTR(chip_height, 0444, chip_height_show, NULL); |
49 | 49 | ||
50 | static ssize_t chip_serial_show(struct sysdev_class *dev, | 50 | static ssize_t chip_serial_show(struct device *dev, |
51 | struct sysdev_class_attribute *attr, | 51 | struct device_attribute *attr, |
52 | char *page) | 52 | char *page) |
53 | { | 53 | { |
54 | return get_hv_confstr(page, HV_CONFSTR_CHIP_SERIAL_NUM); | 54 | return get_hv_confstr(page, HV_CONFSTR_CHIP_SERIAL_NUM); |
55 | } | 55 | } |
56 | static SYSDEV_CLASS_ATTR(chip_serial, 0444, chip_serial_show, NULL); | 56 | static DEVICE_ATTR(chip_serial, 0444, chip_serial_show, NULL); |
57 | 57 | ||
58 | static ssize_t chip_revision_show(struct sysdev_class *dev, | 58 | static ssize_t chip_revision_show(struct device *dev, |
59 | struct sysdev_class_attribute *attr, | 59 | struct device_attribute *attr, |
60 | char *page) | 60 | char *page) |
61 | { | 61 | { |
62 | return get_hv_confstr(page, HV_CONFSTR_CHIP_REV); | 62 | return get_hv_confstr(page, HV_CONFSTR_CHIP_REV); |
63 | } | 63 | } |
64 | static SYSDEV_CLASS_ATTR(chip_revision, 0444, chip_revision_show, NULL); | 64 | static DEVICE_ATTR(chip_revision, 0444, chip_revision_show, NULL); |
65 | 65 | ||
66 | 66 | ||
67 | static ssize_t type_show(struct sysdev_class *dev, | 67 | static ssize_t type_show(struct device *dev, |
68 | struct sysdev_class_attribute *attr, | 68 | struct device_attribute *attr, |
69 | char *page) | 69 | char *page) |
70 | { | 70 | { |
71 | return sprintf(page, "tilera\n"); | 71 | return sprintf(page, "tilera\n"); |
72 | } | 72 | } |
73 | static SYSDEV_CLASS_ATTR(type, 0444, type_show, NULL); | 73 | static DEVICE_ATTR(type, 0444, type_show, NULL); |
74 | 74 | ||
75 | #define HV_CONF_ATTR(name, conf) \ | 75 | #define HV_CONF_ATTR(name, conf) \ |
76 | static ssize_t name ## _show(struct sysdev_class *dev, \ | 76 | static ssize_t name ## _show(struct device *dev, \ |
77 | struct sysdev_class_attribute *attr, \ | 77 | struct device_attribute *attr, \ |
78 | char *page) \ | 78 | char *page) \ |
79 | { \ | 79 | { \ |
80 | return get_hv_confstr(page, conf); \ | 80 | return get_hv_confstr(page, conf); \ |
81 | } \ | 81 | } \ |
82 | static SYSDEV_CLASS_ATTR(name, 0444, name ## _show, NULL); | 82 | static DEVICE_ATTR(name, 0444, name ## _show, NULL); |
83 | 83 | ||
84 | HV_CONF_ATTR(version, HV_CONFSTR_HV_SW_VER) | 84 | HV_CONF_ATTR(version, HV_CONFSTR_HV_SW_VER) |
85 | HV_CONF_ATTR(config_version, HV_CONFSTR_HV_CONFIG_VER) | 85 | HV_CONF_ATTR(config_version, HV_CONFSTR_HV_CONFIG_VER) |
@@ -95,15 +95,15 @@ HV_CONF_ATTR(mezz_description, HV_CONFSTR_MEZZ_DESC) | |||
95 | HV_CONF_ATTR(switch_control, HV_CONFSTR_SWITCH_CONTROL) | 95 | HV_CONF_ATTR(switch_control, HV_CONFSTR_SWITCH_CONTROL) |
96 | 96 | ||
97 | static struct attribute *board_attrs[] = { | 97 | static struct attribute *board_attrs[] = { |
98 | &attr_board_part.attr, | 98 | &dev_attr_board_part.attr, |
99 | &attr_board_serial.attr, | 99 | &dev_attr_board_serial.attr, |
100 | &attr_board_revision.attr, | 100 | &dev_attr_board_revision.attr, |
101 | &attr_board_description.attr, | 101 | &dev_attr_board_description.attr, |
102 | &attr_mezz_part.attr, | 102 | &dev_attr_mezz_part.attr, |
103 | &attr_mezz_serial.attr, | 103 | &dev_attr_mezz_serial.attr, |
104 | &attr_mezz_revision.attr, | 104 | &dev_attr_mezz_revision.attr, |
105 | &attr_mezz_description.attr, | 105 | &dev_attr_mezz_description.attr, |
106 | &attr_switch_control.attr, | 106 | &dev_attr_switch_control.attr, |
107 | NULL | 107 | NULL |
108 | }; | 108 | }; |
109 | 109 | ||
@@ -150,12 +150,11 @@ hvconfig_bin_read(struct file *filp, struct kobject *kobj, | |||
150 | 150 | ||
151 | static int __init create_sysfs_entries(void) | 151 | static int __init create_sysfs_entries(void) |
152 | { | 152 | { |
153 | struct sysdev_class *cls = &cpu_sysdev_class; | ||
154 | int err = 0; | 153 | int err = 0; |
155 | 154 | ||
156 | #define create_cpu_attr(name) \ | 155 | #define create_cpu_attr(name) \ |
157 | if (!err) \ | 156 | if (!err) \ |
158 | err = sysfs_create_file(&cls->kset.kobj, &attr_##name.attr); | 157 | err = device_create_file(cpu_subsys.dev_root, &dev_attr_##name); |
159 | create_cpu_attr(chip_width); | 158 | create_cpu_attr(chip_width); |
160 | create_cpu_attr(chip_height); | 159 | create_cpu_attr(chip_height); |
161 | create_cpu_attr(chip_serial); | 160 | create_cpu_attr(chip_serial); |
@@ -163,7 +162,7 @@ static int __init create_sysfs_entries(void) | |||
163 | 162 | ||
164 | #define create_hv_attr(name) \ | 163 | #define create_hv_attr(name) \ |
165 | if (!err) \ | 164 | if (!err) \ |
166 | err = sysfs_create_file(hypervisor_kobj, &attr_##name.attr); | 165 | err = sysfs_create_file(hypervisor_kobj, &dev_attr_##name); |
167 | create_hv_attr(type); | 166 | create_hv_attr(type); |
168 | create_hv_attr(version); | 167 | create_hv_attr(version); |
169 | create_hv_attr(config_version); | 168 | create_hv_attr(config_version); |