diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2012-01-06 14:42:52 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2012-01-06 14:42:52 -0500 |
commit | ff4b8a57f0aaa2882d444ca44b2b9b333d22a4df (patch) | |
tree | d851c923f85566572112d4c0f884cff388a3cc05 /arch/powerpc | |
parent | 805a6af8dba5dfdd35ec35dc52ec0122400b2610 (diff) | |
parent | ea04018e6bc5ddb2f0466c0e5b986bd4901b7e8e (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/powerpc')
-rw-r--r-- | arch/powerpc/include/asm/spu.h | 12 | ||||
-rw-r--r-- | arch/powerpc/include/asm/topology.h | 10 | ||||
-rw-r--r-- | arch/powerpc/kernel/cacheinfo.c | 10 | ||||
-rw-r--r-- | arch/powerpc/kernel/smp.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/sysfs.c | 261 | ||||
-rw-r--r-- | arch/powerpc/mm/numa.c | 8 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/cbe_thermal.c | 144 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/smp.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spu_base.c | 61 | ||||
-rw-r--r-- | arch/powerpc/platforms/iseries/smp.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/powermac/cpufreq_32.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/cmm.c | 67 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/pseries_energy.c | 71 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/smp.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/suspend.c | 33 | ||||
-rw-r--r-- | arch/powerpc/sysdev/ppc4xx_cpm.c | 6 | ||||
-rw-r--r-- | arch/powerpc/sysdev/qe_lib/qe_ic.c | 12 | ||||
-rw-r--r-- | arch/powerpc/sysdev/uic.c | 1 |
18 files changed, 352 insertions, 354 deletions
diff --git a/arch/powerpc/include/asm/spu.h b/arch/powerpc/include/asm/spu.h index 4e360bd4a35a..fff921345ddc 100644 --- a/arch/powerpc/include/asm/spu.h +++ b/arch/powerpc/include/asm/spu.h | |||
@@ -25,7 +25,7 @@ | |||
25 | #ifdef __KERNEL__ | 25 | #ifdef __KERNEL__ |
26 | 26 | ||
27 | #include <linux/workqueue.h> | 27 | #include <linux/workqueue.h> |
28 | #include <linux/sysdev.h> | 28 | #include <linux/device.h> |
29 | #include <linux/mutex.h> | 29 | #include <linux/mutex.h> |
30 | 30 | ||
31 | #define LS_SIZE (256 * 1024) | 31 | #define LS_SIZE (256 * 1024) |
@@ -166,7 +166,7 @@ struct spu { | |||
166 | /* beat only */ | 166 | /* beat only */ |
167 | u64 shadow_int_mask_RW[3]; | 167 | u64 shadow_int_mask_RW[3]; |
168 | 168 | ||
169 | struct sys_device sysdev; | 169 | struct device dev; |
170 | 170 | ||
171 | int has_mem_affinity; | 171 | int has_mem_affinity; |
172 | struct list_head aff_list; | 172 | struct list_head aff_list; |
@@ -270,11 +270,11 @@ struct spufs_calls { | |||
270 | int register_spu_syscalls(struct spufs_calls *calls); | 270 | int register_spu_syscalls(struct spufs_calls *calls); |
271 | void unregister_spu_syscalls(struct spufs_calls *calls); | 271 | void unregister_spu_syscalls(struct spufs_calls *calls); |
272 | 272 | ||
273 | int spu_add_sysdev_attr(struct sysdev_attribute *attr); | 273 | int spu_add_dev_attr(struct device_attribute *attr); |
274 | void spu_remove_sysdev_attr(struct sysdev_attribute *attr); | 274 | void spu_remove_dev_attr(struct device_attribute *attr); |
275 | 275 | ||
276 | int spu_add_sysdev_attr_group(struct attribute_group *attrs); | 276 | int spu_add_dev_attr_group(struct attribute_group *attrs); |
277 | void spu_remove_sysdev_attr_group(struct attribute_group *attrs); | 277 | void spu_remove_dev_attr_group(struct attribute_group *attrs); |
278 | 278 | ||
279 | int spu_handle_mm_fault(struct mm_struct *mm, unsigned long ea, | 279 | int spu_handle_mm_fault(struct mm_struct *mm, unsigned long ea, |
280 | unsigned long dsisr, unsigned *flt); | 280 | unsigned long dsisr, unsigned *flt); |
diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h index 1e104af08483..c97185885c6d 100644 --- a/arch/powerpc/include/asm/topology.h +++ b/arch/powerpc/include/asm/topology.h | |||
@@ -3,7 +3,7 @@ | |||
3 | #ifdef __KERNEL__ | 3 | #ifdef __KERNEL__ |
4 | 4 | ||
5 | 5 | ||
6 | struct sys_device; | 6 | struct device; |
7 | struct device_node; | 7 | struct device_node; |
8 | 8 | ||
9 | #ifdef CONFIG_NUMA | 9 | #ifdef CONFIG_NUMA |
@@ -86,19 +86,19 @@ extern int __node_distance(int, int); | |||
86 | 86 | ||
87 | extern void __init dump_numa_cpu_topology(void); | 87 | extern void __init dump_numa_cpu_topology(void); |
88 | 88 | ||
89 | extern int sysfs_add_device_to_node(struct sys_device *dev, int nid); | 89 | extern int sysfs_add_device_to_node(struct device *dev, int nid); |
90 | extern void sysfs_remove_device_from_node(struct sys_device *dev, int nid); | 90 | extern void sysfs_remove_device_from_node(struct device *dev, int nid); |
91 | 91 | ||
92 | #else | 92 | #else |
93 | 93 | ||
94 | static inline void dump_numa_cpu_topology(void) {} | 94 | static inline void dump_numa_cpu_topology(void) {} |
95 | 95 | ||
96 | static inline int sysfs_add_device_to_node(struct sys_device *dev, int nid) | 96 | static inline int sysfs_add_device_to_node(struct device *dev, int nid) |
97 | { | 97 | { |
98 | return 0; | 98 | return 0; |
99 | } | 99 | } |
100 | 100 | ||
101 | static inline void sysfs_remove_device_from_node(struct sys_device *dev, | 101 | static inline void sysfs_remove_device_from_node(struct device *dev, |
102 | int nid) | 102 | int nid) |
103 | { | 103 | { |
104 | } | 104 | } |
diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c index a3c684b4c862..92c6b008dd2b 100644 --- a/arch/powerpc/kernel/cacheinfo.c +++ b/arch/powerpc/kernel/cacheinfo.c | |||
@@ -451,15 +451,15 @@ out: | |||
451 | static struct cache_dir *__cpuinit cacheinfo_create_cache_dir(unsigned int cpu_id) | 451 | static struct cache_dir *__cpuinit cacheinfo_create_cache_dir(unsigned int cpu_id) |
452 | { | 452 | { |
453 | struct cache_dir *cache_dir; | 453 | struct cache_dir *cache_dir; |
454 | struct sys_device *sysdev; | 454 | struct device *dev; |
455 | struct kobject *kobj = NULL; | 455 | struct kobject *kobj = NULL; |
456 | 456 | ||
457 | sysdev = get_cpu_sysdev(cpu_id); | 457 | dev = get_cpu_device(cpu_id); |
458 | WARN_ONCE(!sysdev, "no sysdev for CPU %i\n", cpu_id); | 458 | WARN_ONCE(!dev, "no dev for CPU %i\n", cpu_id); |
459 | if (!sysdev) | 459 | if (!dev) |
460 | goto err; | 460 | goto err; |
461 | 461 | ||
462 | kobj = kobject_create_and_add("cache", &sysdev->kobj); | 462 | kobj = kobject_create_and_add("cache", &dev->kobj); |
463 | if (!kobj) | 463 | if (!kobj) |
464 | goto err; | 464 | goto err; |
465 | 465 | ||
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index 6df70907d60a..d9a7a464ec51 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c | |||
@@ -27,7 +27,7 @@ | |||
27 | #include <linux/spinlock.h> | 27 | #include <linux/spinlock.h> |
28 | #include <linux/cache.h> | 28 | #include <linux/cache.h> |
29 | #include <linux/err.h> | 29 | #include <linux/err.h> |
30 | #include <linux/sysdev.h> | 30 | #include <linux/device.h> |
31 | #include <linux/cpu.h> | 31 | #include <linux/cpu.h> |
32 | #include <linux/notifier.h> | 32 | #include <linux/notifier.h> |
33 | #include <linux/topology.h> | 33 | #include <linux/topology.h> |
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c index ce035c1905f0..5e7c1655f13a 100644 --- a/arch/powerpc/kernel/sysfs.c +++ b/arch/powerpc/kernel/sysfs.c | |||
@@ -1,4 +1,4 @@ | |||
1 | #include <linux/sysdev.h> | 1 | #include <linux/device.h> |
2 | #include <linux/cpu.h> | 2 | #include <linux/cpu.h> |
3 | #include <linux/smp.h> | 3 | #include <linux/smp.h> |
4 | #include <linux/percpu.h> | 4 | #include <linux/percpu.h> |
@@ -37,12 +37,12 @@ static DEFINE_PER_CPU(struct cpu, cpu_devices); | |||
37 | /* Time in microseconds we delay before sleeping in the idle loop */ | 37 | /* Time in microseconds we delay before sleeping in the idle loop */ |
38 | DEFINE_PER_CPU(long, smt_snooze_delay) = { 100 }; | 38 | DEFINE_PER_CPU(long, smt_snooze_delay) = { 100 }; |
39 | 39 | ||
40 | static ssize_t store_smt_snooze_delay(struct sys_device *dev, | 40 | static ssize_t store_smt_snooze_delay(struct device *dev, |
41 | struct sysdev_attribute *attr, | 41 | struct device_attribute *attr, |
42 | const char *buf, | 42 | const char *buf, |
43 | size_t count) | 43 | size_t count) |
44 | { | 44 | { |
45 | struct cpu *cpu = container_of(dev, struct cpu, sysdev); | 45 | struct cpu *cpu = container_of(dev, struct cpu, dev); |
46 | ssize_t ret; | 46 | ssize_t ret; |
47 | long snooze; | 47 | long snooze; |
48 | 48 | ||
@@ -50,21 +50,21 @@ static ssize_t store_smt_snooze_delay(struct sys_device *dev, | |||
50 | if (ret != 1) | 50 | if (ret != 1) |
51 | return -EINVAL; | 51 | return -EINVAL; |
52 | 52 | ||
53 | per_cpu(smt_snooze_delay, cpu->sysdev.id) = snooze; | 53 | per_cpu(smt_snooze_delay, cpu->dev.id) = snooze; |
54 | 54 | ||
55 | return count; | 55 | return count; |
56 | } | 56 | } |
57 | 57 | ||
58 | static ssize_t show_smt_snooze_delay(struct sys_device *dev, | 58 | static ssize_t show_smt_snooze_delay(struct device *dev, |
59 | struct sysdev_attribute *attr, | 59 | struct device_attribute *attr, |
60 | char *buf) | 60 | char *buf) |
61 | { | 61 | { |
62 | struct cpu *cpu = container_of(dev, struct cpu, sysdev); | 62 | struct cpu *cpu = container_of(dev, struct cpu, dev); |
63 | 63 | ||
64 | return sprintf(buf, "%ld\n", per_cpu(smt_snooze_delay, cpu->sysdev.id)); | 64 | return sprintf(buf, "%ld\n", per_cpu(smt_snooze_delay, cpu->dev.id)); |
65 | } | 65 | } |
66 | 66 | ||
67 | static SYSDEV_ATTR(smt_snooze_delay, 0644, show_smt_snooze_delay, | 67 | static DEVICE_ATTR(smt_snooze_delay, 0644, show_smt_snooze_delay, |
68 | store_smt_snooze_delay); | 68 | store_smt_snooze_delay); |
69 | 69 | ||
70 | static int __init setup_smt_snooze_delay(char *str) | 70 | static int __init setup_smt_snooze_delay(char *str) |
@@ -117,25 +117,25 @@ static void write_##NAME(void *val) \ | |||
117 | ppc_enable_pmcs(); \ | 117 | ppc_enable_pmcs(); \ |
118 | mtspr(ADDRESS, *(unsigned long *)val); \ | 118 | mtspr(ADDRESS, *(unsigned long *)val); \ |
119 | } \ | 119 | } \ |
120 | static ssize_t show_##NAME(struct sys_device *dev, \ | 120 | static ssize_t show_##NAME(struct device *dev, \ |
121 | struct sysdev_attribute *attr, \ | 121 | struct device_attribute *attr, \ |
122 | char *buf) \ | 122 | char *buf) \ |
123 | { \ | 123 | { \ |
124 | struct cpu *cpu = container_of(dev, struct cpu, sysdev); \ | 124 | struct cpu *cpu = container_of(dev, struct cpu, dev); \ |
125 | unsigned long val; \ | 125 | unsigned long val; \ |
126 | smp_call_function_single(cpu->sysdev.id, read_##NAME, &val, 1); \ | 126 | smp_call_function_single(cpu->dev.id, read_##NAME, &val, 1); \ |
127 | return sprintf(buf, "%lx\n", val); \ | 127 | return sprintf(buf, "%lx\n", val); \ |
128 | } \ | 128 | } \ |
129 | static ssize_t __used \ | 129 | static ssize_t __used \ |
130 | store_##NAME(struct sys_device *dev, struct sysdev_attribute *attr, \ | 130 | store_##NAME(struct device *dev, struct device_attribute *attr, \ |
131 | const char *buf, size_t count) \ | 131 | const char *buf, size_t count) \ |
132 | { \ | 132 | { \ |
133 | struct cpu *cpu = container_of(dev, struct cpu, sysdev); \ | 133 | struct cpu *cpu = container_of(dev, struct cpu, dev); \ |
134 | unsigned long val; \ | 134 | unsigned long val; \ |
135 | int ret = sscanf(buf, "%lx", &val); \ | 135 | int ret = sscanf(buf, "%lx", &val); \ |
136 | if (ret != 1) \ | 136 | if (ret != 1) \ |
137 | return -EINVAL; \ | 137 | return -EINVAL; \ |
138 | smp_call_function_single(cpu->sysdev.id, write_##NAME, &val, 1); \ | 138 | smp_call_function_single(cpu->dev.id, write_##NAME, &val, 1); \ |
139 | return count; \ | 139 | return count; \ |
140 | } | 140 | } |
141 | 141 | ||
@@ -178,22 +178,22 @@ SYSFS_PMCSETUP(purr, SPRN_PURR); | |||
178 | SYSFS_PMCSETUP(spurr, SPRN_SPURR); | 178 | SYSFS_PMCSETUP(spurr, SPRN_SPURR); |
179 | SYSFS_PMCSETUP(dscr, SPRN_DSCR); | 179 | SYSFS_PMCSETUP(dscr, SPRN_DSCR); |
180 | 180 | ||
181 | static SYSDEV_ATTR(mmcra, 0600, show_mmcra, store_mmcra); | 181 | static DEVICE_ATTR(mmcra, 0600, show_mmcra, store_mmcra); |
182 | static SYSDEV_ATTR(spurr, 0600, show_spurr, NULL); | 182 | static DEVICE_ATTR(spurr, 0600, show_spurr, NULL); |
183 | static SYSDEV_ATTR(dscr, 0600, show_dscr, store_dscr); | 183 | static DEVICE_ATTR(dscr, 0600, show_dscr, store_dscr); |
184 | static SYSDEV_ATTR(purr, 0600, show_purr, store_purr); | 184 | static DEVICE_ATTR(purr, 0600, show_purr, store_purr); |
185 | 185 | ||
186 | unsigned long dscr_default = 0; | 186 | unsigned long dscr_default = 0; |
187 | EXPORT_SYMBOL(dscr_default); | 187 | EXPORT_SYMBOL(dscr_default); |
188 | 188 | ||
189 | static ssize_t show_dscr_default(struct sysdev_class *class, | 189 | static ssize_t show_dscr_default(struct device *dev, |
190 | struct sysdev_class_attribute *attr, char *buf) | 190 | struct device_attribute *attr, char *buf) |
191 | { | 191 | { |
192 | return sprintf(buf, "%lx\n", dscr_default); | 192 | return sprintf(buf, "%lx\n", dscr_default); |
193 | } | 193 | } |
194 | 194 | ||
195 | static ssize_t __used store_dscr_default(struct sysdev_class *class, | 195 | static ssize_t __used store_dscr_default(struct device *dev, |
196 | struct sysdev_class_attribute *attr, const char *buf, | 196 | struct device_attribute *attr, const char *buf, |
197 | size_t count) | 197 | size_t count) |
198 | { | 198 | { |
199 | unsigned long val; | 199 | unsigned long val; |
@@ -207,15 +207,14 @@ static ssize_t __used store_dscr_default(struct sysdev_class *class, | |||
207 | return count; | 207 | return count; |
208 | } | 208 | } |
209 | 209 | ||
210 | static SYSDEV_CLASS_ATTR(dscr_default, 0600, | 210 | static DEVICE_ATTR(dscr_default, 0600, |
211 | show_dscr_default, store_dscr_default); | 211 | show_dscr_default, store_dscr_default); |
212 | 212 | ||
213 | static void sysfs_create_dscr_default(void) | 213 | static void sysfs_create_dscr_default(void) |
214 | { | 214 | { |
215 | int err = 0; | 215 | int err = 0; |
216 | if (cpu_has_feature(CPU_FTR_DSCR)) | 216 | if (cpu_has_feature(CPU_FTR_DSCR)) |
217 | err = sysfs_create_file(&cpu_sysdev_class.kset.kobj, | 217 | err = device_create_file(cpu_subsys.dev_root, &dev_attr_dscr_default); |
218 | &attr_dscr_default.attr); | ||
219 | } | 218 | } |
220 | #endif /* CONFIG_PPC64 */ | 219 | #endif /* CONFIG_PPC64 */ |
221 | 220 | ||
@@ -259,72 +258,72 @@ SYSFS_PMCSETUP(tsr3, SPRN_PA6T_TSR3); | |||
259 | #endif /* HAS_PPC_PMC_PA6T */ | 258 | #endif /* HAS_PPC_PMC_PA6T */ |
260 | 259 | ||
261 | #ifdef HAS_PPC_PMC_IBM | 260 | #ifdef HAS_PPC_PMC_IBM |
262 | static struct sysdev_attribute ibm_common_attrs[] = { | 261 | static struct device_attribute ibm_common_attrs[] = { |
263 | _SYSDEV_ATTR(mmcr0, 0600, show_mmcr0, store_mmcr0), | 262 | __ATTR(mmcr0, 0600, show_mmcr0, store_mmcr0), |
264 | _SYSDEV_ATTR(mmcr1, 0600, show_mmcr1, store_mmcr1), | 263 | __ATTR(mmcr1, 0600, show_mmcr1, store_mmcr1), |
265 | }; | 264 | }; |
266 | #endif /* HAS_PPC_PMC_G4 */ | 265 | #endif /* HAS_PPC_PMC_G4 */ |
267 | 266 | ||
268 | #ifdef HAS_PPC_PMC_G4 | 267 | #ifdef HAS_PPC_PMC_G4 |
269 | static struct sysdev_attribute g4_common_attrs[] = { | 268 | static struct device_attribute g4_common_attrs[] = { |
270 | _SYSDEV_ATTR(mmcr0, 0600, show_mmcr0, store_mmcr0), | 269 | __ATTR(mmcr0, 0600, show_mmcr0, store_mmcr0), |
271 | _SYSDEV_ATTR(mmcr1, 0600, show_mmcr1, store_mmcr1), | 270 | __ATTR(mmcr1, 0600, show_mmcr1, store_mmcr1), |
272 | _SYSDEV_ATTR(mmcr2, 0600, show_mmcr2, store_mmcr2), | 271 | __ATTR(mmcr2, 0600, show_mmcr2, store_mmcr2), |
273 | }; | 272 | }; |
274 | #endif /* HAS_PPC_PMC_G4 */ | 273 | #endif /* HAS_PPC_PMC_G4 */ |
275 | 274 | ||
276 | static struct sysdev_attribute classic_pmc_attrs[] = { | 275 | static struct device_attribute classic_pmc_attrs[] = { |
277 | _SYSDEV_ATTR(pmc1, 0600, show_pmc1, store_pmc1), | 276 | __ATTR(pmc1, 0600, show_pmc1, store_pmc1), |
278 | _SYSDEV_ATTR(pmc2, 0600, show_pmc2, store_pmc2), | 277 | __ATTR(pmc2, 0600, show_pmc2, store_pmc2), |
279 | _SYSDEV_ATTR(pmc3, 0600, show_pmc3, store_pmc3), | 278 | __ATTR(pmc3, 0600, show_pmc3, store_pmc3), |
280 | _SYSDEV_ATTR(pmc4, 0600, show_pmc4, store_pmc4), | 279 | __ATTR(pmc4, 0600, show_pmc4, store_pmc4), |
281 | _SYSDEV_ATTR(pmc5, 0600, show_pmc5, store_pmc5), | 280 | __ATTR(pmc5, 0600, show_pmc5, store_pmc5), |
282 | _SYSDEV_ATTR(pmc6, 0600, show_pmc6, store_pmc6), | 281 | __ATTR(pmc6, 0600, show_pmc6, store_pmc6), |
283 | #ifdef CONFIG_PPC64 | 282 | #ifdef CONFIG_PPC64 |
284 | _SYSDEV_ATTR(pmc7, 0600, show_pmc7, store_pmc7), | 283 | __ATTR(pmc7, 0600, show_pmc7, store_pmc7), |
285 | _SYSDEV_ATTR(pmc8, 0600, show_pmc8, store_pmc8), | 284 | __ATTR(pmc8, 0600, show_pmc8, store_pmc8), |
286 | #endif | 285 | #endif |
287 | }; | 286 | }; |
288 | 287 | ||
289 | #ifdef HAS_PPC_PMC_PA6T | 288 | #ifdef HAS_PPC_PMC_PA6T |
290 | static struct sysdev_attribute pa6t_attrs[] = { | 289 | static struct device_attribute pa6t_attrs[] = { |
291 | _SYSDEV_ATTR(mmcr0, 0600, show_mmcr0, store_mmcr0), | 290 | __ATTR(mmcr0, 0600, show_mmcr0, store_mmcr0), |
292 | _SYSDEV_ATTR(mmcr1, 0600, show_mmcr1, store_mmcr1), | 291 | __ATTR(mmcr1, 0600, show_mmcr1, store_mmcr1), |
293 | _SYSDEV_ATTR(pmc0, 0600, show_pa6t_pmc0, store_pa6t_pmc0), | 292 | __ATTR(pmc0, 0600, show_pa6t_pmc0, store_pa6t_pmc0), |
294 | _SYSDEV_ATTR(pmc1, 0600, show_pa6t_pmc1, store_pa6t_pmc1), | 293 | __ATTR(pmc1, 0600, show_pa6t_pmc1, store_pa6t_pmc1), |
295 | _SYSDEV_ATTR(pmc2, 0600, show_pa6t_pmc2, store_pa6t_pmc2), | 294 | __ATTR(pmc2, 0600, show_pa6t_pmc2, store_pa6t_pmc2), |
296 | _SYSDEV_ATTR(pmc3, 0600, show_pa6t_pmc3, store_pa6t_pmc3), | 295 | __ATTR(pmc3, 0600, show_pa6t_pmc3, store_pa6t_pmc3), |
297 | _SYSDEV_ATTR(pmc4, 0600, show_pa6t_pmc4, store_pa6t_pmc4), | 296 | __ATTR(pmc4, 0600, show_pa6t_pmc4, store_pa6t_pmc4), |
298 | _SYSDEV_ATTR(pmc5, 0600, show_pa6t_pmc5, store_pa6t_pmc5), | 297 | __ATTR(pmc5, 0600, show_pa6t_pmc5, store_pa6t_pmc5), |
299 | #ifdef CONFIG_DEBUG_KERNEL | 298 | #ifdef CONFIG_DEBUG_KERNEL |
300 | _SYSDEV_ATTR(hid0, 0600, show_hid0, store_hid0), | 299 | __ATTR(hid0, 0600, show_hid0, store_hid0), |
301 | _SYSDEV_ATTR(hid1, 0600, show_hid1, store_hid1), | 300 | __ATTR(hid1, 0600, show_hid1, store_hid1), |
302 | _SYSDEV_ATTR(hid4, 0600, show_hid4, store_hid4), | 301 | __ATTR(hid4, 0600, show_hid4, store_hid4), |
303 | _SYSDEV_ATTR(hid5, 0600, show_hid5, store_hid5), | 302 | __ATTR(hid5, 0600, show_hid5, store_hid5), |
304 | _SYSDEV_ATTR(ima0, 0600, show_ima0, store_ima0), | 303 | __ATTR(ima0, 0600, show_ima0, store_ima0), |
305 | _SYSDEV_ATTR(ima1, 0600, show_ima1, store_ima1), | 304 | __ATTR(ima1, 0600, show_ima1, store_ima1), |
306 | _SYSDEV_ATTR(ima2, 0600, show_ima2, store_ima2), | 305 | __ATTR(ima2, 0600, show_ima2, store_ima2), |
307 | _SYSDEV_ATTR(ima3, 0600, show_ima3, store_ima3), | 306 | __ATTR(ima3, 0600, show_ima3, store_ima3), |
308 | _SYSDEV_ATTR(ima4, 0600, show_ima4, store_ima4), | 307 | __ATTR(ima4, 0600, show_ima4, store_ima4), |
309 | _SYSDEV_ATTR(ima5, 0600, show_ima5, store_ima5), | 308 | __ATTR(ima5, 0600, show_ima5, store_ima5), |
310 | _SYSDEV_ATTR(ima6, 0600, show_ima6, store_ima6), | 309 | __ATTR(ima6, 0600, show_ima6, store_ima6), |
311 | _SYSDEV_ATTR(ima7, 0600, show_ima7, store_ima7), | 310 | __ATTR(ima7, 0600, show_ima7, store_ima7), |
312 | _SYSDEV_ATTR(ima8, 0600, show_ima8, store_ima8), | 311 | __ATTR(ima8, 0600, show_ima8, store_ima8), |
313 | _SYSDEV_ATTR(ima9, 0600, show_ima9, store_ima9), | 312 | __ATTR(ima9, 0600, show_ima9, store_ima9), |
314 | _SYSDEV_ATTR(imaat, 0600, show_imaat, store_imaat), | 313 | __ATTR(imaat, 0600, show_imaat, store_imaat), |
315 | _SYSDEV_ATTR(btcr, 0600, show_btcr, store_btcr), | 314 | __ATTR(btcr, 0600, show_btcr, store_btcr), |
316 | _SYSDEV_ATTR(pccr, 0600, show_pccr, store_pccr), | 315 | __ATTR(pccr, 0600, show_pccr, store_pccr), |
317 | _SYSDEV_ATTR(rpccr, 0600, show_rpccr, store_rpccr), | 316 | __ATTR(rpccr, 0600, show_rpccr, store_rpccr), |
318 | _SYSDEV_ATTR(der, 0600, show_der, store_der), | 317 | __ATTR(der, 0600, show_der, store_der), |
319 | _SYSDEV_ATTR(mer, 0600, show_mer, store_mer), | 318 | __ATTR(mer, 0600, show_mer, store_mer), |
320 | _SYSDEV_ATTR(ber, 0600, show_ber, store_ber), | 319 | __ATTR(ber, 0600, show_ber, store_ber), |
321 | _SYSDEV_ATTR(ier, 0600, show_ier, store_ier), | 320 | __ATTR(ier, 0600, show_ier, store_ier), |
322 | _SYSDEV_ATTR(sier, 0600, show_sier, store_sier), | 321 | __ATTR(sier, 0600, show_sier, store_sier), |
323 | _SYSDEV_ATTR(siar, 0600, show_siar, store_siar), | 322 | __ATTR(siar, 0600, show_siar, store_siar), |
324 | _SYSDEV_ATTR(tsr0, 0600, show_tsr0, store_tsr0), | 323 | __ATTR(tsr0, 0600, show_tsr0, store_tsr0), |
325 | _SYSDEV_ATTR(tsr1, 0600, show_tsr1, store_tsr1), | 324 | __ATTR(tsr1, 0600, show_tsr1, store_tsr1), |
326 | _SYSDEV_ATTR(tsr2, 0600, show_tsr2, store_tsr2), | 325 | __ATTR(tsr2, 0600, show_tsr2, store_tsr2), |
327 | _SYSDEV_ATTR(tsr3, 0600, show_tsr3, store_tsr3), | 326 | __ATTR(tsr3, 0600, show_tsr3, store_tsr3), |
328 | #endif /* CONFIG_DEBUG_KERNEL */ | 327 | #endif /* CONFIG_DEBUG_KERNEL */ |
329 | }; | 328 | }; |
330 | #endif /* HAS_PPC_PMC_PA6T */ | 329 | #endif /* HAS_PPC_PMC_PA6T */ |
@@ -333,14 +332,14 @@ static struct sysdev_attribute pa6t_attrs[] = { | |||
333 | static void __cpuinit register_cpu_online(unsigned int cpu) | 332 | static void __cpuinit register_cpu_online(unsigned int cpu) |
334 | { | 333 | { |
335 | struct cpu *c = &per_cpu(cpu_devices, cpu); | 334 | struct cpu *c = &per_cpu(cpu_devices, cpu); |
336 | struct sys_device *s = &c->sysdev; | 335 | struct device *s = &c->dev; |
337 | struct sysdev_attribute *attrs, *pmc_attrs; | 336 | struct device_attribute *attrs, *pmc_attrs; |
338 | int i, nattrs; | 337 | int i, nattrs; |
339 | 338 | ||
340 | #ifdef CONFIG_PPC64 | 339 | #ifdef CONFIG_PPC64 |
341 | if (!firmware_has_feature(FW_FEATURE_ISERIES) && | 340 | if (!firmware_has_feature(FW_FEATURE_ISERIES) && |
342 | cpu_has_feature(CPU_FTR_SMT)) | 341 | cpu_has_feature(CPU_FTR_SMT)) |
343 | sysdev_create_file(s, &attr_smt_snooze_delay); | 342 | device_create_file(s, &dev_attr_smt_snooze_delay); |
344 | #endif | 343 | #endif |
345 | 344 | ||
346 | /* PMC stuff */ | 345 | /* PMC stuff */ |
@@ -348,14 +347,14 @@ static void __cpuinit register_cpu_online(unsigned int cpu) | |||
348 | #ifdef HAS_PPC_PMC_IBM | 347 | #ifdef HAS_PPC_PMC_IBM |
349 | case PPC_PMC_IBM: | 348 | case PPC_PMC_IBM: |
350 | attrs = ibm_common_attrs; | 349 | attrs = ibm_common_attrs; |
351 | nattrs = sizeof(ibm_common_attrs) / sizeof(struct sysdev_attribute); | 350 | nattrs = sizeof(ibm_common_attrs) / sizeof(struct device_attribute); |
352 | pmc_attrs = classic_pmc_attrs; | 351 | pmc_attrs = classic_pmc_attrs; |
353 | break; | 352 | break; |
354 | #endif /* HAS_PPC_PMC_IBM */ | 353 | #endif /* HAS_PPC_PMC_IBM */ |
355 | #ifdef HAS_PPC_PMC_G4 | 354 | #ifdef HAS_PPC_PMC_G4 |
356 | case PPC_PMC_G4: | 355 | case PPC_PMC_G4: |
357 | attrs = g4_common_attrs; | 356 | attrs = g4_common_attrs; |
358 | nattrs = sizeof(g4_common_attrs) / sizeof(struct sysdev_attribute); | 357 | nattrs = sizeof(g4_common_attrs) / sizeof(struct device_attribute); |
359 | pmc_attrs = classic_pmc_attrs; | 358 | pmc_attrs = classic_pmc_attrs; |
360 | break; | 359 | break; |
361 | #endif /* HAS_PPC_PMC_G4 */ | 360 | #endif /* HAS_PPC_PMC_G4 */ |
@@ -363,7 +362,7 @@ static void __cpuinit register_cpu_online(unsigned int cpu) | |||
363 | case PPC_PMC_PA6T: | 362 | case PPC_PMC_PA6T: |
364 | /* PA Semi starts counting at PMC0 */ | 363 | /* PA Semi starts counting at PMC0 */ |
365 | attrs = pa6t_attrs; | 364 | attrs = pa6t_attrs; |
366 | nattrs = sizeof(pa6t_attrs) / sizeof(struct sysdev_attribute); | 365 | nattrs = sizeof(pa6t_attrs) / sizeof(struct device_attribute); |
367 | pmc_attrs = NULL; | 366 | pmc_attrs = NULL; |
368 | break; | 367 | break; |
369 | #endif /* HAS_PPC_PMC_PA6T */ | 368 | #endif /* HAS_PPC_PMC_PA6T */ |
@@ -374,24 +373,24 @@ static void __cpuinit register_cpu_online(unsigned int cpu) | |||
374 | } | 373 | } |
375 | 374 | ||
376 | for (i = 0; i < nattrs; i++) | 375 | for (i = 0; i < nattrs; i++) |
377 | sysdev_create_file(s, &attrs[i]); | 376 | device_create_file(s, &attrs[i]); |
378 | 377 | ||
379 | if (pmc_attrs) | 378 | if (pmc_attrs) |
380 | for (i = 0; i < cur_cpu_spec->num_pmcs; i++) | 379 | for (i = 0; i < cur_cpu_spec->num_pmcs; i++) |
381 | sysdev_create_file(s, &pmc_attrs[i]); | 380 | device_create_file(s, &pmc_attrs[i]); |
382 | 381 | ||
383 | #ifdef CONFIG_PPC64 | 382 | #ifdef CONFIG_PPC64 |
384 | if (cpu_has_feature(CPU_FTR_MMCRA)) | 383 | if (cpu_has_feature(CPU_FTR_MMCRA)) |
385 | sysdev_create_file(s, &attr_mmcra); | 384 | device_create_file(s, &dev_attr_mmcra); |
386 | 385 | ||
387 | if (cpu_has_feature(CPU_FTR_PURR)) | 386 | if (cpu_has_feature(CPU_FTR_PURR)) |
388 | sysdev_create_file(s, &attr_purr); | 387 | device_create_file(s, &dev_attr_purr); |
389 | 388 | ||
390 | if (cpu_has_feature(CPU_FTR_SPURR)) | 389 | if (cpu_has_feature(CPU_FTR_SPURR)) |
391 | sysdev_create_file(s, &attr_spurr); | 390 | device_create_file(s, &dev_attr_spurr); |
392 | 391 | ||
393 | if (cpu_has_feature(CPU_FTR_DSCR)) | 392 | if (cpu_has_feature(CPU_FTR_DSCR)) |
394 | sysdev_create_file(s, &attr_dscr); | 393 | device_create_file(s, &dev_attr_dscr); |
395 | #endif /* CONFIG_PPC64 */ | 394 | #endif /* CONFIG_PPC64 */ |
396 | 395 | ||
397 | cacheinfo_cpu_online(cpu); | 396 | cacheinfo_cpu_online(cpu); |
@@ -401,8 +400,8 @@ static void __cpuinit register_cpu_online(unsigned int cpu) | |||
401 | static void unregister_cpu_online(unsigned int cpu) | 400 | static void unregister_cpu_online(unsigned int cpu) |
402 | { | 401 | { |
403 | struct cpu *c = &per_cpu(cpu_devices, cpu); | 402 | struct cpu *c = &per_cpu(cpu_devices, cpu); |
404 | struct sys_device *s = &c->sysdev; | 403 | struct device *s = &c->dev; |
405 | struct sysdev_attribute *attrs, *pmc_attrs; | 404 | struct device_attribute *attrs, *pmc_attrs; |
406 | int i, nattrs; | 405 | int i, nattrs; |
407 | 406 | ||
408 | BUG_ON(!c->hotpluggable); | 407 | BUG_ON(!c->hotpluggable); |
@@ -410,7 +409,7 @@ static void unregister_cpu_online(unsigned int cpu) | |||
410 | #ifdef CONFIG_PPC64 | 409 | #ifdef CONFIG_PPC64 |
411 | if (!firmware_has_feature(FW_FEATURE_ISERIES) && | 410 | if (!firmware_has_feature(FW_FEATURE_ISERIES) && |
412 | cpu_has_feature(CPU_FTR_SMT)) | 411 | cpu_has_feature(CPU_FTR_SMT)) |
413 | sysdev_remove_file(s, &attr_smt_snooze_delay); | 412 | device_remove_file(s, &dev_attr_smt_snooze_delay); |
414 | #endif | 413 | #endif |
415 | 414 | ||
416 | /* PMC stuff */ | 415 | /* PMC stuff */ |
@@ -418,14 +417,14 @@ static void unregister_cpu_online(unsigned int cpu) | |||
418 | #ifdef HAS_PPC_PMC_IBM | 417 | #ifdef HAS_PPC_PMC_IBM |
419 | case PPC_PMC_IBM: | 418 | case PPC_PMC_IBM: |
420 | attrs = ibm_common_attrs; | 419 | attrs = ibm_common_attrs; |
421 | nattrs = sizeof(ibm_common_attrs) / sizeof(struct sysdev_attribute); | 420 | nattrs = sizeof(ibm_common_attrs) / sizeof(struct device_attribute); |
422 | pmc_attrs = classic_pmc_attrs; | 421 | pmc_attrs = classic_pmc_attrs; |
423 | break; | 422 | break; |
424 | #endif /* HAS_PPC_PMC_IBM */ | 423 | #endif /* HAS_PPC_PMC_IBM */ |
425 | #ifdef HAS_PPC_PMC_G4 | 424 | #ifdef HAS_PPC_PMC_G4 |
426 | case PPC_PMC_G4: | 425 | case PPC_PMC_G4: |
427 | attrs = g4_common_attrs; | 426 | attrs = g4_common_attrs; |
428 | nattrs = sizeof(g4_common_attrs) / sizeof(struct sysdev_attribute); | 427 | nattrs = sizeof(g4_common_attrs) / sizeof(struct device_attribute); |
429 | pmc_attrs = classic_pmc_attrs; | 428 | pmc_attrs = classic_pmc_attrs; |
430 | break; | 429 | break; |
431 | #endif /* HAS_PPC_PMC_G4 */ | 430 | #endif /* HAS_PPC_PMC_G4 */ |
@@ -433,7 +432,7 @@ static void unregister_cpu_online(unsigned int cpu) | |||
433 | case PPC_PMC_PA6T: | 432 | case PPC_PMC_PA6T: |
434 | /* PA Semi starts counting at PMC0 */ | 433 | /* PA Semi starts counting at PMC0 */ |
435 | attrs = pa6t_attrs; | 434 | attrs = pa6t_attrs; |
436 | nattrs = sizeof(pa6t_attrs) / sizeof(struct sysdev_attribute); | 435 | nattrs = sizeof(pa6t_attrs) / sizeof(struct device_attribute); |
437 | pmc_attrs = NULL; | 436 | pmc_attrs = NULL; |
438 | break; | 437 | break; |
439 | #endif /* HAS_PPC_PMC_PA6T */ | 438 | #endif /* HAS_PPC_PMC_PA6T */ |
@@ -444,24 +443,24 @@ static void unregister_cpu_online(unsigned int cpu) | |||
444 | } | 443 | } |
445 | 444 | ||
446 | for (i = 0; i < nattrs; i++) | 445 | for (i = 0; i < nattrs; i++) |
447 | sysdev_remove_file(s, &attrs[i]); | 446 | device_remove_file(s, &attrs[i]); |
448 | 447 | ||
449 | if (pmc_attrs) | 448 | if (pmc_attrs) |
450 | for (i = 0; i < cur_cpu_spec->num_pmcs; i++) | 449 | for (i = 0; i < cur_cpu_spec->num_pmcs; i++) |
451 | sysdev_remove_file(s, &pmc_attrs[i]); | 450 | device_remove_file(s, &pmc_attrs[i]); |
452 | 451 | ||
453 | #ifdef CONFIG_PPC64 | 452 | #ifdef CONFIG_PPC64 |
454 | if (cpu_has_feature(CPU_FTR_MMCRA)) | 453 | if (cpu_has_feature(CPU_FTR_MMCRA)) |
455 | sysdev_remove_file(s, &attr_mmcra); | 454 | device_remove_file(s, &dev_attr_mmcra); |
456 | 455 | ||
457 | if (cpu_has_feature(CPU_FTR_PURR)) | 456 | if (cpu_has_feature(CPU_FTR_PURR)) |
458 | sysdev_remove_file(s, &attr_purr); | 457 | device_remove_file(s, &dev_attr_purr); |
459 | 458 | ||
460 | if (cpu_has_feature(CPU_FTR_SPURR)) | 459 | if (cpu_has_feature(CPU_FTR_SPURR)) |
461 | sysdev_remove_file(s, &attr_spurr); | 460 | device_remove_file(s, &dev_attr_spurr); |
462 | 461 | ||
463 | if (cpu_has_feature(CPU_FTR_DSCR)) | 462 | if (cpu_has_feature(CPU_FTR_DSCR)) |
464 | sysdev_remove_file(s, &attr_dscr); | 463 | device_remove_file(s, &dev_attr_dscr); |
465 | #endif /* CONFIG_PPC64 */ | 464 | #endif /* CONFIG_PPC64 */ |
466 | 465 | ||
467 | cacheinfo_cpu_offline(cpu); | 466 | cacheinfo_cpu_offline(cpu); |
@@ -513,70 +512,70 @@ static struct notifier_block __cpuinitdata sysfs_cpu_nb = { | |||
513 | 512 | ||
514 | static DEFINE_MUTEX(cpu_mutex); | 513 | static DEFINE_MUTEX(cpu_mutex); |
515 | 514 | ||
516 | int cpu_add_sysdev_attr(struct sysdev_attribute *attr) | 515 | int cpu_add_dev_attr(struct device_attribute *attr) |
517 | { | 516 | { |
518 | int cpu; | 517 | int cpu; |
519 | 518 | ||
520 | mutex_lock(&cpu_mutex); | 519 | mutex_lock(&cpu_mutex); |
521 | 520 | ||
522 | for_each_possible_cpu(cpu) { | 521 | for_each_possible_cpu(cpu) { |
523 | sysdev_create_file(get_cpu_sysdev(cpu), attr); | 522 | device_create_file(get_cpu_device(cpu), attr); |
524 | } | 523 | } |
525 | 524 | ||
526 | mutex_unlock(&cpu_mutex); | 525 | mutex_unlock(&cpu_mutex); |
527 | return 0; | 526 | return 0; |
528 | } | 527 | } |
529 | EXPORT_SYMBOL_GPL(cpu_add_sysdev_attr); | 528 | EXPORT_SYMBOL_GPL(cpu_add_dev_attr); |
530 | 529 | ||
531 | int cpu_add_sysdev_attr_group(struct attribute_group *attrs) | 530 | int cpu_add_dev_attr_group(struct attribute_group *attrs) |
532 | { | 531 | { |
533 | int cpu; | 532 | int cpu; |
534 | struct sys_device *sysdev; | 533 | struct device *dev; |
535 | int ret; | 534 | int ret; |
536 | 535 | ||
537 | mutex_lock(&cpu_mutex); | 536 | mutex_lock(&cpu_mutex); |
538 | 537 | ||
539 | for_each_possible_cpu(cpu) { | 538 | for_each_possible_cpu(cpu) { |
540 | sysdev = get_cpu_sysdev(cpu); | 539 | dev = get_cpu_device(cpu); |
541 | ret = sysfs_create_group(&sysdev->kobj, attrs); | 540 | ret = sysfs_create_group(&dev->kobj, attrs); |
542 | WARN_ON(ret != 0); | 541 | WARN_ON(ret != 0); |
543 | } | 542 | } |
544 | 543 | ||
545 | mutex_unlock(&cpu_mutex); | 544 | mutex_unlock(&cpu_mutex); |
546 | return 0; | 545 | return 0; |
547 | } | 546 | } |
548 | EXPORT_SYMBOL_GPL(cpu_add_sysdev_attr_group); | 547 | EXPORT_SYMBOL_GPL(cpu_add_dev_attr_group); |
549 | 548 | ||
550 | 549 | ||
551 | void cpu_remove_sysdev_attr(struct sysdev_attribute *attr) | 550 | void cpu_remove_dev_attr(struct device_attribute *attr) |
552 | { | 551 | { |
553 | int cpu; | 552 | int cpu; |
554 | 553 | ||
555 | mutex_lock(&cpu_mutex); | 554 | mutex_lock(&cpu_mutex); |
556 | 555 | ||
557 | for_each_possible_cpu(cpu) { | 556 | for_each_possible_cpu(cpu) { |
558 | sysdev_remove_file(get_cpu_sysdev(cpu), attr); | 557 | device_remove_file(get_cpu_device(cpu), attr); |
559 | } | 558 | } |
560 | 559 | ||
561 | mutex_unlock(&cpu_mutex); | 560 | mutex_unlock(&cpu_mutex); |
562 | } | 561 | } |
563 | EXPORT_SYMBOL_GPL(cpu_remove_sysdev_attr); | 562 | EXPORT_SYMBOL_GPL(cpu_remove_dev_attr); |
564 | 563 | ||
565 | void cpu_remove_sysdev_attr_group(struct attribute_group *attrs) | 564 | void cpu_remove_dev_attr_group(struct attribute_group *attrs) |
566 | { | 565 | { |
567 | int cpu; | 566 | int cpu; |
568 | struct sys_device *sysdev; | 567 | struct device *dev; |
569 | 568 | ||
570 | mutex_lock(&cpu_mutex); | 569 | mutex_lock(&cpu_mutex); |
571 | 570 | ||
572 | for_each_possible_cpu(cpu) { | 571 | for_each_possible_cpu(cpu) { |
573 | sysdev = get_cpu_sysdev(cpu); | 572 | dev = get_cpu_device(cpu); |
574 | sysfs_remove_group(&sysdev->kobj, attrs); | 573 | sysfs_remove_group(&dev->kobj, attrs); |
575 | } | 574 | } |
576 | 575 | ||
577 | mutex_unlock(&cpu_mutex); | 576 | mutex_unlock(&cpu_mutex); |
578 | } | 577 | } |
579 | EXPORT_SYMBOL_GPL(cpu_remove_sysdev_attr_group); | 578 | EXPORT_SYMBOL_GPL(cpu_remove_dev_attr_group); |
580 | 579 | ||
581 | 580 | ||
582 | /* NUMA stuff */ | 581 | /* NUMA stuff */ |
@@ -590,18 +589,18 @@ static void register_nodes(void) | |||
590 | register_one_node(i); | 589 | register_one_node(i); |
591 | } | 590 | } |
592 | 591 | ||
593 | int sysfs_add_device_to_node(struct sys_device *dev, int nid) | 592 | int sysfs_add_device_to_node(struct device *dev, int nid) |
594 | { | 593 | { |
595 | struct node *node = &node_devices[nid]; | 594 | struct node *node = &node_devices[nid]; |
596 | return sysfs_create_link(&node->sysdev.kobj, &dev->kobj, | 595 | return sysfs_create_link(&node->dev.kobj, &dev->kobj, |
597 | kobject_name(&dev->kobj)); | 596 | kobject_name(&dev->kobj)); |
598 | } | 597 | } |
599 | EXPORT_SYMBOL_GPL(sysfs_add_device_to_node); | 598 | EXPORT_SYMBOL_GPL(sysfs_add_device_to_node); |
600 | 599 | ||
601 | void sysfs_remove_device_from_node(struct sys_device *dev, int nid) | 600 | void sysfs_remove_device_from_node(struct device *dev, int nid) |
602 | { | 601 | { |
603 | struct node *node = &node_devices[nid]; | 602 | struct node *node = &node_devices[nid]; |
604 | sysfs_remove_link(&node->sysdev.kobj, kobject_name(&dev->kobj)); | 603 | sysfs_remove_link(&node->dev.kobj, kobject_name(&dev->kobj)); |
605 | } | 604 | } |
606 | EXPORT_SYMBOL_GPL(sysfs_remove_device_from_node); | 605 | EXPORT_SYMBOL_GPL(sysfs_remove_device_from_node); |
607 | 606 | ||
@@ -614,14 +613,14 @@ static void register_nodes(void) | |||
614 | #endif | 613 | #endif |
615 | 614 | ||
616 | /* Only valid if CPU is present. */ | 615 | /* Only valid if CPU is present. */ |
617 | static ssize_t show_physical_id(struct sys_device *dev, | 616 | static ssize_t show_physical_id(struct device *dev, |
618 | struct sysdev_attribute *attr, char *buf) | 617 | struct device_attribute *attr, char *buf) |
619 | { | 618 | { |
620 | struct cpu *cpu = container_of(dev, struct cpu, sysdev); | 619 | struct cpu *cpu = container_of(dev, struct cpu, dev); |
621 | 620 | ||
622 | return sprintf(buf, "%d\n", get_hard_smp_processor_id(cpu->sysdev.id)); | 621 | return sprintf(buf, "%d\n", get_hard_smp_processor_id(cpu->dev.id)); |
623 | } | 622 | } |
624 | static SYSDEV_ATTR(physical_id, 0444, show_physical_id, NULL); | 623 | static DEVICE_ATTR(physical_id, 0444, show_physical_id, NULL); |
625 | 624 | ||
626 | static int __init topology_init(void) | 625 | static int __init topology_init(void) |
627 | { | 626 | { |
@@ -646,7 +645,7 @@ static int __init topology_init(void) | |||
646 | if (cpu_online(cpu) || c->hotpluggable) { | 645 | if (cpu_online(cpu) || c->hotpluggable) { |
647 | register_cpu(c, cpu); | 646 | register_cpu(c, cpu); |
648 | 647 | ||
649 | sysdev_create_file(&c->sysdev, &attr_physical_id); | 648 | device_create_file(&c->dev, &dev_attr_physical_id); |
650 | } | 649 | } |
651 | 650 | ||
652 | if (cpu_online(cpu)) | 651 | if (cpu_online(cpu)) |
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index b22a83a91cb8..b088e985bee2 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -1462,7 +1462,7 @@ int arch_update_cpu_topology(void) | |||
1462 | { | 1462 | { |
1463 | int cpu, nid, old_nid; | 1463 | int cpu, nid, old_nid; |
1464 | unsigned int associativity[VPHN_ASSOC_BUFSIZE] = {0}; | 1464 | unsigned int associativity[VPHN_ASSOC_BUFSIZE] = {0}; |
1465 | struct sys_device *sysdev; | 1465 | struct device *dev; |
1466 | 1466 | ||
1467 | for_each_cpu(cpu,&cpu_associativity_changes_mask) { | 1467 | for_each_cpu(cpu,&cpu_associativity_changes_mask) { |
1468 | vphn_get_associativity(cpu, associativity); | 1468 | vphn_get_associativity(cpu, associativity); |
@@ -1483,9 +1483,9 @@ int arch_update_cpu_topology(void) | |||
1483 | register_cpu_under_node(cpu, nid); | 1483 | register_cpu_under_node(cpu, nid); |
1484 | put_online_cpus(); | 1484 | put_online_cpus(); |
1485 | 1485 | ||
1486 | sysdev = get_cpu_sysdev(cpu); | 1486 | dev = get_cpu_device(cpu); |
1487 | if (sysdev) | 1487 | if (dev) |
1488 | kobject_uevent(&sysdev->kobj, KOBJ_CHANGE); | 1488 | kobject_uevent(&dev->kobj, KOBJ_CHANGE); |
1489 | } | 1489 | } |
1490 | 1490 | ||
1491 | return 1; | 1491 | return 1; |
diff --git a/arch/powerpc/platforms/cell/cbe_thermal.c b/arch/powerpc/platforms/cell/cbe_thermal.c index 4d4c8c169124..94560db788bf 100644 --- a/arch/powerpc/platforms/cell/cbe_thermal.c +++ b/arch/powerpc/platforms/cell/cbe_thermal.c | |||
@@ -46,7 +46,7 @@ | |||
46 | */ | 46 | */ |
47 | 47 | ||
48 | #include <linux/module.h> | 48 | #include <linux/module.h> |
49 | #include <linux/sysdev.h> | 49 | #include <linux/device.h> |
50 | #include <linux/kernel.h> | 50 | #include <linux/kernel.h> |
51 | #include <linux/cpu.h> | 51 | #include <linux/cpu.h> |
52 | #include <asm/spu.h> | 52 | #include <asm/spu.h> |
@@ -59,8 +59,8 @@ | |||
59 | #define TEMP_MIN 65 | 59 | #define TEMP_MIN 65 |
60 | #define TEMP_MAX 125 | 60 | #define TEMP_MAX 125 |
61 | 61 | ||
62 | #define SYSDEV_PREFIX_ATTR(_prefix,_name,_mode) \ | 62 | #define DEVICE_PREFIX_ATTR(_prefix,_name,_mode) \ |
63 | struct sysdev_attribute attr_ ## _prefix ## _ ## _name = { \ | 63 | struct device_attribute attr_ ## _prefix ## _ ## _name = { \ |
64 | .attr = { .name = __stringify(_name), .mode = _mode }, \ | 64 | .attr = { .name = __stringify(_name), .mode = _mode }, \ |
65 | .show = _prefix ## _show_ ## _name, \ | 65 | .show = _prefix ## _show_ ## _name, \ |
66 | .store = _prefix ## _store_ ## _name, \ | 66 | .store = _prefix ## _store_ ## _name, \ |
@@ -76,36 +76,36 @@ static inline u8 temp_to_reg(u8 temp) | |||
76 | return ((temp - TEMP_MIN) >> 1) & 0x3f; | 76 | return ((temp - TEMP_MIN) >> 1) & 0x3f; |
77 | } | 77 | } |
78 | 78 | ||
79 | static struct cbe_pmd_regs __iomem *get_pmd_regs(struct sys_device *sysdev) | 79 | static struct cbe_pmd_regs __iomem *get_pmd_regs(struct device *dev) |
80 | { | 80 | { |
81 | struct spu *spu; | 81 | struct spu *spu; |
82 | 82 | ||
83 | spu = container_of(sysdev, struct spu, sysdev); | 83 | spu = container_of(dev, struct spu, dev); |
84 | 84 | ||
85 | return cbe_get_pmd_regs(spu_devnode(spu)); | 85 | return cbe_get_pmd_regs(spu_devnode(spu)); |
86 | } | 86 | } |
87 | 87 | ||
88 | /* returns the value for a given spu in a given register */ | 88 | /* returns the value for a given spu in a given register */ |
89 | static u8 spu_read_register_value(struct sys_device *sysdev, union spe_reg __iomem *reg) | 89 | static u8 spu_read_register_value(struct device *dev, union spe_reg __iomem *reg) |
90 | { | 90 | { |
91 | union spe_reg value; | 91 | union spe_reg value; |
92 | struct spu *spu; | 92 | struct spu *spu; |
93 | 93 | ||
94 | spu = container_of(sysdev, struct spu, sysdev); | 94 | spu = container_of(dev, struct spu, dev); |
95 | value.val = in_be64(®->val); | 95 | value.val = in_be64(®->val); |
96 | 96 | ||
97 | return value.spe[spu->spe_id]; | 97 | return value.spe[spu->spe_id]; |
98 | } | 98 | } |
99 | 99 | ||
100 | static ssize_t spu_show_temp(struct sys_device *sysdev, struct sysdev_attribute *attr, | 100 | static ssize_t spu_show_temp(struct device *dev, struct device_attribute *attr, |
101 | char *buf) | 101 | char *buf) |
102 | { | 102 | { |
103 | u8 value; | 103 | u8 value; |
104 | struct cbe_pmd_regs __iomem *pmd_regs; | 104 | struct cbe_pmd_regs __iomem *pmd_regs; |
105 | 105 | ||
106 | pmd_regs = get_pmd_regs(sysdev); | 106 | pmd_regs = get_pmd_regs(dev); |
107 | 107 | ||
108 | value = spu_read_register_value(sysdev, &pmd_regs->ts_ctsr1); | 108 | value = spu_read_register_value(dev, &pmd_regs->ts_ctsr1); |
109 | 109 | ||
110 | return sprintf(buf, "%d\n", reg_to_temp(value)); | 110 | return sprintf(buf, "%d\n", reg_to_temp(value)); |
111 | } | 111 | } |
@@ -147,48 +147,48 @@ static ssize_t store_throttle(struct cbe_pmd_regs __iomem *pmd_regs, const char | |||
147 | return size; | 147 | return size; |
148 | } | 148 | } |
149 | 149 | ||
150 | static ssize_t spu_show_throttle_end(struct sys_device *sysdev, | 150 | static ssize_t spu_show_throttle_end(struct device *dev, |
151 | struct sysdev_attribute *attr, char *buf) | 151 | struct device_attribute *attr, char *buf) |
152 | { | 152 | { |
153 | return show_throttle(get_pmd_regs(sysdev), buf, 0); | 153 | return show_throttle(get_pmd_regs(dev), buf, 0); |
154 | } | 154 | } |
155 | 155 | ||
156 | static ssize_t spu_show_throttle_begin(struct sys_device *sysdev, | 156 | static ssize_t spu_show_throttle_begin(struct device *dev, |
157 | struct sysdev_attribute *attr, char *buf) | 157 | struct device_attribute *attr, char *buf) |
158 | { | 158 | { |
159 | return show_throttle(get_pmd_regs(sysdev), buf, 8); | 159 | return show_throttle(get_pmd_regs(dev), buf, 8); |
160 | } | 160 | } |
161 | 161 | ||
162 | static ssize_t spu_show_throttle_full_stop(struct sys_device *sysdev, | 162 | static ssize_t spu_show_throttle_full_stop(struct device *dev, |
163 | struct sysdev_attribute *attr, char *buf) | 163 | struct device_attribute *attr, char *buf) |
164 | { | 164 | { |
165 | return show_throttle(get_pmd_regs(sysdev), buf, 16); | 165 | return show_throttle(get_pmd_regs(dev), buf, 16); |
166 | } | 166 | } |
167 | 167 | ||
168 | static ssize_t spu_store_throttle_end(struct sys_device *sysdev, | 168 | static ssize_t spu_store_throttle_end(struct device *dev, |
169 | struct sysdev_attribute *attr, const char *buf, size_t size) | 169 | struct device_attribute *attr, const char *buf, size_t size) |
170 | { | 170 | { |
171 | return store_throttle(get_pmd_regs(sysdev), buf, size, 0); | 171 | return store_throttle(get_pmd_regs(dev), buf, size, 0); |
172 | } | 172 | } |
173 | 173 | ||
174 | static ssize_t spu_store_throttle_begin(struct sys_device *sysdev, | 174 | static ssize_t spu_store_throttle_begin(struct device *dev, |
175 | struct sysdev_attribute *attr, const char *buf, size_t size) | 175 | struct device_attribute *attr, const char *buf, size_t size) |
176 | { | 176 | { |
177 | return store_throttle(get_pmd_regs(sysdev), buf, size, 8); | 177 | return store_throttle(get_pmd_regs(dev), buf, size, 8); |
178 | } | 178 | } |
179 | 179 | ||
180 | static ssize_t spu_store_throttle_full_stop(struct sys_device *sysdev, | 180 | static ssize_t spu_store_throttle_full_stop(struct device *dev, |
181 | struct sysdev_attribute *attr, const char *buf, size_t size) | 181 | struct device_attribute *attr, const char *buf, size_t size) |
182 | { | 182 | { |
183 | return store_throttle(get_pmd_regs(sysdev), buf, size, 16); | 183 | return store_throttle(get_pmd_regs(dev), buf, size, 16); |
184 | } | 184 | } |
185 | 185 | ||
186 | static ssize_t ppe_show_temp(struct sys_device *sysdev, char *buf, int pos) | 186 | static ssize_t ppe_show_temp(struct device *dev, char *buf, int pos) |
187 | { | 187 | { |
188 | struct cbe_pmd_regs __iomem *pmd_regs; | 188 | struct cbe_pmd_regs __iomem *pmd_regs; |
189 | u64 value; | 189 | u64 value; |
190 | 190 | ||
191 | pmd_regs = cbe_get_cpu_pmd_regs(sysdev->id); | 191 | pmd_regs = cbe_get_cpu_pmd_regs(dev->id); |
192 | value = in_be64(&pmd_regs->ts_ctsr2); | 192 | value = in_be64(&pmd_regs->ts_ctsr2); |
193 | 193 | ||
194 | value = (value >> pos) & 0x3f; | 194 | value = (value >> pos) & 0x3f; |
@@ -199,64 +199,64 @@ static ssize_t ppe_show_temp(struct sys_device *sysdev, char *buf, int pos) | |||
199 | 199 | ||
200 | /* shows the temperature of the DTS on the PPE, | 200 | /* shows the temperature of the DTS on the PPE, |
201 | * located near the linear thermal sensor */ | 201 | * located near the linear thermal sensor */ |
202 | static ssize_t ppe_show_temp0(struct sys_device *sysdev, | 202 | static ssize_t ppe_show_temp0(struct device *dev, |
203 | struct sysdev_attribute *attr, char *buf) | 203 | struct device_attribute *attr, char *buf) |
204 | { | 204 | { |
205 | return ppe_show_temp(sysdev, buf, 32); | 205 | return ppe_show_temp(dev, buf, 32); |
206 | } | 206 | } |
207 | 207 | ||
208 | /* shows the temperature of the second DTS on the PPE */ | 208 | /* shows the temperature of the second DTS on the PPE */ |
209 | static ssize_t ppe_show_temp1(struct sys_device *sysdev, | 209 | static ssize_t ppe_show_temp1(struct device *dev, |
210 | struct sysdev_attribute *attr, char *buf) | 210 | struct device_attribute *attr, char *buf) |
211 | { | 211 | { |
212 | return ppe_show_temp(sysdev, buf, 0); | 212 | return ppe_show_temp(dev, buf, 0); |
213 | } | 213 | } |
214 | 214 | ||
215 | static ssize_t ppe_show_throttle_end(struct sys_device *sysdev, | 215 | static ssize_t ppe_show_throttle_end(struct device *dev, |
216 | struct sysdev_attribute *attr, char *buf) | 216 | struct device_attribute *attr, char *buf) |
217 | { | 217 | { |
218 | return show_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, 32); | 218 | return show_throttle(cbe_get_cpu_pmd_regs(dev->id), buf, 32); |
219 | } | 219 | } |
220 | 220 | ||
221 | static ssize_t ppe_show_throttle_begin(struct sys_device *sysdev, | 221 | static ssize_t ppe_show_throttle_begin(struct device *dev, |
222 | struct sysdev_attribute *attr, char *buf) | 222 | struct device_attribute *attr, char *buf) |
223 | { | 223 | { |
224 | return show_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, 40); | 224 | return show_throttle(cbe_get_cpu_pmd_regs(dev->id), buf, 40); |
225 | } | 225 | } |
226 | 226 | ||
227 | static ssize_t ppe_show_throttle_full_stop(struct sys_device *sysdev, | 227 | static ssize_t ppe_show_throttle_full_stop(struct device *dev, |
228 | struct sysdev_attribute *attr, char *buf) | 228 | struct device_attribute *attr, char *buf) |
229 | { | 229 | { |
230 | return show_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, 48); | 230 | return show_throttle(cbe_get_cpu_pmd_regs(dev->id), buf, 48); |
231 | } | 231 | } |
232 | 232 | ||
233 | static ssize_t ppe_store_throttle_end(struct sys_device *sysdev, | 233 | static ssize_t ppe_store_throttle_end(struct device *dev, |
234 | struct sysdev_attribute *attr, const char *buf, size_t size) | 234 | struct device_attribute *attr, const char *buf, size_t size) |
235 | { | 235 | { |
236 | return store_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, size, 32); | 236 | return store_throttle(cbe_get_cpu_pmd_regs(dev->id), buf, size, 32); |
237 | } | 237 | } |
238 | 238 | ||
239 | static ssize_t ppe_store_throttle_begin(struct sys_device *sysdev, | 239 | static ssize_t ppe_store_throttle_begin(struct device *dev, |
240 | struct sysdev_attribute *attr, const char *buf, size_t size) | 240 | struct device_attribute *attr, const char *buf, size_t size) |
241 | { | 241 | { |
242 | return store_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, size, 40); | 242 | return store_throttle(cbe_get_cpu_pmd_regs(dev->id), buf, size, 40); |
243 | } | 243 | } |
244 | 244 | ||
245 | static ssize_t ppe_store_throttle_full_stop(struct sys_device *sysdev, | 245 | static ssize_t ppe_store_throttle_full_stop(struct device *dev, |
246 | struct sysdev_attribute *attr, const char *buf, size_t size) | 246 | struct device_attribute *attr, const char *buf, size_t size) |
247 | { | 247 | { |
248 | return store_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, size, 48); | 248 | return store_throttle(cbe_get_cpu_pmd_regs(dev->id), buf, size, 48); |
249 | } | 249 | } |
250 | 250 | ||
251 | 251 | ||
252 | static struct sysdev_attribute attr_spu_temperature = { | 252 | static struct device_attribute attr_spu_temperature = { |
253 | .attr = {.name = "temperature", .mode = 0400 }, | 253 | .attr = {.name = "temperature", .mode = 0400 }, |
254 | .show = spu_show_temp, | 254 | .show = spu_show_temp, |
255 | }; | 255 | }; |
256 | 256 | ||
257 | static SYSDEV_PREFIX_ATTR(spu, throttle_end, 0600); | 257 | static DEVICE_PREFIX_ATTR(spu, throttle_end, 0600); |
258 | static SYSDEV_PREFIX_ATTR(spu, throttle_begin, 0600); | 258 | static DEVICE_PREFIX_ATTR(spu, throttle_begin, 0600); |
259 | static SYSDEV_PREFIX_ATTR(spu, throttle_full_stop, 0600); | 259 | static DEVICE_PREFIX_ATTR(spu, throttle_full_stop, 0600); |
260 | 260 | ||
261 | 261 | ||
262 | static struct attribute *spu_attributes[] = { | 262 | static struct attribute *spu_attributes[] = { |
@@ -272,19 +272,19 @@ static struct attribute_group spu_attribute_group = { | |||
272 | .attrs = spu_attributes, | 272 | .attrs = spu_attributes, |
273 | }; | 273 | }; |
274 | 274 | ||
275 | static struct sysdev_attribute attr_ppe_temperature0 = { | 275 | static struct device_attribute attr_ppe_temperature0 = { |
276 | .attr = {.name = "temperature0", .mode = 0400 }, | 276 | .attr = {.name = "temperature0", .mode = 0400 }, |
277 | .show = ppe_show_temp0, | 277 | .show = ppe_show_temp0, |
278 | }; | 278 | }; |
279 | 279 | ||
280 | static struct sysdev_attribute attr_ppe_temperature1 = { | 280 | static struct device_attribute attr_ppe_temperature1 = { |
281 | .attr = {.name = "temperature1", .mode = 0400 }, | 281 | .attr = {.name = "temperature1", .mode = 0400 }, |
282 | .show = ppe_show_temp1, | 282 | .show = ppe_show_temp1, |
283 | }; | 283 | }; |
284 | 284 | ||
285 | static SYSDEV_PREFIX_ATTR(ppe, throttle_end, 0600); | 285 | static DEVICE_PREFIX_ATTR(ppe, throttle_end, 0600); |
286 | static SYSDEV_PREFIX_ATTR(ppe, throttle_begin, 0600); | 286 | static DEVICE_PREFIX_ATTR(ppe, throttle_begin, 0600); |
287 | static SYSDEV_PREFIX_ATTR(ppe, throttle_full_stop, 0600); | 287 | static DEVICE_PREFIX_ATTR(ppe, throttle_full_stop, 0600); |
288 | 288 | ||
289 | static struct attribute *ppe_attributes[] = { | 289 | static struct attribute *ppe_attributes[] = { |
290 | &attr_ppe_temperature0.attr, | 290 | &attr_ppe_temperature0.attr, |
@@ -307,7 +307,7 @@ static int __init init_default_values(void) | |||
307 | { | 307 | { |
308 | int cpu; | 308 | int cpu; |
309 | struct cbe_pmd_regs __iomem *pmd_regs; | 309 | struct cbe_pmd_regs __iomem *pmd_regs; |
310 | struct sys_device *sysdev; | 310 | struct device *dev; |
311 | union ppe_spe_reg tpr; | 311 | union ppe_spe_reg tpr; |
312 | union spe_reg str1; | 312 | union spe_reg str1; |
313 | u64 str2; | 313 | u64 str2; |
@@ -349,14 +349,14 @@ static int __init init_default_values(void) | |||
349 | 349 | ||
350 | for_each_possible_cpu (cpu) { | 350 | for_each_possible_cpu (cpu) { |
351 | pr_debug("processing cpu %d\n", cpu); | 351 | pr_debug("processing cpu %d\n", cpu); |
352 | sysdev = get_cpu_sysdev(cpu); | 352 | dev = get_cpu_device(cpu); |
353 | 353 | ||
354 | if (!sysdev) { | 354 | if (!dev) { |
355 | pr_info("invalid sysdev pointer for cbe_thermal\n"); | 355 | pr_info("invalid dev pointer for cbe_thermal\n"); |
356 | return -EINVAL; | 356 | return -EINVAL; |
357 | } | 357 | } |
358 | 358 | ||
359 | pmd_regs = cbe_get_cpu_pmd_regs(sysdev->id); | 359 | pmd_regs = cbe_get_cpu_pmd_regs(dev->id); |
360 | 360 | ||
361 | if (!pmd_regs) { | 361 | if (!pmd_regs) { |
362 | pr_info("invalid CBE regs pointer for cbe_thermal\n"); | 362 | pr_info("invalid CBE regs pointer for cbe_thermal\n"); |
@@ -379,8 +379,8 @@ static int __init thermal_init(void) | |||
379 | int rc = init_default_values(); | 379 | int rc = init_default_values(); |
380 | 380 | ||
381 | if (rc == 0) { | 381 | if (rc == 0) { |
382 | spu_add_sysdev_attr_group(&spu_attribute_group); | 382 | spu_add_dev_attr_group(&spu_attribute_group); |
383 | cpu_add_sysdev_attr_group(&ppe_attribute_group); | 383 | cpu_add_dev_attr_group(&ppe_attribute_group); |
384 | } | 384 | } |
385 | 385 | ||
386 | return rc; | 386 | return rc; |
@@ -389,8 +389,8 @@ module_init(thermal_init); | |||
389 | 389 | ||
390 | static void __exit thermal_exit(void) | 390 | static void __exit thermal_exit(void) |
391 | { | 391 | { |
392 | spu_remove_sysdev_attr_group(&spu_attribute_group); | 392 | spu_remove_dev_attr_group(&spu_attribute_group); |
393 | cpu_remove_sysdev_attr_group(&ppe_attribute_group); | 393 | cpu_remove_dev_attr_group(&ppe_attribute_group); |
394 | } | 394 | } |
395 | module_exit(thermal_exit); | 395 | module_exit(thermal_exit); |
396 | 396 | ||
diff --git a/arch/powerpc/platforms/cell/smp.c b/arch/powerpc/platforms/cell/smp.c index f5c5c762d5a3..4a255cf8cd17 100644 --- a/arch/powerpc/platforms/cell/smp.c +++ b/arch/powerpc/platforms/cell/smp.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #include <linux/spinlock.h> | 23 | #include <linux/spinlock.h> |
24 | #include <linux/cache.h> | 24 | #include <linux/cache.h> |
25 | #include <linux/err.h> | 25 | #include <linux/err.h> |
26 | #include <linux/sysdev.h> | 26 | #include <linux/device.h> |
27 | #include <linux/cpu.h> | 27 | #include <linux/cpu.h> |
28 | 28 | ||
29 | #include <asm/ptrace.h> | 29 | #include <asm/ptrace.h> |
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c index e94d3ecdd8bb..8b1213993b10 100644 --- a/arch/powerpc/platforms/cell/spu_base.c +++ b/arch/powerpc/platforms/cell/spu_base.c | |||
@@ -519,31 +519,32 @@ void spu_init_channels(struct spu *spu) | |||
519 | } | 519 | } |
520 | EXPORT_SYMBOL_GPL(spu_init_channels); | 520 | EXPORT_SYMBOL_GPL(spu_init_channels); |
521 | 521 | ||
522 | static struct sysdev_class spu_sysdev_class = { | 522 | static struct bus_type spu_subsys = { |
523 | .name = "spu", | 523 | .name = "spu", |
524 | .dev_name = "spu", | ||
524 | }; | 525 | }; |
525 | 526 | ||
526 | int spu_add_sysdev_attr(struct sysdev_attribute *attr) | 527 | int spu_add_dev_attr(struct device_attribute *attr) |
527 | { | 528 | { |
528 | struct spu *spu; | 529 | struct spu *spu; |
529 | 530 | ||
530 | mutex_lock(&spu_full_list_mutex); | 531 | mutex_lock(&spu_full_list_mutex); |
531 | list_for_each_entry(spu, &spu_full_list, full_list) | 532 | list_for_each_entry(spu, &spu_full_list, full_list) |
532 | sysdev_create_file(&spu->sysdev, attr); | 533 | device_create_file(&spu->dev, attr); |
533 | mutex_unlock(&spu_full_list_mutex); | 534 | mutex_unlock(&spu_full_list_mutex); |
534 | 535 | ||
535 | return 0; | 536 | return 0; |
536 | } | 537 | } |
537 | EXPORT_SYMBOL_GPL(spu_add_sysdev_attr); | 538 | EXPORT_SYMBOL_GPL(spu_add_dev_attr); |
538 | 539 | ||
539 | int spu_add_sysdev_attr_group(struct attribute_group *attrs) | 540 | int spu_add_dev_attr_group(struct attribute_group *attrs) |
540 | { | 541 | { |
541 | struct spu *spu; | 542 | struct spu *spu; |
542 | int rc = 0; | 543 | int rc = 0; |
543 | 544 | ||
544 | mutex_lock(&spu_full_list_mutex); | 545 | mutex_lock(&spu_full_list_mutex); |
545 | list_for_each_entry(spu, &spu_full_list, full_list) { | 546 | list_for_each_entry(spu, &spu_full_list, full_list) { |
546 | rc = sysfs_create_group(&spu->sysdev.kobj, attrs); | 547 | rc = sysfs_create_group(&spu->dev.kobj, attrs); |
547 | 548 | ||
548 | /* we're in trouble here, but try unwinding anyway */ | 549 | /* we're in trouble here, but try unwinding anyway */ |
549 | if (rc) { | 550 | if (rc) { |
@@ -552,7 +553,7 @@ int spu_add_sysdev_attr_group(struct attribute_group *attrs) | |||
552 | 553 | ||
553 | list_for_each_entry_continue_reverse(spu, | 554 | list_for_each_entry_continue_reverse(spu, |
554 | &spu_full_list, full_list) | 555 | &spu_full_list, full_list) |
555 | sysfs_remove_group(&spu->sysdev.kobj, attrs); | 556 | sysfs_remove_group(&spu->dev.kobj, attrs); |
556 | break; | 557 | break; |
557 | } | 558 | } |
558 | } | 559 | } |
@@ -561,45 +562,45 @@ int spu_add_sysdev_attr_group(struct attribute_group *attrs) | |||
561 | 562 | ||
562 | return rc; | 563 | return rc; |
563 | } | 564 | } |
564 | EXPORT_SYMBOL_GPL(spu_add_sysdev_attr_group); | 565 | EXPORT_SYMBOL_GPL(spu_add_dev_attr_group); |
565 | 566 | ||
566 | 567 | ||
567 | void spu_remove_sysdev_attr(struct sysdev_attribute *attr) | 568 | void spu_remove_dev_attr(struct device_attribute *attr) |
568 | { | 569 | { |
569 | struct spu *spu; | 570 | struct spu *spu; |
570 | 571 | ||
571 | mutex_lock(&spu_full_list_mutex); | 572 | mutex_lock(&spu_full_list_mutex); |
572 | list_for_each_entry(spu, &spu_full_list, full_list) | 573 | list_for_each_entry(spu, &spu_full_list, full_list) |
573 | sysdev_remove_file(&spu->sysdev, attr); | 574 | device_remove_file(&spu->dev, attr); |
574 | mutex_unlock(&spu_full_list_mutex); | 575 | mutex_unlock(&spu_full_list_mutex); |
575 | } | 576 | } |
576 | EXPORT_SYMBOL_GPL(spu_remove_sysdev_attr); | 577 | EXPORT_SYMBOL_GPL(spu_remove_dev_attr); |
577 | 578 | ||
578 | void spu_remove_sysdev_attr_group(struct attribute_group *attrs) | 579 | void spu_remove_dev_attr_group(struct attribute_group *attrs) |
579 | { | 580 | { |
580 | struct spu *spu; | 581 | struct spu *spu; |
581 | 582 | ||
582 | mutex_lock(&spu_full_list_mutex); | 583 | mutex_lock(&spu_full_list_mutex); |
583 | list_for_each_entry(spu, &spu_full_list, full_list) | 584 | list_for_each_entry(spu, &spu_full_list, full_list) |
584 | sysfs_remove_group(&spu->sysdev.kobj, attrs); | 585 | sysfs_remove_group(&spu->dev.kobj, attrs); |
585 | mutex_unlock(&spu_full_list_mutex); | 586 | mutex_unlock(&spu_full_list_mutex); |
586 | } | 587 | } |
587 | EXPORT_SYMBOL_GPL(spu_remove_sysdev_attr_group); | 588 | EXPORT_SYMBOL_GPL(spu_remove_dev_attr_group); |
588 | 589 | ||
589 | static int spu_create_sysdev(struct spu *spu) | 590 | static int spu_create_dev(struct spu *spu) |
590 | { | 591 | { |
591 | int ret; | 592 | int ret; |
592 | 593 | ||
593 | spu->sysdev.id = spu->number; | 594 | spu->dev.id = spu->number; |
594 | spu->sysdev.cls = &spu_sysdev_class; | 595 | spu->dev.bus = &spu_subsys; |
595 | ret = sysdev_register(&spu->sysdev); | 596 | ret = device_register(&spu->dev); |
596 | if (ret) { | 597 | if (ret) { |
597 | printk(KERN_ERR "Can't register SPU %d with sysfs\n", | 598 | printk(KERN_ERR "Can't register SPU %d with sysfs\n", |
598 | spu->number); | 599 | spu->number); |
599 | return ret; | 600 | return ret; |
600 | } | 601 | } |
601 | 602 | ||
602 | sysfs_add_device_to_node(&spu->sysdev, spu->node); | 603 | sysfs_add_device_to_node(&spu->dev, spu->node); |
603 | 604 | ||
604 | return 0; | 605 | return 0; |
605 | } | 606 | } |
@@ -635,7 +636,7 @@ static int __init create_spu(void *data) | |||
635 | if (ret) | 636 | if (ret) |
636 | goto out_destroy; | 637 | goto out_destroy; |
637 | 638 | ||
638 | ret = spu_create_sysdev(spu); | 639 | ret = spu_create_dev(spu); |
639 | if (ret) | 640 | if (ret) |
640 | goto out_free_irqs; | 641 | goto out_free_irqs; |
641 | 642 | ||
@@ -692,10 +693,10 @@ static unsigned long long spu_acct_time(struct spu *spu, | |||
692 | } | 693 | } |
693 | 694 | ||
694 | 695 | ||
695 | static ssize_t spu_stat_show(struct sys_device *sysdev, | 696 | static ssize_t spu_stat_show(struct device *dev, |
696 | struct sysdev_attribute *attr, char *buf) | 697 | struct device_attribute *attr, char *buf) |
697 | { | 698 | { |
698 | struct spu *spu = container_of(sysdev, struct spu, sysdev); | 699 | struct spu *spu = container_of(dev, struct spu, dev); |
699 | 700 | ||
700 | return sprintf(buf, "%s %llu %llu %llu %llu " | 701 | return sprintf(buf, "%s %llu %llu %llu %llu " |
701 | "%llu %llu %llu %llu %llu %llu %llu %llu\n", | 702 | "%llu %llu %llu %llu %llu %llu %llu %llu\n", |
@@ -714,7 +715,7 @@ static ssize_t spu_stat_show(struct sys_device *sysdev, | |||
714 | spu->stats.libassist); | 715 | spu->stats.libassist); |
715 | } | 716 | } |
716 | 717 | ||
717 | static SYSDEV_ATTR(stat, 0644, spu_stat_show, NULL); | 718 | static DEVICE_ATTR(stat, 0644, spu_stat_show, NULL); |
718 | 719 | ||
719 | #ifdef CONFIG_KEXEC | 720 | #ifdef CONFIG_KEXEC |
720 | 721 | ||
@@ -813,8 +814,8 @@ static int __init init_spu_base(void) | |||
813 | if (!spu_management_ops) | 814 | if (!spu_management_ops) |
814 | goto out; | 815 | goto out; |
815 | 816 | ||
816 | /* create sysdev class for spus */ | 817 | /* create system subsystem for spus */ |
817 | ret = sysdev_class_register(&spu_sysdev_class); | 818 | ret = subsys_system_register(&spu_subsys, NULL); |
818 | if (ret) | 819 | if (ret) |
819 | goto out; | 820 | goto out; |
820 | 821 | ||
@@ -823,7 +824,7 @@ static int __init init_spu_base(void) | |||
823 | if (ret < 0) { | 824 | if (ret < 0) { |
824 | printk(KERN_WARNING "%s: Error initializing spus\n", | 825 | printk(KERN_WARNING "%s: Error initializing spus\n", |
825 | __func__); | 826 | __func__); |
826 | goto out_unregister_sysdev_class; | 827 | goto out_unregister_subsys; |
827 | } | 828 | } |
828 | 829 | ||
829 | if (ret > 0) | 830 | if (ret > 0) |
@@ -833,15 +834,15 @@ static int __init init_spu_base(void) | |||
833 | xmon_register_spus(&spu_full_list); | 834 | xmon_register_spus(&spu_full_list); |
834 | crash_register_spus(&spu_full_list); | 835 | crash_register_spus(&spu_full_list); |
835 | mutex_unlock(&spu_full_list_mutex); | 836 | mutex_unlock(&spu_full_list_mutex); |
836 | spu_add_sysdev_attr(&attr_stat); | 837 | spu_add_dev_attr(&dev_attr_stat); |
837 | register_syscore_ops(&spu_syscore_ops); | 838 | register_syscore_ops(&spu_syscore_ops); |
838 | 839 | ||
839 | spu_init_affinity(); | 840 | spu_init_affinity(); |
840 | 841 | ||
841 | return 0; | 842 | return 0; |
842 | 843 | ||
843 | out_unregister_sysdev_class: | 844 | out_unregister_subsys: |
844 | sysdev_class_unregister(&spu_sysdev_class); | 845 | bus_unregister(&spu_subsys); |
845 | out: | 846 | out: |
846 | return ret; | 847 | return ret; |
847 | } | 848 | } |
diff --git a/arch/powerpc/platforms/iseries/smp.c b/arch/powerpc/platforms/iseries/smp.c index 7e2a5515ed76..02df49fb59f0 100644 --- a/arch/powerpc/platforms/iseries/smp.c +++ b/arch/powerpc/platforms/iseries/smp.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <linux/spinlock.h> | 24 | #include <linux/spinlock.h> |
25 | #include <linux/cache.h> | 25 | #include <linux/cache.h> |
26 | #include <linux/err.h> | 26 | #include <linux/err.h> |
27 | #include <linux/sysdev.h> | 27 | #include <linux/device.h> |
28 | #include <linux/cpu.h> | 28 | #include <linux/cpu.h> |
29 | 29 | ||
30 | #include <asm/ptrace.h> | 30 | #include <asm/ptrace.h> |
diff --git a/arch/powerpc/platforms/powermac/cpufreq_32.c b/arch/powerpc/platforms/powermac/cpufreq_32.c index 04af5f48b4eb..1fc386a23f18 100644 --- a/arch/powerpc/platforms/powermac/cpufreq_32.c +++ b/arch/powerpc/platforms/powermac/cpufreq_32.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #include <linux/pmu.h> | 23 | #include <linux/pmu.h> |
24 | #include <linux/cpufreq.h> | 24 | #include <linux/cpufreq.h> |
25 | #include <linux/init.h> | 25 | #include <linux/init.h> |
26 | #include <linux/sysdev.h> | 26 | #include <linux/device.h> |
27 | #include <linux/hardirq.h> | 27 | #include <linux/hardirq.h> |
28 | #include <asm/prom.h> | 28 | #include <asm/prom.h> |
29 | #include <asm/machdep.h> | 29 | #include <asm/machdep.h> |
diff --git a/arch/powerpc/platforms/pseries/cmm.c b/arch/powerpc/platforms/pseries/cmm.c index 3cafc306b971..c638535753df 100644 --- a/arch/powerpc/platforms/pseries/cmm.c +++ b/arch/powerpc/platforms/pseries/cmm.c | |||
@@ -33,7 +33,7 @@ | |||
33 | #include <linux/sched.h> | 33 | #include <linux/sched.h> |
34 | #include <linux/stringify.h> | 34 | #include <linux/stringify.h> |
35 | #include <linux/swap.h> | 35 | #include <linux/swap.h> |
36 | #include <linux/sysdev.h> | 36 | #include <linux/device.h> |
37 | #include <asm/firmware.h> | 37 | #include <asm/firmware.h> |
38 | #include <asm/hvcall.h> | 38 | #include <asm/hvcall.h> |
39 | #include <asm/mmu.h> | 39 | #include <asm/mmu.h> |
@@ -65,7 +65,7 @@ static unsigned int oom_kb = CMM_OOM_KB; | |||
65 | static unsigned int cmm_debug = CMM_DEBUG; | 65 | static unsigned int cmm_debug = CMM_DEBUG; |
66 | static unsigned int cmm_disabled = CMM_DISABLE; | 66 | static unsigned int cmm_disabled = CMM_DISABLE; |
67 | static unsigned long min_mem_mb = CMM_MIN_MEM_MB; | 67 | static unsigned long min_mem_mb = CMM_MIN_MEM_MB; |
68 | static struct sys_device cmm_sysdev; | 68 | static struct device cmm_dev; |
69 | 69 | ||
70 | MODULE_AUTHOR("Brian King <brking@linux.vnet.ibm.com>"); | 70 | MODULE_AUTHOR("Brian King <brking@linux.vnet.ibm.com>"); |
71 | MODULE_DESCRIPTION("IBM System p Collaborative Memory Manager"); | 71 | MODULE_DESCRIPTION("IBM System p Collaborative Memory Manager"); |
@@ -347,25 +347,25 @@ static int cmm_thread(void *dummy) | |||
347 | } | 347 | } |
348 | 348 | ||
349 | #define CMM_SHOW(name, format, args...) \ | 349 | #define CMM_SHOW(name, format, args...) \ |
350 | static ssize_t show_##name(struct sys_device *dev, \ | 350 | static ssize_t show_##name(struct device *dev, \ |
351 | struct sysdev_attribute *attr, \ | 351 | struct device_attribute *attr, \ |
352 | char *buf) \ | 352 | char *buf) \ |
353 | { \ | 353 | { \ |
354 | return sprintf(buf, format, ##args); \ | 354 | return sprintf(buf, format, ##args); \ |
355 | } \ | 355 | } \ |
356 | static SYSDEV_ATTR(name, S_IRUGO, show_##name, NULL) | 356 | static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL) |
357 | 357 | ||
358 | CMM_SHOW(loaned_kb, "%lu\n", PAGES2KB(loaned_pages)); | 358 | CMM_SHOW(loaned_kb, "%lu\n", PAGES2KB(loaned_pages)); |
359 | CMM_SHOW(loaned_target_kb, "%lu\n", PAGES2KB(loaned_pages_target)); | 359 | CMM_SHOW(loaned_target_kb, "%lu\n", PAGES2KB(loaned_pages_target)); |
360 | 360 | ||
361 | static ssize_t show_oom_pages(struct sys_device *dev, | 361 | static ssize_t show_oom_pages(struct device *dev, |
362 | struct sysdev_attribute *attr, char *buf) | 362 | struct device_attribute *attr, char *buf) |
363 | { | 363 | { |
364 | return sprintf(buf, "%lu\n", PAGES2KB(oom_freed_pages)); | 364 | return sprintf(buf, "%lu\n", PAGES2KB(oom_freed_pages)); |
365 | } | 365 | } |
366 | 366 | ||
367 | static ssize_t store_oom_pages(struct sys_device *dev, | 367 | static ssize_t store_oom_pages(struct device *dev, |
368 | struct sysdev_attribute *attr, | 368 | struct device_attribute *attr, |
369 | const char *buf, size_t count) | 369 | const char *buf, size_t count) |
370 | { | 370 | { |
371 | unsigned long val = simple_strtoul (buf, NULL, 10); | 371 | unsigned long val = simple_strtoul (buf, NULL, 10); |
@@ -379,17 +379,18 @@ static ssize_t store_oom_pages(struct sys_device *dev, | |||
379 | return count; | 379 | return count; |
380 | } | 380 | } |
381 | 381 | ||
382 | static SYSDEV_ATTR(oom_freed_kb, S_IWUSR| S_IRUGO, | 382 | static DEVICE_ATTR(oom_freed_kb, S_IWUSR | S_IRUGO, |
383 | show_oom_pages, store_oom_pages); | 383 | show_oom_pages, store_oom_pages); |
384 | 384 | ||
385 | static struct sysdev_attribute *cmm_attrs[] = { | 385 | static struct device_attribute *cmm_attrs[] = { |
386 | &attr_loaned_kb, | 386 | &dev_attr_loaned_kb, |
387 | &attr_loaned_target_kb, | 387 | &dev_attr_loaned_target_kb, |
388 | &attr_oom_freed_kb, | 388 | &dev_attr_oom_freed_kb, |
389 | }; | 389 | }; |
390 | 390 | ||
391 | static struct sysdev_class cmm_sysdev_class = { | 391 | static struct bus_type cmm_subsys = { |
392 | .name = "cmm", | 392 | .name = "cmm", |
393 | .dev_name = "cmm", | ||
393 | }; | 394 | }; |
394 | 395 | ||
395 | /** | 396 | /** |
@@ -398,21 +399,21 @@ static struct sysdev_class cmm_sysdev_class = { | |||
398 | * Return value: | 399 | * Return value: |
399 | * 0 on success / other on failure | 400 | * 0 on success / other on failure |
400 | **/ | 401 | **/ |
401 | static int cmm_sysfs_register(struct sys_device *sysdev) | 402 | static int cmm_sysfs_register(struct device *dev) |
402 | { | 403 | { |
403 | int i, rc; | 404 | int i, rc; |
404 | 405 | ||
405 | if ((rc = sysdev_class_register(&cmm_sysdev_class))) | 406 | if ((rc = subsys_system_register(&cmm_subsys, NULL))) |
406 | return rc; | 407 | return rc; |
407 | 408 | ||
408 | sysdev->id = 0; | 409 | dev->id = 0; |
409 | sysdev->cls = &cmm_sysdev_class; | 410 | dev->bus = &cmm_subsys; |
410 | 411 | ||
411 | if ((rc = sysdev_register(sysdev))) | 412 | if ((rc = device_register(dev))) |
412 | goto class_unregister; | 413 | goto subsys_unregister; |
413 | 414 | ||
414 | for (i = 0; i < ARRAY_SIZE(cmm_attrs); i++) { | 415 | for (i = 0; i < ARRAY_SIZE(cmm_attrs); i++) { |
415 | if ((rc = sysdev_create_file(sysdev, cmm_attrs[i]))) | 416 | if ((rc = device_create_file(dev, cmm_attrs[i]))) |
416 | goto fail; | 417 | goto fail; |
417 | } | 418 | } |
418 | 419 | ||
@@ -420,10 +421,10 @@ static int cmm_sysfs_register(struct sys_device *sysdev) | |||
420 | 421 | ||
421 | fail: | 422 | fail: |
422 | while (--i >= 0) | 423 | while (--i >= 0) |
423 | sysdev_remove_file(sysdev, cmm_attrs[i]); | 424 | device_remove_file(dev, cmm_attrs[i]); |
424 | sysdev_unregister(sysdev); | 425 | device_unregister(dev); |
425 | class_unregister: | 426 | subsys_unregister: |
426 | sysdev_class_unregister(&cmm_sysdev_class); | 427 | bus_unregister(&cmm_subsys); |
427 | return rc; | 428 | return rc; |
428 | } | 429 | } |
429 | 430 | ||
@@ -431,14 +432,14 @@ class_unregister: | |||
431 | * cmm_unregister_sysfs - Unregister from sysfs | 432 | * cmm_unregister_sysfs - Unregister from sysfs |
432 | * | 433 | * |
433 | **/ | 434 | **/ |
434 | static void cmm_unregister_sysfs(struct sys_device *sysdev) | 435 | static void cmm_unregister_sysfs(struct device *dev) |
435 | { | 436 | { |
436 | int i; | 437 | int i; |
437 | 438 | ||
438 | for (i = 0; i < ARRAY_SIZE(cmm_attrs); i++) | 439 | for (i = 0; i < ARRAY_SIZE(cmm_attrs); i++) |
439 | sysdev_remove_file(sysdev, cmm_attrs[i]); | 440 | device_remove_file(dev, cmm_attrs[i]); |
440 | sysdev_unregister(sysdev); | 441 | device_unregister(dev); |
441 | sysdev_class_unregister(&cmm_sysdev_class); | 442 | bus_unregister(&cmm_subsys); |
442 | } | 443 | } |
443 | 444 | ||
444 | /** | 445 | /** |
@@ -657,7 +658,7 @@ static int cmm_init(void) | |||
657 | if ((rc = register_reboot_notifier(&cmm_reboot_nb))) | 658 | if ((rc = register_reboot_notifier(&cmm_reboot_nb))) |
658 | goto out_oom_notifier; | 659 | goto out_oom_notifier; |
659 | 660 | ||
660 | if ((rc = cmm_sysfs_register(&cmm_sysdev))) | 661 | if ((rc = cmm_sysfs_register(&cmm_dev))) |
661 | goto out_reboot_notifier; | 662 | goto out_reboot_notifier; |
662 | 663 | ||
663 | if (register_memory_notifier(&cmm_mem_nb) || | 664 | if (register_memory_notifier(&cmm_mem_nb) || |
@@ -678,7 +679,7 @@ static int cmm_init(void) | |||
678 | out_unregister_notifier: | 679 | out_unregister_notifier: |
679 | unregister_memory_notifier(&cmm_mem_nb); | 680 | unregister_memory_notifier(&cmm_mem_nb); |
680 | unregister_memory_isolate_notifier(&cmm_mem_isolate_nb); | 681 | unregister_memory_isolate_notifier(&cmm_mem_isolate_nb); |
681 | cmm_unregister_sysfs(&cmm_sysdev); | 682 | cmm_unregister_sysfs(&cmm_dev); |
682 | out_reboot_notifier: | 683 | out_reboot_notifier: |
683 | unregister_reboot_notifier(&cmm_reboot_nb); | 684 | unregister_reboot_notifier(&cmm_reboot_nb); |
684 | out_oom_notifier: | 685 | out_oom_notifier: |
@@ -701,7 +702,7 @@ static void cmm_exit(void) | |||
701 | unregister_memory_notifier(&cmm_mem_nb); | 702 | unregister_memory_notifier(&cmm_mem_nb); |
702 | unregister_memory_isolate_notifier(&cmm_mem_isolate_nb); | 703 | unregister_memory_isolate_notifier(&cmm_mem_isolate_nb); |
703 | cmm_free_pages(loaned_pages); | 704 | cmm_free_pages(loaned_pages); |
704 | cmm_unregister_sysfs(&cmm_sysdev); | 705 | cmm_unregister_sysfs(&cmm_dev); |
705 | } | 706 | } |
706 | 707 | ||
707 | /** | 708 | /** |
diff --git a/arch/powerpc/platforms/pseries/pseries_energy.c b/arch/powerpc/platforms/pseries/pseries_energy.c index c8b3c69fe891..af281dce510a 100644 --- a/arch/powerpc/platforms/pseries/pseries_energy.c +++ b/arch/powerpc/platforms/pseries/pseries_energy.c | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <linux/errno.h> | 15 | #include <linux/errno.h> |
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/seq_file.h> | 17 | #include <linux/seq_file.h> |
18 | #include <linux/sysdev.h> | 18 | #include <linux/device.h> |
19 | #include <linux/cpu.h> | 19 | #include <linux/cpu.h> |
20 | #include <linux/of.h> | 20 | #include <linux/of.h> |
21 | #include <asm/cputhreads.h> | 21 | #include <asm/cputhreads.h> |
@@ -184,7 +184,7 @@ static ssize_t get_best_energy_list(char *page, int activate) | |||
184 | return s-page; | 184 | return s-page; |
185 | } | 185 | } |
186 | 186 | ||
187 | static ssize_t get_best_energy_data(struct sys_device *dev, | 187 | static ssize_t get_best_energy_data(struct device *dev, |
188 | char *page, int activate) | 188 | char *page, int activate) |
189 | { | 189 | { |
190 | int rc; | 190 | int rc; |
@@ -207,26 +207,26 @@ static ssize_t get_best_energy_data(struct sys_device *dev, | |||
207 | 207 | ||
208 | /* Wrapper functions */ | 208 | /* Wrapper functions */ |
209 | 209 | ||
210 | static ssize_t cpu_activate_hint_list_show(struct sysdev_class *class, | 210 | static ssize_t cpu_activate_hint_list_show(struct device *dev, |
211 | struct sysdev_class_attribute *attr, char *page) | 211 | struct device_attribute *attr, char *page) |
212 | { | 212 | { |
213 | return get_best_energy_list(page, 1); | 213 | return get_best_energy_list(page, 1); |
214 | } | 214 | } |
215 | 215 | ||
216 | static ssize_t cpu_deactivate_hint_list_show(struct sysdev_class *class, | 216 | static ssize_t cpu_deactivate_hint_list_show(struct device *dev, |
217 | struct sysdev_class_attribute *attr, char *page) | 217 | struct device_attribute *attr, char *page) |
218 | { | 218 | { |
219 | return get_best_energy_list(page, 0); | 219 | return get_best_energy_list(page, 0); |
220 | } | 220 | } |
221 | 221 | ||
222 | static ssize_t percpu_activate_hint_show(struct sys_device *dev, | 222 | static ssize_t percpu_activate_hint_show(struct device *dev, |
223 | struct sysdev_attribute *attr, char *page) | 223 | struct device_attribute *attr, char *page) |
224 | { | 224 | { |
225 | return get_best_energy_data(dev, page, 1); | 225 | return get_best_energy_data(dev, page, 1); |
226 | } | 226 | } |
227 | 227 | ||
228 | static ssize_t percpu_deactivate_hint_show(struct sys_device *dev, | 228 | static ssize_t percpu_deactivate_hint_show(struct device *dev, |
229 | struct sysdev_attribute *attr, char *page) | 229 | struct device_attribute *attr, char *page) |
230 | { | 230 | { |
231 | return get_best_energy_data(dev, page, 0); | 231 | return get_best_energy_data(dev, page, 0); |
232 | } | 232 | } |
@@ -241,48 +241,48 @@ static ssize_t percpu_deactivate_hint_show(struct sys_device *dev, | |||
241 | * Per-cpu value of the hint | 241 | * Per-cpu value of the hint |
242 | */ | 242 | */ |
243 | 243 | ||
244 | struct sysdev_class_attribute attr_cpu_activate_hint_list = | 244 | struct device_attribute attr_cpu_activate_hint_list = |
245 | _SYSDEV_CLASS_ATTR(pseries_activate_hint_list, 0444, | 245 | __ATTR(pseries_activate_hint_list, 0444, |
246 | cpu_activate_hint_list_show, NULL); | 246 | cpu_activate_hint_list_show, NULL); |
247 | 247 | ||
248 | struct sysdev_class_attribute attr_cpu_deactivate_hint_list = | 248 | struct device_attribute attr_cpu_deactivate_hint_list = |
249 | _SYSDEV_CLASS_ATTR(pseries_deactivate_hint_list, 0444, | 249 | __ATTR(pseries_deactivate_hint_list, 0444, |
250 | cpu_deactivate_hint_list_show, NULL); | 250 | cpu_deactivate_hint_list_show, NULL); |
251 | 251 | ||
252 | struct sysdev_attribute attr_percpu_activate_hint = | 252 | struct device_attribute attr_percpu_activate_hint = |
253 | _SYSDEV_ATTR(pseries_activate_hint, 0444, | 253 | __ATTR(pseries_activate_hint, 0444, |
254 | percpu_activate_hint_show, NULL); | 254 | percpu_activate_hint_show, NULL); |
255 | 255 | ||
256 | struct sysdev_attribute attr_percpu_deactivate_hint = | 256 | struct device_attribute attr_percpu_deactivate_hint = |
257 | _SYSDEV_ATTR(pseries_deactivate_hint, 0444, | 257 | __ATTR(pseries_deactivate_hint, 0444, |
258 | percpu_deactivate_hint_show, NULL); | 258 | percpu_deactivate_hint_show, NULL); |
259 | 259 | ||
260 | static int __init pseries_energy_init(void) | 260 | static int __init pseries_energy_init(void) |
261 | { | 261 | { |
262 | int cpu, err; | 262 | int cpu, err; |
263 | struct sys_device *cpu_sys_dev; | 263 | struct device *cpu_dev; |
264 | 264 | ||
265 | if (!check_for_h_best_energy()) { | 265 | if (!check_for_h_best_energy()) { |
266 | printk(KERN_INFO "Hypercall H_BEST_ENERGY not supported\n"); | 266 | printk(KERN_INFO "Hypercall H_BEST_ENERGY not supported\n"); |
267 | return 0; | 267 | return 0; |
268 | } | 268 | } |
269 | /* Create the sysfs files */ | 269 | /* Create the sysfs files */ |
270 | err = sysfs_create_file(&cpu_sysdev_class.kset.kobj, | 270 | err = device_create_file(cpu_subsys.dev_root, |
271 | &attr_cpu_activate_hint_list.attr); | 271 | &attr_cpu_activate_hint_list); |
272 | if (!err) | 272 | if (!err) |
273 | err = sysfs_create_file(&cpu_sysdev_class.kset.kobj, | 273 | err = device_create_file(cpu_subsys.dev_root, |
274 | &attr_cpu_deactivate_hint_list.attr); | 274 | &attr_cpu_deactivate_hint_list); |
275 | 275 | ||
276 | if (err) | 276 | if (err) |
277 | return err; | 277 | return err; |
278 | for_each_possible_cpu(cpu) { | 278 | for_each_possible_cpu(cpu) { |
279 | cpu_sys_dev = get_cpu_sysdev(cpu); | 279 | cpu_dev = get_cpu_device(cpu); |
280 | err = sysfs_create_file(&cpu_sys_dev->kobj, | 280 | err = device_create_file(cpu_dev, |
281 | &attr_percpu_activate_hint.attr); | 281 | &attr_percpu_activate_hint); |
282 | if (err) | 282 | if (err) |
283 | break; | 283 | break; |
284 | err = sysfs_create_file(&cpu_sys_dev->kobj, | 284 | err = device_create_file(cpu_dev, |
285 | &attr_percpu_deactivate_hint.attr); | 285 | &attr_percpu_deactivate_hint); |
286 | if (err) | 286 | if (err) |
287 | break; | 287 | break; |
288 | } | 288 | } |
@@ -298,23 +298,20 @@ static int __init pseries_energy_init(void) | |||
298 | static void __exit pseries_energy_cleanup(void) | 298 | static void __exit pseries_energy_cleanup(void) |
299 | { | 299 | { |
300 | int cpu; | 300 | int cpu; |
301 | struct sys_device *cpu_sys_dev; | 301 | struct device *cpu_dev; |
302 | 302 | ||
303 | if (!sysfs_entries) | 303 | if (!sysfs_entries) |
304 | return; | 304 | return; |
305 | 305 | ||
306 | /* Remove the sysfs files */ | 306 | /* Remove the sysfs files */ |
307 | sysfs_remove_file(&cpu_sysdev_class.kset.kobj, | 307 | device_remove_file(cpu_subsys.dev_root, &attr_cpu_activate_hint_list); |
308 | &attr_cpu_activate_hint_list.attr); | 308 | device_remove_file(cpu_subsys.dev_root, &attr_cpu_deactivate_hint_list); |
309 | |||
310 | sysfs_remove_file(&cpu_sysdev_class.kset.kobj, | ||
311 | &attr_cpu_deactivate_hint_list.attr); | ||
312 | 309 | ||
313 | for_each_possible_cpu(cpu) { | 310 | for_each_possible_cpu(cpu) { |
314 | cpu_sys_dev = get_cpu_sysdev(cpu); | 311 | cpu_dev = get_cpu_device(cpu); |
315 | sysfs_remove_file(&cpu_sys_dev->kobj, | 312 | sysfs_remove_file(&cpu_dev->kobj, |
316 | &attr_percpu_activate_hint.attr); | 313 | &attr_percpu_activate_hint.attr); |
317 | sysfs_remove_file(&cpu_sys_dev->kobj, | 314 | sysfs_remove_file(&cpu_dev->kobj, |
318 | &attr_percpu_deactivate_hint.attr); | 315 | &attr_percpu_deactivate_hint.attr); |
319 | } | 316 | } |
320 | } | 317 | } |
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c index 26e93fd4c62b..6212ff4693ea 100644 --- a/arch/powerpc/platforms/pseries/smp.c +++ b/arch/powerpc/platforms/pseries/smp.c | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <linux/spinlock.h> | 22 | #include <linux/spinlock.h> |
23 | #include <linux/cache.h> | 23 | #include <linux/cache.h> |
24 | #include <linux/err.h> | 24 | #include <linux/err.h> |
25 | #include <linux/sysdev.h> | 25 | #include <linux/device.h> |
26 | #include <linux/cpu.h> | 26 | #include <linux/cpu.h> |
27 | 27 | ||
28 | #include <asm/ptrace.h> | 28 | #include <asm/ptrace.h> |
diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c index d3de0849f296..b84a8b2238dd 100644 --- a/arch/powerpc/platforms/pseries/suspend.c +++ b/arch/powerpc/platforms/pseries/suspend.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <asm/rtas.h> | 26 | #include <asm/rtas.h> |
27 | 27 | ||
28 | static u64 stream_id; | 28 | static u64 stream_id; |
29 | static struct sys_device suspend_sysdev; | 29 | static struct device suspend_dev; |
30 | static DECLARE_COMPLETION(suspend_work); | 30 | static DECLARE_COMPLETION(suspend_work); |
31 | static struct rtas_suspend_me_data suspend_data; | 31 | static struct rtas_suspend_me_data suspend_data; |
32 | static atomic_t suspending; | 32 | static atomic_t suspending; |
@@ -110,8 +110,8 @@ static int pseries_prepare_late(void) | |||
110 | 110 | ||
111 | /** | 111 | /** |
112 | * store_hibernate - Initiate partition hibernation | 112 | * store_hibernate - Initiate partition hibernation |
113 | * @classdev: sysdev class struct | 113 | * @dev: subsys root device |
114 | * @attr: class device attribute struct | 114 | * @attr: device attribute struct |
115 | * @buf: buffer | 115 | * @buf: buffer |
116 | * @count: buffer size | 116 | * @count: buffer size |
117 | * | 117 | * |
@@ -121,8 +121,8 @@ static int pseries_prepare_late(void) | |||
121 | * Return value: | 121 | * Return value: |
122 | * number of bytes printed to buffer / other on failure | 122 | * number of bytes printed to buffer / other on failure |
123 | **/ | 123 | **/ |
124 | static ssize_t store_hibernate(struct sysdev_class *classdev, | 124 | static ssize_t store_hibernate(struct device *dev, |
125 | struct sysdev_class_attribute *attr, | 125 | struct device_attribute *attr, |
126 | const char *buf, size_t count) | 126 | const char *buf, size_t count) |
127 | { | 127 | { |
128 | int rc; | 128 | int rc; |
@@ -148,10 +148,11 @@ static ssize_t store_hibernate(struct sysdev_class *classdev, | |||
148 | return rc; | 148 | return rc; |
149 | } | 149 | } |
150 | 150 | ||
151 | static SYSDEV_CLASS_ATTR(hibernate, S_IWUSR, NULL, store_hibernate); | 151 | static DEVICE_ATTR(hibernate, S_IWUSR, NULL, store_hibernate); |
152 | 152 | ||
153 | static struct sysdev_class suspend_sysdev_class = { | 153 | static struct bus_type suspend_subsys = { |
154 | .name = "power", | 154 | .name = "power", |
155 | .dev_name = "power", | ||
155 | }; | 156 | }; |
156 | 157 | ||
157 | static const struct platform_suspend_ops pseries_suspend_ops = { | 158 | static const struct platform_suspend_ops pseries_suspend_ops = { |
@@ -167,23 +168,23 @@ static const struct platform_suspend_ops pseries_suspend_ops = { | |||
167 | * Return value: | 168 | * Return value: |
168 | * 0 on success / other on failure | 169 | * 0 on success / other on failure |
169 | **/ | 170 | **/ |
170 | static int pseries_suspend_sysfs_register(struct sys_device *sysdev) | 171 | static int pseries_suspend_sysfs_register(struct device *dev) |
171 | { | 172 | { |
172 | int rc; | 173 | int rc; |
173 | 174 | ||
174 | if ((rc = sysdev_class_register(&suspend_sysdev_class))) | 175 | if ((rc = subsys_system_register(&suspend_subsys, NULL))) |
175 | return rc; | 176 | return rc; |
176 | 177 | ||
177 | sysdev->id = 0; | 178 | dev->id = 0; |
178 | sysdev->cls = &suspend_sysdev_class; | 179 | dev->bus = &suspend_subsys; |
179 | 180 | ||
180 | if ((rc = sysdev_class_create_file(&suspend_sysdev_class, &attr_hibernate))) | 181 | if ((rc = device_create_file(suspend_subsys.dev_root, &dev_attr_hibernate))) |
181 | goto class_unregister; | 182 | goto subsys_unregister; |
182 | 183 | ||
183 | return 0; | 184 | return 0; |
184 | 185 | ||
185 | class_unregister: | 186 | subsys_unregister: |
186 | sysdev_class_unregister(&suspend_sysdev_class); | 187 | bus_unregister(&suspend_subsys); |
187 | return rc; | 188 | return rc; |
188 | } | 189 | } |
189 | 190 | ||
@@ -204,7 +205,7 @@ static int __init pseries_suspend_init(void) | |||
204 | if (suspend_data.token == RTAS_UNKNOWN_SERVICE) | 205 | if (suspend_data.token == RTAS_UNKNOWN_SERVICE) |
205 | return 0; | 206 | return 0; |
206 | 207 | ||
207 | if ((rc = pseries_suspend_sysfs_register(&suspend_sysdev))) | 208 | if ((rc = pseries_suspend_sysfs_register(&suspend_dev))) |
208 | return rc; | 209 | return rc; |
209 | 210 | ||
210 | ppc_md.suspend_disable_cpu = pseries_suspend_cpu; | 211 | ppc_md.suspend_disable_cpu = pseries_suspend_cpu; |
diff --git a/arch/powerpc/sysdev/ppc4xx_cpm.c b/arch/powerpc/sysdev/ppc4xx_cpm.c index 73b86cc5ea74..82e2cfe35c62 100644 --- a/arch/powerpc/sysdev/ppc4xx_cpm.c +++ b/arch/powerpc/sysdev/ppc4xx_cpm.c | |||
@@ -179,12 +179,12 @@ static struct kobj_attribute cpm_idle_attr = | |||
179 | 179 | ||
180 | static void cpm_idle_config_sysfs(void) | 180 | static void cpm_idle_config_sysfs(void) |
181 | { | 181 | { |
182 | struct sys_device *sys_dev; | 182 | struct device *dev; |
183 | unsigned long ret; | 183 | unsigned long ret; |
184 | 184 | ||
185 | sys_dev = get_cpu_sysdev(0); | 185 | dev = get_cpu_device(0); |
186 | 186 | ||
187 | ret = sysfs_create_file(&sys_dev->kobj, | 187 | ret = sysfs_create_file(&dev->kobj, |
188 | &cpm_idle_attr.attr); | 188 | &cpm_idle_attr.attr); |
189 | if (ret) | 189 | if (ret) |
190 | printk(KERN_WARNING | 190 | printk(KERN_WARNING |
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/arch/powerpc/sysdev/qe_lib/qe_ic.c index 18e75ca19fe6..73034bd203c4 100644 --- a/arch/powerpc/sysdev/qe_lib/qe_ic.c +++ b/arch/powerpc/sysdev/qe_lib/qe_ic.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <linux/stddef.h> | 22 | #include <linux/stddef.h> |
23 | #include <linux/sched.h> | 23 | #include <linux/sched.h> |
24 | #include <linux/signal.h> | 24 | #include <linux/signal.h> |
25 | #include <linux/sysdev.h> | ||
26 | #include <linux/device.h> | 25 | #include <linux/device.h> |
27 | #include <linux/bootmem.h> | 26 | #include <linux/bootmem.h> |
28 | #include <linux/spinlock.h> | 27 | #include <linux/spinlock.h> |
@@ -484,13 +483,14 @@ int qe_ic_set_high_priority(unsigned int virq, unsigned int priority, int high) | |||
484 | return 0; | 483 | return 0; |
485 | } | 484 | } |
486 | 485 | ||
487 | static struct sysdev_class qe_ic_sysclass = { | 486 | static struct bus_type qe_ic_subsys = { |
488 | .name = "qe_ic", | 487 | .name = "qe_ic", |
488 | .dev_name = "qe_ic", | ||
489 | }; | 489 | }; |
490 | 490 | ||
491 | static struct sys_device device_qe_ic = { | 491 | static struct device device_qe_ic = { |
492 | .id = 0, | 492 | .id = 0, |
493 | .cls = &qe_ic_sysclass, | 493 | .bus = &qe_ic_subsys, |
494 | }; | 494 | }; |
495 | 495 | ||
496 | static int __init init_qe_ic_sysfs(void) | 496 | static int __init init_qe_ic_sysfs(void) |
@@ -499,12 +499,12 @@ static int __init init_qe_ic_sysfs(void) | |||
499 | 499 | ||
500 | printk(KERN_DEBUG "Registering qe_ic with sysfs...\n"); | 500 | printk(KERN_DEBUG "Registering qe_ic with sysfs...\n"); |
501 | 501 | ||
502 | rc = sysdev_class_register(&qe_ic_sysclass); | 502 | rc = subsys_system_register(&qe_ic_subsys, NULL); |
503 | if (rc) { | 503 | if (rc) { |
504 | printk(KERN_ERR "Failed registering qe_ic sys class\n"); | 504 | printk(KERN_ERR "Failed registering qe_ic sys class\n"); |
505 | return -ENODEV; | 505 | return -ENODEV; |
506 | } | 506 | } |
507 | rc = sysdev_register(&device_qe_ic); | 507 | rc = device_register(&device_qe_ic); |
508 | if (rc) { | 508 | if (rc) { |
509 | printk(KERN_ERR "Failed registering qe_ic sys device\n"); | 509 | printk(KERN_ERR "Failed registering qe_ic sys device\n"); |
510 | return -ENODEV; | 510 | return -ENODEV; |
diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c index 3330feca7502..063c901b1265 100644 --- a/arch/powerpc/sysdev/uic.c +++ b/arch/powerpc/sysdev/uic.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <linux/stddef.h> | 18 | #include <linux/stddef.h> |
19 | #include <linux/sched.h> | 19 | #include <linux/sched.h> |
20 | #include <linux/signal.h> | 20 | #include <linux/signal.h> |
21 | #include <linux/sysdev.h> | ||
22 | #include <linux/device.h> | 21 | #include <linux/device.h> |
23 | #include <linux/bootmem.h> | 22 | #include <linux/bootmem.h> |
24 | #include <linux/spinlock.h> | 23 | #include <linux/spinlock.h> |