diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-07 15:03:30 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-07 15:03:30 -0500 |
commit | 7affca3537d74365128e477b40c529d6f2fe86c8 (patch) | |
tree | 20be92bd240029182fc89c2c4f25401b7715dcae /arch/powerpc/platforms/pseries | |
parent | 356b95424cfb456e14a59eaa579422ce014c424b (diff) | |
parent | ff4b8a57f0aaa2882d444ca44b2b9b333d22a4df (diff) |
Merge branch 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
* 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (73 commits)
arm: fix up some samsung merge sysdev conversion problems
firmware: Fix an oops on reading fw_priv->fw in sysfs loading file
Drivers:hv: Fix a bug in vmbus_driver_unregister()
driver core: remove __must_check from device_create_file
debugfs: add missing #ifdef HAS_IOMEM
arm: time.h: remove device.h #include
driver-core: remove sysdev.h usage.
clockevents: remove sysdev.h
arm: convert sysdev_class to a regular subsystem
arm: leds: convert sysdev_class to a regular subsystem
kobject: remove kset_find_obj_hinted()
m86k: gpio - convert sysdev_class to a regular subsystem
mips: txx9_sram - convert sysdev_class to a regular subsystem
mips: 7segled - convert sysdev_class to a regular subsystem
sh: dma - convert sysdev_class to a regular subsystem
sh: intc - convert sysdev_class to a regular subsystem
power: suspend - convert sysdev_class to a regular subsystem
power: qe_ic - convert sysdev_class to a regular subsystem
power: cmm - convert sysdev_class to a regular subsystem
s390: time - convert sysdev_class to a regular subsystem
...
Fix up conflicts with 'struct sysdev' removal from various platform
drivers that got changed:
- arch/arm/mach-exynos/cpu.c
- arch/arm/mach-exynos/irq-eint.c
- arch/arm/mach-s3c64xx/common.c
- arch/arm/mach-s3c64xx/cpu.c
- arch/arm/mach-s5p64x0/cpu.c
- arch/arm/mach-s5pv210/common.c
- arch/arm/plat-samsung/include/plat/cpu.h
- arch/powerpc/kernel/sysfs.c
and fix up cpu_is_hotpluggable() as per Greg in include/linux/cpu.h
Diffstat (limited to 'arch/powerpc/platforms/pseries')
-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 |
4 files changed, 86 insertions, 87 deletions
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 bbc3c42f6730..eadba9521a35 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; |