aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile/kernel/sysfs.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2012-01-06 14:42:52 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2012-01-06 14:42:52 -0500
commitff4b8a57f0aaa2882d444ca44b2b9b333d22a4df (patch)
treed851c923f85566572112d4c0f884cff388a3cc05 /arch/tile/kernel/sysfs.c
parent805a6af8dba5dfdd35ec35dc52ec0122400b2610 (diff)
parentea04018e6bc5ddb2f0466c0e5b986bd4901b7e8e (diff)
Merge branch 'driver-core-next' into Linux 3.2
This resolves the conflict in the arch/arm/mach-s3c64xx/s3c6400.c file, and it fixes the build error in the arch/x86/kernel/microcode_core.c file, that the merge did not catch. The microcode_core.c patch was provided by Stephen Rothwell <sfr@canb.auug.org.au> who was invaluable in the merge issues involved with the large sysdev removal process in the driver-core tree. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/tile/kernel/sysfs.c')
-rw-r--r--arch/tile/kernel/sysfs.c61
1 files changed, 30 insertions, 31 deletions
diff --git a/arch/tile/kernel/sysfs.c b/arch/tile/kernel/sysfs.c
index 602908268093..f862b005eb73 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>
@@ -32,55 +32,55 @@ static ssize_t get_hv_confstr(char *page, int query)
32 return n; 32 return n;
33} 33}
34 34
35static ssize_t chip_width_show(struct sysdev_class *dev, 35static ssize_t chip_width_show(struct device *dev,
36 struct sysdev_class_attribute *attr, 36 struct device_attribute *attr,
37 char *page) 37 char *page)
38{ 38{
39 return sprintf(page, "%u\n", smp_width); 39 return sprintf(page, "%u\n", smp_width);
40} 40}
41static SYSDEV_CLASS_ATTR(chip_width, 0444, chip_width_show, NULL); 41static DEVICE_ATTR(chip_width, 0444, chip_width_show, NULL);
42 42
43static ssize_t chip_height_show(struct sysdev_class *dev, 43static ssize_t chip_height_show(struct device *dev,
44 struct sysdev_class_attribute *attr, 44 struct device_attribute *attr,
45 char *page) 45 char *page)
46{ 46{
47 return sprintf(page, "%u\n", smp_height); 47 return sprintf(page, "%u\n", smp_height);
48} 48}
49static SYSDEV_CLASS_ATTR(chip_height, 0444, chip_height_show, NULL); 49static DEVICE_ATTR(chip_height, 0444, chip_height_show, NULL);
50 50
51static ssize_t chip_serial_show(struct sysdev_class *dev, 51static ssize_t chip_serial_show(struct device *dev,
52 struct sysdev_class_attribute *attr, 52 struct device_attribute *attr,
53 char *page) 53 char *page)
54{ 54{
55 return get_hv_confstr(page, HV_CONFSTR_CHIP_SERIAL_NUM); 55 return get_hv_confstr(page, HV_CONFSTR_CHIP_SERIAL_NUM);
56} 56}
57static SYSDEV_CLASS_ATTR(chip_serial, 0444, chip_serial_show, NULL); 57static DEVICE_ATTR(chip_serial, 0444, chip_serial_show, NULL);
58 58
59static ssize_t chip_revision_show(struct sysdev_class *dev, 59static ssize_t chip_revision_show(struct device *dev,
60 struct sysdev_class_attribute *attr, 60 struct device_attribute *attr,
61 char *page) 61 char *page)
62{ 62{
63 return get_hv_confstr(page, HV_CONFSTR_CHIP_REV); 63 return get_hv_confstr(page, HV_CONFSTR_CHIP_REV);
64} 64}
65static SYSDEV_CLASS_ATTR(chip_revision, 0444, chip_revision_show, NULL); 65static DEVICE_ATTR(chip_revision, 0444, chip_revision_show, NULL);
66 66
67 67
68static ssize_t type_show(struct sysdev_class *dev, 68static ssize_t type_show(struct device *dev,
69 struct sysdev_class_attribute *attr, 69 struct device_attribute *attr,
70 char *page) 70 char *page)
71{ 71{
72 return sprintf(page, "tilera\n"); 72 return sprintf(page, "tilera\n");
73} 73}
74static SYSDEV_CLASS_ATTR(type, 0444, type_show, NULL); 74static DEVICE_ATTR(type, 0444, type_show, NULL);
75 75
76#define HV_CONF_ATTR(name, conf) \ 76#define HV_CONF_ATTR(name, conf) \
77 static ssize_t name ## _show(struct sysdev_class *dev, \ 77 static ssize_t name ## _show(struct device *dev, \
78 struct sysdev_class_attribute *attr, \ 78 struct device_attribute *attr, \
79 char *page) \ 79 char *page) \
80 { \ 80 { \
81 return get_hv_confstr(page, conf); \ 81 return get_hv_confstr(page, conf); \
82 } \ 82 } \
83 static SYSDEV_CLASS_ATTR(name, 0444, name ## _show, NULL); 83 static DEVICE_ATTR(name, 0444, name ## _show, NULL);
84 84
85HV_CONF_ATTR(version, HV_CONFSTR_HV_SW_VER) 85HV_CONF_ATTR(version, HV_CONFSTR_HV_SW_VER)
86HV_CONF_ATTR(config_version, HV_CONFSTR_HV_CONFIG_VER) 86HV_CONF_ATTR(config_version, HV_CONFSTR_HV_CONFIG_VER)
@@ -96,15 +96,15 @@ HV_CONF_ATTR(mezz_description, HV_CONFSTR_MEZZ_DESC)
96HV_CONF_ATTR(switch_control, HV_CONFSTR_SWITCH_CONTROL) 96HV_CONF_ATTR(switch_control, HV_CONFSTR_SWITCH_CONTROL)
97 97
98static struct attribute *board_attrs[] = { 98static struct attribute *board_attrs[] = {
99 &attr_board_part.attr, 99 &dev_attr_board_part.attr,
100 &attr_board_serial.attr, 100 &dev_attr_board_serial.attr,
101 &attr_board_revision.attr, 101 &dev_attr_board_revision.attr,
102 &attr_board_description.attr, 102 &dev_attr_board_description.attr,
103 &attr_mezz_part.attr, 103 &dev_attr_mezz_part.attr,
104 &attr_mezz_serial.attr, 104 &dev_attr_mezz_serial.attr,
105 &attr_mezz_revision.attr, 105 &dev_attr_mezz_revision.attr,
106 &attr_mezz_description.attr, 106 &dev_attr_mezz_description.attr,
107 &attr_switch_control.attr, 107 &dev_attr_switch_control.attr,
108 NULL 108 NULL
109}; 109};
110 110
@@ -151,12 +151,11 @@ hvconfig_bin_read(struct file *filp, struct kobject *kobj,
151 151
152static int __init create_sysfs_entries(void) 152static int __init create_sysfs_entries(void)
153{ 153{
154 struct sysdev_class *cls = &cpu_sysdev_class;
155 int err = 0; 154 int err = 0;
156 155
157#define create_cpu_attr(name) \ 156#define create_cpu_attr(name) \
158 if (!err) \ 157 if (!err) \
159 err = sysfs_create_file(&cls->kset.kobj, &attr_##name.attr); 158 err = device_create_file(cpu_subsys.dev_root, &dev_attr_##name);
160 create_cpu_attr(chip_width); 159 create_cpu_attr(chip_width);
161 create_cpu_attr(chip_height); 160 create_cpu_attr(chip_height);
162 create_cpu_attr(chip_serial); 161 create_cpu_attr(chip_serial);
@@ -164,7 +163,7 @@ static int __init create_sysfs_entries(void)
164 163
165#define create_hv_attr(name) \ 164#define create_hv_attr(name) \
166 if (!err) \ 165 if (!err) \
167 err = sysfs_create_file(hypervisor_kobj, &attr_##name.attr); 166 err = sysfs_create_file(hypervisor_kobj, &dev_attr_##name);
168 create_hv_attr(type); 167 create_hv_attr(type);
169 create_hv_attr(version); 168 create_hv_attr(version);
170 create_hv_attr(config_version); 169 create_hv_attr(config_version);