aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-07 15:03:30 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-07 15:03:30 -0500
commit7affca3537d74365128e477b40c529d6f2fe86c8 (patch)
tree20be92bd240029182fc89c2c4f25401b7715dcae /arch
parent356b95424cfb456e14a59eaa579422ce014c424b (diff)
parentff4b8a57f0aaa2882d444ca44b2b9b333d22a4df (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')
-rw-r--r--arch/arm/include/asm/mach/time.h2
-rw-r--r--arch/arm/kernel/leds.c21
-rw-r--r--arch/arm/mach-bcmring/core.c1
-rw-r--r--arch/arm/mach-exynos/common.c15
-rw-r--r--arch/arm/mach-exynos/pm.c10
-rw-r--r--arch/arm/mach-integrator/integrator_cp.c2
-rw-r--r--arch/arm/mach-ks8695/irq.c2
-rw-r--r--arch/arm/mach-lpc32xx/phy3250.c2
-rw-r--r--arch/arm/mach-msm/board-sapphire.c2
-rw-r--r--arch/arm/mach-realview/core.c2
-rw-r--r--arch/arm/mach-realview/realview_eb.c2
-rw-r--r--arch/arm/mach-realview/realview_pb1176.c2
-rw-r--r--arch/arm/mach-realview/realview_pb11mp.c2
-rw-r--r--arch/arm/mach-realview/realview_pba8.c2
-rw-r--r--arch/arm/mach-realview/realview_pbx.c2
-rw-r--r--arch/arm/mach-s3c2410/bast-irq.c2
-rw-r--r--arch/arm/mach-s3c2410/cpu-freq.c26
-rw-r--r--arch/arm/mach-s3c2410/dma.c28
-rw-r--r--arch/arm/mach-s3c2410/include/mach/dma.h4
-rw-r--r--arch/arm/mach-s3c2410/mach-h1940.c2
-rw-r--r--arch/arm/mach-s3c2410/mach-qt2410.c2
-rw-r--r--arch/arm/mach-s3c2410/pll.c20
-rw-r--r--arch/arm/mach-s3c2410/pm.c36
-rw-r--r--arch/arm/mach-s3c2410/s3c2410.c24
-rw-r--r--arch/arm/mach-s3c2412/clock.c2
-rw-r--r--arch/arm/mach-s3c2412/cpu-freq.c13
-rw-r--r--arch/arm/mach-s3c2412/dma.c12
-rw-r--r--arch/arm/mach-s3c2412/irq.c12
-rw-r--r--arch/arm/mach-s3c2412/pm.c12
-rw-r--r--arch/arm/mach-s3c2412/s3c2412.c15
-rw-r--r--arch/arm/mach-s3c2416/irq.c12
-rw-r--r--arch/arm/mach-s3c2416/pm.c12
-rw-r--r--arch/arm/mach-s3c2416/s3c2416.c15
-rw-r--r--arch/arm/mach-s3c2440/clock.c15
-rw-r--r--arch/arm/mach-s3c2440/dma.c12
-rw-r--r--arch/arm/mach-s3c2440/irq.c12
-rw-r--r--arch/arm/mach-s3c2440/mach-rx1950.c2
-rw-r--r--arch/arm/mach-s3c2440/mach-rx3715.c2
-rw-r--r--arch/arm/mach-s3c2440/s3c2440-cpufreq.c22
-rw-r--r--arch/arm/mach-s3c2440/s3c2440-pll-12000000.c20
-rw-r--r--arch/arm/mach-s3c2440/s3c2440-pll-16934400.c24
-rw-r--r--arch/arm/mach-s3c2440/s3c2440.c8
-rw-r--r--arch/arm/mach-s3c2440/s3c2442.c17
-rw-r--r--arch/arm/mach-s3c2440/s3c244x-clock.c19
-rw-r--r--arch/arm/mach-s3c2440/s3c244x-irq.c20
-rw-r--r--arch/arm/mach-s3c2440/s3c244x.c16
-rw-r--r--arch/arm/mach-s3c2443/clock.c2
-rw-r--r--arch/arm/mach-s3c2443/dma.c12
-rw-r--r--arch/arm/mach-s3c2443/irq.c12
-rw-r--r--arch/arm/mach-s3c2443/s3c2443.c15
-rw-r--r--arch/arm/mach-s3c64xx/common.c18
-rw-r--r--arch/arm/mach-s3c64xx/common.h1
-rw-r--r--arch/arm/mach-s3c64xx/dma.c23
-rw-r--r--arch/arm/mach-s3c64xx/s3c6400.c15
-rw-r--r--arch/arm/mach-s3c64xx/s3c6410.c15
-rw-r--r--arch/arm/mach-s5p64x0/clock-s5p6440.c2
-rw-r--r--arch/arm/mach-s5p64x0/clock-s5p6450.c2
-rw-r--r--arch/arm/mach-s5p64x0/clock.c2
-rw-r--r--arch/arm/mach-s5p64x0/common.c15
-rw-r--r--arch/arm/mach-s5p64x0/pm.c10
-rw-r--r--arch/arm/mach-s5pc100/common.c15
-rw-r--r--arch/arm/mach-s5pv210/clock.c2
-rw-r--r--arch/arm/mach-s5pv210/common.c15
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkc110.c2
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkv210.c2
-rw-r--r--arch/arm/mach-s5pv210/pm.c10
-rw-r--r--arch/arm/mach-versatile/core.c1
-rw-r--r--arch/arm/mach-versatile/versatile_ab.c1
-rw-r--r--arch/arm/mach-versatile/versatile_pb.c1
-rw-r--r--arch/arm/mach-vexpress/v2m.c2
-rw-r--r--arch/arm/mach-w90x900/irq.c2
-rw-r--r--arch/arm/plat-s3c24xx/common-smdk.c2
-rw-r--r--arch/arm/plat-s3c24xx/cpu-freq.c2
-rw-r--r--arch/arm/plat-s3c24xx/irq.c2
-rw-r--r--arch/arm/plat-s3c24xx/pm-simtec.c1
-rw-r--r--arch/arm/plat-s3c24xx/s3c2410-clock.c2
-rw-r--r--arch/arm/plat-s3c24xx/s3c2412-iotiming.c2
-rw-r--r--arch/arm/plat-s5p/clock.c2
-rw-r--r--arch/arm/plat-s5p/irq-eint.c2
-rw-r--r--arch/arm/plat-samsung/clock-clksrc.c2
-rw-r--r--arch/arm/plat-samsung/clock.c2
-rw-r--r--arch/arm/plat-samsung/include/plat/cpu.h26
-rw-r--r--arch/arm/plat-samsung/include/plat/dma-s3c24xx.h2
-rw-r--r--arch/arm/plat-samsung/include/plat/pm.h2
-rw-r--r--arch/arm/plat-samsung/pm-gpio.c2
-rw-r--r--arch/arm/plat-samsung/wakeup-mask.c2
-rw-r--r--arch/avr32/boards/merisc/merisc_sysfs.c1
-rw-r--r--arch/avr32/kernel/cpu.c74
-rw-r--r--arch/avr32/kernel/irq.c2
-rw-r--r--arch/ia64/kernel/err_inject.c52
-rw-r--r--arch/ia64/kernel/topology.c10
-rw-r--r--arch/m68k/platform/coldfire/gpio.c9
-rw-r--r--arch/mips/txx9/generic/7segled.c44
-rw-r--r--arch/mips/txx9/generic/setup.c34
-rw-r--r--arch/mips/txx9/generic/setup_tx4939.c2
-rw-r--r--arch/powerpc/include/asm/spu.h12
-rw-r--r--arch/powerpc/include/asm/topology.h10
-rw-r--r--arch/powerpc/kernel/cacheinfo.c10
-rw-r--r--arch/powerpc/kernel/smp.c2
-rw-r--r--arch/powerpc/kernel/sysfs.c267
-rw-r--r--arch/powerpc/mm/numa.c8
-rw-r--r--arch/powerpc/platforms/cell/cbe_thermal.c144
-rw-r--r--arch/powerpc/platforms/cell/smp.c2
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c61
-rw-r--r--arch/powerpc/platforms/iseries/smp.c2
-rw-r--r--arch/powerpc/platforms/powermac/cpufreq_32.c2
-rw-r--r--arch/powerpc/platforms/pseries/cmm.c67
-rw-r--r--arch/powerpc/platforms/pseries/pseries_energy.c71
-rw-r--r--arch/powerpc/platforms/pseries/smp.c2
-rw-r--r--arch/powerpc/platforms/pseries/suspend.c33
-rw-r--r--arch/powerpc/sysdev/ppc4xx_cpm.c6
-rw-r--r--arch/powerpc/sysdev/qe_lib/qe_ic.c12
-rw-r--r--arch/powerpc/sysdev/uic.c1
-rw-r--r--arch/s390/kernel/smp.c76
-rw-r--r--arch/s390/kernel/time.c260
-rw-r--r--arch/s390/kernel/topology.c6
-rw-r--r--arch/sh/drivers/dma/dma-sysfs.c81
-rw-r--r--arch/sh/include/asm/dma.h4
-rw-r--r--arch/sh/kernel/cpu/sh4/sq.c24
-rw-r--r--arch/sparc/kernel/sysfs.c122
-rw-r--r--arch/tile/kernel/sysfs.c61
-rw-r--r--arch/unicore32/kernel/puv3-core.c1
-rw-r--r--arch/unicore32/kernel/puv3-nb0916.c1
-rw-r--r--arch/x86/include/asm/mce.h2
-rw-r--r--arch/x86/kernel/cpu/intel_cacheinfo.c25
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce-internal.h4
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.c128
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_amd.c11
-rw-r--r--arch/x86/kernel/cpu/mcheck/therm_throt.c63
-rw-r--r--arch/x86/kernel/hpet.c1
-rw-r--r--arch/x86/kernel/irqinit.c2
-rw-r--r--arch/x86/kernel/microcode_core.c64
-rw-r--r--arch/x86/platform/uv/uv_sysfs.c2
133 files changed, 1349 insertions, 1286 deletions
diff --git a/arch/arm/include/asm/mach/time.h b/arch/arm/include/asm/mach/time.h
index d5adaae5ee2c..f73c908b7fa0 100644
--- a/arch/arm/include/asm/mach/time.h
+++ b/arch/arm/include/asm/mach/time.h
@@ -10,8 +10,6 @@
10#ifndef __ASM_ARM_MACH_TIME_H 10#ifndef __ASM_ARM_MACH_TIME_H
11#define __ASM_ARM_MACH_TIME_H 11#define __ASM_ARM_MACH_TIME_H
12 12
13#include <linux/sysdev.h>
14
15/* 13/*
16 * This is our kernel timer structure. 14 * This is our kernel timer structure.
17 * 15 *
diff --git a/arch/arm/kernel/leds.c b/arch/arm/kernel/leds.c
index 0bcd38341573..1911dae19e4f 100644
--- a/arch/arm/kernel/leds.c
+++ b/arch/arm/kernel/leds.c
@@ -9,7 +9,7 @@
9 */ 9 */
10#include <linux/export.h> 10#include <linux/export.h>
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/sysdev.h> 12#include <linux/device.h>
13#include <linux/syscore_ops.h> 13#include <linux/syscore_ops.h>
14#include <linux/string.h> 14#include <linux/string.h>
15 15
@@ -34,8 +34,8 @@ static const struct leds_evt_name evt_names[] = {
34 { "red", led_red_on, led_red_off }, 34 { "red", led_red_on, led_red_off },
35}; 35};
36 36
37static ssize_t leds_store(struct sys_device *dev, 37static ssize_t leds_store(struct device *dev,
38 struct sysdev_attribute *attr, 38 struct device_attribute *attr,
39 const char *buf, size_t size) 39 const char *buf, size_t size)
40{ 40{
41 int ret = -EINVAL, len = strcspn(buf, " "); 41 int ret = -EINVAL, len = strcspn(buf, " ");
@@ -69,15 +69,16 @@ static ssize_t leds_store(struct sys_device *dev,
69 return ret; 69 return ret;
70} 70}
71 71
72static SYSDEV_ATTR(event, 0200, NULL, leds_store); 72static DEVICE_ATTR(event, 0200, NULL, leds_store);
73 73
74static struct sysdev_class leds_sysclass = { 74static struct bus_type leds_subsys = {
75 .name = "leds", 75 .name = "leds",
76 .dev_name = "leds",
76}; 77};
77 78
78static struct sys_device leds_device = { 79static struct device leds_device = {
79 .id = 0, 80 .id = 0,
80 .cls = &leds_sysclass, 81 .bus = &leds_subsys,
81}; 82};
82 83
83static int leds_suspend(void) 84static int leds_suspend(void)
@@ -105,11 +106,11 @@ static struct syscore_ops leds_syscore_ops = {
105static int __init leds_init(void) 106static int __init leds_init(void)
106{ 107{
107 int ret; 108 int ret;
108 ret = sysdev_class_register(&leds_sysclass); 109 ret = subsys_system_register(&leds_subsys, NULL);
109 if (ret == 0) 110 if (ret == 0)
110 ret = sysdev_register(&leds_device); 111 ret = device_register(&leds_device);
111 if (ret == 0) 112 if (ret == 0)
112 ret = sysdev_create_file(&leds_device, &attr_event); 113 ret = device_create_file(&leds_device, &dev_attr_event);
113 if (ret == 0) 114 if (ret == 0)
114 register_syscore_ops(&leds_syscore_ops); 115 register_syscore_ops(&leds_syscore_ops);
115 return ret; 116 return ret;
diff --git a/arch/arm/mach-bcmring/core.c b/arch/arm/mach-bcmring/core.c
index 430da120a297..6b67b7e8426c 100644
--- a/arch/arm/mach-bcmring/core.c
+++ b/arch/arm/mach-bcmring/core.c
@@ -25,7 +25,6 @@
25#include <linux/device.h> 25#include <linux/device.h>
26#include <linux/dma-mapping.h> 26#include <linux/dma-mapping.h>
27#include <linux/platform_device.h> 27#include <linux/platform_device.h>
28#include <linux/sysdev.h>
29#include <linux/interrupt.h> 28#include <linux/interrupt.h>
30#include <linux/amba/bus.h> 29#include <linux/amba/bus.h>
31#include <linux/clkdev.h> 30#include <linux/clkdev.h>
diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index d2acb0f948c6..b6ac6ee658c0 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -13,7 +13,7 @@
13#include <linux/interrupt.h> 13#include <linux/interrupt.h>
14#include <linux/irq.h> 14#include <linux/irq.h>
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/sysdev.h> 16#include <linux/device.h>
17#include <linux/gpio.h> 17#include <linux/gpio.h>
18#include <linux/sched.h> 18#include <linux/sched.h>
19#include <linux/serial_core.h> 19#include <linux/serial_core.h>
@@ -423,17 +423,18 @@ void __init exynos4_init_irq(void)
423 s5p_init_irq(NULL, 0); 423 s5p_init_irq(NULL, 0);
424} 424}
425 425
426struct sysdev_class exynos4_sysclass = { 426struct bus_type exynos4_subsys = {
427 .name = "exynos4-core", 427 .name = "exynos4-core",
428 .dev_name = "exynos4-core",
428}; 429};
429 430
430static struct sys_device exynos4_sysdev = { 431static struct device exynos4_dev = {
431 .cls = &exynos4_sysclass, 432 .bus = &exynos4_subsys,
432}; 433};
433 434
434static int __init exynos4_core_init(void) 435static int __init exynos4_core_init(void)
435{ 436{
436 return sysdev_class_register(&exynos4_sysclass); 437 return subsys_system_register(&exynos4_subsys, NULL);
437} 438}
438core_initcall(exynos4_core_init); 439core_initcall(exynos4_core_init);
439 440
@@ -470,7 +471,7 @@ int __init exynos_init(void)
470 /* set idle function */ 471 /* set idle function */
471 pm_idle = exynos_idle; 472 pm_idle = exynos_idle;
472 473
473 return sysdev_register(&exynos4_sysdev); 474 return device_register(&exynos4_dev);
474} 475}
475 476
476static struct s3c24xx_uart_clksrc exynos4_serial_clocks[] = { 477static struct s3c24xx_uart_clksrc exynos4_serial_clocks[] = {
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
index 509a435afd4b..c4f792dcad19 100644
--- a/arch/arm/mach-exynos/pm.c
+++ b/arch/arm/mach-exynos/pm.c
@@ -205,7 +205,7 @@ static void exynos4_pm_prepare(void)
205 205
206} 206}
207 207
208static int exynos4_pm_add(struct sys_device *sysdev) 208static int exynos4_pm_add(struct device *dev)
209{ 209{
210 pm_cpu_prep = exynos4_pm_prepare; 210 pm_cpu_prep = exynos4_pm_prepare;
211 pm_cpu_sleep = exynos4_cpu_suspend; 211 pm_cpu_sleep = exynos4_cpu_suspend;
@@ -301,8 +301,10 @@ static void exynos4_restore_pll(void)
301 } while (epll_wait || vpll_wait); 301 } while (epll_wait || vpll_wait);
302} 302}
303 303
304static struct sysdev_driver exynos4_pm_driver = { 304static struct subsys_interface exynos4_pm_interface = {
305 .add = exynos4_pm_add, 305 .name = "exynos4_pm",
306 .subsys = &exynos4_subsys,
307 .add_dev = exynos4_pm_add,
306}; 308};
307 309
308static __init int exynos4_pm_drvinit(void) 310static __init int exynos4_pm_drvinit(void)
@@ -325,7 +327,7 @@ static __init int exynos4_pm_drvinit(void)
325 clk_put(pll_base); 327 clk_put(pll_base);
326 } 328 }
327 329
328 return sysdev_driver_register(&exynos4_sysclass, &exynos4_pm_driver); 330 return subsys_interface_register(&exynos4_pm_interface);
329} 331}
330arch_initcall(exynos4_pm_drvinit); 332arch_initcall(exynos4_pm_drvinit);
331 333
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 3a730d447c9a..a8b6aa6003f3 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -14,7 +14,7 @@
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/dma-mapping.h> 15#include <linux/dma-mapping.h>
16#include <linux/string.h> 16#include <linux/string.h>
17#include <linux/sysdev.h> 17#include <linux/device.h>
18#include <linux/amba/bus.h> 18#include <linux/amba/bus.h>
19#include <linux/amba/kmi.h> 19#include <linux/amba/kmi.h>
20#include <linux/amba/clcd.h> 20#include <linux/amba/clcd.h>
diff --git a/arch/arm/mach-ks8695/irq.c b/arch/arm/mach-ks8695/irq.c
index a78092dcd6fb..76802aac0f45 100644
--- a/arch/arm/mach-ks8695/irq.c
+++ b/arch/arm/mach-ks8695/irq.c
@@ -23,7 +23,7 @@
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/ioport.h> 25#include <linux/ioport.h>
26#include <linux/sysdev.h> 26#include <linux/device.h>
27#include <linux/io.h> 27#include <linux/io.h>
28 28
29#include <mach/hardware.h> 29#include <mach/hardware.h>
diff --git a/arch/arm/mach-lpc32xx/phy3250.c b/arch/arm/mach-lpc32xx/phy3250.c
index ecb94114c81b..bfee5b455105 100644
--- a/arch/arm/mach-lpc32xx/phy3250.c
+++ b/arch/arm/mach-lpc32xx/phy3250.c
@@ -18,7 +18,7 @@
18 18
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/sysdev.h> 21#include <linux/device.h>
22#include <linux/interrupt.h> 22#include <linux/interrupt.h>
23#include <linux/irq.h> 23#include <linux/irq.h>
24#include <linux/dma-mapping.h> 24#include <linux/dma-mapping.h>
diff --git a/arch/arm/mach-msm/board-sapphire.c b/arch/arm/mach-msm/board-sapphire.c
index 32b465763dbd..97b8191d9d38 100644
--- a/arch/arm/mach-msm/board-sapphire.c
+++ b/arch/arm/mach-msm/board-sapphire.c
@@ -18,7 +18,7 @@
18#include <linux/input.h> 18#include <linux/input.h>
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/irq.h> 20#include <linux/irq.h>
21#include <linux/sysdev.h> 21#include <linux/device.h>
22 22
23#include <linux/delay.h> 23#include <linux/delay.h>
24 24
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index d5ed5d4f77d6..acd329afc3ac 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -21,7 +21,7 @@
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/dma-mapping.h> 23#include <linux/dma-mapping.h>
24#include <linux/sysdev.h> 24#include <linux/device.h>
25#include <linux/interrupt.h> 25#include <linux/interrupt.h>
26#include <linux/amba/bus.h> 26#include <linux/amba/bus.h>
27#include <linux/amba/clcd.h> 27#include <linux/amba/clcd.h>
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c
index f92a920cf507..0069561464f9 100644
--- a/arch/arm/mach-realview/realview_eb.c
+++ b/arch/arm/mach-realview/realview_eb.c
@@ -21,7 +21,7 @@
21 21
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/sysdev.h> 24#include <linux/device.h>
25#include <linux/amba/bus.h> 25#include <linux/amba/bus.h>
26#include <linux/amba/pl061.h> 26#include <linux/amba/pl061.h>
27#include <linux/amba/mmci.h> 27#include <linux/amba/mmci.h>
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c
index 8ec37b29e0fa..8fe395568a47 100644
--- a/arch/arm/mach-realview/realview_pb1176.c
+++ b/arch/arm/mach-realview/realview_pb1176.c
@@ -21,7 +21,7 @@
21 21
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/sysdev.h> 24#include <linux/device.h>
25#include <linux/amba/bus.h> 25#include <linux/amba/bus.h>
26#include <linux/amba/pl061.h> 26#include <linux/amba/pl061.h>
27#include <linux/amba/mmci.h> 27#include <linux/amba/mmci.h>
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c
index f035fda8b619..34a26011bb89 100644
--- a/arch/arm/mach-realview/realview_pb11mp.c
+++ b/arch/arm/mach-realview/realview_pb11mp.c
@@ -21,7 +21,7 @@
21 21
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/sysdev.h> 24#include <linux/device.h>
25#include <linux/amba/bus.h> 25#include <linux/amba/bus.h>
26#include <linux/amba/pl061.h> 26#include <linux/amba/pl061.h>
27#include <linux/amba/mmci.h> 27#include <linux/amba/mmci.h>
diff --git a/arch/arm/mach-realview/realview_pba8.c b/arch/arm/mach-realview/realview_pba8.c
index 0109c8b440cc..d26a6def1d65 100644
--- a/arch/arm/mach-realview/realview_pba8.c
+++ b/arch/arm/mach-realview/realview_pba8.c
@@ -21,7 +21,7 @@
21 21
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/sysdev.h> 24#include <linux/device.h>
25#include <linux/amba/bus.h> 25#include <linux/amba/bus.h>
26#include <linux/amba/pl061.h> 26#include <linux/amba/pl061.h>
27#include <linux/amba/mmci.h> 27#include <linux/amba/mmci.h>
diff --git a/arch/arm/mach-realview/realview_pbx.c b/arch/arm/mach-realview/realview_pbx.c
index 0194b3e26dc1..a250fb4124bf 100644
--- a/arch/arm/mach-realview/realview_pbx.c
+++ b/arch/arm/mach-realview/realview_pbx.c
@@ -20,7 +20,7 @@
20 20
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/sysdev.h> 23#include <linux/device.h>
24#include <linux/amba/bus.h> 24#include <linux/amba/bus.h>
25#include <linux/amba/pl061.h> 25#include <linux/amba/pl061.h>
26#include <linux/amba/mmci.h> 26#include <linux/amba/mmci.h>
diff --git a/arch/arm/mach-s3c2410/bast-irq.c b/arch/arm/mach-s3c2410/bast-irq.c
index bc53d2d16d1a..ac7b2ad5c405 100644
--- a/arch/arm/mach-s3c2410/bast-irq.c
+++ b/arch/arm/mach-s3c2410/bast-irq.c
@@ -24,7 +24,7 @@
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/ioport.h> 26#include <linux/ioport.h>
27#include <linux/sysdev.h> 27#include <linux/device.h>
28#include <linux/io.h> 28#include <linux/io.h>
29 29
30#include <asm/mach-types.h> 30#include <asm/mach-types.h>
diff --git a/arch/arm/mach-s3c2410/cpu-freq.c b/arch/arm/mach-s3c2410/cpu-freq.c
index 75189df995ae..7dc6c46b5e2b 100644
--- a/arch/arm/mach-s3c2410/cpu-freq.c
+++ b/arch/arm/mach-s3c2410/cpu-freq.c
@@ -16,7 +16,7 @@
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/ioport.h> 17#include <linux/ioport.h>
18#include <linux/cpufreq.h> 18#include <linux/cpufreq.h>
19#include <linux/sysdev.h> 19#include <linux/device.h>
20#include <linux/clk.h> 20#include <linux/clk.h>
21#include <linux/err.h> 21#include <linux/err.h>
22#include <linux/io.h> 22#include <linux/io.h>
@@ -115,24 +115,25 @@ static struct s3c_cpufreq_info s3c2410_cpufreq_info = {
115 .debug_io_show = s3c_cpufreq_debugfs_call(s3c2410_iotiming_debugfs), 115 .debug_io_show = s3c_cpufreq_debugfs_call(s3c2410_iotiming_debugfs),
116}; 116};
117 117
118static int s3c2410_cpufreq_add(struct sys_device *sysdev) 118static int s3c2410_cpufreq_add(struct device *dev)
119{ 119{
120 return s3c_cpufreq_register(&s3c2410_cpufreq_info); 120 return s3c_cpufreq_register(&s3c2410_cpufreq_info);
121} 121}
122 122
123static struct sysdev_driver s3c2410_cpufreq_driver = { 123static struct subsys_interface s3c2410_cpufreq_interface = {
124 .add = s3c2410_cpufreq_add, 124 .name = "s3c2410_cpufreq",
125 .subsys = &s3c2410_subsys,
126 .add_dev = s3c2410_cpufreq_add,
125}; 127};
126 128
127static int __init s3c2410_cpufreq_init(void) 129static int __init s3c2410_cpufreq_init(void)
128{ 130{
129 return sysdev_driver_register(&s3c2410_sysclass, 131 return subsys_interface_register(&s3c2410_cpufreq_interface);
130 &s3c2410_cpufreq_driver);
131} 132}
132 133
133arch_initcall(s3c2410_cpufreq_init); 134arch_initcall(s3c2410_cpufreq_init);
134 135
135static int s3c2410a_cpufreq_add(struct sys_device *sysdev) 136static int s3c2410a_cpufreq_add(struct device *dev)
136{ 137{
137 /* alter the maximum freq settings for S3C2410A. If a board knows 138 /* alter the maximum freq settings for S3C2410A. If a board knows
138 * it only has a maximum of 200, then it should register its own 139 * it only has a maximum of 200, then it should register its own
@@ -143,17 +144,18 @@ static int s3c2410a_cpufreq_add(struct sys_device *sysdev)
143 s3c2410_cpufreq_info.max.pclk = 66500000; 144 s3c2410_cpufreq_info.max.pclk = 66500000;
144 s3c2410_cpufreq_info.name = "s3c2410a"; 145 s3c2410_cpufreq_info.name = "s3c2410a";
145 146
146 return s3c2410_cpufreq_add(sysdev); 147 return s3c2410_cpufreq_add(dev);
147} 148}
148 149
149static struct sysdev_driver s3c2410a_cpufreq_driver = { 150static struct subsys_interface s3c2410a_cpufreq_interface = {
150 .add = s3c2410a_cpufreq_add, 151 .name = "s3c2410a_cpufreq",
152 .subsys = &s3c2410a_subsys,
153 .add_dev = s3c2410a_cpufreq_add,
151}; 154};
152 155
153static int __init s3c2410a_cpufreq_init(void) 156static int __init s3c2410a_cpufreq_init(void)
154{ 157{
155 return sysdev_driver_register(&s3c2410a_sysclass, 158 return subsys_interface_register(&s3c2410a_cpufreq_interface);
156 &s3c2410a_cpufreq_driver);
157} 159}
158 160
159arch_initcall(s3c2410a_cpufreq_init); 161arch_initcall(s3c2410a_cpufreq_init);
diff --git a/arch/arm/mach-s3c2410/dma.c b/arch/arm/mach-s3c2410/dma.c
index dbe43df8cfec..2afd00014a77 100644
--- a/arch/arm/mach-s3c2410/dma.c
+++ b/arch/arm/mach-s3c2410/dma.c
@@ -14,7 +14,7 @@
14 14
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/sysdev.h> 17#include <linux/device.h>
18#include <linux/serial_core.h> 18#include <linux/serial_core.h>
19 19
20#include <mach/map.h> 20#include <mach/map.h>
@@ -132,7 +132,7 @@ static struct s3c24xx_dma_order __initdata s3c2410_dma_order = {
132 }, 132 },
133}; 133};
134 134
135static int __init s3c2410_dma_add(struct sys_device *sysdev) 135static int __init s3c2410_dma_add(struct device *dev)
136{ 136{
137 s3c2410_dma_init(); 137 s3c2410_dma_init();
138 s3c24xx_dma_order_set(&s3c2410_dma_order); 138 s3c24xx_dma_order_set(&s3c2410_dma_order);
@@ -140,24 +140,28 @@ static int __init s3c2410_dma_add(struct sys_device *sysdev)
140} 140}
141 141
142#if defined(CONFIG_CPU_S3C2410) 142#if defined(CONFIG_CPU_S3C2410)
143static struct sysdev_driver s3c2410_dma_driver = { 143static struct subsys_interface s3c2410_dma_interface = {
144 .add = s3c2410_dma_add, 144 .name = "s3c2410_dma",
145 .subsys = &s3c2410_subsys,
146 .add_dev = s3c2410_dma_add,
145}; 147};
146 148
147static int __init s3c2410_dma_drvinit(void) 149static int __init s3c2410_dma_drvinit(void)
148{ 150{
149 return sysdev_driver_register(&s3c2410_sysclass, &s3c2410_dma_driver); 151 return subsys_interface_register(&s3c2410_interface);
150} 152}
151 153
152arch_initcall(s3c2410_dma_drvinit); 154arch_initcall(s3c2410_dma_drvinit);
153 155
154static struct sysdev_driver s3c2410a_dma_driver = { 156static struct subsys_interface s3c2410a_dma_interface = {
155 .add = s3c2410_dma_add, 157 .name = "s3c2410a_dma",
158 .subsys = &s3c2410a_subsys,
159 .add_dev = s3c2410_dma_add,
156}; 160};
157 161
158static int __init s3c2410a_dma_drvinit(void) 162static int __init s3c2410a_dma_drvinit(void)
159{ 163{
160 return sysdev_driver_register(&s3c2410a_sysclass, &s3c2410a_dma_driver); 164 return subsys_interface_register(&s3c2410a_dma_interface);
161} 165}
162 166
163arch_initcall(s3c2410a_dma_drvinit); 167arch_initcall(s3c2410a_dma_drvinit);
@@ -165,13 +169,15 @@ arch_initcall(s3c2410a_dma_drvinit);
165 169
166#if defined(CONFIG_CPU_S3C2442) 170#if defined(CONFIG_CPU_S3C2442)
167/* S3C2442 DMA contains the same selection table as the S3C2410 */ 171/* S3C2442 DMA contains the same selection table as the S3C2410 */
168static struct sysdev_driver s3c2442_dma_driver = { 172static struct subsys_interface s3c2442_dma_interface = {
169 .add = s3c2410_dma_add, 173 .name = "s3c2442_dma",
174 .subsys = &s3c2442_subsys,
175 .add_dev = s3c2410_dma_add,
170}; 176};
171 177
172static int __init s3c2442_dma_drvinit(void) 178static int __init s3c2442_dma_drvinit(void)
173{ 179{
174 return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_dma_driver); 180 return subsys_interface_register(&s3c2442_dma_interface);
175} 181}
176 182
177arch_initcall(s3c2442_dma_drvinit); 183arch_initcall(s3c2442_dma_drvinit);
diff --git a/arch/arm/mach-s3c2410/include/mach/dma.h b/arch/arm/mach-s3c2410/include/mach/dma.h
index ae8e482b6427..acbdfecd4186 100644
--- a/arch/arm/mach-s3c2410/include/mach/dma.h
+++ b/arch/arm/mach-s3c2410/include/mach/dma.h
@@ -13,7 +13,7 @@
13#ifndef __ASM_ARCH_DMA_H 13#ifndef __ASM_ARCH_DMA_H
14#define __ASM_ARCH_DMA_H __FILE__ 14#define __ASM_ARCH_DMA_H __FILE__
15 15
16#include <linux/sysdev.h> 16#include <linux/device.h>
17 17
18#define MAX_DMA_TRANSFER_SIZE 0x100000 /* Data Unit is half word */ 18#define MAX_DMA_TRANSFER_SIZE 0x100000 /* Data Unit is half word */
19 19
@@ -202,7 +202,7 @@ struct s3c2410_dma_chan {
202 struct s3c2410_dma_buf *end; /* end of queue */ 202 struct s3c2410_dma_buf *end; /* end of queue */
203 203
204 /* system device */ 204 /* system device */
205 struct sys_device dev; 205 struct device dev;
206}; 206};
207 207
208typedef unsigned long dma_device_t; 208typedef unsigned long dma_device_t;
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index ad9d865651d7..41245a603981 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -18,7 +18,7 @@
18#include <linux/memblock.h> 18#include <linux/memblock.h>
19#include <linux/timer.h> 19#include <linux/timer.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/sysdev.h> 21#include <linux/device.h>
22#include <linux/serial_core.h> 22#include <linux/serial_core.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/io.h> 24#include <linux/io.h>
diff --git a/arch/arm/mach-s3c2410/mach-qt2410.c b/arch/arm/mach-s3c2410/mach-qt2410.c
index 58f2c17b9f0d..91c16d9d2459 100644
--- a/arch/arm/mach-s3c2410/mach-qt2410.c
+++ b/arch/arm/mach-s3c2410/mach-qt2410.c
@@ -28,7 +28,7 @@
28#include <linux/timer.h> 28#include <linux/timer.h>
29#include <linux/init.h> 29#include <linux/init.h>
30#include <linux/gpio.h> 30#include <linux/gpio.h>
31#include <linux/sysdev.h> 31#include <linux/device.h>
32#include <linux/platform_device.h> 32#include <linux/platform_device.h>
33#include <linux/serial_core.h> 33#include <linux/serial_core.h>
34#include <linux/spi/spi.h> 34#include <linux/spi/spi.h>
diff --git a/arch/arm/mach-s3c2410/pll.c b/arch/arm/mach-s3c2410/pll.c
index 8338865e11c0..c07438bfc99f 100644
--- a/arch/arm/mach-s3c2410/pll.c
+++ b/arch/arm/mach-s3c2410/pll.c
@@ -25,7 +25,7 @@
25#include <linux/types.h> 25#include <linux/types.h>
26#include <linux/kernel.h> 26#include <linux/kernel.h>
27#include <linux/module.h> 27#include <linux/module.h>
28#include <linux/sysdev.h> 28#include <linux/device.h>
29#include <linux/list.h> 29#include <linux/list.h>
30#include <linux/clk.h> 30#include <linux/clk.h>
31#include <linux/err.h> 31#include <linux/err.h>
@@ -66,30 +66,34 @@ static struct cpufreq_frequency_table pll_vals_12MHz[] = {
66 { .frequency = 270000000, .index = PLLVAL(127, 1, 1), }, 66 { .frequency = 270000000, .index = PLLVAL(127, 1, 1), },
67}; 67};
68 68
69static int s3c2410_plls_add(struct sys_device *dev) 69static int s3c2410_plls_add(struct device *dev)
70{ 70{
71 return s3c_plltab_register(pll_vals_12MHz, ARRAY_SIZE(pll_vals_12MHz)); 71 return s3c_plltab_register(pll_vals_12MHz, ARRAY_SIZE(pll_vals_12MHz));
72} 72}
73 73
74static struct sysdev_driver s3c2410_plls_drv = { 74static struct subsys_interface s3c2410_plls_interface = {
75 .add = s3c2410_plls_add, 75 .name = "s3c2410_plls",
76 .subsys = &s3c2410_subsys,
77 .add_dev = s3c2410_plls_add,
76}; 78};
77 79
78static int __init s3c2410_pll_init(void) 80static int __init s3c2410_pll_init(void)
79{ 81{
80 return sysdev_driver_register(&s3c2410_sysclass, &s3c2410_plls_drv); 82 return subsys_interface_register(&s3c2410_plls_interface);
81 83
82} 84}
83 85
84arch_initcall(s3c2410_pll_init); 86arch_initcall(s3c2410_pll_init);
85 87
86static struct sysdev_driver s3c2410a_plls_drv = { 88static struct subsys_interface s3c2410a_plls_interface = {
87 .add = s3c2410_plls_add, 89 .name = "s3c2410a_plls",
90 .subsys = &s3c2410a_subsys,
91 .add_dev = s3c2410_plls_add,
88}; 92};
89 93
90static int __init s3c2410a_pll_init(void) 94static int __init s3c2410a_pll_init(void)
91{ 95{
92 return sysdev_driver_register(&s3c2410a_sysclass, &s3c2410a_plls_drv); 96 return subsys_interface_register(&s3c2410a_plls_interface);
93} 97}
94 98
95arch_initcall(s3c2410a_pll_init); 99arch_initcall(s3c2410a_pll_init);
diff --git a/arch/arm/mach-s3c2410/pm.c b/arch/arm/mach-s3c2410/pm.c
index 4728f9aa7df1..fda5385deff6 100644
--- a/arch/arm/mach-s3c2410/pm.c
+++ b/arch/arm/mach-s3c2410/pm.c
@@ -24,7 +24,7 @@
24#include <linux/suspend.h> 24#include <linux/suspend.h>
25#include <linux/errno.h> 25#include <linux/errno.h>
26#include <linux/time.h> 26#include <linux/time.h>
27#include <linux/sysdev.h> 27#include <linux/device.h>
28#include <linux/syscore_ops.h> 28#include <linux/syscore_ops.h>
29#include <linux/gpio.h> 29#include <linux/gpio.h>
30#include <linux/io.h> 30#include <linux/io.h>
@@ -111,7 +111,7 @@ struct syscore_ops s3c2410_pm_syscore_ops = {
111 .resume = s3c2410_pm_resume, 111 .resume = s3c2410_pm_resume,
112}; 112};
113 113
114static int s3c2410_pm_add(struct sys_device *dev) 114static int s3c2410_pm_add(struct device *dev)
115{ 115{
116 pm_cpu_prep = s3c2410_pm_prepare; 116 pm_cpu_prep = s3c2410_pm_prepare;
117 pm_cpu_sleep = s3c2410_cpu_suspend; 117 pm_cpu_sleep = s3c2410_cpu_suspend;
@@ -120,52 +120,60 @@ static int s3c2410_pm_add(struct sys_device *dev)
120} 120}
121 121
122#if defined(CONFIG_CPU_S3C2410) 122#if defined(CONFIG_CPU_S3C2410)
123static struct sysdev_driver s3c2410_pm_driver = { 123static struct subsys_interface s3c2410_pm_interface = {
124 .add = s3c2410_pm_add, 124 .name = "s3c2410_pm",
125 .subsys = &s3c2410_subsys,
126 .add_dev = s3c2410_pm_add,
125}; 127};
126 128
127/* register ourselves */ 129/* register ourselves */
128 130
129static int __init s3c2410_pm_drvinit(void) 131static int __init s3c2410_pm_drvinit(void)
130{ 132{
131 return sysdev_driver_register(&s3c2410_sysclass, &s3c2410_pm_driver); 133 return subsys_interface_register(&s3c2410_pm_interface);
132} 134}
133 135
134arch_initcall(s3c2410_pm_drvinit); 136arch_initcall(s3c2410_pm_drvinit);
135 137
136static struct sysdev_driver s3c2410a_pm_driver = { 138static struct subsys_interface s3c2410a_pm_interface = {
137 .add = s3c2410_pm_add, 139 .name = "s3c2410a_pm",
140 .subsys = &s3c2410a_subsys,
141 .add_dev = s3c2410_pm_add,
138}; 142};
139 143
140static int __init s3c2410a_pm_drvinit(void) 144static int __init s3c2410a_pm_drvinit(void)
141{ 145{
142 return sysdev_driver_register(&s3c2410a_sysclass, &s3c2410a_pm_driver); 146 return subsys_interface_register(&s3c2410a_pm_interface);
143} 147}
144 148
145arch_initcall(s3c2410a_pm_drvinit); 149arch_initcall(s3c2410a_pm_drvinit);
146#endif 150#endif
147 151
148#if defined(CONFIG_CPU_S3C2440) 152#if defined(CONFIG_CPU_S3C2440)
149static struct sysdev_driver s3c2440_pm_driver = { 153static struct subsys_interface s3c2440_pm_interface = {
150 .add = s3c2410_pm_add, 154 .name = "s3c2440_pm",
155 .subsys = &s3c2440_subsys,
156 .add_dev = s3c2410_pm_add,
151}; 157};
152 158
153static int __init s3c2440_pm_drvinit(void) 159static int __init s3c2440_pm_drvinit(void)
154{ 160{
155 return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_pm_driver); 161 return subsys_interface_register(&s3c2440_pm_interface);
156} 162}
157 163
158arch_initcall(s3c2440_pm_drvinit); 164arch_initcall(s3c2440_pm_drvinit);
159#endif 165#endif
160 166
161#if defined(CONFIG_CPU_S3C2442) 167#if defined(CONFIG_CPU_S3C2442)
162static struct sysdev_driver s3c2442_pm_driver = { 168static struct subsys_interface s3c2442_pm_interface = {
163 .add = s3c2410_pm_add, 169 .name = "s3c2442_pm",
170 .subsys = &s3c2442_subsys,
171 .add_dev = s3c2410_pm_add,
164}; 172};
165 173
166static int __init s3c2442_pm_drvinit(void) 174static int __init s3c2442_pm_drvinit(void)
167{ 175{
168 return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_pm_driver); 176 return subsys_interface_register(&s3c2442_pm_interface);
169} 177}
170 178
171arch_initcall(s3c2442_pm_drvinit); 179arch_initcall(s3c2442_pm_drvinit);
diff --git a/arch/arm/mach-s3c2410/s3c2410.c b/arch/arm/mach-s3c2410/s3c2410.c
index 489c826e92a7..eea559ec7a58 100644
--- a/arch/arm/mach-s3c2410/s3c2410.c
+++ b/arch/arm/mach-s3c2410/s3c2410.c
@@ -18,7 +18,7 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/clk.h> 20#include <linux/clk.h>
21#include <linux/sysdev.h> 21#include <linux/device.h>
22#include <linux/syscore_ops.h> 22#include <linux/syscore_ops.h>
23#include <linux/serial_core.h> 23#include <linux/serial_core.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
@@ -132,22 +132,24 @@ void __init s3c2410_init_clocks(int xtal)
132 s3c24xx_register_clock(&s3c2410_armclk); 132 s3c24xx_register_clock(&s3c2410_armclk);
133} 133}
134 134
135struct sysdev_class s3c2410_sysclass = { 135struct bus_type s3c2410_subsys = {
136 .name = "s3c2410-core", 136 .name = "s3c2410-core",
137 .dev_name = "s3c2410-core",
137}; 138};
138 139
139/* Note, we would have liked to name this s3c2410-core, but we cannot 140/* Note, we would have liked to name this s3c2410-core, but we cannot
140 * register two sysdev_class with the same name. 141 * register two subsystems with the same name.
141 */ 142 */
142struct sysdev_class s3c2410a_sysclass = { 143struct bus_type s3c2410a_subsys = {
143 .name = "s3c2410a-core", 144 .name = "s3c2410a-core",
145 .dev_name = "s3c2410a-core",
144}; 146};
145 147
146static struct sys_device s3c2410_sysdev = { 148static struct device s3c2410_dev = {
147 .cls = &s3c2410_sysclass, 149 .bus = &s3c2410_subsys,
148}; 150};
149 151
150/* need to register class before we actually register the device, and 152/* need to register the subsystem before we actually register the device, and
151 * we also need to ensure that it has been initialised before any of the 153 * we also need to ensure that it has been initialised before any of the
152 * drivers even try to use it (even if not on an s3c2410 based system) 154 * drivers even try to use it (even if not on an s3c2410 based system)
153 * as a driver which may support both 2410 and 2440 may try and use it. 155 * as a driver which may support both 2410 and 2440 may try and use it.
@@ -155,14 +157,14 @@ static struct sys_device s3c2410_sysdev = {
155 157
156static int __init s3c2410_core_init(void) 158static int __init s3c2410_core_init(void)
157{ 159{
158 return sysdev_class_register(&s3c2410_sysclass); 160 return subsys_system_register(&s3c2410_subsys, NULL);
159} 161}
160 162
161core_initcall(s3c2410_core_init); 163core_initcall(s3c2410_core_init);
162 164
163static int __init s3c2410a_core_init(void) 165static int __init s3c2410a_core_init(void)
164{ 166{
165 return sysdev_class_register(&s3c2410a_sysclass); 167 return subsys_system_register(&s3c2410a_subsys, NULL);
166} 168}
167 169
168core_initcall(s3c2410a_core_init); 170core_initcall(s3c2410a_core_init);
@@ -176,12 +178,12 @@ int __init s3c2410_init(void)
176#endif 178#endif
177 register_syscore_ops(&s3c24xx_irq_syscore_ops); 179 register_syscore_ops(&s3c24xx_irq_syscore_ops);
178 180
179 return sysdev_register(&s3c2410_sysdev); 181 return device_register(&s3c2410_dev);
180} 182}
181 183
182int __init s3c2410a_init(void) 184int __init s3c2410a_init(void)
183{ 185{
184 s3c2410_sysdev.cls = &s3c2410a_sysclass; 186 s3c2410_dev.bus = &s3c2410a_subsys;
185 return s3c2410_init(); 187 return s3c2410_init();
186} 188}
187 189
diff --git a/arch/arm/mach-s3c2412/clock.c b/arch/arm/mach-s3c2412/clock.c
index 140711db6c89..516881640808 100644
--- a/arch/arm/mach-s3c2412/clock.c
+++ b/arch/arm/mach-s3c2412/clock.c
@@ -26,7 +26,7 @@
26#include <linux/list.h> 26#include <linux/list.h>
27#include <linux/errno.h> 27#include <linux/errno.h>
28#include <linux/err.h> 28#include <linux/err.h>
29#include <linux/sysdev.h> 29#include <linux/device.h>
30#include <linux/clk.h> 30#include <linux/clk.h>
31#include <linux/mutex.h> 31#include <linux/mutex.h>
32#include <linux/delay.h> 32#include <linux/delay.h>
diff --git a/arch/arm/mach-s3c2412/cpu-freq.c b/arch/arm/mach-s3c2412/cpu-freq.c
index eb3ea1721335..d8664b7652ce 100644
--- a/arch/arm/mach-s3c2412/cpu-freq.c
+++ b/arch/arm/mach-s3c2412/cpu-freq.c
@@ -16,7 +16,7 @@
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/ioport.h> 17#include <linux/ioport.h>
18#include <linux/cpufreq.h> 18#include <linux/cpufreq.h>
19#include <linux/sysdev.h> 19#include <linux/device.h>
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/clk.h> 21#include <linux/clk.h>
22#include <linux/err.h> 22#include <linux/err.h>
@@ -194,7 +194,7 @@ static struct s3c_cpufreq_info s3c2412_cpufreq_info = {
194 .debug_io_show = s3c_cpufreq_debugfs_call(s3c2412_iotiming_debugfs), 194 .debug_io_show = s3c_cpufreq_debugfs_call(s3c2412_iotiming_debugfs),
195}; 195};
196 196
197static int s3c2412_cpufreq_add(struct sys_device *sysdev) 197static int s3c2412_cpufreq_add(struct device *dev)
198{ 198{
199 unsigned long fclk_rate; 199 unsigned long fclk_rate;
200 200
@@ -244,14 +244,15 @@ err_fclk:
244 return -ENOENT; 244 return -ENOENT;
245} 245}
246 246
247static struct sysdev_driver s3c2412_cpufreq_driver = { 247static struct subsys_interface s3c2412_cpufreq_interface = {
248 .add = s3c2412_cpufreq_add, 248 .name = "s3c2412_cpufreq",
249 .subsys = &s3c2412_subsys,
250 .add_dev = s3c2412_cpufreq_add,
249}; 251};
250 252
251static int s3c2412_cpufreq_init(void) 253static int s3c2412_cpufreq_init(void)
252{ 254{
253 return sysdev_driver_register(&s3c2412_sysclass, 255 return subsys_interface_register(&s3c2412_cpufreq_interface);
254 &s3c2412_cpufreq_driver);
255} 256}
256 257
257arch_initcall(s3c2412_cpufreq_init); 258arch_initcall(s3c2412_cpufreq_init);
diff --git a/arch/arm/mach-s3c2412/dma.c b/arch/arm/mach-s3c2412/dma.c
index d2a7d5ef3e67..142acd3b5e15 100644
--- a/arch/arm/mach-s3c2412/dma.c
+++ b/arch/arm/mach-s3c2412/dma.c
@@ -14,7 +14,7 @@
14 14
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/sysdev.h> 17#include <linux/device.h>
18#include <linux/serial_core.h> 18#include <linux/serial_core.h>
19#include <linux/io.h> 19#include <linux/io.h>
20 20
@@ -159,19 +159,21 @@ static struct s3c24xx_dma_selection __initdata s3c2412_dma_sel = {
159 .map_size = ARRAY_SIZE(s3c2412_dma_mappings), 159 .map_size = ARRAY_SIZE(s3c2412_dma_mappings),
160}; 160};
161 161
162static int __init s3c2412_dma_add(struct sys_device *sysdev) 162static int __init s3c2412_dma_add(struct device *dev)
163{ 163{
164 s3c2410_dma_init(); 164 s3c2410_dma_init();
165 return s3c24xx_dma_init_map(&s3c2412_dma_sel); 165 return s3c24xx_dma_init_map(&s3c2412_dma_sel);
166} 166}
167 167
168static struct sysdev_driver s3c2412_dma_driver = { 168static struct subsys_interface s3c2412_dma_interface = {
169 .add = s3c2412_dma_add, 169 .name = "s3c2412_dma",
170 .subsys = &s3c2412_subsys,
171 .add_dev = s3c2412_dma_add,
170}; 172};
171 173
172static int __init s3c2412_dma_init(void) 174static int __init s3c2412_dma_init(void)
173{ 175{
174 return sysdev_driver_register(&s3c2412_sysclass, &s3c2412_dma_driver); 176 return subsys_interface_register(&s3c2412_dma_interface);
175} 177}
176 178
177arch_initcall(s3c2412_dma_init); 179arch_initcall(s3c2412_dma_init);
diff --git a/arch/arm/mach-s3c2412/irq.c b/arch/arm/mach-s3c2412/irq.c
index 1a1aa220972b..a8a46c1644f4 100644
--- a/arch/arm/mach-s3c2412/irq.c
+++ b/arch/arm/mach-s3c2412/irq.c
@@ -23,7 +23,7 @@
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/ioport.h> 25#include <linux/ioport.h>
26#include <linux/sysdev.h> 26#include <linux/device.h>
27#include <linux/io.h> 27#include <linux/io.h>
28 28
29#include <mach/hardware.h> 29#include <mach/hardware.h>
@@ -170,7 +170,7 @@ static int s3c2412_irq_rtc_wake(struct irq_data *data, unsigned int state)
170 170
171static struct irq_chip s3c2412_irq_rtc_chip; 171static struct irq_chip s3c2412_irq_rtc_chip;
172 172
173static int s3c2412_irq_add(struct sys_device *sysdev) 173static int s3c2412_irq_add(struct device *dev)
174{ 174{
175 unsigned int irqno; 175 unsigned int irqno;
176 176
@@ -200,13 +200,15 @@ static int s3c2412_irq_add(struct sys_device *sysdev)
200 return 0; 200 return 0;
201} 201}
202 202
203static struct sysdev_driver s3c2412_irq_driver = { 203static struct subsys_interface s3c2412_irq_interface = {
204 .add = s3c2412_irq_add, 204 .name = "s3c2412_irq",
205 .subsys = &s3c2412_subsys,
206 .add_dev = s3c2412_irq_add,
205}; 207};
206 208
207static int s3c2412_irq_init(void) 209static int s3c2412_irq_init(void)
208{ 210{
209 return sysdev_driver_register(&s3c2412_sysclass, &s3c2412_irq_driver); 211 return subsys_interface_register(&s3c2412_irq_interface);
210} 212}
211 213
212arch_initcall(s3c2412_irq_init); 214arch_initcall(s3c2412_irq_init);
diff --git a/arch/arm/mach-s3c2412/pm.c b/arch/arm/mach-s3c2412/pm.c
index f4077efa51fa..d1adfa65f66d 100644
--- a/arch/arm/mach-s3c2412/pm.c
+++ b/arch/arm/mach-s3c2412/pm.c
@@ -16,7 +16,7 @@
16#include <linux/list.h> 16#include <linux/list.h>
17#include <linux/timer.h> 17#include <linux/timer.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/sysdev.h> 19#include <linux/device.h>
20#include <linux/syscore_ops.h> 20#include <linux/syscore_ops.h>
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/io.h> 22#include <linux/io.h>
@@ -56,7 +56,7 @@ static void s3c2412_pm_prepare(void)
56{ 56{
57} 57}
58 58
59static int s3c2412_pm_add(struct sys_device *sysdev) 59static int s3c2412_pm_add(struct device *dev)
60{ 60{
61 pm_cpu_prep = s3c2412_pm_prepare; 61 pm_cpu_prep = s3c2412_pm_prepare;
62 pm_cpu_sleep = s3c2412_cpu_suspend; 62 pm_cpu_sleep = s3c2412_cpu_suspend;
@@ -87,13 +87,15 @@ static struct sleep_save s3c2412_sleep[] = {
87 SAVE_ITEM(S3C2413_GPJSLPCON), 87 SAVE_ITEM(S3C2413_GPJSLPCON),
88}; 88};
89 89
90static struct sysdev_driver s3c2412_pm_driver = { 90static struct subsys_interface s3c2412_pm_interface = {
91 .add = s3c2412_pm_add, 91 .name = "s3c2412_pm",
92 .subsys = &s3c2412_subsys,
93 .add_dev = s3c2412_pm_add,
92}; 94};
93 95
94static __init int s3c2412_pm_init(void) 96static __init int s3c2412_pm_init(void)
95{ 97{
96 return sysdev_driver_register(&s3c2412_sysclass, &s3c2412_pm_driver); 98 return subsys_interface_register(&s3c2412_pm_interface);
97} 99}
98 100
99arch_initcall(s3c2412_pm_init); 101arch_initcall(s3c2412_pm_init);
diff --git a/arch/arm/mach-s3c2412/s3c2412.c b/arch/arm/mach-s3c2412/s3c2412.c
index 867ce2e269f6..aff6e85a97c6 100644
--- a/arch/arm/mach-s3c2412/s3c2412.c
+++ b/arch/arm/mach-s3c2412/s3c2412.c
@@ -18,7 +18,7 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/sysdev.h> 21#include <linux/device.h>
22#include <linux/syscore_ops.h> 22#include <linux/syscore_ops.h>
23#include <linux/serial_core.h> 23#include <linux/serial_core.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
@@ -218,25 +218,26 @@ void __init s3c2412_init_clocks(int xtal)
218 s3c2412_baseclk_add(); 218 s3c2412_baseclk_add();
219} 219}
220 220
221/* need to register class before we actually register the device, and 221/* need to register the subsystem before we actually register the device, and
222 * we also need to ensure that it has been initialised before any of the 222 * we also need to ensure that it has been initialised before any of the
223 * drivers even try to use it (even if not on an s3c2412 based system) 223 * drivers even try to use it (even if not on an s3c2412 based system)
224 * as a driver which may support both 2410 and 2440 may try and use it. 224 * as a driver which may support both 2410 and 2440 may try and use it.
225*/ 225*/
226 226
227struct sysdev_class s3c2412_sysclass = { 227struct bus_type s3c2412_subsys = {
228 .name = "s3c2412-core", 228 .name = "s3c2412-core",
229 .dev_name = "s3c2412-core",
229}; 230};
230 231
231static int __init s3c2412_core_init(void) 232static int __init s3c2412_core_init(void)
232{ 233{
233 return sysdev_class_register(&s3c2412_sysclass); 234 return subsys_system_register(&s3c2412_subsys, NULL);
234} 235}
235 236
236core_initcall(s3c2412_core_init); 237core_initcall(s3c2412_core_init);
237 238
238static struct sys_device s3c2412_sysdev = { 239static struct device s3c2412_dev = {
239 .cls = &s3c2412_sysclass, 240 .bus = &s3c2412_subsys,
240}; 241};
241 242
242int __init s3c2412_init(void) 243int __init s3c2412_init(void)
@@ -248,5 +249,5 @@ int __init s3c2412_init(void)
248#endif 249#endif
249 register_syscore_ops(&s3c24xx_irq_syscore_ops); 250 register_syscore_ops(&s3c24xx_irq_syscore_ops);
250 251
251 return sysdev_register(&s3c2412_sysdev); 252 return device_register(&s3c2412_dev);
252} 253}
diff --git a/arch/arm/mach-s3c2416/irq.c b/arch/arm/mach-s3c2416/irq.c
index 28ad20d42445..36df761061de 100644
--- a/arch/arm/mach-s3c2416/irq.c
+++ b/arch/arm/mach-s3c2416/irq.c
@@ -25,7 +25,7 @@
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <linux/ioport.h> 27#include <linux/ioport.h>
28#include <linux/sysdev.h> 28#include <linux/device.h>
29#include <linux/io.h> 29#include <linux/io.h>
30 30
31#include <mach/hardware.h> 31#include <mach/hardware.h>
@@ -213,7 +213,7 @@ static int __init s3c2416_add_sub(unsigned int base,
213 return 0; 213 return 0;
214} 214}
215 215
216static int __init s3c2416_irq_add(struct sys_device *sysdev) 216static int __init s3c2416_irq_add(struct device *dev)
217{ 217{
218 printk(KERN_INFO "S3C2416: IRQ Support\n"); 218 printk(KERN_INFO "S3C2416: IRQ Support\n");
219 219
@@ -234,13 +234,15 @@ static int __init s3c2416_irq_add(struct sys_device *sysdev)
234 return 0; 234 return 0;
235} 235}
236 236
237static struct sysdev_driver s3c2416_irq_driver = { 237static struct subsys_interface s3c2416_irq_interface = {
238 .add = s3c2416_irq_add, 238 .name = "s3c2416_irq",
239 .subsys = &s3c2416_subsys,
240 .add_dev = s3c2416_irq_add,
239}; 241};
240 242
241static int __init s3c2416_irq_init(void) 243static int __init s3c2416_irq_init(void)
242{ 244{
243 return sysdev_driver_register(&s3c2416_sysclass, &s3c2416_irq_driver); 245 return subsys_interface_register(&s3c2416_irq_interface);
244} 246}
245 247
246arch_initcall(s3c2416_irq_init); 248arch_initcall(s3c2416_irq_init);
diff --git a/arch/arm/mach-s3c2416/pm.c b/arch/arm/mach-s3c2416/pm.c
index 9ec54f1d8e75..3bdb15a0d419 100644
--- a/arch/arm/mach-s3c2416/pm.c
+++ b/arch/arm/mach-s3c2416/pm.c
@@ -10,7 +10,7 @@
10 * published by the Free Software Foundation. 10 * published by the Free Software Foundation.
11*/ 11*/
12 12
13#include <linux/sysdev.h> 13#include <linux/device.h>
14#include <linux/syscore_ops.h> 14#include <linux/syscore_ops.h>
15#include <linux/io.h> 15#include <linux/io.h>
16 16
@@ -48,7 +48,7 @@ static void s3c2416_pm_prepare(void)
48 __raw_writel(virt_to_phys(s3c_cpu_resume), S3C2412_INFORM1); 48 __raw_writel(virt_to_phys(s3c_cpu_resume), S3C2412_INFORM1);
49} 49}
50 50
51static int s3c2416_pm_add(struct sys_device *sysdev) 51static int s3c2416_pm_add(struct device *dev)
52{ 52{
53 pm_cpu_prep = s3c2416_pm_prepare; 53 pm_cpu_prep = s3c2416_pm_prepare;
54 pm_cpu_sleep = s3c2416_cpu_suspend; 54 pm_cpu_sleep = s3c2416_cpu_suspend;
@@ -56,13 +56,15 @@ static int s3c2416_pm_add(struct sys_device *sysdev)
56 return 0; 56 return 0;
57} 57}
58 58
59static struct sysdev_driver s3c2416_pm_driver = { 59static struct subsys_interface s3c2416_pm_interface = {
60 .add = s3c2416_pm_add, 60 .name = "s3c2416_pm",
61 .subsys = &s3c2416_subsys,
62 .add_dev = s3c2416_pm_add,
61}; 63};
62 64
63static __init int s3c2416_pm_init(void) 65static __init int s3c2416_pm_init(void)
64{ 66{
65 return sysdev_driver_register(&s3c2416_sysclass, &s3c2416_pm_driver); 67 return subsys_interface_register(&s3c2416_pm_interface);
66} 68}
67 69
68arch_initcall(s3c2416_pm_init); 70arch_initcall(s3c2416_pm_init);
diff --git a/arch/arm/mach-s3c2416/s3c2416.c b/arch/arm/mach-s3c2416/s3c2416.c
index 46062232bbc7..5287d2808d3e 100644
--- a/arch/arm/mach-s3c2416/s3c2416.c
+++ b/arch/arm/mach-s3c2416/s3c2416.c
@@ -31,7 +31,7 @@
31#include <linux/gpio.h> 31#include <linux/gpio.h>
32#include <linux/platform_device.h> 32#include <linux/platform_device.h>
33#include <linux/serial_core.h> 33#include <linux/serial_core.h>
34#include <linux/sysdev.h> 34#include <linux/device.h>
35#include <linux/syscore_ops.h> 35#include <linux/syscore_ops.h>
36#include <linux/clk.h> 36#include <linux/clk.h>
37#include <linux/io.h> 37#include <linux/io.h>
@@ -67,12 +67,13 @@ static struct map_desc s3c2416_iodesc[] __initdata = {
67 IODESC_ENT(TIMER), 67 IODESC_ENT(TIMER),
68}; 68};
69 69
70struct sysdev_class s3c2416_sysclass = { 70struct bus_type s3c2416_subsys = {
71 .name = "s3c2416-core", 71 .name = "s3c2416-core",
72 .dev_name = "s3c2416-core",
72}; 73};
73 74
74static struct sys_device s3c2416_sysdev = { 75static struct device s3c2416_dev = {
75 .cls = &s3c2416_sysclass, 76 .bus = &s3c2416_subsys,
76}; 77};
77 78
78void s3c2416_restart(char mode, const char *cmd) 79void s3c2416_restart(char mode, const char *cmd)
@@ -106,7 +107,7 @@ int __init s3c2416_init(void)
106#endif 107#endif
107 register_syscore_ops(&s3c24xx_irq_syscore_ops); 108 register_syscore_ops(&s3c24xx_irq_syscore_ops);
108 109
109 return sysdev_register(&s3c2416_sysdev); 110 return device_register(&s3c2416_dev);
110} 111}
111 112
112void __init s3c2416_init_uarts(struct s3c2410_uartcfg *cfg, int no) 113void __init s3c2416_init_uarts(struct s3c2410_uartcfg *cfg, int no)
@@ -134,7 +135,7 @@ void __init s3c2416_map_io(void)
134 iotable_init(s3c2416_iodesc, ARRAY_SIZE(s3c2416_iodesc)); 135 iotable_init(s3c2416_iodesc, ARRAY_SIZE(s3c2416_iodesc));
135} 136}
136 137
137/* need to register class before we actually register the device, and 138/* need to register the subsystem before we actually register the device, and
138 * we also need to ensure that it has been initialised before any of the 139 * we also need to ensure that it has been initialised before any of the
139 * drivers even try to use it (even if not on an s3c2416 based system) 140 * drivers even try to use it (even if not on an s3c2416 based system)
140 * as a driver which may support both 2443 and 2440 may try and use it. 141 * as a driver which may support both 2443 and 2440 may try and use it.
@@ -142,7 +143,7 @@ void __init s3c2416_map_io(void)
142 143
143static int __init s3c2416_core_init(void) 144static int __init s3c2416_core_init(void)
144{ 145{
145 return sysdev_class_register(&s3c2416_sysclass); 146 return subsys_system_register(&s3c2416_subsys, NULL);
146} 147}
147 148
148core_initcall(s3c2416_core_init); 149core_initcall(s3c2416_core_init);
diff --git a/arch/arm/mach-s3c2440/clock.c b/arch/arm/mach-s3c2440/clock.c
index f9e6bdaf41d2..d8957592fdc4 100644
--- a/arch/arm/mach-s3c2440/clock.c
+++ b/arch/arm/mach-s3c2440/clock.c
@@ -28,7 +28,6 @@
28#include <linux/errno.h> 28#include <linux/errno.h>
29#include <linux/err.h> 29#include <linux/err.h>
30#include <linux/device.h> 30#include <linux/device.h>
31#include <linux/sysdev.h>
32#include <linux/interrupt.h> 31#include <linux/interrupt.h>
33#include <linux/ioport.h> 32#include <linux/ioport.h>
34#include <linux/mutex.h> 33#include <linux/mutex.h>
@@ -108,7 +107,7 @@ static struct clk s3c2440_clk_ac97 = {
108 .ctrlbit = S3C2440_CLKCON_CAMERA, 107 .ctrlbit = S3C2440_CLKCON_CAMERA,
109}; 108};
110 109
111static int s3c2440_clk_add(struct sys_device *sysdev) 110static int s3c2440_clk_add(struct device *dev)
112{ 111{
113 struct clk *clock_upll; 112 struct clk *clock_upll;
114 struct clk *clock_h; 113 struct clk *clock_h;
@@ -137,13 +136,15 @@ static int s3c2440_clk_add(struct sys_device *sysdev)
137 return 0; 136 return 0;
138} 137}
139 138
140static struct sysdev_driver s3c2440_clk_driver = { 139static struct subsys_interface s3c2440_clk_interface = {
141 .add = s3c2440_clk_add, 140 .name = "s3c2440_clk",
141 .subsys = &s3c2440_subsys,
142 .add_dev = s3c2440_clk_add,
142}; 143};
143 144
144static __init int s3c24xx_clk_driver(void) 145static __init int s3c24xx_clk_init(void)
145{ 146{
146 return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_clk_driver); 147 return subsys_interface_register(&s3c2440_clk_interface);
147} 148}
148 149
149arch_initcall(s3c24xx_clk_driver); 150arch_initcall(s3c24xx_clk_init);
diff --git a/arch/arm/mach-s3c2440/dma.c b/arch/arm/mach-s3c2440/dma.c
index 0e73f8f9d132..15b1ddf8f626 100644
--- a/arch/arm/mach-s3c2440/dma.c
+++ b/arch/arm/mach-s3c2440/dma.c
@@ -14,7 +14,7 @@
14 14
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/sysdev.h> 17#include <linux/device.h>
18#include <linux/serial_core.h> 18#include <linux/serial_core.h>
19 19
20#include <mach/map.h> 20#include <mach/map.h>
@@ -174,20 +174,22 @@ static struct s3c24xx_dma_order __initdata s3c2440_dma_order = {
174 }, 174 },
175}; 175};
176 176
177static int __init s3c2440_dma_add(struct sys_device *sysdev) 177static int __init s3c2440_dma_add(struct device *dev)
178{ 178{
179 s3c2410_dma_init(); 179 s3c2410_dma_init();
180 s3c24xx_dma_order_set(&s3c2440_dma_order); 180 s3c24xx_dma_order_set(&s3c2440_dma_order);
181 return s3c24xx_dma_init_map(&s3c2440_dma_sel); 181 return s3c24xx_dma_init_map(&s3c2440_dma_sel);
182} 182}
183 183
184static struct sysdev_driver s3c2440_dma_driver = { 184static struct subsys_interface s3c2440_dma_interface = {
185 .add = s3c2440_dma_add, 185 .name = "s3c2440_dma",
186 .subsys = &s3c2440_subsys,
187 .add_dev = s3c2440_dma_add,
186}; 188};
187 189
188static int __init s3c2440_dma_init(void) 190static int __init s3c2440_dma_init(void)
189{ 191{
190 return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_dma_driver); 192 return subsys_interface_register(&s3c2440_dma_interface);
191} 193}
192 194
193arch_initcall(s3c2440_dma_init); 195arch_initcall(s3c2440_dma_init);
diff --git a/arch/arm/mach-s3c2440/irq.c b/arch/arm/mach-s3c2440/irq.c
index eb1cc0f0705e..4fee9bc6bcb5 100644
--- a/arch/arm/mach-s3c2440/irq.c
+++ b/arch/arm/mach-s3c2440/irq.c
@@ -23,7 +23,7 @@
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/ioport.h> 25#include <linux/ioport.h>
26#include <linux/sysdev.h> 26#include <linux/device.h>
27#include <linux/io.h> 27#include <linux/io.h>
28 28
29#include <mach/hardware.h> 29#include <mach/hardware.h>
@@ -92,7 +92,7 @@ static struct irq_chip s3c_irq_wdtac97 = {
92 .irq_ack = s3c_irq_wdtac97_ack, 92 .irq_ack = s3c_irq_wdtac97_ack,
93}; 93};
94 94
95static int s3c2440_irq_add(struct sys_device *sysdev) 95static int s3c2440_irq_add(struct device *dev)
96{ 96{
97 unsigned int irqno; 97 unsigned int irqno;
98 98
@@ -113,13 +113,15 @@ static int s3c2440_irq_add(struct sys_device *sysdev)
113 return 0; 113 return 0;
114} 114}
115 115
116static struct sysdev_driver s3c2440_irq_driver = { 116static struct subsys_interface s3c2440_irq_interface = {
117 .add = s3c2440_irq_add, 117 .name = "s3c2440_irq",
118 .subsys = &s3c2440_subsys,
119 .add_dev = s3c2440_irq_add,
118}; 120};
119 121
120static int s3c2440_irq_init(void) 122static int s3c2440_irq_init(void)
121{ 123{
122 return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_irq_driver); 124 return subsys_interface_register(&s3c2440_irq_interface);
123} 125}
124 126
125arch_initcall(s3c2440_irq_init); 127arch_initcall(s3c2440_irq_init);
diff --git a/arch/arm/mach-s3c2440/mach-rx1950.c b/arch/arm/mach-s3c2440/mach-rx1950.c
index 1c50d3e09177..332d7533bd96 100644
--- a/arch/arm/mach-s3c2440/mach-rx1950.c
+++ b/arch/arm/mach-s3c2440/mach-rx1950.c
@@ -24,7 +24,7 @@
24#include <linux/serial_core.h> 24#include <linux/serial_core.h>
25#include <linux/input.h> 25#include <linux/input.h>
26#include <linux/gpio_keys.h> 26#include <linux/gpio_keys.h>
27#include <linux/sysdev.h> 27#include <linux/device.h>
28#include <linux/pda_power.h> 28#include <linux/pda_power.h>
29#include <linux/pwm_backlight.h> 29#include <linux/pwm_backlight.h>
30#include <linux/pwm.h> 30#include <linux/pwm.h>
diff --git a/arch/arm/mach-s3c2440/mach-rx3715.c b/arch/arm/mach-s3c2440/mach-rx3715.c
index 4d20a016b85d..80a0972873c2 100644
--- a/arch/arm/mach-s3c2440/mach-rx3715.c
+++ b/arch/arm/mach-s3c2440/mach-rx3715.c
@@ -20,7 +20,7 @@
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/tty.h> 21#include <linux/tty.h>
22#include <linux/console.h> 22#include <linux/console.h>
23#include <linux/sysdev.h> 23#include <linux/device.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/serial_core.h> 25#include <linux/serial_core.h>
26#include <linux/serial.h> 26#include <linux/serial.h>
diff --git a/arch/arm/mach-s3c2440/s3c2440-cpufreq.c b/arch/arm/mach-s3c2440/s3c2440-cpufreq.c
index 976002fb1b8f..cf7596694efe 100644
--- a/arch/arm/mach-s3c2440/s3c2440-cpufreq.c
+++ b/arch/arm/mach-s3c2440/s3c2440-cpufreq.c
@@ -17,7 +17,7 @@
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/ioport.h> 18#include <linux/ioport.h>
19#include <linux/cpufreq.h> 19#include <linux/cpufreq.h>
20#include <linux/sysdev.h> 20#include <linux/device.h>
21#include <linux/delay.h> 21#include <linux/delay.h>
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/err.h> 23#include <linux/err.h>
@@ -270,7 +270,7 @@ struct s3c_cpufreq_info s3c2440_cpufreq_info = {
270 .debug_io_show = s3c_cpufreq_debugfs_call(s3c2410_iotiming_debugfs), 270 .debug_io_show = s3c_cpufreq_debugfs_call(s3c2410_iotiming_debugfs),
271}; 271};
272 272
273static int s3c2440_cpufreq_add(struct sys_device *sysdev) 273static int s3c2440_cpufreq_add(struct device *dev)
274{ 274{
275 xtal = s3c_cpufreq_clk_get(NULL, "xtal"); 275 xtal = s3c_cpufreq_clk_get(NULL, "xtal");
276 hclk = s3c_cpufreq_clk_get(NULL, "hclk"); 276 hclk = s3c_cpufreq_clk_get(NULL, "hclk");
@@ -285,27 +285,29 @@ static int s3c2440_cpufreq_add(struct sys_device *sysdev)
285 return s3c_cpufreq_register(&s3c2440_cpufreq_info); 285 return s3c_cpufreq_register(&s3c2440_cpufreq_info);
286} 286}
287 287
288static struct sysdev_driver s3c2440_cpufreq_driver = { 288static struct subsys_interface s3c2440_cpufreq_interface = {
289 .add = s3c2440_cpufreq_add, 289 .name = "s3c2440_cpufreq",
290 .subsys = &s3c2440_subsys,
291 .add_dev = s3c2440_cpufreq_add,
290}; 292};
291 293
292static int s3c2440_cpufreq_init(void) 294static int s3c2440_cpufreq_init(void)
293{ 295{
294 return sysdev_driver_register(&s3c2440_sysclass, 296 return subsys_interface_register(&s3c2440_cpufreq_interface);
295 &s3c2440_cpufreq_driver);
296} 297}
297 298
298/* arch_initcall adds the clocks we need, so use subsys_initcall. */ 299/* arch_initcall adds the clocks we need, so use subsys_initcall. */
299subsys_initcall(s3c2440_cpufreq_init); 300subsys_initcall(s3c2440_cpufreq_init);
300 301
301static struct sysdev_driver s3c2442_cpufreq_driver = { 302static struct subsys_interface s3c2442_cpufreq_interface = {
302 .add = s3c2440_cpufreq_add, 303 .name = "s3c2442_cpufreq",
304 .subsys = &s3c2442_subsys,
305 .add_dev = s3c2440_cpufreq_add,
303}; 306};
304 307
305static int s3c2442_cpufreq_init(void) 308static int s3c2442_cpufreq_init(void)
306{ 309{
307 return sysdev_driver_register(&s3c2442_sysclass, 310 return subsys_interface_register(&s3c2442_cpufreq_interface);
308 &s3c2442_cpufreq_driver);
309} 311}
310 312
311subsys_initcall(s3c2442_cpufreq_init); 313subsys_initcall(s3c2442_cpufreq_init);
diff --git a/arch/arm/mach-s3c2440/s3c2440-pll-12000000.c b/arch/arm/mach-s3c2440/s3c2440-pll-12000000.c
index f105d5e8c477..b5368ae8d7fe 100644
--- a/arch/arm/mach-s3c2440/s3c2440-pll-12000000.c
+++ b/arch/arm/mach-s3c2440/s3c2440-pll-12000000.c
@@ -14,7 +14,7 @@
14 14
15#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/sysdev.h> 17#include <linux/device.h>
18#include <linux/clk.h> 18#include <linux/clk.h>
19#include <linux/err.h> 19#include <linux/err.h>
20 20
@@ -51,7 +51,7 @@ static struct cpufreq_frequency_table s3c2440_plls_12[] __initdata = {
51 { .frequency = 400000000, .index = PLLVAL(0x5c, 1, 1), }, /* FVco 800.000000 */ 51 { .frequency = 400000000, .index = PLLVAL(0x5c, 1, 1), }, /* FVco 800.000000 */
52}; 52};
53 53
54static int s3c2440_plls12_add(struct sys_device *dev) 54static int s3c2440_plls12_add(struct device *dev)
55{ 55{
56 struct clk *xtal_clk; 56 struct clk *xtal_clk;
57 unsigned long xtal; 57 unsigned long xtal;
@@ -72,25 +72,29 @@ static int s3c2440_plls12_add(struct sys_device *dev)
72 return 0; 72 return 0;
73} 73}
74 74
75static struct sysdev_driver s3c2440_plls12_drv = { 75static struct subsys_interface s3c2440_plls12_interface = {
76 .add = s3c2440_plls12_add, 76 .name = "s3c2440_plls12",
77 .subsys = &s3c2440_subsys,
78 .add_dev = s3c2440_plls12_add,
77}; 79};
78 80
79static int __init s3c2440_pll_12mhz(void) 81static int __init s3c2440_pll_12mhz(void)
80{ 82{
81 return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_plls12_drv); 83 return subsys_interface_register(&s3c2440_plls12_interface);
82 84
83} 85}
84 86
85arch_initcall(s3c2440_pll_12mhz); 87arch_initcall(s3c2440_pll_12mhz);
86 88
87static struct sysdev_driver s3c2442_plls12_drv = { 89static struct subsys_interface s3c2442_plls12_interface = {
88 .add = s3c2440_plls12_add, 90 .name = "s3c2442_plls12",
91 .subsys = &s3c2442_subsys,
92 .add_dev = s3c2440_plls12_add,
89}; 93};
90 94
91static int __init s3c2442_pll_12mhz(void) 95static int __init s3c2442_pll_12mhz(void)
92{ 96{
93 return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_plls12_drv); 97 return subsys_interface_register(&s3c2442_plls12_interface);
94 98
95} 99}
96 100
diff --git a/arch/arm/mach-s3c2440/s3c2440-pll-16934400.c b/arch/arm/mach-s3c2440/s3c2440-pll-16934400.c
index c8a8f90ef382..42f2b5cd2399 100644
--- a/arch/arm/mach-s3c2440/s3c2440-pll-16934400.c
+++ b/arch/arm/mach-s3c2440/s3c2440-pll-16934400.c
@@ -14,7 +14,7 @@
14 14
15#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/sysdev.h> 17#include <linux/device.h>
18#include <linux/clk.h> 18#include <linux/clk.h>
19#include <linux/err.h> 19#include <linux/err.h>
20 20
@@ -79,7 +79,7 @@ static struct cpufreq_frequency_table s3c2440_plls_169344[] __initdata = {
79 { .frequency = 402192000, .index = PLLVAL(87, 2, 1), }, /* FVco 804.384000 */ 79 { .frequency = 402192000, .index = PLLVAL(87, 2, 1), }, /* FVco 804.384000 */
80}; 80};
81 81
82static int s3c2440_plls169344_add(struct sys_device *dev) 82static int s3c2440_plls169344_add(struct device *dev)
83{ 83{
84 struct clk *xtal_clk; 84 struct clk *xtal_clk;
85 unsigned long xtal; 85 unsigned long xtal;
@@ -100,28 +100,28 @@ static int s3c2440_plls169344_add(struct sys_device *dev)
100 return 0; 100 return 0;
101} 101}
102 102
103static struct sysdev_driver s3c2440_plls169344_drv = { 103static struct subsys_interface s3c2440_plls169344_interface = {
104 .add = s3c2440_plls169344_add, 104 .name = "s3c2440_plls169344",
105 .subsys = &s3c2440_subsys,
106 .add_dev = s3c2440_plls169344_add,
105}; 107};
106 108
107static int __init s3c2440_pll_16934400(void) 109static int __init s3c2440_pll_16934400(void)
108{ 110{
109 return sysdev_driver_register(&s3c2440_sysclass, 111 return subsys_interface_register(&s3c2440_plls169344_interface);
110 &s3c2440_plls169344_drv);
111
112} 112}
113 113
114arch_initcall(s3c2440_pll_16934400); 114arch_initcall(s3c2440_pll_16934400);
115 115
116static struct sysdev_driver s3c2442_plls169344_drv = { 116static struct subsys_interface s3c2442_plls169344_interface = {
117 .add = s3c2440_plls169344_add, 117 .name = "s3c2442_plls169344",
118 .subsys = &s3c2442_subsys,
119 .add_dev = s3c2440_plls169344_add,
118}; 120};
119 121
120static int __init s3c2442_pll_16934400(void) 122static int __init s3c2442_pll_16934400(void)
121{ 123{
122 return sysdev_driver_register(&s3c2442_sysclass, 124 return subsys_interface_register(&s3c2442_plls169344_interface);
123 &s3c2442_plls169344_drv);
124
125} 125}
126 126
127arch_initcall(s3c2442_pll_16934400); 127arch_initcall(s3c2442_pll_16934400);
diff --git a/arch/arm/mach-s3c2440/s3c2440.c b/arch/arm/mach-s3c2440/s3c2440.c
index 42d73f1e0cef..517623a09fc5 100644
--- a/arch/arm/mach-s3c2440/s3c2440.c
+++ b/arch/arm/mach-s3c2440/s3c2440.c
@@ -18,7 +18,7 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/serial_core.h> 20#include <linux/serial_core.h>
21#include <linux/sysdev.h> 21#include <linux/device.h>
22#include <linux/syscore_ops.h> 22#include <linux/syscore_ops.h>
23#include <linux/gpio.h> 23#include <linux/gpio.h>
24#include <linux/clk.h> 24#include <linux/clk.h>
@@ -41,8 +41,8 @@
41#include <plat/gpio-cfg.h> 41#include <plat/gpio-cfg.h>
42#include <plat/gpio-cfg-helpers.h> 42#include <plat/gpio-cfg-helpers.h>
43 43
44static struct sys_device s3c2440_sysdev = { 44static struct device s3c2440_dev = {
45 .cls = &s3c2440_sysclass, 45 .bus = &s3c2440_subsys,
46}; 46};
47 47
48int __init s3c2440_init(void) 48int __init s3c2440_init(void)
@@ -64,7 +64,7 @@ int __init s3c2440_init(void)
64 64
65 /* register our system device for everything else */ 65 /* register our system device for everything else */
66 66
67 return sysdev_register(&s3c2440_sysdev); 67 return device_register(&s3c2440_dev);
68} 68}
69 69
70void __init s3c2440_map_io(void) 70void __init s3c2440_map_io(void)
diff --git a/arch/arm/mach-s3c2440/s3c2442.c b/arch/arm/mach-s3c2440/s3c2442.c
index 2c822e09392f..8004e0497bf4 100644
--- a/arch/arm/mach-s3c2440/s3c2442.c
+++ b/arch/arm/mach-s3c2440/s3c2442.c
@@ -28,7 +28,6 @@
28#include <linux/errno.h> 28#include <linux/errno.h>
29#include <linux/err.h> 29#include <linux/err.h>
30#include <linux/device.h> 30#include <linux/device.h>
31#include <linux/sysdev.h>
32#include <linux/syscore_ops.h> 31#include <linux/syscore_ops.h>
33#include <linux/interrupt.h> 32#include <linux/interrupt.h>
34#include <linux/ioport.h> 33#include <linux/ioport.h>
@@ -123,7 +122,7 @@ static struct clk s3c2442_clk_cam_upll = {
123 }, 122 },
124}; 123};
125 124
126static int s3c2442_clk_add(struct sys_device *sysdev) 125static int s3c2442_clk_add(struct device *dev)
127{ 126{
128 struct clk *clock_upll; 127 struct clk *clock_upll;
129 struct clk *clock_h; 128 struct clk *clock_h;
@@ -149,20 +148,22 @@ static int s3c2442_clk_add(struct sys_device *sysdev)
149 return 0; 148 return 0;
150} 149}
151 150
152static struct sysdev_driver s3c2442_clk_driver = { 151static struct subsys_interface s3c2442_clk_interface = {
153 .add = s3c2442_clk_add, 152 .name = "s3c2442_clk",
153 .subsys = &s3c2442_subsys,
154 .add_dev = s3c2442_clk_add,
154}; 155};
155 156
156static __init int s3c2442_clk_init(void) 157static __init int s3c2442_clk_init(void)
157{ 158{
158 return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_clk_driver); 159 return subsys_interface_register(&s3c2442_clk_interface);
159} 160}
160 161
161arch_initcall(s3c2442_clk_init); 162arch_initcall(s3c2442_clk_init);
162 163
163 164
164static struct sys_device s3c2442_sysdev = { 165static struct device s3c2442_dev = {
165 .cls = &s3c2442_sysclass, 166 .bus = &s3c2442_subsys,
166}; 167};
167 168
168int __init s3c2442_init(void) 169int __init s3c2442_init(void)
@@ -175,7 +176,7 @@ int __init s3c2442_init(void)
175 register_syscore_ops(&s3c244x_pm_syscore_ops); 176 register_syscore_ops(&s3c244x_pm_syscore_ops);
176 register_syscore_ops(&s3c24xx_irq_syscore_ops); 177 register_syscore_ops(&s3c24xx_irq_syscore_ops);
177 178
178 return sysdev_register(&s3c2442_sysdev); 179 return device_register(&s3c2442_dev);
179} 180}
180 181
181void __init s3c2442_map_io(void) 182void __init s3c2442_map_io(void)
diff --git a/arch/arm/mach-s3c2440/s3c244x-clock.c b/arch/arm/mach-s3c2440/s3c244x-clock.c
index 7f5ea0a169a5..b3fdbdda3d5f 100644
--- a/arch/arm/mach-s3c2440/s3c244x-clock.c
+++ b/arch/arm/mach-s3c2440/s3c244x-clock.c
@@ -28,7 +28,6 @@
28#include <linux/errno.h> 28#include <linux/errno.h>
29#include <linux/err.h> 29#include <linux/err.h>
30#include <linux/device.h> 30#include <linux/device.h>
31#include <linux/sysdev.h>
32#include <linux/interrupt.h> 31#include <linux/interrupt.h>
33#include <linux/ioport.h> 32#include <linux/ioport.h>
34#include <linux/clk.h> 33#include <linux/clk.h>
@@ -73,7 +72,7 @@ static struct clk clk_arm = {
73 }, 72 },
74}; 73};
75 74
76static int s3c244x_clk_add(struct sys_device *sysdev) 75static int s3c244x_clk_add(struct device *dev)
77{ 76{
78 unsigned long camdivn = __raw_readl(S3C2440_CAMDIVN); 77 unsigned long camdivn = __raw_readl(S3C2440_CAMDIVN);
79 unsigned long clkdivn; 78 unsigned long clkdivn;
@@ -115,24 +114,28 @@ static int s3c244x_clk_add(struct sys_device *sysdev)
115 return 0; 114 return 0;
116} 115}
117 116
118static struct sysdev_driver s3c2440_clk_driver = { 117static struct subsys_interface s3c2440_clk_interface = {
119 .add = s3c244x_clk_add, 118 .name = "s3c2440_clk",
119 .subsys = &s3c2440_subsys,
120 .add_dev = s3c244x_clk_add,
120}; 121};
121 122
122static int s3c2440_clk_init(void) 123static int s3c2440_clk_init(void)
123{ 124{
124 return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_clk_driver); 125 return subsys_interface_register(&s3c2440_clk_interface);
125} 126}
126 127
127arch_initcall(s3c2440_clk_init); 128arch_initcall(s3c2440_clk_init);
128 129
129static struct sysdev_driver s3c2442_clk_driver = { 130static struct subsys_interface s3c2442_clk_interface = {
130 .add = s3c244x_clk_add, 131 .name = "s3c2442_clk",
132 .subsys = &s3c2442_subsys,
133 .add_dev = s3c244x_clk_add,
131}; 134};
132 135
133static int s3c2442_clk_init(void) 136static int s3c2442_clk_init(void)
134{ 137{
135 return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_clk_driver); 138 return subsys_interface_register(&s3c2442_clk_interface);
136} 139}
137 140
138arch_initcall(s3c2442_clk_init); 141arch_initcall(s3c2442_clk_init);
diff --git a/arch/arm/mach-s3c2440/s3c244x-irq.c b/arch/arm/mach-s3c2440/s3c244x-irq.c
index c63e8f26d901..74d3dcf46a48 100644
--- a/arch/arm/mach-s3c2440/s3c244x-irq.c
+++ b/arch/arm/mach-s3c2440/s3c244x-irq.c
@@ -23,7 +23,7 @@
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/ioport.h> 25#include <linux/ioport.h>
26#include <linux/sysdev.h> 26#include <linux/device.h>
27#include <linux/io.h> 27#include <linux/io.h>
28 28
29#include <mach/hardware.h> 29#include <mach/hardware.h>
@@ -91,7 +91,7 @@ static struct irq_chip s3c_irq_cam = {
91 .irq_ack = s3c_irq_cam_ack, 91 .irq_ack = s3c_irq_cam_ack,
92}; 92};
93 93
94static int s3c244x_irq_add(struct sys_device *sysdev) 94static int s3c244x_irq_add(struct device *dev)
95{ 95{
96 unsigned int irqno; 96 unsigned int irqno;
97 97
@@ -114,25 +114,29 @@ static int s3c244x_irq_add(struct sys_device *sysdev)
114 return 0; 114 return 0;
115} 115}
116 116
117static struct sysdev_driver s3c2440_irq_driver = { 117static struct subsys_interface s3c2440_irq_interface = {
118 .add = s3c244x_irq_add, 118 .name = "s3c2440_irq",
119 .subsys = &s3c2440_subsys,
120 .add_dev = s3c244x_irq_add,
119}; 121};
120 122
121static int s3c2440_irq_init(void) 123static int s3c2440_irq_init(void)
122{ 124{
123 return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_irq_driver); 125 return subsys_interface_register(&s3c2440_irq_interface);
124} 126}
125 127
126arch_initcall(s3c2440_irq_init); 128arch_initcall(s3c2440_irq_init);
127 129
128static struct sysdev_driver s3c2442_irq_driver = { 130static struct subsys_interface s3c2442_irq_interface = {
129 .add = s3c244x_irq_add, 131 .name = "s3c2442_irq",
132 .subsys = &s3c2442_subsys,
133 .add_dev = s3c244x_irq_add,
130}; 134};
131 135
132 136
133static int s3c2442_irq_init(void) 137static int s3c2442_irq_init(void)
134{ 138{
135 return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_irq_driver); 139 return subsys_interface_register(&s3c2442_irq_interface);
136} 140}
137 141
138arch_initcall(s3c2442_irq_init); 142arch_initcall(s3c2442_irq_init);
diff --git a/arch/arm/mach-s3c2440/s3c244x.c b/arch/arm/mach-s3c2440/s3c244x.c
index 7e8a23d2098a..36bc60f61d0a 100644
--- a/arch/arm/mach-s3c2440/s3c244x.c
+++ b/arch/arm/mach-s3c2440/s3c244x.c
@@ -18,7 +18,7 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/serial_core.h> 19#include <linux/serial_core.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/sysdev.h> 21#include <linux/device.h>
22#include <linux/syscore_ops.h> 22#include <linux/syscore_ops.h>
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/io.h> 24#include <linux/io.h>
@@ -135,17 +135,19 @@ void __init s3c244x_init_clocks(int xtal)
135 s3c2410_baseclk_add(); 135 s3c2410_baseclk_add();
136} 136}
137 137
138/* Since the S3C2442 and S3C2440 share items, put both sysclasses here */ 138/* Since the S3C2442 and S3C2440 share items, put both subsystems here */
139 139
140struct sysdev_class s3c2440_sysclass = { 140struct bus_type s3c2440_subsys = {
141 .name = "s3c2440-core", 141 .name = "s3c2440-core",
142 .dev_name = "s3c2440-core",
142}; 143};
143 144
144struct sysdev_class s3c2442_sysclass = { 145struct bus_type s3c2442_subsys = {
145 .name = "s3c2442-core", 146 .name = "s3c2442-core",
147 .dev_name = "s3c2442-core",
146}; 148};
147 149
148/* need to register class before we actually register the device, and 150/* need to register the subsystem before we actually register the device, and
149 * we also need to ensure that it has been initialised before any of the 151 * we also need to ensure that it has been initialised before any of the
150 * drivers even try to use it (even if not on an s3c2440 based system) 152 * drivers even try to use it (even if not on an s3c2440 based system)
151 * as a driver which may support both 2410 and 2440 may try and use it. 153 * as a driver which may support both 2410 and 2440 may try and use it.
@@ -153,14 +155,14 @@ struct sysdev_class s3c2442_sysclass = {
153 155
154static int __init s3c2440_core_init(void) 156static int __init s3c2440_core_init(void)
155{ 157{
156 return sysdev_class_register(&s3c2440_sysclass); 158 return subsys_system_register(&s3c2440_subsys, NULL);
157} 159}
158 160
159core_initcall(s3c2440_core_init); 161core_initcall(s3c2440_core_init);
160 162
161static int __init s3c2442_core_init(void) 163static int __init s3c2442_core_init(void)
162{ 164{
163 return sysdev_class_register(&s3c2442_sysclass); 165 return subsys_system_register(&s3c2442_subsys, NULL);
164} 166}
165 167
166core_initcall(s3c2442_core_init); 168core_initcall(s3c2442_core_init);
diff --git a/arch/arm/mach-s3c2443/clock.c b/arch/arm/mach-s3c2443/clock.c
index 1c2c088aa2e8..6dde2696f8f0 100644
--- a/arch/arm/mach-s3c2443/clock.c
+++ b/arch/arm/mach-s3c2443/clock.c
@@ -27,7 +27,7 @@
27#include <linux/list.h> 27#include <linux/list.h>
28#include <linux/errno.h> 28#include <linux/errno.h>
29#include <linux/err.h> 29#include <linux/err.h>
30#include <linux/sysdev.h> 30#include <linux/device.h>
31#include <linux/clk.h> 31#include <linux/clk.h>
32#include <linux/mutex.h> 32#include <linux/mutex.h>
33#include <linux/serial_core.h> 33#include <linux/serial_core.h>
diff --git a/arch/arm/mach-s3c2443/dma.c b/arch/arm/mach-s3c2443/dma.c
index fe52151d2e84..de6b4a23c9ed 100644
--- a/arch/arm/mach-s3c2443/dma.c
+++ b/arch/arm/mach-s3c2443/dma.c
@@ -14,7 +14,7 @@
14 14
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/sysdev.h> 17#include <linux/device.h>
18#include <linux/serial_core.h> 18#include <linux/serial_core.h>
19#include <linux/io.h> 19#include <linux/io.h>
20 20
@@ -135,19 +135,21 @@ static struct s3c24xx_dma_selection __initdata s3c2443_dma_sel = {
135 .map_size = ARRAY_SIZE(s3c2443_dma_mappings), 135 .map_size = ARRAY_SIZE(s3c2443_dma_mappings),
136}; 136};
137 137
138static int __init s3c2443_dma_add(struct sys_device *sysdev) 138static int __init s3c2443_dma_add(struct device *dev)
139{ 139{
140 s3c24xx_dma_init(6, IRQ_S3C2443_DMA0, 0x100); 140 s3c24xx_dma_init(6, IRQ_S3C2443_DMA0, 0x100);
141 return s3c24xx_dma_init_map(&s3c2443_dma_sel); 141 return s3c24xx_dma_init_map(&s3c2443_dma_sel);
142} 142}
143 143
144static struct sysdev_driver s3c2443_dma_driver = { 144static struct subsys_interface s3c2443_dma_interface = {
145 .add = s3c2443_dma_add, 145 .name = "s3c2443_dma",
146 .subsys = &s3c2443_subsys,
147 .add_dev = s3c2443_dma_add,
146}; 148};
147 149
148static int __init s3c2443_dma_init(void) 150static int __init s3c2443_dma_init(void)
149{ 151{
150 return sysdev_driver_register(&s3c2443_sysclass, &s3c2443_dma_driver); 152 return subsys_interface_register(&s3c2443_dma_interface);
151} 153}
152 154
153arch_initcall(s3c2443_dma_init); 155arch_initcall(s3c2443_dma_init);
diff --git a/arch/arm/mach-s3c2443/irq.c b/arch/arm/mach-s3c2443/irq.c
index 83ecb1173fb1..35e4ff24fb43 100644
--- a/arch/arm/mach-s3c2443/irq.c
+++ b/arch/arm/mach-s3c2443/irq.c
@@ -23,7 +23,7 @@
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/ioport.h> 25#include <linux/ioport.h>
26#include <linux/sysdev.h> 26#include <linux/device.h>
27#include <linux/io.h> 27#include <linux/io.h>
28 28
29#include <mach/hardware.h> 29#include <mach/hardware.h>
@@ -241,7 +241,7 @@ static int __init s3c2443_add_sub(unsigned int base,
241 return 0; 241 return 0;
242} 242}
243 243
244static int __init s3c2443_irq_add(struct sys_device *sysdev) 244static int __init s3c2443_irq_add(struct device *dev)
245{ 245{
246 printk("S3C2443: IRQ Support\n"); 246 printk("S3C2443: IRQ Support\n");
247 247
@@ -265,13 +265,15 @@ static int __init s3c2443_irq_add(struct sys_device *sysdev)
265 return 0; 265 return 0;
266} 266}
267 267
268static struct sysdev_driver s3c2443_irq_driver = { 268static struct subsys_interface s3c2443_irq_interface = {
269 .add = s3c2443_irq_add, 269 .name = "s3c2443_irq",
270 .subsys = &s3c2443_subsys,
271 .add_dev = s3c2443_irq_add,
270}; 272};
271 273
272static int __init s3c2443_irq_init(void) 274static int __init s3c2443_irq_init(void)
273{ 275{
274 return sysdev_driver_register(&s3c2443_sysclass, &s3c2443_irq_driver); 276 return subsys_interface_register(&s3c2443_irq_interface);
275} 277}
276 278
277arch_initcall(s3c2443_irq_init); 279arch_initcall(s3c2443_irq_init);
diff --git a/arch/arm/mach-s3c2443/s3c2443.c b/arch/arm/mach-s3c2443/s3c2443.c
index 4568ded338d0..b9deaeb0dfff 100644
--- a/arch/arm/mach-s3c2443/s3c2443.c
+++ b/arch/arm/mach-s3c2443/s3c2443.c
@@ -19,7 +19,7 @@
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/serial_core.h> 21#include <linux/serial_core.h>
22#include <linux/sysdev.h> 22#include <linux/device.h>
23#include <linux/clk.h> 23#include <linux/clk.h>
24#include <linux/io.h> 24#include <linux/io.h>
25 25
@@ -48,12 +48,13 @@ static struct map_desc s3c2443_iodesc[] __initdata = {
48 IODESC_ENT(TIMER), 48 IODESC_ENT(TIMER),
49}; 49};
50 50
51struct sysdev_class s3c2443_sysclass = { 51struct bus_type s3c2443_subsys = {
52 .name = "s3c2443-core", 52 .name = "s3c2443-core",
53 .dev_name = "s3c2443-core",
53}; 54};
54 55
55static struct sys_device s3c2443_sysdev = { 56static struct device s3c2443_dev = {
56 .cls = &s3c2443_sysclass, 57 .bus = &s3c2443_subsys,
57}; 58};
58 59
59void s3c2443_restart(char mode, const char *cmd) 60void s3c2443_restart(char mode, const char *cmd)
@@ -77,7 +78,7 @@ int __init s3c2443_init(void)
77 s3c_device_wdt.resource[1].start = IRQ_S3C2443_WDT; 78 s3c_device_wdt.resource[1].start = IRQ_S3C2443_WDT;
78 s3c_device_wdt.resource[1].end = IRQ_S3C2443_WDT; 79 s3c_device_wdt.resource[1].end = IRQ_S3C2443_WDT;
79 80
80 return sysdev_register(&s3c2443_sysdev); 81 return device_register(&s3c2443_dev);
81} 82}
82 83
83void __init s3c2443_init_uarts(struct s3c2410_uartcfg *cfg, int no) 84void __init s3c2443_init_uarts(struct s3c2410_uartcfg *cfg, int no)
@@ -99,7 +100,7 @@ void __init s3c2443_map_io(void)
99 iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc)); 100 iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc));
100} 101}
101 102
102/* need to register class before we actually register the device, and 103/* need to register the subsystem before we actually register the device, and
103 * we also need to ensure that it has been initialised before any of the 104 * we also need to ensure that it has been initialised before any of the
104 * drivers even try to use it (even if not on an s3c2443 based system) 105 * drivers even try to use it (even if not on an s3c2443 based system)
105 * as a driver which may support both 2443 and 2440 may try and use it. 106 * as a driver which may support both 2443 and 2440 may try and use it.
@@ -107,7 +108,7 @@ void __init s3c2443_map_io(void)
107 108
108static int __init s3c2443_core_init(void) 109static int __init s3c2443_core_init(void)
109{ 110{
110 return sysdev_class_register(&s3c2443_sysclass); 111 return subsys_system_register(&s3c2443_subsys, NULL);
111} 112}
112 113
113core_initcall(s3c2443_core_init); 114core_initcall(s3c2443_core_init);
diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c
index 35182ba049da..4a7394d4bd9e 100644
--- a/arch/arm/mach-s3c64xx/common.c
+++ b/arch/arm/mach-s3c64xx/common.c
@@ -19,7 +19,6 @@
19#include <linux/module.h> 19#include <linux/module.h>
20#include <linux/interrupt.h> 20#include <linux/interrupt.h>
21#include <linux/ioport.h> 21#include <linux/ioport.h>
22#include <linux/sysdev.h>
23#include <linux/serial_core.h> 22#include <linux/serial_core.h>
24#include <linux/platform_device.h> 23#include <linux/platform_device.h>
25#include <linux/io.h> 24#include <linux/io.h>
@@ -139,12 +138,13 @@ static struct map_desc s3c_iodesc[] __initdata = {
139 }, 138 },
140}; 139};
141 140
142struct sysdev_class s3c64xx_sysclass = { 141static struct bus_type s3c64xx_subsys = {
143 .name = "s3c64xx-core", 142 .name = "s3c64xx-core",
143 .dev_name = "s3c64xx-core",
144}; 144};
145 145
146static struct sys_device s3c64xx_sysdev = { 146static struct device s3c64xx_dev = {
147 .cls = &s3c64xx_sysclass, 147 .bus = &s3c64xx_subsys,
148}; 148};
149 149
150/* read cpu identification code */ 150/* read cpu identification code */
@@ -162,12 +162,12 @@ void __init s3c64xx_init_io(struct map_desc *mach_desc, int size)
162 s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); 162 s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids));
163} 163}
164 164
165static __init int s3c64xx_sysdev_init(void) 165static __init int s3c64xx_dev_init(void)
166{ 166{
167 sysdev_class_register(&s3c64xx_sysclass); 167 subsys_system_register(&s3c64xx_subsys, NULL);
168 return sysdev_register(&s3c64xx_sysdev); 168 return device_register(&s3c64xx_dev);
169} 169}
170core_initcall(s3c64xx_sysdev_init); 170core_initcall(s3c64xx_dev_init);
171 171
172/* 172/*
173 * setup the sources the vic should advertise resume 173 * setup the sources the vic should advertise resume
diff --git a/arch/arm/mach-s3c64xx/common.h b/arch/arm/mach-s3c64xx/common.h
index 8dc8ab6d8d6d..5eb9c9a7d73b 100644
--- a/arch/arm/mach-s3c64xx/common.h
+++ b/arch/arm/mach-s3c64xx/common.h
@@ -26,7 +26,6 @@ void s3c64xx_setup_clocks(void);
26void s3c64xx_restart(char mode, const char *cmd); 26void s3c64xx_restart(char mode, const char *cmd);
27 27
28extern struct syscore_ops s3c64xx_irq_syscore_ops; 28extern struct syscore_ops s3c64xx_irq_syscore_ops;
29extern struct sysdev_class s3c64xx_sysclass;
30 29
31#ifdef CONFIG_CPU_S3C6400 30#ifdef CONFIG_CPU_S3C6400
32 31
diff --git a/arch/arm/mach-s3c64xx/dma.c b/arch/arm/mach-s3c64xx/dma.c
index 17d62f4f8204..f2a7a1725596 100644
--- a/arch/arm/mach-s3c64xx/dma.c
+++ b/arch/arm/mach-s3c64xx/dma.c
@@ -16,7 +16,7 @@
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/dmapool.h> 18#include <linux/dmapool.h>
19#include <linux/sysdev.h> 19#include <linux/device.h>
20#include <linux/errno.h> 20#include <linux/errno.h>
21#include <linux/slab.h> 21#include <linux/slab.h>
22#include <linux/delay.h> 22#include <linux/delay.h>
@@ -35,7 +35,7 @@
35/* dma channel state information */ 35/* dma channel state information */
36 36
37struct s3c64xx_dmac { 37struct s3c64xx_dmac {
38 struct sys_device sysdev; 38 struct device dev;
39 struct clk *clk; 39 struct clk *clk;
40 void __iomem *regs; 40 void __iomem *regs;
41 struct s3c2410_dma_chan *channels; 41 struct s3c2410_dma_chan *channels;
@@ -631,8 +631,9 @@ static irqreturn_t s3c64xx_dma_irq(int irq, void *pw)
631 return IRQ_HANDLED; 631 return IRQ_HANDLED;
632} 632}
633 633
634static struct sysdev_class dma_sysclass = { 634static struct bus_type dma_subsys = {
635 .name = "s3c64xx-dma", 635 .name = "s3c64xx-dma",
636 .dev_name = "s3c64xx-dma",
636}; 637};
637 638
638static int s3c64xx_dma_init1(int chno, enum dma_ch chbase, 639static int s3c64xx_dma_init1(int chno, enum dma_ch chbase,
@@ -651,12 +652,12 @@ static int s3c64xx_dma_init1(int chno, enum dma_ch chbase,
651 return -ENOMEM; 652 return -ENOMEM;
652 } 653 }
653 654
654 dmac->sysdev.id = chno / 8; 655 dmac->dev.id = chno / 8;
655 dmac->sysdev.cls = &dma_sysclass; 656 dmac->dev.bus = &dma_subsys;
656 657
657 err = sysdev_register(&dmac->sysdev); 658 err = device_register(&dmac->dev);
658 if (err) { 659 if (err) {
659 printk(KERN_ERR "%s: failed to register sysdevice\n", __func__); 660 printk(KERN_ERR "%s: failed to register device\n", __func__);
660 goto err_alloc; 661 goto err_alloc;
661 } 662 }
662 663
@@ -667,7 +668,7 @@ static int s3c64xx_dma_init1(int chno, enum dma_ch chbase,
667 goto err_dev; 668 goto err_dev;
668 } 669 }
669 670
670 snprintf(clkname, sizeof(clkname), "dma%d", dmac->sysdev.id); 671 snprintf(clkname, sizeof(clkname), "dma%d", dmac->dev.id);
671 672
672 dmac->clk = clk_get(NULL, clkname); 673 dmac->clk = clk_get(NULL, clkname);
673 if (IS_ERR(dmac->clk)) { 674 if (IS_ERR(dmac->clk)) {
@@ -715,7 +716,7 @@ err_clk:
715err_map: 716err_map:
716 iounmap(regs); 717 iounmap(regs);
717err_dev: 718err_dev:
718 sysdev_unregister(&dmac->sysdev); 719 device_unregister(&dmac->dev);
719err_alloc: 720err_alloc:
720 kfree(dmac); 721 kfree(dmac);
721 return err; 722 return err;
@@ -733,9 +734,9 @@ static int __init s3c64xx_dma_init(void)
733 return -ENOMEM; 734 return -ENOMEM;
734 } 735 }
735 736
736 ret = sysdev_class_register(&dma_sysclass); 737 ret = subsys_system_register(&dma_subsys, NULL);
737 if (ret) { 738 if (ret) {
738 printk(KERN_ERR "%s: failed to create sysclass\n", __func__); 739 printk(KERN_ERR "%s: failed to create subsys\n", __func__);
739 return -ENOMEM; 740 return -ENOMEM;
740 } 741 }
741 742
diff --git a/arch/arm/mach-s3c64xx/s3c6400.c b/arch/arm/mach-s3c64xx/s3c6400.c
index b1e1571f2f6b..4869714c6f1b 100644
--- a/arch/arm/mach-s3c64xx/s3c6400.c
+++ b/arch/arm/mach-s3c64xx/s3c6400.c
@@ -17,7 +17,7 @@
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/clk.h> 18#include <linux/clk.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/sysdev.h> 20#include <linux/device.h>
21#include <linux/serial_core.h> 21#include <linux/serial_core.h>
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23 23
@@ -71,17 +71,18 @@ void __init s3c6400_init_irq(void)
71 s3c64xx_init_irq(~0 & ~(0xf << 5), ~0); 71 s3c64xx_init_irq(~0 & ~(0xf << 5), ~0);
72} 72}
73 73
74static struct sysdev_class s3c6400_sysclass = { 74static struct bus_type s3c6400_subsys = {
75 .name = "s3c6400-core", 75 .name = "s3c6400-core",
76 .dev_name = "s3c6400-core",
76}; 77};
77 78
78static struct sys_device s3c6400_sysdev = { 79static struct device s3c6400_dev = {
79 .cls = &s3c6400_sysclass, 80 .bus = &s3c6400_subsys,
80}; 81};
81 82
82static int __init s3c6400_core_init(void) 83static int __init s3c6400_core_init(void)
83{ 84{
84 return sysdev_class_register(&s3c6400_sysclass); 85 return subsys_system_register(&s3c6400_subsys, NULL);
85} 86}
86 87
87core_initcall(s3c6400_core_init); 88core_initcall(s3c6400_core_init);
@@ -90,5 +91,5 @@ int __init s3c6400_init(void)
90{ 91{
91 printk("S3C6400: Initialising architecture\n"); 92 printk("S3C6400: Initialising architecture\n");
92 93
93 return sysdev_register(&s3c6400_sysdev); 94 return device_register(&s3c6400_dev);
94} 95}
diff --git a/arch/arm/mach-s3c64xx/s3c6410.c b/arch/arm/mach-s3c64xx/s3c6410.c
index fba71bd991c7..31c29fdf1800 100644
--- a/arch/arm/mach-s3c64xx/s3c6410.c
+++ b/arch/arm/mach-s3c64xx/s3c6410.c
@@ -18,7 +18,7 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <linux/io.h> 20#include <linux/io.h>
21#include <linux/sysdev.h> 21#include <linux/device.h>
22#include <linux/serial_core.h> 22#include <linux/serial_core.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24 24
@@ -75,17 +75,18 @@ void __init s3c6410_init_irq(void)
75 s3c64xx_init_irq(~0 & ~(1 << 7), ~0); 75 s3c64xx_init_irq(~0 & ~(1 << 7), ~0);
76} 76}
77 77
78struct sysdev_class s3c6410_sysclass = { 78struct bus_type s3c6410_subsys = {
79 .name = "s3c6410-core", 79 .name = "s3c6410-core",
80 .dev_name = "s3c6410-core",
80}; 81};
81 82
82static struct sys_device s3c6410_sysdev = { 83static struct device s3c6410_dev = {
83 .cls = &s3c6410_sysclass, 84 .bus = &s3c6410_subsys,
84}; 85};
85 86
86static int __init s3c6410_core_init(void) 87static int __init s3c6410_core_init(void)
87{ 88{
88 return sysdev_class_register(&s3c6410_sysclass); 89 return subsys_system_register(&s3c6410_subsys, NULL);
89} 90}
90 91
91core_initcall(s3c6410_core_init); 92core_initcall(s3c6410_core_init);
@@ -94,5 +95,5 @@ int __init s3c6410_init(void)
94{ 95{
95 printk("S3C6410: Initialising architecture\n"); 96 printk("S3C6410: Initialising architecture\n");
96 97
97 return sysdev_register(&s3c6410_sysdev); 98 return device_register(&s3c6410_dev);
98} 99}
diff --git a/arch/arm/mach-s5p64x0/clock-s5p6440.c b/arch/arm/mach-s5p64x0/clock-s5p6440.c
index dd2b8daef0cd..eb4ffe331e1a 100644
--- a/arch/arm/mach-s5p64x0/clock-s5p6440.c
+++ b/arch/arm/mach-s5p64x0/clock-s5p6440.c
@@ -17,7 +17,7 @@
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <linux/sysdev.h> 20#include <linux/device.h>
21#include <linux/io.h> 21#include <linux/io.h>
22 22
23#include <mach/hardware.h> 23#include <mach/hardware.h>
diff --git a/arch/arm/mach-s5p64x0/clock-s5p6450.c b/arch/arm/mach-s5p64x0/clock-s5p6450.c
index 328a224f0075..bb7ee912090b 100644
--- a/arch/arm/mach-s5p64x0/clock-s5p6450.c
+++ b/arch/arm/mach-s5p64x0/clock-s5p6450.c
@@ -17,7 +17,7 @@
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <linux/sysdev.h> 20#include <linux/device.h>
21#include <linux/io.h> 21#include <linux/io.h>
22 22
23#include <mach/hardware.h> 23#include <mach/hardware.h>
diff --git a/arch/arm/mach-s5p64x0/clock.c b/arch/arm/mach-s5p64x0/clock.c
index b289b726a7d6..241d0e645c85 100644
--- a/arch/arm/mach-s5p64x0/clock.c
+++ b/arch/arm/mach-s5p64x0/clock.c
@@ -17,7 +17,7 @@
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <linux/sysdev.h> 20#include <linux/device.h>
21#include <linux/io.h> 21#include <linux/io.h>
22 22
23#include <mach/hardware.h> 23#include <mach/hardware.h>
diff --git a/arch/arm/mach-s5p64x0/common.c b/arch/arm/mach-s5p64x0/common.c
index b7555a0fb0fb..28d0b918cd4b 100644
--- a/arch/arm/mach-s5p64x0/common.c
+++ b/arch/arm/mach-s5p64x0/common.c
@@ -17,7 +17,7 @@
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/clk.h> 18#include <linux/clk.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/sysdev.h> 20#include <linux/device.h>
21#include <linux/serial_core.h> 21#include <linux/serial_core.h>
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/sched.h> 23#include <linux/sched.h>
@@ -257,17 +257,18 @@ void __init s5p6450_init_irq(void)
257 s5p_init_irq(vic, ARRAY_SIZE(vic)); 257 s5p_init_irq(vic, ARRAY_SIZE(vic));
258} 258}
259 259
260struct sysdev_class s5p64x0_sysclass = { 260struct bus_type s5p64x0_subsys = {
261 .name = "s5p64x0-core", 261 .name = "s5p64x0-core",
262 .dev_name = "s5p64x0-core",
262}; 263};
263 264
264static struct sys_device s5p64x0_sysdev = { 265static struct device s5p64x0_dev = {
265 .cls = &s5p64x0_sysclass, 266 .bus = &s5p64x0_subsys,
266}; 267};
267 268
268static int __init s5p64x0_core_init(void) 269static int __init s5p64x0_core_init(void)
269{ 270{
270 return sysdev_class_register(&s5p64x0_sysclass); 271 return subsys_system_register(&s5p64x0_subsys, NULL);
271} 272}
272core_initcall(s5p64x0_core_init); 273core_initcall(s5p64x0_core_init);
273 274
@@ -278,7 +279,7 @@ int __init s5p64x0_init(void)
278 /* set idle function */ 279 /* set idle function */
279 pm_idle = s5p64x0_idle; 280 pm_idle = s5p64x0_idle;
280 281
281 return sysdev_register(&s5p64x0_sysdev); 282 return device_register(&s5p64x0_dev);
282} 283}
283 284
284static struct s3c24xx_uart_clksrc s5p64x0_serial_clocks[] = { 285static struct s3c24xx_uart_clksrc s5p64x0_serial_clocks[] = {
diff --git a/arch/arm/mach-s5p64x0/pm.c b/arch/arm/mach-s5p64x0/pm.c
index 69927243d25f..23f9b22439c9 100644
--- a/arch/arm/mach-s5p64x0/pm.c
+++ b/arch/arm/mach-s5p64x0/pm.c
@@ -160,7 +160,7 @@ static void s5p64x0_pm_prepare(void)
160 160
161} 161}
162 162
163static int s5p64x0_pm_add(struct sys_device *sysdev) 163static int s5p64x0_pm_add(struct device *dev)
164{ 164{
165 pm_cpu_prep = s5p64x0_pm_prepare; 165 pm_cpu_prep = s5p64x0_pm_prepare;
166 pm_cpu_sleep = s5p64x0_cpu_suspend; 166 pm_cpu_sleep = s5p64x0_cpu_suspend;
@@ -169,15 +169,17 @@ static int s5p64x0_pm_add(struct sys_device *sysdev)
169 return 0; 169 return 0;
170} 170}
171 171
172static struct sysdev_driver s5p64x0_pm_driver = { 172static struct subsys_interface s5p64x0_pm_interface = {
173 .add = s5p64x0_pm_add, 173 .name = "s5p64x0_pm",
174 .subsys = &s5p64x0_subsys,
175 .add_dev = s5p64x0_pm_add,
174}; 176};
175 177
176static __init int s5p64x0_pm_drvinit(void) 178static __init int s5p64x0_pm_drvinit(void)
177{ 179{
178 s3c_pm_init(); 180 s3c_pm_init();
179 181
180 return sysdev_driver_register(&s5p64x0_sysclass, &s5p64x0_pm_driver); 182 return subsys_interface_register(&s5p64x0_pm_interface);
181} 183}
182arch_initcall(s5p64x0_pm_drvinit); 184arch_initcall(s5p64x0_pm_drvinit);
183 185
diff --git a/arch/arm/mach-s5pc100/common.c b/arch/arm/mach-s5pc100/common.c
index 73594a2fcf26..c9095730a7f5 100644
--- a/arch/arm/mach-s5pc100/common.c
+++ b/arch/arm/mach-s5pc100/common.c
@@ -20,7 +20,7 @@
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/clk.h> 21#include <linux/clk.h>
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/sysdev.h> 23#include <linux/device.h>
24#include <linux/serial_core.h> 24#include <linux/serial_core.h>
25#include <linux/platform_device.h> 25#include <linux/platform_device.h>
26#include <linux/sched.h> 26#include <linux/sched.h>
@@ -192,17 +192,18 @@ void __init s5pc100_init_irq(void)
192 s5p_init_irq(vic, ARRAY_SIZE(vic)); 192 s5p_init_irq(vic, ARRAY_SIZE(vic));
193} 193}
194 194
195static struct sysdev_class s5pc100_sysclass = { 195static struct bus_type s5pc100_subsys = {
196 .name = "s5pc100-core", 196 .name = "s5pc100-core",
197 .dev_name = "s5pc100-core",
197}; 198};
198 199
199static struct sys_device s5pc100_sysdev = { 200static struct device s5pc100_dev = {
200 .cls = &s5pc100_sysclass, 201 .bus = &s5pc100_subsys,
201}; 202};
202 203
203static int __init s5pc100_core_init(void) 204static int __init s5pc100_core_init(void)
204{ 205{
205 return sysdev_class_register(&s5pc100_sysclass); 206 return subsys_system_register(&s5pc100_subsys, NULL);
206} 207}
207core_initcall(s5pc100_core_init); 208core_initcall(s5pc100_core_init);
208 209
@@ -213,7 +214,7 @@ int __init s5pc100_init(void)
213 /* set idle function */ 214 /* set idle function */
214 pm_idle = s5pc100_idle; 215 pm_idle = s5pc100_idle;
215 216
216 return sysdev_register(&s5pc100_sysdev); 217 return device_register(&s5pc100_dev);
217} 218}
218 219
219/* uart registration process */ 220/* uart registration process */
diff --git a/arch/arm/mach-s5pv210/clock.c b/arch/arm/mach-s5pv210/clock.c
index f2dbf5f75a2c..04c9b578e626 100644
--- a/arch/arm/mach-s5pv210/clock.c
+++ b/arch/arm/mach-s5pv210/clock.c
@@ -17,7 +17,7 @@
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <linux/sysdev.h> 20#include <linux/device.h>
21#include <linux/io.h> 21#include <linux/io.h>
22 22
23#include <mach/map.h> 23#include <mach/map.h>
diff --git a/arch/arm/mach-s5pv210/common.c b/arch/arm/mach-s5pv210/common.c
index a4921bc9f1dc..0ec393305d7c 100644
--- a/arch/arm/mach-s5pv210/common.c
+++ b/arch/arm/mach-s5pv210/common.c
@@ -18,7 +18,7 @@
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <linux/io.h> 20#include <linux/io.h>
21#include <linux/sysdev.h> 21#include <linux/device.h>
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/sched.h> 23#include <linux/sched.h>
24#include <linux/dma-mapping.h> 24#include <linux/dma-mapping.h>
@@ -229,17 +229,18 @@ void __init s5pv210_init_irq(void)
229 s5p_init_irq(vic, ARRAY_SIZE(vic)); 229 s5p_init_irq(vic, ARRAY_SIZE(vic));
230} 230}
231 231
232struct sysdev_class s5pv210_sysclass = { 232struct bus_type s5pv210_subsys = {
233 .name = "s5pv210-core", 233 .name = "s5pv210-core",
234 .dev_name = "s5pv210-core",
234}; 235};
235 236
236static struct sys_device s5pv210_sysdev = { 237static struct device s5pv210_dev = {
237 .cls = &s5pv210_sysclass, 238 .bus = &s5pv210_subsys,
238}; 239};
239 240
240static int __init s5pv210_core_init(void) 241static int __init s5pv210_core_init(void)
241{ 242{
242 return sysdev_class_register(&s5pv210_sysclass); 243 return subsys_system_register(&s5pv210_subsys, NULL);
243} 244}
244core_initcall(s5pv210_core_init); 245core_initcall(s5pv210_core_init);
245 246
@@ -250,7 +251,7 @@ int __init s5pv210_init(void)
250 /* set idle function */ 251 /* set idle function */
251 pm_idle = s5pv210_idle; 252 pm_idle = s5pv210_idle;
252 253
253 return sysdev_register(&s5pv210_sysdev); 254 return device_register(&s5pv210_dev);
254} 255}
255 256
256static struct s3c24xx_uart_clksrc s5pv210_serial_clocks[] = { 257static struct s3c24xx_uart_clksrc s5pv210_serial_clocks[] = {
diff --git a/arch/arm/mach-s5pv210/mach-smdkc110.c b/arch/arm/mach-s5pv210/mach-smdkc110.c
index 9405da4ae3a3..b323983b2c54 100644
--- a/arch/arm/mach-s5pv210/mach-smdkc110.c
+++ b/arch/arm/mach-s5pv210/mach-smdkc110.c
@@ -13,7 +13,7 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/serial_core.h> 14#include <linux/serial_core.h>
15#include <linux/i2c.h> 15#include <linux/i2c.h>
16#include <linux/sysdev.h> 16#include <linux/device.h>
17 17
18#include <asm/hardware/vic.h> 18#include <asm/hardware/vic.h>
19#include <asm/mach/arch.h> 19#include <asm/mach/arch.h>
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c
index cf4da7393822..b4021dd802a8 100644
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -13,7 +13,7 @@
13#include <linux/i2c.h> 13#include <linux/i2c.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/serial_core.h> 15#include <linux/serial_core.h>
16#include <linux/sysdev.h> 16#include <linux/device.h>
17#include <linux/dm9000.h> 17#include <linux/dm9000.h>
18#include <linux/fb.h> 18#include <linux/fb.h>
19#include <linux/gpio.h> 19#include <linux/gpio.h>
diff --git a/arch/arm/mach-s5pv210/pm.c b/arch/arm/mach-s5pv210/pm.c
index f149d278377b..677c71c41e50 100644
--- a/arch/arm/mach-s5pv210/pm.c
+++ b/arch/arm/mach-s5pv210/pm.c
@@ -133,7 +133,7 @@ static void s5pv210_pm_prepare(void)
133 s3c_pm_do_save(s5pv210_core_save, ARRAY_SIZE(s5pv210_core_save)); 133 s3c_pm_do_save(s5pv210_core_save, ARRAY_SIZE(s5pv210_core_save));
134} 134}
135 135
136static int s5pv210_pm_add(struct sys_device *sysdev) 136static int s5pv210_pm_add(struct device *dev)
137{ 137{
138 pm_cpu_prep = s5pv210_pm_prepare; 138 pm_cpu_prep = s5pv210_pm_prepare;
139 pm_cpu_sleep = s5pv210_cpu_suspend; 139 pm_cpu_sleep = s5pv210_cpu_suspend;
@@ -141,13 +141,15 @@ static int s5pv210_pm_add(struct sys_device *sysdev)
141 return 0; 141 return 0;
142} 142}
143 143
144static struct sysdev_driver s5pv210_pm_driver = { 144static struct subsys_interface s5pv210_pm_interface = {
145 .add = s5pv210_pm_add, 145 .name = "s5pv210_pm",
146 .subsys = &s5pv210_subsys,
147 .add_dev = s5pv210_pm_add,
146}; 148};
147 149
148static __init int s5pv210_pm_drvinit(void) 150static __init int s5pv210_pm_drvinit(void)
149{ 151{
150 return sysdev_driver_register(&s5pv210_sysclass, &s5pv210_pm_driver); 152 return subsys_interface_register(&s5pv210_pm_interface);
151} 153}
152arch_initcall(s5pv210_pm_drvinit); 154arch_initcall(s5pv210_pm_drvinit);
153 155
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index cbcda61162d3..02b7b9303f3b 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -22,7 +22,6 @@
22#include <linux/device.h> 22#include <linux/device.h>
23#include <linux/dma-mapping.h> 23#include <linux/dma-mapping.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/sysdev.h>
26#include <linux/interrupt.h> 25#include <linux/interrupt.h>
27#include <linux/irqdomain.h> 26#include <linux/irqdomain.h>
28#include <linux/of_address.h> 27#include <linux/of_address.h>
diff --git a/arch/arm/mach-versatile/versatile_ab.c b/arch/arm/mach-versatile/versatile_ab.c
index 63b8dd2b9f4d..98f65493177a 100644
--- a/arch/arm/mach-versatile/versatile_ab.c
+++ b/arch/arm/mach-versatile/versatile_ab.c
@@ -21,7 +21,6 @@
21 21
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/device.h> 23#include <linux/device.h>
24#include <linux/sysdev.h>
25#include <linux/amba/bus.h> 24#include <linux/amba/bus.h>
26#include <linux/io.h> 25#include <linux/io.h>
27 26
diff --git a/arch/arm/mach-versatile/versatile_pb.c b/arch/arm/mach-versatile/versatile_pb.c
index 7aab79b665e7..9581c197500c 100644
--- a/arch/arm/mach-versatile/versatile_pb.c
+++ b/arch/arm/mach-versatile/versatile_pb.c
@@ -21,7 +21,6 @@
21 21
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/device.h> 23#include <linux/device.h>
24#include <linux/sysdev.h>
25#include <linux/amba/bus.h> 24#include <linux/amba/bus.h>
26#include <linux/amba/pl061.h> 25#include <linux/amba/pl061.h>
27#include <linux/amba/mmci.h> 26#include <linux/amba/mmci.h>
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index 6dd10e320ef6..b4a28ca0e50a 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -10,7 +10,7 @@
10#include <linux/ata_platform.h> 10#include <linux/ata_platform.h>
11#include <linux/smsc911x.h> 11#include <linux/smsc911x.h>
12#include <linux/spinlock.h> 12#include <linux/spinlock.h>
13#include <linux/sysdev.h> 13#include <linux/device.h>
14#include <linux/usb/isp1760.h> 14#include <linux/usb/isp1760.h>
15#include <linux/clkdev.h> 15#include <linux/clkdev.h>
16#include <linux/mtd/physmap.h> 16#include <linux/mtd/physmap.h>
diff --git a/arch/arm/mach-w90x900/irq.c b/arch/arm/mach-w90x900/irq.c
index b466e2450ba3..d66d43ae8df5 100644
--- a/arch/arm/mach-w90x900/irq.c
+++ b/arch/arm/mach-w90x900/irq.c
@@ -19,7 +19,7 @@
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/ioport.h> 20#include <linux/ioport.h>
21#include <linux/ptrace.h> 21#include <linux/ptrace.h>
22#include <linux/sysdev.h> 22#include <linux/device.h>
23#include <linux/io.h> 23#include <linux/io.h>
24 24
25#include <asm/irq.h> 25#include <asm/irq.h>
diff --git a/arch/arm/plat-s3c24xx/common-smdk.c b/arch/arm/plat-s3c24xx/common-smdk.c
index bcc43f346272..084604be6ad1 100644
--- a/arch/arm/plat-s3c24xx/common-smdk.c
+++ b/arch/arm/plat-s3c24xx/common-smdk.c
@@ -19,7 +19,7 @@
19#include <linux/timer.h> 19#include <linux/timer.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/gpio.h> 21#include <linux/gpio.h>
22#include <linux/sysdev.h> 22#include <linux/device.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24 24
25#include <linux/mtd/mtd.h> 25#include <linux/mtd/mtd.h>
diff --git a/arch/arm/plat-s3c24xx/cpu-freq.c b/arch/arm/plat-s3c24xx/cpu-freq.c
index b3d3d0278997..468079938884 100644
--- a/arch/arm/plat-s3c24xx/cpu-freq.c
+++ b/arch/arm/plat-s3c24xx/cpu-freq.c
@@ -20,7 +20,7 @@
20#include <linux/clk.h> 20#include <linux/clk.h>
21#include <linux/err.h> 21#include <linux/err.h>
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/sysdev.h> 23#include <linux/device.h>
24#include <linux/sysfs.h> 24#include <linux/sysfs.h>
25#include <linux/slab.h> 25#include <linux/slab.h>
26 26
diff --git a/arch/arm/plat-s3c24xx/irq.c b/arch/arm/plat-s3c24xx/irq.c
index fc8c5f89954d..bc42c04091fd 100644
--- a/arch/arm/plat-s3c24xx/irq.c
+++ b/arch/arm/plat-s3c24xx/irq.c
@@ -22,7 +22,7 @@
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/ioport.h> 24#include <linux/ioport.h>
25#include <linux/sysdev.h> 25#include <linux/device.h>
26#include <linux/syscore_ops.h> 26#include <linux/syscore_ops.h>
27 27
28#include <asm/irq.h> 28#include <asm/irq.h>
diff --git a/arch/arm/plat-s3c24xx/pm-simtec.c b/arch/arm/plat-s3c24xx/pm-simtec.c
index 663b280d65da..68296b1fe7e5 100644
--- a/arch/arm/plat-s3c24xx/pm-simtec.c
+++ b/arch/arm/plat-s3c24xx/pm-simtec.c
@@ -18,7 +18,6 @@
18#include <linux/list.h> 18#include <linux/list.h>
19#include <linux/timer.h> 19#include <linux/timer.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/sysdev.h>
22#include <linux/device.h> 21#include <linux/device.h>
23#include <linux/io.h> 22#include <linux/io.h>
24 23
diff --git a/arch/arm/plat-s3c24xx/s3c2410-clock.c b/arch/arm/plat-s3c24xx/s3c2410-clock.c
index def76aa3825a..25dc4d4397b1 100644
--- a/arch/arm/plat-s3c24xx/s3c2410-clock.c
+++ b/arch/arm/plat-s3c24xx/s3c2410-clock.c
@@ -26,7 +26,7 @@
26#include <linux/list.h> 26#include <linux/list.h>
27#include <linux/errno.h> 27#include <linux/errno.h>
28#include <linux/err.h> 28#include <linux/err.h>
29#include <linux/sysdev.h> 29#include <linux/device.h>
30#include <linux/clk.h> 30#include <linux/clk.h>
31#include <linux/mutex.h> 31#include <linux/mutex.h>
32#include <linux/delay.h> 32#include <linux/delay.h>
diff --git a/arch/arm/plat-s3c24xx/s3c2412-iotiming.c b/arch/arm/plat-s3c24xx/s3c2412-iotiming.c
index 0b46d3895d62..48eee39ab369 100644
--- a/arch/arm/plat-s3c24xx/s3c2412-iotiming.c
+++ b/arch/arm/plat-s3c24xx/s3c2412-iotiming.c
@@ -17,7 +17,7 @@
17#include <linux/ioport.h> 17#include <linux/ioport.h>
18#include <linux/cpufreq.h> 18#include <linux/cpufreq.h>
19#include <linux/seq_file.h> 19#include <linux/seq_file.h>
20#include <linux/sysdev.h> 20#include <linux/device.h>
21#include <linux/delay.h> 21#include <linux/delay.h>
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/err.h> 23#include <linux/err.h>
diff --git a/arch/arm/plat-s5p/clock.c b/arch/arm/plat-s5p/clock.c
index 5f84a3f13ef9..963edea7f7e7 100644
--- a/arch/arm/plat-s5p/clock.c
+++ b/arch/arm/plat-s5p/clock.c
@@ -17,7 +17,7 @@
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <linux/sysdev.h> 20#include <linux/device.h>
21#include <linux/io.h> 21#include <linux/io.h>
22#include <asm/div64.h> 22#include <asm/div64.h>
23 23
diff --git a/arch/arm/plat-s5p/irq-eint.c b/arch/arm/plat-s5p/irq-eint.c
index b5bb774985b0..c496b359c371 100644
--- a/arch/arm/plat-s5p/irq-eint.c
+++ b/arch/arm/plat-s5p/irq-eint.c
@@ -14,7 +14,7 @@
14#include <linux/interrupt.h> 14#include <linux/interrupt.h>
15#include <linux/irq.h> 15#include <linux/irq.h>
16#include <linux/io.h> 16#include <linux/io.h>
17#include <linux/sysdev.h> 17#include <linux/device.h>
18#include <linux/gpio.h> 18#include <linux/gpio.h>
19 19
20#include <asm/hardware/vic.h> 20#include <asm/hardware/vic.h>
diff --git a/arch/arm/plat-samsung/clock-clksrc.c b/arch/arm/plat-samsung/clock-clksrc.c
index ae8b8507663f..786a4107a157 100644
--- a/arch/arm/plat-samsung/clock-clksrc.c
+++ b/arch/arm/plat-samsung/clock-clksrc.c
@@ -16,7 +16,7 @@
16#include <linux/errno.h> 16#include <linux/errno.h>
17#include <linux/err.h> 17#include <linux/err.h>
18#include <linux/clk.h> 18#include <linux/clk.h>
19#include <linux/sysdev.h> 19#include <linux/device.h>
20#include <linux/io.h> 20#include <linux/io.h>
21 21
22#include <plat/clock.h> 22#include <plat/clock.h>
diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c
index 3b4451979d1b..10f71179071f 100644
--- a/arch/arm/plat-samsung/clock.c
+++ b/arch/arm/plat-samsung/clock.c
@@ -33,7 +33,7 @@
33#include <linux/errno.h> 33#include <linux/errno.h>
34#include <linux/err.h> 34#include <linux/err.h>
35#include <linux/platform_device.h> 35#include <linux/platform_device.h>
36#include <linux/sysdev.h> 36#include <linux/device.h>
37#include <linux/interrupt.h> 37#include <linux/interrupt.h>
38#include <linux/ioport.h> 38#include <linux/ioport.h>
39#include <linux/clk.h> 39#include <linux/clk.h>
diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h
index 258d9d8a94f2..73cb3cfd0685 100644
--- a/arch/arm/plat-samsung/include/plat/cpu.h
+++ b/arch/arm/plat-samsung/include/plat/cpu.h
@@ -180,19 +180,19 @@ extern struct syscore_ops s3c2412_pm_syscore_ops;
180extern struct syscore_ops s3c2416_pm_syscore_ops; 180extern struct syscore_ops s3c2416_pm_syscore_ops;
181extern struct syscore_ops s3c244x_pm_syscore_ops; 181extern struct syscore_ops s3c244x_pm_syscore_ops;
182 182
183/* system device classes */ 183/* system device subsystems */
184 184
185extern struct sysdev_class s3c2410_sysclass; 185extern struct bus_type s3c2410_subsys;
186extern struct sysdev_class s3c2410a_sysclass; 186extern struct bus_type s3c2410a_subsys;
187extern struct sysdev_class s3c2412_sysclass; 187extern struct bus_type s3c2412_subsys;
188extern struct sysdev_class s3c2416_sysclass; 188extern struct bus_type s3c2416_subsys;
189extern struct sysdev_class s3c2440_sysclass; 189extern struct bus_type s3c2440_subsys;
190extern struct sysdev_class s3c2442_sysclass; 190extern struct bus_type s3c2442_subsys;
191extern struct sysdev_class s3c2443_sysclass; 191extern struct bus_type s3c2443_subsys;
192extern struct sysdev_class s3c6410_sysclass; 192extern struct bus_type s3c6410_subsys;
193extern struct sysdev_class s5p64x0_sysclass; 193extern struct bus_type s5p64x0_subsys;
194extern struct sysdev_class s5pv210_sysclass; 194extern struct bus_type s5pv210_subsys;
195extern struct sysdev_class exynos4_sysclass; 195extern struct bus_type exynos4_subsys;
196 196
197extern void (*s5pc1xx_idle)(void); 197extern void (*s5pc1xx_idle)(void);
198 198
diff --git a/arch/arm/plat-samsung/include/plat/dma-s3c24xx.h b/arch/arm/plat-samsung/include/plat/dma-s3c24xx.h
index 1c1ed5481253..d01576318b2c 100644
--- a/arch/arm/plat-samsung/include/plat/dma-s3c24xx.h
+++ b/arch/arm/plat-samsung/include/plat/dma-s3c24xx.h
@@ -12,7 +12,7 @@
12 12
13#include <plat/dma-core.h> 13#include <plat/dma-core.h>
14 14
15extern struct sysdev_class dma_sysclass; 15extern struct bus_type dma_subsys;
16extern struct s3c2410_dma_chan s3c2410_chans[S3C_DMA_CHANNELS]; 16extern struct s3c2410_dma_chan s3c2410_chans[S3C_DMA_CHANNELS];
17 17
18#define DMA_CH_VALID (1<<31) 18#define DMA_CH_VALID (1<<31)
diff --git a/arch/arm/plat-samsung/include/plat/pm.h b/arch/arm/plat-samsung/include/plat/pm.h
index dcf68709f9cf..78014e53eb3c 100644
--- a/arch/arm/plat-samsung/include/plat/pm.h
+++ b/arch/arm/plat-samsung/include/plat/pm.h
@@ -17,7 +17,7 @@
17 17
18#include <linux/irq.h> 18#include <linux/irq.h>
19 19
20struct sys_device; 20struct device;
21 21
22#ifdef CONFIG_PM 22#ifdef CONFIG_PM
23 23
diff --git a/arch/arm/plat-samsung/pm-gpio.c b/arch/arm/plat-samsung/pm-gpio.c
index 4be016eaa6db..c2ff92c30bdf 100644
--- a/arch/arm/plat-samsung/pm-gpio.c
+++ b/arch/arm/plat-samsung/pm-gpio.c
@@ -14,7 +14,7 @@
14*/ 14*/
15 15
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/sysdev.h> 17#include <linux/device.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/gpio.h> 20#include <linux/gpio.h>
diff --git a/arch/arm/plat-samsung/wakeup-mask.c b/arch/arm/plat-samsung/wakeup-mask.c
index dc814037297b..20c3d9117cc2 100644
--- a/arch/arm/plat-samsung/wakeup-mask.c
+++ b/arch/arm/plat-samsung/wakeup-mask.c
@@ -11,7 +11,7 @@
11 11
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/spinlock.h> 13#include <linux/spinlock.h>
14#include <linux/sysdev.h> 14#include <linux/device.h>
15#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/irq.h> 16#include <linux/irq.h>
17#include <linux/io.h> 17#include <linux/io.h>
diff --git a/arch/avr32/boards/merisc/merisc_sysfs.c b/arch/avr32/boards/merisc/merisc_sysfs.c
index df431fdba9ad..5a252318f4bd 100644
--- a/arch/avr32/boards/merisc/merisc_sysfs.c
+++ b/arch/avr32/boards/merisc/merisc_sysfs.c
@@ -13,7 +13,6 @@
13#include <linux/list.h> 13#include <linux/list.h>
14#include <linux/spinlock.h> 14#include <linux/spinlock.h>
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/sysdev.h>
17#include <linux/timer.h> 16#include <linux/timer.h>
18#include <linux/err.h> 17#include <linux/err.h>
19#include <linux/ctype.h> 18#include <linux/ctype.h>
diff --git a/arch/avr32/kernel/cpu.c b/arch/avr32/kernel/cpu.c
index e84faffbbeca..2233be71e2e8 100644
--- a/arch/avr32/kernel/cpu.c
+++ b/arch/avr32/kernel/cpu.c
@@ -6,7 +6,7 @@
6 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
7 */ 7 */
8#include <linux/init.h> 8#include <linux/init.h>
9#include <linux/sysdev.h> 9#include <linux/device.h>
10#include <linux/seq_file.h> 10#include <linux/seq_file.h>
11#include <linux/cpu.h> 11#include <linux/cpu.h>
12#include <linux/module.h> 12#include <linux/module.h>
@@ -26,16 +26,16 @@ static DEFINE_PER_CPU(struct cpu, cpu_devices);
26 * XXX: If/when a SMP-capable implementation of AVR32 will ever be 26 * XXX: If/when a SMP-capable implementation of AVR32 will ever be
27 * made, we must make sure that the code executes on the correct CPU. 27 * made, we must make sure that the code executes on the correct CPU.
28 */ 28 */
29static ssize_t show_pc0event(struct sys_device *dev, 29static ssize_t show_pc0event(struct device *dev,
30 struct sysdev_attribute *attr, char *buf) 30 struct device_attribute *attr, char *buf)
31{ 31{
32 unsigned long pccr; 32 unsigned long pccr;
33 33
34 pccr = sysreg_read(PCCR); 34 pccr = sysreg_read(PCCR);
35 return sprintf(buf, "0x%lx\n", (pccr >> 12) & 0x3f); 35 return sprintf(buf, "0x%lx\n", (pccr >> 12) & 0x3f);
36} 36}
37static ssize_t store_pc0event(struct sys_device *dev, 37static ssize_t store_pc0event(struct device *dev,
38 struct sysdev_attribute *attr, const char *buf, 38 struct device_attribute *attr, const char *buf,
39 size_t count) 39 size_t count)
40{ 40{
41 unsigned long val; 41 unsigned long val;
@@ -48,16 +48,16 @@ static ssize_t store_pc0event(struct sys_device *dev,
48 sysreg_write(PCCR, val); 48 sysreg_write(PCCR, val);
49 return count; 49 return count;
50} 50}
51static ssize_t show_pc0count(struct sys_device *dev, 51static ssize_t show_pc0count(struct device *dev,
52 struct sysdev_attribute *attr, char *buf) 52 struct device_attribute *attr, char *buf)
53{ 53{
54 unsigned long pcnt0; 54 unsigned long pcnt0;
55 55
56 pcnt0 = sysreg_read(PCNT0); 56 pcnt0 = sysreg_read(PCNT0);
57 return sprintf(buf, "%lu\n", pcnt0); 57 return sprintf(buf, "%lu\n", pcnt0);
58} 58}
59static ssize_t store_pc0count(struct sys_device *dev, 59static ssize_t store_pc0count(struct device *dev,
60 struct sysdev_attribute *attr, 60 struct device_attribute *attr,
61 const char *buf, size_t count) 61 const char *buf, size_t count)
62{ 62{
63 unsigned long val; 63 unsigned long val;
@@ -71,16 +71,16 @@ static ssize_t store_pc0count(struct sys_device *dev,
71 return count; 71 return count;
72} 72}
73 73
74static ssize_t show_pc1event(struct sys_device *dev, 74static ssize_t show_pc1event(struct device *dev,
75 struct sysdev_attribute *attr, char *buf) 75 struct device_attribute *attr, char *buf)
76{ 76{
77 unsigned long pccr; 77 unsigned long pccr;
78 78
79 pccr = sysreg_read(PCCR); 79 pccr = sysreg_read(PCCR);
80 return sprintf(buf, "0x%lx\n", (pccr >> 18) & 0x3f); 80 return sprintf(buf, "0x%lx\n", (pccr >> 18) & 0x3f);
81} 81}
82static ssize_t store_pc1event(struct sys_device *dev, 82static ssize_t store_pc1event(struct device *dev,
83 struct sysdev_attribute *attr, const char *buf, 83 struct device_attribute *attr, const char *buf,
84 size_t count) 84 size_t count)
85{ 85{
86 unsigned long val; 86 unsigned long val;
@@ -93,16 +93,16 @@ static ssize_t store_pc1event(struct sys_device *dev,
93 sysreg_write(PCCR, val); 93 sysreg_write(PCCR, val);
94 return count; 94 return count;
95} 95}
96static ssize_t show_pc1count(struct sys_device *dev, 96static ssize_t show_pc1count(struct device *dev,
97 struct sysdev_attribute *attr, char *buf) 97 struct device_attribute *attr, char *buf)
98{ 98{
99 unsigned long pcnt1; 99 unsigned long pcnt1;
100 100
101 pcnt1 = sysreg_read(PCNT1); 101 pcnt1 = sysreg_read(PCNT1);
102 return sprintf(buf, "%lu\n", pcnt1); 102 return sprintf(buf, "%lu\n", pcnt1);
103} 103}
104static ssize_t store_pc1count(struct sys_device *dev, 104static ssize_t store_pc1count(struct device *dev,
105 struct sysdev_attribute *attr, const char *buf, 105 struct device_attribute *attr, const char *buf,
106 size_t count) 106 size_t count)
107{ 107{
108 unsigned long val; 108 unsigned long val;
@@ -116,16 +116,16 @@ static ssize_t store_pc1count(struct sys_device *dev,
116 return count; 116 return count;
117} 117}
118 118
119static ssize_t show_pccycles(struct sys_device *dev, 119static ssize_t show_pccycles(struct device *dev,
120 struct sysdev_attribute *attr, char *buf) 120 struct device_attribute *attr, char *buf)
121{ 121{
122 unsigned long pccnt; 122 unsigned long pccnt;
123 123
124 pccnt = sysreg_read(PCCNT); 124 pccnt = sysreg_read(PCCNT);
125 return sprintf(buf, "%lu\n", pccnt); 125 return sprintf(buf, "%lu\n", pccnt);
126} 126}
127static ssize_t store_pccycles(struct sys_device *dev, 127static ssize_t store_pccycles(struct device *dev,
128 struct sysdev_attribute *attr, const char *buf, 128 struct device_attribute *attr, const char *buf,
129 size_t count) 129 size_t count)
130{ 130{
131 unsigned long val; 131 unsigned long val;
@@ -139,16 +139,16 @@ static ssize_t store_pccycles(struct sys_device *dev,
139 return count; 139 return count;
140} 140}
141 141
142static ssize_t show_pcenable(struct sys_device *dev, 142static ssize_t show_pcenable(struct device *dev,
143 struct sysdev_attribute *attr, char *buf) 143 struct device_attribute *attr, char *buf)
144{ 144{
145 unsigned long pccr; 145 unsigned long pccr;
146 146
147 pccr = sysreg_read(PCCR); 147 pccr = sysreg_read(PCCR);
148 return sprintf(buf, "%c\n", (pccr & 1)?'1':'0'); 148 return sprintf(buf, "%c\n", (pccr & 1)?'1':'0');
149} 149}
150static ssize_t store_pcenable(struct sys_device *dev, 150static ssize_t store_pcenable(struct device *dev,
151 struct sysdev_attribute *attr, const char *buf, 151 struct device_attribute *attr, const char *buf,
152 size_t count) 152 size_t count)
153{ 153{
154 unsigned long pccr, val; 154 unsigned long pccr, val;
@@ -167,12 +167,12 @@ static ssize_t store_pcenable(struct sys_device *dev,
167 return count; 167 return count;
168} 168}
169 169
170static SYSDEV_ATTR(pc0event, 0600, show_pc0event, store_pc0event); 170static DEVICE_ATTR(pc0event, 0600, show_pc0event, store_pc0event);
171static SYSDEV_ATTR(pc0count, 0600, show_pc0count, store_pc0count); 171static DEVICE_ATTR(pc0count, 0600, show_pc0count, store_pc0count);
172static SYSDEV_ATTR(pc1event, 0600, show_pc1event, store_pc1event); 172static DEVICE_ATTR(pc1event, 0600, show_pc1event, store_pc1event);
173static SYSDEV_ATTR(pc1count, 0600, show_pc1count, store_pc1count); 173static DEVICE_ATTR(pc1count, 0600, show_pc1count, store_pc1count);
174static SYSDEV_ATTR(pccycles, 0600, show_pccycles, store_pccycles); 174static DEVICE_ATTR(pccycles, 0600, show_pccycles, store_pccycles);
175static SYSDEV_ATTR(pcenable, 0600, show_pcenable, store_pcenable); 175static DEVICE_ATTR(pcenable, 0600, show_pcenable, store_pcenable);
176 176
177#endif /* CONFIG_PERFORMANCE_COUNTERS */ 177#endif /* CONFIG_PERFORMANCE_COUNTERS */
178 178
@@ -186,12 +186,12 @@ static int __init topology_init(void)
186 register_cpu(c, cpu); 186 register_cpu(c, cpu);
187 187
188#ifdef CONFIG_PERFORMANCE_COUNTERS 188#ifdef CONFIG_PERFORMANCE_COUNTERS
189 sysdev_create_file(&c->sysdev, &attr_pc0event); 189 device_create_file(&c->dev, &dev_attr_pc0event);
190 sysdev_create_file(&c->sysdev, &attr_pc0count); 190 device_create_file(&c->dev, &dev_attr_pc0count);
191 sysdev_create_file(&c->sysdev, &attr_pc1event); 191 device_create_file(&c->dev, &dev_attr_pc1event);
192 sysdev_create_file(&c->sysdev, &attr_pc1count); 192 device_create_file(&c->dev, &dev_attr_pc1count);
193 sysdev_create_file(&c->sysdev, &attr_pccycles); 193 device_create_file(&c->dev, &dev_attr_pccycles);
194 sysdev_create_file(&c->sysdev, &attr_pcenable); 194 device_create_file(&c->dev, &dev_attr_pcenable);
195#endif 195#endif
196 } 196 }
197 197
diff --git a/arch/avr32/kernel/irq.c b/arch/avr32/kernel/irq.c
index bc3aa18293df..900e49b2258b 100644
--- a/arch/avr32/kernel/irq.c
+++ b/arch/avr32/kernel/irq.c
@@ -14,7 +14,7 @@
14#include <linux/kernel_stat.h> 14#include <linux/kernel_stat.h>
15#include <linux/proc_fs.h> 15#include <linux/proc_fs.h>
16#include <linux/seq_file.h> 16#include <linux/seq_file.h>
17#include <linux/sysdev.h> 17#include <linux/device.h>
18 18
19/* May be overridden by platform code */ 19/* May be overridden by platform code */
20int __weak nmi_enable(void) 20int __weak nmi_enable(void)
diff --git a/arch/ia64/kernel/err_inject.c b/arch/ia64/kernel/err_inject.c
index c539c689493b..2d67317a1ec2 100644
--- a/arch/ia64/kernel/err_inject.c
+++ b/arch/ia64/kernel/err_inject.c
@@ -24,7 +24,7 @@
24 * Copyright (C) 2006, Intel Corp. All rights reserved. 24 * Copyright (C) 2006, Intel Corp. All rights reserved.
25 * 25 *
26 */ 26 */
27#include <linux/sysdev.h> 27#include <linux/device.h>
28#include <linux/init.h> 28#include <linux/init.h>
29#include <linux/mm.h> 29#include <linux/mm.h>
30#include <linux/cpu.h> 30#include <linux/cpu.h>
@@ -35,10 +35,10 @@
35#define ERR_DATA_BUFFER_SIZE 3 // Three 8-byte; 35#define ERR_DATA_BUFFER_SIZE 3 // Three 8-byte;
36 36
37#define define_one_ro(name) \ 37#define define_one_ro(name) \
38static SYSDEV_ATTR(name, 0444, show_##name, NULL) 38static DEVICE_ATTR(name, 0444, show_##name, NULL)
39 39
40#define define_one_rw(name) \ 40#define define_one_rw(name) \
41static SYSDEV_ATTR(name, 0644, show_##name, store_##name) 41static DEVICE_ATTR(name, 0644, show_##name, store_##name)
42 42
43static u64 call_start[NR_CPUS]; 43static u64 call_start[NR_CPUS];
44static u64 phys_addr[NR_CPUS]; 44static u64 phys_addr[NR_CPUS];
@@ -55,7 +55,7 @@ static u64 resources[NR_CPUS];
55 55
56#define show(name) \ 56#define show(name) \
57static ssize_t \ 57static ssize_t \
58show_##name(struct sys_device *dev, struct sysdev_attribute *attr, \ 58show_##name(struct device *dev, struct device_attribute *attr, \
59 char *buf) \ 59 char *buf) \
60{ \ 60{ \
61 u32 cpu=dev->id; \ 61 u32 cpu=dev->id; \
@@ -64,7 +64,7 @@ show_##name(struct sys_device *dev, struct sysdev_attribute *attr, \
64 64
65#define store(name) \ 65#define store(name) \
66static ssize_t \ 66static ssize_t \
67store_##name(struct sys_device *dev, struct sysdev_attribute *attr, \ 67store_##name(struct device *dev, struct device_attribute *attr, \
68 const char *buf, size_t size) \ 68 const char *buf, size_t size) \
69{ \ 69{ \
70 unsigned int cpu=dev->id; \ 70 unsigned int cpu=dev->id; \
@@ -78,7 +78,7 @@ show(call_start)
78 * processor. The cpu number in driver is only used for storing data. 78 * processor. The cpu number in driver is only used for storing data.
79 */ 79 */
80static ssize_t 80static ssize_t
81store_call_start(struct sys_device *dev, struct sysdev_attribute *attr, 81store_call_start(struct device *dev, struct device_attribute *attr,
82 const char *buf, size_t size) 82 const char *buf, size_t size)
83{ 83{
84 unsigned int cpu=dev->id; 84 unsigned int cpu=dev->id;
@@ -127,7 +127,7 @@ show(err_type_info)
127store(err_type_info) 127store(err_type_info)
128 128
129static ssize_t 129static ssize_t
130show_virtual_to_phys(struct sys_device *dev, struct sysdev_attribute *attr, 130show_virtual_to_phys(struct device *dev, struct device_attribute *attr,
131 char *buf) 131 char *buf)
132{ 132{
133 unsigned int cpu=dev->id; 133 unsigned int cpu=dev->id;
@@ -135,7 +135,7 @@ show_virtual_to_phys(struct sys_device *dev, struct sysdev_attribute *attr,
135} 135}
136 136
137static ssize_t 137static ssize_t
138store_virtual_to_phys(struct sys_device *dev, struct sysdev_attribute *attr, 138store_virtual_to_phys(struct device *dev, struct device_attribute *attr,
139 const char *buf, size_t size) 139 const char *buf, size_t size)
140{ 140{
141 unsigned int cpu=dev->id; 141 unsigned int cpu=dev->id;
@@ -159,8 +159,8 @@ show(err_struct_info)
159store(err_struct_info) 159store(err_struct_info)
160 160
161static ssize_t 161static ssize_t
162show_err_data_buffer(struct sys_device *dev, 162show_err_data_buffer(struct device *dev,
163 struct sysdev_attribute *attr, char *buf) 163 struct device_attribute *attr, char *buf)
164{ 164{
165 unsigned int cpu=dev->id; 165 unsigned int cpu=dev->id;
166 166
@@ -171,8 +171,8 @@ show_err_data_buffer(struct sys_device *dev,
171} 171}
172 172
173static ssize_t 173static ssize_t
174store_err_data_buffer(struct sys_device *dev, 174store_err_data_buffer(struct device *dev,
175 struct sysdev_attribute *attr, 175 struct device_attribute *attr,
176 const char *buf, size_t size) 176 const char *buf, size_t size)
177{ 177{
178 unsigned int cpu=dev->id; 178 unsigned int cpu=dev->id;
@@ -209,14 +209,14 @@ define_one_ro(capabilities);
209define_one_ro(resources); 209define_one_ro(resources);
210 210
211static struct attribute *default_attrs[] = { 211static struct attribute *default_attrs[] = {
212 &attr_call_start.attr, 212 &dev_attr_call_start.attr,
213 &attr_virtual_to_phys.attr, 213 &dev_attr_virtual_to_phys.attr,
214 &attr_err_type_info.attr, 214 &dev_attr_err_type_info.attr,
215 &attr_err_struct_info.attr, 215 &dev_attr_err_struct_info.attr,
216 &attr_err_data_buffer.attr, 216 &dev_attr_err_data_buffer.attr,
217 &attr_status.attr, 217 &dev_attr_status.attr,
218 &attr_capabilities.attr, 218 &dev_attr_capabilities.attr,
219 &attr_resources.attr, 219 &dev_attr_resources.attr,
220 NULL 220 NULL
221}; 221};
222 222
@@ -225,12 +225,12 @@ static struct attribute_group err_inject_attr_group = {
225 .name = "err_inject" 225 .name = "err_inject"
226}; 226};
227/* Add/Remove err_inject interface for CPU device */ 227/* Add/Remove err_inject interface for CPU device */
228static int __cpuinit err_inject_add_dev(struct sys_device * sys_dev) 228static int __cpuinit err_inject_add_dev(struct device * sys_dev)
229{ 229{
230 return sysfs_create_group(&sys_dev->kobj, &err_inject_attr_group); 230 return sysfs_create_group(&sys_dev->kobj, &err_inject_attr_group);
231} 231}
232 232
233static int __cpuinit err_inject_remove_dev(struct sys_device * sys_dev) 233static int __cpuinit err_inject_remove_dev(struct device * sys_dev)
234{ 234{
235 sysfs_remove_group(&sys_dev->kobj, &err_inject_attr_group); 235 sysfs_remove_group(&sys_dev->kobj, &err_inject_attr_group);
236 return 0; 236 return 0;
@@ -239,9 +239,9 @@ static int __cpuinit err_inject_cpu_callback(struct notifier_block *nfb,
239 unsigned long action, void *hcpu) 239 unsigned long action, void *hcpu)
240{ 240{
241 unsigned int cpu = (unsigned long)hcpu; 241 unsigned int cpu = (unsigned long)hcpu;
242 struct sys_device *sys_dev; 242 struct device *sys_dev;
243 243
244 sys_dev = get_cpu_sysdev(cpu); 244 sys_dev = get_cpu_device(cpu);
245 switch (action) { 245 switch (action) {
246 case CPU_ONLINE: 246 case CPU_ONLINE:
247 case CPU_ONLINE_FROZEN: 247 case CPU_ONLINE_FROZEN:
@@ -283,13 +283,13 @@ static void __exit
283err_inject_exit(void) 283err_inject_exit(void)
284{ 284{
285 int i; 285 int i;
286 struct sys_device *sys_dev; 286 struct device *sys_dev;
287 287
288#ifdef ERR_INJ_DEBUG 288#ifdef ERR_INJ_DEBUG
289 printk(KERN_INFO "Exit error injection driver.\n"); 289 printk(KERN_INFO "Exit error injection driver.\n");
290#endif 290#endif
291 for_each_online_cpu(i) { 291 for_each_online_cpu(i) {
292 sys_dev = get_cpu_sysdev(i); 292 sys_dev = get_cpu_device(i);
293 sysfs_remove_group(&sys_dev->kobj, &err_inject_attr_group); 293 sysfs_remove_group(&sys_dev->kobj, &err_inject_attr_group);
294 } 294 }
295 unregister_hotcpu_notifier(&err_inject_cpu_notifier); 295 unregister_hotcpu_notifier(&err_inject_cpu_notifier);
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c
index 9be1f11a01d9..9deb21dbf629 100644
--- a/arch/ia64/kernel/topology.c
+++ b/arch/ia64/kernel/topology.c
@@ -350,7 +350,7 @@ static int __cpuinit cpu_cache_sysfs_init(unsigned int cpu)
350} 350}
351 351
352/* Add cache interface for CPU device */ 352/* Add cache interface for CPU device */
353static int __cpuinit cache_add_dev(struct sys_device * sys_dev) 353static int __cpuinit cache_add_dev(struct device * sys_dev)
354{ 354{
355 unsigned int cpu = sys_dev->id; 355 unsigned int cpu = sys_dev->id;
356 unsigned long i, j; 356 unsigned long i, j;
@@ -400,7 +400,7 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
400} 400}
401 401
402/* Remove cache interface for CPU device */ 402/* Remove cache interface for CPU device */
403static int __cpuinit cache_remove_dev(struct sys_device * sys_dev) 403static int __cpuinit cache_remove_dev(struct device * sys_dev)
404{ 404{
405 unsigned int cpu = sys_dev->id; 405 unsigned int cpu = sys_dev->id;
406 unsigned long i; 406 unsigned long i;
@@ -428,9 +428,9 @@ static int __cpuinit cache_cpu_callback(struct notifier_block *nfb,
428 unsigned long action, void *hcpu) 428 unsigned long action, void *hcpu)
429{ 429{
430 unsigned int cpu = (unsigned long)hcpu; 430 unsigned int cpu = (unsigned long)hcpu;
431 struct sys_device *sys_dev; 431 struct device *sys_dev;
432 432
433 sys_dev = get_cpu_sysdev(cpu); 433 sys_dev = get_cpu_device(cpu);
434 switch (action) { 434 switch (action) {
435 case CPU_ONLINE: 435 case CPU_ONLINE:
436 case CPU_ONLINE_FROZEN: 436 case CPU_ONLINE_FROZEN:
@@ -454,7 +454,7 @@ static int __init cache_sysfs_init(void)
454 int i; 454 int i;
455 455
456 for_each_online_cpu(i) { 456 for_each_online_cpu(i) {
457 struct sys_device *sys_dev = get_cpu_sysdev((unsigned int)i); 457 struct device *sys_dev = get_cpu_device((unsigned int)i);
458 cache_add_dev(sys_dev); 458 cache_add_dev(sys_dev);
459 } 459 }
460 460
diff --git a/arch/m68k/platform/coldfire/gpio.c b/arch/m68k/platform/coldfire/gpio.c
index ff0045793450..292a1a5a2d7c 100644
--- a/arch/m68k/platform/coldfire/gpio.c
+++ b/arch/m68k/platform/coldfire/gpio.c
@@ -15,7 +15,7 @@
15 15
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/sysdev.h> 18#include <linux/device.h>
19 19
20#include <asm/gpio.h> 20#include <asm/gpio.h>
21#include <asm/pinmux.h> 21#include <asm/pinmux.h>
@@ -115,13 +115,14 @@ void mcf_gpio_free(struct gpio_chip *chip, unsigned offset)
115 mcf_pinmux_release(mcf_chip->gpio_to_pinmux[offset], 0); 115 mcf_pinmux_release(mcf_chip->gpio_to_pinmux[offset], 0);
116} 116}
117 117
118struct sysdev_class mcf_gpio_sysclass = { 118struct bus_type mcf_gpio_subsys = {
119 .name = "gpio", 119 .name = "gpio",
120 .dev_name = "gpio",
120}; 121};
121 122
122static int __init mcf_gpio_sysinit(void) 123static int __init mcf_gpio_sysinit(void)
123{ 124{
124 return sysdev_class_register(&mcf_gpio_sysclass); 125 return subsys_system_register(&mcf_gpio_subsys, NULL);
125} 126}
126 127
127core_initcall(mcf_gpio_sysinit); 128core_initcall(mcf_gpio_sysinit);
diff --git a/arch/mips/txx9/generic/7segled.c b/arch/mips/txx9/generic/7segled.c
index 7f8416f86222..8e93b2122524 100644
--- a/arch/mips/txx9/generic/7segled.c
+++ b/arch/mips/txx9/generic/7segled.c
@@ -9,7 +9,7 @@
9 * (C) Copyright TOSHIBA CORPORATION 2005-2007 9 * (C) Copyright TOSHIBA CORPORATION 2005-2007
10 * All Rights Reserved. 10 * All Rights Reserved.
11 */ 11 */
12#include <linux/sysdev.h> 12#include <linux/device.h>
13#include <linux/slab.h> 13#include <linux/slab.h>
14#include <linux/map_to_7segment.h> 14#include <linux/map_to_7segment.h>
15#include <asm/txx9/generic.h> 15#include <asm/txx9/generic.h>
@@ -37,8 +37,8 @@ int txx9_7segled_putc(unsigned int pos, char c)
37 return 0; 37 return 0;
38} 38}
39 39
40static ssize_t ascii_store(struct sys_device *dev, 40static ssize_t ascii_store(struct device *dev,
41 struct sysdev_attribute *attr, 41 struct device_attribute *attr,
42 const char *buf, size_t size) 42 const char *buf, size_t size)
43{ 43{
44 unsigned int ch = dev->id; 44 unsigned int ch = dev->id;
@@ -46,8 +46,8 @@ static ssize_t ascii_store(struct sys_device *dev,
46 return size; 46 return size;
47} 47}
48 48
49static ssize_t raw_store(struct sys_device *dev, 49static ssize_t raw_store(struct device *dev,
50 struct sysdev_attribute *attr, 50 struct device_attribute *attr,
51 const char *buf, size_t size) 51 const char *buf, size_t size)
52{ 52{
53 unsigned int ch = dev->id; 53 unsigned int ch = dev->id;
@@ -55,19 +55,19 @@ static ssize_t raw_store(struct sys_device *dev,
55 return size; 55 return size;
56} 56}
57 57
58static SYSDEV_ATTR(ascii, 0200, NULL, ascii_store); 58static DEVICE_ATTR(ascii, 0200, NULL, ascii_store);
59static SYSDEV_ATTR(raw, 0200, NULL, raw_store); 59static DEVICE_ATTR(raw, 0200, NULL, raw_store);
60 60
61static ssize_t map_seg7_show(struct sysdev_class *class, 61static ssize_t map_seg7_show(struct device *dev,
62 struct sysdev_class_attribute *attr, 62 struct device_attribute *attr,
63 char *buf) 63 char *buf)
64{ 64{
65 memcpy(buf, &txx9_seg7map, sizeof(txx9_seg7map)); 65 memcpy(buf, &txx9_seg7map, sizeof(txx9_seg7map));
66 return sizeof(txx9_seg7map); 66 return sizeof(txx9_seg7map);
67} 67}
68 68
69static ssize_t map_seg7_store(struct sysdev_class *class, 69static ssize_t map_seg7_store(struct device *dev,
70 struct sysdev_class_attribute *attr, 70 struct device_attribute *attr,
71 const char *buf, size_t size) 71 const char *buf, size_t size)
72{ 72{
73 if (size != sizeof(txx9_seg7map)) 73 if (size != sizeof(txx9_seg7map))
@@ -76,10 +76,11 @@ static ssize_t map_seg7_store(struct sysdev_class *class,
76 return size; 76 return size;
77} 77}
78 78
79static SYSDEV_CLASS_ATTR(map_seg7, 0600, map_seg7_show, map_seg7_store); 79static DEVICE_ATTR(map_seg7, 0600, map_seg7_show, map_seg7_store);
80 80
81static struct sysdev_class tx_7segled_sysdev_class = { 81static struct bus_type tx_7segled_subsys = {
82 .name = "7segled", 82 .name = "7segled",
83 .dev_name = "7segled",
83}; 84};
84 85
85static int __init tx_7segled_init_sysfs(void) 86static int __init tx_7segled_init_sysfs(void)
@@ -87,26 +88,25 @@ static int __init tx_7segled_init_sysfs(void)
87 int error, i; 88 int error, i;
88 if (!tx_7segled_num) 89 if (!tx_7segled_num)
89 return -ENODEV; 90 return -ENODEV;
90 error = sysdev_class_register(&tx_7segled_sysdev_class); 91 error = subsys_system_register(&tx_7segled_subsys, NULL);
91 if (error) 92 if (error)
92 return error; 93 return error;
93 error = sysdev_class_create_file(&tx_7segled_sysdev_class, 94 error = device_create_file(tx_7segled_subsys.dev_root, &dev_attr_map_seg7);
94 &attr_map_seg7);
95 if (error) 95 if (error)
96 return error; 96 return error;
97 for (i = 0; i < tx_7segled_num; i++) { 97 for (i = 0; i < tx_7segled_num; i++) {
98 struct sys_device *dev; 98 struct device *dev;
99 dev = kzalloc(sizeof(*dev), GFP_KERNEL); 99 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
100 if (!dev) { 100 if (!dev) {
101 error = -ENODEV; 101 error = -ENODEV;
102 break; 102 break;
103 } 103 }
104 dev->id = i; 104 dev->id = i;
105 dev->cls = &tx_7segled_sysdev_class; 105 dev->dev = &tx_7segled_subsys;
106 error = sysdev_register(dev); 106 error = device_register(dev);
107 if (!error) { 107 if (!error) {
108 sysdev_create_file(dev, &attr_ascii); 108 device_create_file(dev, &dev_attr_ascii);
109 sysdev_create_file(dev, &attr_raw); 109 device_create_file(dev, &dev_attr_raw);
110 } 110 }
111 } 111 }
112 return error; 112 return error;
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c
index ec38e00b2559..ae77a7916c03 100644
--- a/arch/mips/txx9/generic/setup.c
+++ b/arch/mips/txx9/generic/setup.c
@@ -22,7 +22,7 @@
22#include <linux/serial_core.h> 22#include <linux/serial_core.h>
23#include <linux/mtd/physmap.h> 23#include <linux/mtd/physmap.h>
24#include <linux/leds.h> 24#include <linux/leds.h>
25#include <linux/sysdev.h> 25#include <linux/device.h>
26#include <linux/slab.h> 26#include <linux/slab.h>
27#include <linux/irq.h> 27#include <linux/irq.h>
28#include <asm/bootinfo.h> 28#include <asm/bootinfo.h>
@@ -897,10 +897,13 @@ void __init txx9_aclc_init(unsigned long baseaddr, int irq,
897#endif 897#endif
898} 898}
899 899
900static struct sysdev_class txx9_sramc_sysdev_class; 900static struct bus_type txx9_sramc_subsys = {
901 .name = "txx9_sram",
902 .dev_name = "txx9_sram",
903};
901 904
902struct txx9_sramc_sysdev { 905struct txx9_sramc_dev {
903 struct sys_device dev; 906 struct device dev;
904 struct bin_attribute bindata_attr; 907 struct bin_attribute bindata_attr;
905 void __iomem *base; 908 void __iomem *base;
906}; 909};
@@ -909,7 +912,7 @@ static ssize_t txx9_sram_read(struct file *filp, struct kobject *kobj,
909 struct bin_attribute *bin_attr, 912 struct bin_attribute *bin_attr,
910 char *buf, loff_t pos, size_t size) 913 char *buf, loff_t pos, size_t size)
911{ 914{
912 struct txx9_sramc_sysdev *dev = bin_attr->private; 915 struct txx9_sramc_dev *dev = bin_attr->private;
913 size_t ramsize = bin_attr->size; 916 size_t ramsize = bin_attr->size;
914 917
915 if (pos >= ramsize) 918 if (pos >= ramsize)
@@ -924,7 +927,7 @@ static ssize_t txx9_sram_write(struct file *filp, struct kobject *kobj,
924 struct bin_attribute *bin_attr, 927 struct bin_attribute *bin_attr,
925 char *buf, loff_t pos, size_t size) 928 char *buf, loff_t pos, size_t size)
926{ 929{
927 struct txx9_sramc_sysdev *dev = bin_attr->private; 930 struct txx9_sramc_dev *dev = bin_attr->private;
928 size_t ramsize = bin_attr->size; 931 size_t ramsize = bin_attr->size;
929 932
930 if (pos >= ramsize) 933 if (pos >= ramsize)
@@ -937,18 +940,13 @@ static ssize_t txx9_sram_write(struct file *filp, struct kobject *kobj,
937 940
938void __init txx9_sramc_init(struct resource *r) 941void __init txx9_sramc_init(struct resource *r)
939{ 942{
940 struct txx9_sramc_sysdev *dev; 943 struct txx9_sramc_dev *dev;
941 size_t size; 944 size_t size;
942 int err; 945 int err;
943 946
944 if (!txx9_sramc_sysdev_class.name) { 947 err = subsys_system_register(&txx9_sramc_subsys, NULL);
945 txx9_sramc_sysdev_class.name = "txx9_sram"; 948 if (err)
946 err = sysdev_class_register(&txx9_sramc_sysdev_class); 949 return;
947 if (err) {
948 txx9_sramc_sysdev_class.name = NULL;
949 return;
950 }
951 }
952 dev = kzalloc(sizeof(*dev), GFP_KERNEL); 950 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
953 if (!dev) 951 if (!dev)
954 return; 952 return;
@@ -956,7 +954,7 @@ void __init txx9_sramc_init(struct resource *r)
956 dev->base = ioremap(r->start, size); 954 dev->base = ioremap(r->start, size);
957 if (!dev->base) 955 if (!dev->base)
958 goto exit; 956 goto exit;
959 dev->dev.cls = &txx9_sramc_sysdev_class; 957 dev->dev.bus = &txx9_sramc_subsys;
960 sysfs_bin_attr_init(&dev->bindata_attr); 958 sysfs_bin_attr_init(&dev->bindata_attr);
961 dev->bindata_attr.attr.name = "bindata"; 959 dev->bindata_attr.attr.name = "bindata";
962 dev->bindata_attr.attr.mode = S_IRUSR | S_IWUSR; 960 dev->bindata_attr.attr.mode = S_IRUSR | S_IWUSR;
@@ -964,12 +962,12 @@ void __init txx9_sramc_init(struct resource *r)
964 dev->bindata_attr.write = txx9_sram_write; 962 dev->bindata_attr.write = txx9_sram_write;
965 dev->bindata_attr.size = size; 963 dev->bindata_attr.size = size;
966 dev->bindata_attr.private = dev; 964 dev->bindata_attr.private = dev;
967 err = sysdev_register(&dev->dev); 965 err = device_register(&dev->dev);
968 if (err) 966 if (err)
969 goto exit; 967 goto exit;
970 err = sysfs_create_bin_file(&dev->dev.kobj, &dev->bindata_attr); 968 err = sysfs_create_bin_file(&dev->dev.kobj, &dev->bindata_attr);
971 if (err) { 969 if (err) {
972 sysdev_unregister(&dev->dev); 970 device_unregister(&dev->dev);
973 goto exit; 971 goto exit;
974 } 972 }
975 return; 973 return;
diff --git a/arch/mips/txx9/generic/setup_tx4939.c b/arch/mips/txx9/generic/setup_tx4939.c
index ba3cec3155df..6567895d1f59 100644
--- a/arch/mips/txx9/generic/setup_tx4939.c
+++ b/arch/mips/txx9/generic/setup_tx4939.c
@@ -15,7 +15,7 @@
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/netdevice.h> 16#include <linux/netdevice.h>
17#include <linux/notifier.h> 17#include <linux/notifier.h>
18#include <linux/sysdev.h> 18#include <linux/device.h>
19#include <linux/ethtool.h> 19#include <linux/ethtool.h>
20#include <linux/param.h> 20#include <linux/param.h>
21#include <linux/ptrace.h> 21#include <linux/ptrace.h>
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 {
270int register_spu_syscalls(struct spufs_calls *calls); 270int register_spu_syscalls(struct spufs_calls *calls);
271void unregister_spu_syscalls(struct spufs_calls *calls); 271void unregister_spu_syscalls(struct spufs_calls *calls);
272 272
273int spu_add_sysdev_attr(struct sysdev_attribute *attr); 273int spu_add_dev_attr(struct device_attribute *attr);
274void spu_remove_sysdev_attr(struct sysdev_attribute *attr); 274void spu_remove_dev_attr(struct device_attribute *attr);
275 275
276int spu_add_sysdev_attr_group(struct attribute_group *attrs); 276int spu_add_dev_attr_group(struct attribute_group *attrs);
277void spu_remove_sysdev_attr_group(struct attribute_group *attrs); 277void spu_remove_dev_attr_group(struct attribute_group *attrs);
278 278
279int spu_handle_mm_fault(struct mm_struct *mm, unsigned long ea, 279int 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
6struct sys_device; 6struct device;
7struct device_node; 7struct device_node;
8 8
9#ifdef CONFIG_NUMA 9#ifdef CONFIG_NUMA
@@ -86,19 +86,19 @@ extern int __node_distance(int, int);
86 86
87extern void __init dump_numa_cpu_topology(void); 87extern void __init dump_numa_cpu_topology(void);
88 88
89extern int sysfs_add_device_to_node(struct sys_device *dev, int nid); 89extern int sysfs_add_device_to_node(struct device *dev, int nid);
90extern void sysfs_remove_device_from_node(struct sys_device *dev, int nid); 90extern void sysfs_remove_device_from_node(struct device *dev, int nid);
91 91
92#else 92#else
93 93
94static inline void dump_numa_cpu_topology(void) {} 94static inline void dump_numa_cpu_topology(void) {}
95 95
96static inline int sysfs_add_device_to_node(struct sys_device *dev, int nid) 96static inline int sysfs_add_device_to_node(struct device *dev, int nid)
97{ 97{
98 return 0; 98 return 0;
99} 99}
100 100
101static inline void sysfs_remove_device_from_node(struct sys_device *dev, 101static 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:
451static struct cache_dir *__cpuinit cacheinfo_create_cache_dir(unsigned int cpu_id) 451static 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 f0abe92f63f2..46695febc09f 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 6fdf5ffe8c44..883e74c0d1b3 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>
@@ -38,12 +38,12 @@ static DEFINE_PER_CPU(struct cpu, cpu_devices);
38/* Time in microseconds we delay before sleeping in the idle loop */ 38/* Time in microseconds we delay before sleeping in the idle loop */
39DEFINE_PER_CPU(long, smt_snooze_delay) = { 100 }; 39DEFINE_PER_CPU(long, smt_snooze_delay) = { 100 };
40 40
41static ssize_t store_smt_snooze_delay(struct sys_device *dev, 41static ssize_t store_smt_snooze_delay(struct device *dev,
42 struct sysdev_attribute *attr, 42 struct device_attribute *attr,
43 const char *buf, 43 const char *buf,
44 size_t count) 44 size_t count)
45{ 45{
46 struct cpu *cpu = container_of(dev, struct cpu, sysdev); 46 struct cpu *cpu = container_of(dev, struct cpu, dev);
47 ssize_t ret; 47 ssize_t ret;
48 long snooze; 48 long snooze;
49 49
@@ -51,22 +51,22 @@ static ssize_t store_smt_snooze_delay(struct sys_device *dev,
51 if (ret != 1) 51 if (ret != 1)
52 return -EINVAL; 52 return -EINVAL;
53 53
54 per_cpu(smt_snooze_delay, cpu->sysdev.id) = snooze; 54 per_cpu(smt_snooze_delay, cpu->dev.id) = snooze;
55 update_smt_snooze_delay(snooze); 55 update_smt_snooze_delay(snooze);
56 56
57 return count; 57 return count;
58} 58}
59 59
60static ssize_t show_smt_snooze_delay(struct sys_device *dev, 60static ssize_t show_smt_snooze_delay(struct device *dev,
61 struct sysdev_attribute *attr, 61 struct device_attribute *attr,
62 char *buf) 62 char *buf)
63{ 63{
64 struct cpu *cpu = container_of(dev, struct cpu, sysdev); 64 struct cpu *cpu = container_of(dev, struct cpu, dev);
65 65
66 return sprintf(buf, "%ld\n", per_cpu(smt_snooze_delay, cpu->sysdev.id)); 66 return sprintf(buf, "%ld\n", per_cpu(smt_snooze_delay, cpu->dev.id));
67} 67}
68 68
69static SYSDEV_ATTR(smt_snooze_delay, 0644, show_smt_snooze_delay, 69static DEVICE_ATTR(smt_snooze_delay, 0644, show_smt_snooze_delay,
70 store_smt_snooze_delay); 70 store_smt_snooze_delay);
71 71
72static int __init setup_smt_snooze_delay(char *str) 72static int __init setup_smt_snooze_delay(char *str)
@@ -119,25 +119,25 @@ static void write_##NAME(void *val) \
119 ppc_enable_pmcs(); \ 119 ppc_enable_pmcs(); \
120 mtspr(ADDRESS, *(unsigned long *)val); \ 120 mtspr(ADDRESS, *(unsigned long *)val); \
121} \ 121} \
122static ssize_t show_##NAME(struct sys_device *dev, \ 122static ssize_t show_##NAME(struct device *dev, \
123 struct sysdev_attribute *attr, \ 123 struct device_attribute *attr, \
124 char *buf) \ 124 char *buf) \
125{ \ 125{ \
126 struct cpu *cpu = container_of(dev, struct cpu, sysdev); \ 126 struct cpu *cpu = container_of(dev, struct cpu, dev); \
127 unsigned long val; \ 127 unsigned long val; \
128 smp_call_function_single(cpu->sysdev.id, read_##NAME, &val, 1); \ 128 smp_call_function_single(cpu->dev.id, read_##NAME, &val, 1); \
129 return sprintf(buf, "%lx\n", val); \ 129 return sprintf(buf, "%lx\n", val); \
130} \ 130} \
131static ssize_t __used \ 131static ssize_t __used \
132 store_##NAME(struct sys_device *dev, struct sysdev_attribute *attr, \ 132 store_##NAME(struct device *dev, struct device_attribute *attr, \
133 const char *buf, size_t count) \ 133 const char *buf, size_t count) \
134{ \ 134{ \
135 struct cpu *cpu = container_of(dev, struct cpu, sysdev); \ 135 struct cpu *cpu = container_of(dev, struct cpu, dev); \
136 unsigned long val; \ 136 unsigned long val; \
137 int ret = sscanf(buf, "%lx", &val); \ 137 int ret = sscanf(buf, "%lx", &val); \
138 if (ret != 1) \ 138 if (ret != 1) \
139 return -EINVAL; \ 139 return -EINVAL; \
140 smp_call_function_single(cpu->sysdev.id, write_##NAME, &val, 1); \ 140 smp_call_function_single(cpu->dev.id, write_##NAME, &val, 1); \
141 return count; \ 141 return count; \
142} 142}
143 143
@@ -181,23 +181,23 @@ SYSFS_PMCSETUP(spurr, SPRN_SPURR);
181SYSFS_PMCSETUP(dscr, SPRN_DSCR); 181SYSFS_PMCSETUP(dscr, SPRN_DSCR);
182SYSFS_PMCSETUP(pir, SPRN_PIR); 182SYSFS_PMCSETUP(pir, SPRN_PIR);
183 183
184static SYSDEV_ATTR(mmcra, 0600, show_mmcra, store_mmcra); 184static DEVICE_ATTR(mmcra, 0600, show_mmcra, store_mmcra);
185static SYSDEV_ATTR(spurr, 0600, show_spurr, NULL); 185static DEVICE_ATTR(spurr, 0600, show_spurr, NULL);
186static SYSDEV_ATTR(dscr, 0600, show_dscr, store_dscr); 186static DEVICE_ATTR(dscr, 0600, show_dscr, store_dscr);
187static SYSDEV_ATTR(purr, 0600, show_purr, store_purr); 187static DEVICE_ATTR(purr, 0600, show_purr, store_purr);
188static SYSDEV_ATTR(pir, 0400, show_pir, NULL); 188static DEVICE_ATTR(pir, 0400, show_pir, NULL);
189 189
190unsigned long dscr_default = 0; 190unsigned long dscr_default = 0;
191EXPORT_SYMBOL(dscr_default); 191EXPORT_SYMBOL(dscr_default);
192 192
193static ssize_t show_dscr_default(struct sysdev_class *class, 193static ssize_t show_dscr_default(struct device *dev,
194 struct sysdev_class_attribute *attr, char *buf) 194 struct device_attribute *attr, char *buf)
195{ 195{
196 return sprintf(buf, "%lx\n", dscr_default); 196 return sprintf(buf, "%lx\n", dscr_default);
197} 197}
198 198
199static ssize_t __used store_dscr_default(struct sysdev_class *class, 199static ssize_t __used store_dscr_default(struct device *dev,
200 struct sysdev_class_attribute *attr, const char *buf, 200 struct device_attribute *attr, const char *buf,
201 size_t count) 201 size_t count)
202{ 202{
203 unsigned long val; 203 unsigned long val;
@@ -211,15 +211,14 @@ static ssize_t __used store_dscr_default(struct sysdev_class *class,
211 return count; 211 return count;
212} 212}
213 213
214static SYSDEV_CLASS_ATTR(dscr_default, 0600, 214static DEVICE_ATTR(dscr_default, 0600,
215 show_dscr_default, store_dscr_default); 215 show_dscr_default, store_dscr_default);
216 216
217static void sysfs_create_dscr_default(void) 217static void sysfs_create_dscr_default(void)
218{ 218{
219 int err = 0; 219 int err = 0;
220 if (cpu_has_feature(CPU_FTR_DSCR)) 220 if (cpu_has_feature(CPU_FTR_DSCR))
221 err = sysfs_create_file(&cpu_sysdev_class.kset.kobj, 221 err = device_create_file(cpu_subsys.dev_root, &dev_attr_dscr_default);
222 &attr_dscr_default.attr);
223} 222}
224#endif /* CONFIG_PPC64 */ 223#endif /* CONFIG_PPC64 */
225 224
@@ -263,72 +262,72 @@ SYSFS_PMCSETUP(tsr3, SPRN_PA6T_TSR3);
263#endif /* HAS_PPC_PMC_PA6T */ 262#endif /* HAS_PPC_PMC_PA6T */
264 263
265#ifdef HAS_PPC_PMC_IBM 264#ifdef HAS_PPC_PMC_IBM
266static struct sysdev_attribute ibm_common_attrs[] = { 265static struct device_attribute ibm_common_attrs[] = {
267 _SYSDEV_ATTR(mmcr0, 0600, show_mmcr0, store_mmcr0), 266 __ATTR(mmcr0, 0600, show_mmcr0, store_mmcr0),
268 _SYSDEV_ATTR(mmcr1, 0600, show_mmcr1, store_mmcr1), 267 __ATTR(mmcr1, 0600, show_mmcr1, store_mmcr1),
269}; 268};
270#endif /* HAS_PPC_PMC_G4 */ 269#endif /* HAS_PPC_PMC_G4 */
271 270
272#ifdef HAS_PPC_PMC_G4 271#ifdef HAS_PPC_PMC_G4
273static struct sysdev_attribute g4_common_attrs[] = { 272static struct device_attribute g4_common_attrs[] = {
274 _SYSDEV_ATTR(mmcr0, 0600, show_mmcr0, store_mmcr0), 273 __ATTR(mmcr0, 0600, show_mmcr0, store_mmcr0),
275 _SYSDEV_ATTR(mmcr1, 0600, show_mmcr1, store_mmcr1), 274 __ATTR(mmcr1, 0600, show_mmcr1, store_mmcr1),
276 _SYSDEV_ATTR(mmcr2, 0600, show_mmcr2, store_mmcr2), 275 __ATTR(mmcr2, 0600, show_mmcr2, store_mmcr2),
277}; 276};
278#endif /* HAS_PPC_PMC_G4 */ 277#endif /* HAS_PPC_PMC_G4 */
279 278
280static struct sysdev_attribute classic_pmc_attrs[] = { 279static struct device_attribute classic_pmc_attrs[] = {
281 _SYSDEV_ATTR(pmc1, 0600, show_pmc1, store_pmc1), 280 __ATTR(pmc1, 0600, show_pmc1, store_pmc1),
282 _SYSDEV_ATTR(pmc2, 0600, show_pmc2, store_pmc2), 281 __ATTR(pmc2, 0600, show_pmc2, store_pmc2),
283 _SYSDEV_ATTR(pmc3, 0600, show_pmc3, store_pmc3), 282 __ATTR(pmc3, 0600, show_pmc3, store_pmc3),
284 _SYSDEV_ATTR(pmc4, 0600, show_pmc4, store_pmc4), 283 __ATTR(pmc4, 0600, show_pmc4, store_pmc4),
285 _SYSDEV_ATTR(pmc5, 0600, show_pmc5, store_pmc5), 284 __ATTR(pmc5, 0600, show_pmc5, store_pmc5),
286 _SYSDEV_ATTR(pmc6, 0600, show_pmc6, store_pmc6), 285 __ATTR(pmc6, 0600, show_pmc6, store_pmc6),
287#ifdef CONFIG_PPC64 286#ifdef CONFIG_PPC64
288 _SYSDEV_ATTR(pmc7, 0600, show_pmc7, store_pmc7), 287 __ATTR(pmc7, 0600, show_pmc7, store_pmc7),
289 _SYSDEV_ATTR(pmc8, 0600, show_pmc8, store_pmc8), 288 __ATTR(pmc8, 0600, show_pmc8, store_pmc8),
290#endif 289#endif
291}; 290};
292 291
293#ifdef HAS_PPC_PMC_PA6T 292#ifdef HAS_PPC_PMC_PA6T
294static struct sysdev_attribute pa6t_attrs[] = { 293static struct device_attribute pa6t_attrs[] = {
295 _SYSDEV_ATTR(mmcr0, 0600, show_mmcr0, store_mmcr0), 294 __ATTR(mmcr0, 0600, show_mmcr0, store_mmcr0),
296 _SYSDEV_ATTR(mmcr1, 0600, show_mmcr1, store_mmcr1), 295 __ATTR(mmcr1, 0600, show_mmcr1, store_mmcr1),
297 _SYSDEV_ATTR(pmc0, 0600, show_pa6t_pmc0, store_pa6t_pmc0), 296 __ATTR(pmc0, 0600, show_pa6t_pmc0, store_pa6t_pmc0),
298 _SYSDEV_ATTR(pmc1, 0600, show_pa6t_pmc1, store_pa6t_pmc1), 297 __ATTR(pmc1, 0600, show_pa6t_pmc1, store_pa6t_pmc1),
299 _SYSDEV_ATTR(pmc2, 0600, show_pa6t_pmc2, store_pa6t_pmc2), 298 __ATTR(pmc2, 0600, show_pa6t_pmc2, store_pa6t_pmc2),
300 _SYSDEV_ATTR(pmc3, 0600, show_pa6t_pmc3, store_pa6t_pmc3), 299 __ATTR(pmc3, 0600, show_pa6t_pmc3, store_pa6t_pmc3),
301 _SYSDEV_ATTR(pmc4, 0600, show_pa6t_pmc4, store_pa6t_pmc4), 300 __ATTR(pmc4, 0600, show_pa6t_pmc4, store_pa6t_pmc4),
302 _SYSDEV_ATTR(pmc5, 0600, show_pa6t_pmc5, store_pa6t_pmc5), 301 __ATTR(pmc5, 0600, show_pa6t_pmc5, store_pa6t_pmc5),
303#ifdef CONFIG_DEBUG_KERNEL 302#ifdef CONFIG_DEBUG_KERNEL
304 _SYSDEV_ATTR(hid0, 0600, show_hid0, store_hid0), 303 __ATTR(hid0, 0600, show_hid0, store_hid0),
305 _SYSDEV_ATTR(hid1, 0600, show_hid1, store_hid1), 304 __ATTR(hid1, 0600, show_hid1, store_hid1),
306 _SYSDEV_ATTR(hid4, 0600, show_hid4, store_hid4), 305 __ATTR(hid4, 0600, show_hid4, store_hid4),
307 _SYSDEV_ATTR(hid5, 0600, show_hid5, store_hid5), 306 __ATTR(hid5, 0600, show_hid5, store_hid5),
308 _SYSDEV_ATTR(ima0, 0600, show_ima0, store_ima0), 307 __ATTR(ima0, 0600, show_ima0, store_ima0),
309 _SYSDEV_ATTR(ima1, 0600, show_ima1, store_ima1), 308 __ATTR(ima1, 0600, show_ima1, store_ima1),
310 _SYSDEV_ATTR(ima2, 0600, show_ima2, store_ima2), 309 __ATTR(ima2, 0600, show_ima2, store_ima2),
311 _SYSDEV_ATTR(ima3, 0600, show_ima3, store_ima3), 310 __ATTR(ima3, 0600, show_ima3, store_ima3),
312 _SYSDEV_ATTR(ima4, 0600, show_ima4, store_ima4), 311 __ATTR(ima4, 0600, show_ima4, store_ima4),
313 _SYSDEV_ATTR(ima5, 0600, show_ima5, store_ima5), 312 __ATTR(ima5, 0600, show_ima5, store_ima5),
314 _SYSDEV_ATTR(ima6, 0600, show_ima6, store_ima6), 313 __ATTR(ima6, 0600, show_ima6, store_ima6),
315 _SYSDEV_ATTR(ima7, 0600, show_ima7, store_ima7), 314 __ATTR(ima7, 0600, show_ima7, store_ima7),
316 _SYSDEV_ATTR(ima8, 0600, show_ima8, store_ima8), 315 __ATTR(ima8, 0600, show_ima8, store_ima8),
317 _SYSDEV_ATTR(ima9, 0600, show_ima9, store_ima9), 316 __ATTR(ima9, 0600, show_ima9, store_ima9),
318 _SYSDEV_ATTR(imaat, 0600, show_imaat, store_imaat), 317 __ATTR(imaat, 0600, show_imaat, store_imaat),
319 _SYSDEV_ATTR(btcr, 0600, show_btcr, store_btcr), 318 __ATTR(btcr, 0600, show_btcr, store_btcr),
320 _SYSDEV_ATTR(pccr, 0600, show_pccr, store_pccr), 319 __ATTR(pccr, 0600, show_pccr, store_pccr),
321 _SYSDEV_ATTR(rpccr, 0600, show_rpccr, store_rpccr), 320 __ATTR(rpccr, 0600, show_rpccr, store_rpccr),
322 _SYSDEV_ATTR(der, 0600, show_der, store_der), 321 __ATTR(der, 0600, show_der, store_der),
323 _SYSDEV_ATTR(mer, 0600, show_mer, store_mer), 322 __ATTR(mer, 0600, show_mer, store_mer),
324 _SYSDEV_ATTR(ber, 0600, show_ber, store_ber), 323 __ATTR(ber, 0600, show_ber, store_ber),
325 _SYSDEV_ATTR(ier, 0600, show_ier, store_ier), 324 __ATTR(ier, 0600, show_ier, store_ier),
326 _SYSDEV_ATTR(sier, 0600, show_sier, store_sier), 325 __ATTR(sier, 0600, show_sier, store_sier),
327 _SYSDEV_ATTR(siar, 0600, show_siar, store_siar), 326 __ATTR(siar, 0600, show_siar, store_siar),
328 _SYSDEV_ATTR(tsr0, 0600, show_tsr0, store_tsr0), 327 __ATTR(tsr0, 0600, show_tsr0, store_tsr0),
329 _SYSDEV_ATTR(tsr1, 0600, show_tsr1, store_tsr1), 328 __ATTR(tsr1, 0600, show_tsr1, store_tsr1),
330 _SYSDEV_ATTR(tsr2, 0600, show_tsr2, store_tsr2), 329 __ATTR(tsr2, 0600, show_tsr2, store_tsr2),
331 _SYSDEV_ATTR(tsr3, 0600, show_tsr3, store_tsr3), 330 __ATTR(tsr3, 0600, show_tsr3, store_tsr3),
332#endif /* CONFIG_DEBUG_KERNEL */ 331#endif /* CONFIG_DEBUG_KERNEL */
333}; 332};
334#endif /* HAS_PPC_PMC_PA6T */ 333#endif /* HAS_PPC_PMC_PA6T */
@@ -337,14 +336,14 @@ static struct sysdev_attribute pa6t_attrs[] = {
337static void __cpuinit register_cpu_online(unsigned int cpu) 336static void __cpuinit register_cpu_online(unsigned int cpu)
338{ 337{
339 struct cpu *c = &per_cpu(cpu_devices, cpu); 338 struct cpu *c = &per_cpu(cpu_devices, cpu);
340 struct sys_device *s = &c->sysdev; 339 struct device *s = &c->dev;
341 struct sysdev_attribute *attrs, *pmc_attrs; 340 struct device_attribute *attrs, *pmc_attrs;
342 int i, nattrs; 341 int i, nattrs;
343 342
344#ifdef CONFIG_PPC64 343#ifdef CONFIG_PPC64
345 if (!firmware_has_feature(FW_FEATURE_ISERIES) && 344 if (!firmware_has_feature(FW_FEATURE_ISERIES) &&
346 cpu_has_feature(CPU_FTR_SMT)) 345 cpu_has_feature(CPU_FTR_SMT))
347 sysdev_create_file(s, &attr_smt_snooze_delay); 346 device_create_file(s, &dev_attr_smt_snooze_delay);
348#endif 347#endif
349 348
350 /* PMC stuff */ 349 /* PMC stuff */
@@ -352,14 +351,14 @@ static void __cpuinit register_cpu_online(unsigned int cpu)
352#ifdef HAS_PPC_PMC_IBM 351#ifdef HAS_PPC_PMC_IBM
353 case PPC_PMC_IBM: 352 case PPC_PMC_IBM:
354 attrs = ibm_common_attrs; 353 attrs = ibm_common_attrs;
355 nattrs = sizeof(ibm_common_attrs) / sizeof(struct sysdev_attribute); 354 nattrs = sizeof(ibm_common_attrs) / sizeof(struct device_attribute);
356 pmc_attrs = classic_pmc_attrs; 355 pmc_attrs = classic_pmc_attrs;
357 break; 356 break;
358#endif /* HAS_PPC_PMC_IBM */ 357#endif /* HAS_PPC_PMC_IBM */
359#ifdef HAS_PPC_PMC_G4 358#ifdef HAS_PPC_PMC_G4
360 case PPC_PMC_G4: 359 case PPC_PMC_G4:
361 attrs = g4_common_attrs; 360 attrs = g4_common_attrs;
362 nattrs = sizeof(g4_common_attrs) / sizeof(struct sysdev_attribute); 361 nattrs = sizeof(g4_common_attrs) / sizeof(struct device_attribute);
363 pmc_attrs = classic_pmc_attrs; 362 pmc_attrs = classic_pmc_attrs;
364 break; 363 break;
365#endif /* HAS_PPC_PMC_G4 */ 364#endif /* HAS_PPC_PMC_G4 */
@@ -367,7 +366,7 @@ static void __cpuinit register_cpu_online(unsigned int cpu)
367 case PPC_PMC_PA6T: 366 case PPC_PMC_PA6T:
368 /* PA Semi starts counting at PMC0 */ 367 /* PA Semi starts counting at PMC0 */
369 attrs = pa6t_attrs; 368 attrs = pa6t_attrs;
370 nattrs = sizeof(pa6t_attrs) / sizeof(struct sysdev_attribute); 369 nattrs = sizeof(pa6t_attrs) / sizeof(struct device_attribute);
371 pmc_attrs = NULL; 370 pmc_attrs = NULL;
372 break; 371 break;
373#endif /* HAS_PPC_PMC_PA6T */ 372#endif /* HAS_PPC_PMC_PA6T */
@@ -378,27 +377,27 @@ static void __cpuinit register_cpu_online(unsigned int cpu)
378 } 377 }
379 378
380 for (i = 0; i < nattrs; i++) 379 for (i = 0; i < nattrs; i++)
381 sysdev_create_file(s, &attrs[i]); 380 device_create_file(s, &attrs[i]);
382 381
383 if (pmc_attrs) 382 if (pmc_attrs)
384 for (i = 0; i < cur_cpu_spec->num_pmcs; i++) 383 for (i = 0; i < cur_cpu_spec->num_pmcs; i++)
385 sysdev_create_file(s, &pmc_attrs[i]); 384 device_create_file(s, &pmc_attrs[i]);
386 385
387#ifdef CONFIG_PPC64 386#ifdef CONFIG_PPC64
388 if (cpu_has_feature(CPU_FTR_MMCRA)) 387 if (cpu_has_feature(CPU_FTR_MMCRA))
389 sysdev_create_file(s, &attr_mmcra); 388 device_create_file(s, &dev_attr_mmcra);
390 389
391 if (cpu_has_feature(CPU_FTR_PURR)) 390 if (cpu_has_feature(CPU_FTR_PURR))
392 sysdev_create_file(s, &attr_purr); 391 device_create_file(s, &dev_attr_purr);
393 392
394 if (cpu_has_feature(CPU_FTR_SPURR)) 393 if (cpu_has_feature(CPU_FTR_SPURR))
395 sysdev_create_file(s, &attr_spurr); 394 device_create_file(s, &dev_attr_spurr);
396 395
397 if (cpu_has_feature(CPU_FTR_DSCR)) 396 if (cpu_has_feature(CPU_FTR_DSCR))
398 sysdev_create_file(s, &attr_dscr); 397 device_create_file(s, &dev_attr_dscr);
399 398
400 if (cpu_has_feature(CPU_FTR_PPCAS_ARCH_V2)) 399 if (cpu_has_feature(CPU_FTR_PPCAS_ARCH_V2))
401 sysdev_create_file(s, &attr_pir); 400 device_create_file(s, &dev_attr_pir);
402#endif /* CONFIG_PPC64 */ 401#endif /* CONFIG_PPC64 */
403 402
404 cacheinfo_cpu_online(cpu); 403 cacheinfo_cpu_online(cpu);
@@ -408,8 +407,8 @@ static void __cpuinit register_cpu_online(unsigned int cpu)
408static void unregister_cpu_online(unsigned int cpu) 407static void unregister_cpu_online(unsigned int cpu)
409{ 408{
410 struct cpu *c = &per_cpu(cpu_devices, cpu); 409 struct cpu *c = &per_cpu(cpu_devices, cpu);
411 struct sys_device *s = &c->sysdev; 410 struct device *s = &c->dev;
412 struct sysdev_attribute *attrs, *pmc_attrs; 411 struct device_attribute *attrs, *pmc_attrs;
413 int i, nattrs; 412 int i, nattrs;
414 413
415 BUG_ON(!c->hotpluggable); 414 BUG_ON(!c->hotpluggable);
@@ -417,7 +416,7 @@ static void unregister_cpu_online(unsigned int cpu)
417#ifdef CONFIG_PPC64 416#ifdef CONFIG_PPC64
418 if (!firmware_has_feature(FW_FEATURE_ISERIES) && 417 if (!firmware_has_feature(FW_FEATURE_ISERIES) &&
419 cpu_has_feature(CPU_FTR_SMT)) 418 cpu_has_feature(CPU_FTR_SMT))
420 sysdev_remove_file(s, &attr_smt_snooze_delay); 419 device_remove_file(s, &dev_attr_smt_snooze_delay);
421#endif 420#endif
422 421
423 /* PMC stuff */ 422 /* PMC stuff */
@@ -425,14 +424,14 @@ static void unregister_cpu_online(unsigned int cpu)
425#ifdef HAS_PPC_PMC_IBM 424#ifdef HAS_PPC_PMC_IBM
426 case PPC_PMC_IBM: 425 case PPC_PMC_IBM:
427 attrs = ibm_common_attrs; 426 attrs = ibm_common_attrs;
428 nattrs = sizeof(ibm_common_attrs) / sizeof(struct sysdev_attribute); 427 nattrs = sizeof(ibm_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_IBM */ 430#endif /* HAS_PPC_PMC_IBM */
432#ifdef HAS_PPC_PMC_G4 431#ifdef HAS_PPC_PMC_G4
433 case PPC_PMC_G4: 432 case PPC_PMC_G4:
434 attrs = g4_common_attrs; 433 attrs = g4_common_attrs;
435 nattrs = sizeof(g4_common_attrs) / sizeof(struct sysdev_attribute); 434 nattrs = sizeof(g4_common_attrs) / sizeof(struct device_attribute);
436 pmc_attrs = classic_pmc_attrs; 435 pmc_attrs = classic_pmc_attrs;
437 break; 436 break;
438#endif /* HAS_PPC_PMC_G4 */ 437#endif /* HAS_PPC_PMC_G4 */
@@ -440,7 +439,7 @@ static void unregister_cpu_online(unsigned int cpu)
440 case PPC_PMC_PA6T: 439 case PPC_PMC_PA6T:
441 /* PA Semi starts counting at PMC0 */ 440 /* PA Semi starts counting at PMC0 */
442 attrs = pa6t_attrs; 441 attrs = pa6t_attrs;
443 nattrs = sizeof(pa6t_attrs) / sizeof(struct sysdev_attribute); 442 nattrs = sizeof(pa6t_attrs) / sizeof(struct device_attribute);
444 pmc_attrs = NULL; 443 pmc_attrs = NULL;
445 break; 444 break;
446#endif /* HAS_PPC_PMC_PA6T */ 445#endif /* HAS_PPC_PMC_PA6T */
@@ -451,27 +450,27 @@ static void unregister_cpu_online(unsigned int cpu)
451 } 450 }
452 451
453 for (i = 0; i < nattrs; i++) 452 for (i = 0; i < nattrs; i++)
454 sysdev_remove_file(s, &attrs[i]); 453 device_remove_file(s, &attrs[i]);
455 454
456 if (pmc_attrs) 455 if (pmc_attrs)
457 for (i = 0; i < cur_cpu_spec->num_pmcs; i++) 456 for (i = 0; i < cur_cpu_spec->num_pmcs; i++)
458 sysdev_remove_file(s, &pmc_attrs[i]); 457 device_remove_file(s, &pmc_attrs[i]);
459 458
460#ifdef CONFIG_PPC64 459#ifdef CONFIG_PPC64
461 if (cpu_has_feature(CPU_FTR_MMCRA)) 460 if (cpu_has_feature(CPU_FTR_MMCRA))
462 sysdev_remove_file(s, &attr_mmcra); 461 device_remove_file(s, &dev_attr_mmcra);
463 462
464 if (cpu_has_feature(CPU_FTR_PURR)) 463 if (cpu_has_feature(CPU_FTR_PURR))
465 sysdev_remove_file(s, &attr_purr); 464 device_remove_file(s, &dev_attr_purr);
466 465
467 if (cpu_has_feature(CPU_FTR_SPURR)) 466 if (cpu_has_feature(CPU_FTR_SPURR))
468 sysdev_remove_file(s, &attr_spurr); 467 device_remove_file(s, &dev_attr_spurr);
469 468
470 if (cpu_has_feature(CPU_FTR_DSCR)) 469 if (cpu_has_feature(CPU_FTR_DSCR))
471 sysdev_remove_file(s, &attr_dscr); 470 device_remove_file(s, &dev_attr_dscr);
472 471
473 if (cpu_has_feature(CPU_FTR_PPCAS_ARCH_V2)) 472 if (cpu_has_feature(CPU_FTR_PPCAS_ARCH_V2))
474 sysdev_remove_file(s, &attr_pir); 473 device_remove_file(s, &dev_attr_pir);
475#endif /* CONFIG_PPC64 */ 474#endif /* CONFIG_PPC64 */
476 475
477 cacheinfo_cpu_offline(cpu); 476 cacheinfo_cpu_offline(cpu);
@@ -523,70 +522,70 @@ static struct notifier_block __cpuinitdata sysfs_cpu_nb = {
523 522
524static DEFINE_MUTEX(cpu_mutex); 523static DEFINE_MUTEX(cpu_mutex);
525 524
526int cpu_add_sysdev_attr(struct sysdev_attribute *attr) 525int cpu_add_dev_attr(struct device_attribute *attr)
527{ 526{
528 int cpu; 527 int cpu;
529 528
530 mutex_lock(&cpu_mutex); 529 mutex_lock(&cpu_mutex);
531 530
532 for_each_possible_cpu(cpu) { 531 for_each_possible_cpu(cpu) {
533 sysdev_create_file(get_cpu_sysdev(cpu), attr); 532 device_create_file(get_cpu_device(cpu), attr);
534 } 533 }
535 534
536 mutex_unlock(&cpu_mutex); 535 mutex_unlock(&cpu_mutex);
537 return 0; 536 return 0;
538} 537}
539EXPORT_SYMBOL_GPL(cpu_add_sysdev_attr); 538EXPORT_SYMBOL_GPL(cpu_add_dev_attr);
540 539
541int cpu_add_sysdev_attr_group(struct attribute_group *attrs) 540int cpu_add_dev_attr_group(struct attribute_group *attrs)
542{ 541{
543 int cpu; 542 int cpu;
544 struct sys_device *sysdev; 543 struct device *dev;
545 int ret; 544 int ret;
546 545
547 mutex_lock(&cpu_mutex); 546 mutex_lock(&cpu_mutex);
548 547
549 for_each_possible_cpu(cpu) { 548 for_each_possible_cpu(cpu) {
550 sysdev = get_cpu_sysdev(cpu); 549 dev = get_cpu_device(cpu);
551 ret = sysfs_create_group(&sysdev->kobj, attrs); 550 ret = sysfs_create_group(&dev->kobj, attrs);
552 WARN_ON(ret != 0); 551 WARN_ON(ret != 0);
553 } 552 }
554 553
555 mutex_unlock(&cpu_mutex); 554 mutex_unlock(&cpu_mutex);
556 return 0; 555 return 0;
557} 556}
558EXPORT_SYMBOL_GPL(cpu_add_sysdev_attr_group); 557EXPORT_SYMBOL_GPL(cpu_add_dev_attr_group);
559 558
560 559
561void cpu_remove_sysdev_attr(struct sysdev_attribute *attr) 560void cpu_remove_dev_attr(struct device_attribute *attr)
562{ 561{
563 int cpu; 562 int cpu;
564 563
565 mutex_lock(&cpu_mutex); 564 mutex_lock(&cpu_mutex);
566 565
567 for_each_possible_cpu(cpu) { 566 for_each_possible_cpu(cpu) {
568 sysdev_remove_file(get_cpu_sysdev(cpu), attr); 567 device_remove_file(get_cpu_device(cpu), attr);
569 } 568 }
570 569
571 mutex_unlock(&cpu_mutex); 570 mutex_unlock(&cpu_mutex);
572} 571}
573EXPORT_SYMBOL_GPL(cpu_remove_sysdev_attr); 572EXPORT_SYMBOL_GPL(cpu_remove_dev_attr);
574 573
575void cpu_remove_sysdev_attr_group(struct attribute_group *attrs) 574void cpu_remove_dev_attr_group(struct attribute_group *attrs)
576{ 575{
577 int cpu; 576 int cpu;
578 struct sys_device *sysdev; 577 struct device *dev;
579 578
580 mutex_lock(&cpu_mutex); 579 mutex_lock(&cpu_mutex);
581 580
582 for_each_possible_cpu(cpu) { 581 for_each_possible_cpu(cpu) {
583 sysdev = get_cpu_sysdev(cpu); 582 dev = get_cpu_device(cpu);
584 sysfs_remove_group(&sysdev->kobj, attrs); 583 sysfs_remove_group(&dev->kobj, attrs);
585 } 584 }
586 585
587 mutex_unlock(&cpu_mutex); 586 mutex_unlock(&cpu_mutex);
588} 587}
589EXPORT_SYMBOL_GPL(cpu_remove_sysdev_attr_group); 588EXPORT_SYMBOL_GPL(cpu_remove_dev_attr_group);
590 589
591 590
592/* NUMA stuff */ 591/* NUMA stuff */
@@ -600,18 +599,18 @@ static void register_nodes(void)
600 register_one_node(i); 599 register_one_node(i);
601} 600}
602 601
603int sysfs_add_device_to_node(struct sys_device *dev, int nid) 602int sysfs_add_device_to_node(struct device *dev, int nid)
604{ 603{
605 struct node *node = &node_devices[nid]; 604 struct node *node = &node_devices[nid];
606 return sysfs_create_link(&node->sysdev.kobj, &dev->kobj, 605 return sysfs_create_link(&node->dev.kobj, &dev->kobj,
607 kobject_name(&dev->kobj)); 606 kobject_name(&dev->kobj));
608} 607}
609EXPORT_SYMBOL_GPL(sysfs_add_device_to_node); 608EXPORT_SYMBOL_GPL(sysfs_add_device_to_node);
610 609
611void sysfs_remove_device_from_node(struct sys_device *dev, int nid) 610void sysfs_remove_device_from_node(struct device *dev, int nid)
612{ 611{
613 struct node *node = &node_devices[nid]; 612 struct node *node = &node_devices[nid];
614 sysfs_remove_link(&node->sysdev.kobj, kobject_name(&dev->kobj)); 613 sysfs_remove_link(&node->dev.kobj, kobject_name(&dev->kobj));
615} 614}
616EXPORT_SYMBOL_GPL(sysfs_remove_device_from_node); 615EXPORT_SYMBOL_GPL(sysfs_remove_device_from_node);
617 616
@@ -624,14 +623,14 @@ static void register_nodes(void)
624#endif 623#endif
625 624
626/* Only valid if CPU is present. */ 625/* Only valid if CPU is present. */
627static ssize_t show_physical_id(struct sys_device *dev, 626static ssize_t show_physical_id(struct device *dev,
628 struct sysdev_attribute *attr, char *buf) 627 struct device_attribute *attr, char *buf)
629{ 628{
630 struct cpu *cpu = container_of(dev, struct cpu, sysdev); 629 struct cpu *cpu = container_of(dev, struct cpu, dev);
631 630
632 return sprintf(buf, "%d\n", get_hard_smp_processor_id(cpu->sysdev.id)); 631 return sprintf(buf, "%d\n", get_hard_smp_processor_id(cpu->dev.id));
633} 632}
634static SYSDEV_ATTR(physical_id, 0444, show_physical_id, NULL); 633static DEVICE_ATTR(physical_id, 0444, show_physical_id, NULL);
635 634
636static int __init topology_init(void) 635static int __init topology_init(void)
637{ 636{
@@ -656,7 +655,7 @@ static int __init topology_init(void)
656 if (cpu_online(cpu) || c->hotpluggable) { 655 if (cpu_online(cpu) || c->hotpluggable) {
657 register_cpu(c, cpu); 656 register_cpu(c, cpu);
658 657
659 sysdev_create_file(&c->sysdev, &attr_physical_id); 658 device_create_file(&c->dev, &dev_attr_physical_id);
660 } 659 }
661 660
662 if (cpu_online(cpu)) 661 if (cpu_online(cpu))
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index c0189c169bbb..fe92f7007051 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -1440,7 +1440,7 @@ int arch_update_cpu_topology(void)
1440{ 1440{
1441 int cpu, nid, old_nid; 1441 int cpu, nid, old_nid;
1442 unsigned int associativity[VPHN_ASSOC_BUFSIZE] = {0}; 1442 unsigned int associativity[VPHN_ASSOC_BUFSIZE] = {0};
1443 struct sys_device *sysdev; 1443 struct device *dev;
1444 1444
1445 for_each_cpu(cpu,&cpu_associativity_changes_mask) { 1445 for_each_cpu(cpu,&cpu_associativity_changes_mask) {
1446 vphn_get_associativity(cpu, associativity); 1446 vphn_get_associativity(cpu, associativity);
@@ -1461,9 +1461,9 @@ int arch_update_cpu_topology(void)
1461 register_cpu_under_node(cpu, nid); 1461 register_cpu_under_node(cpu, nid);
1462 put_online_cpus(); 1462 put_online_cpus();
1463 1463
1464 sysdev = get_cpu_sysdev(cpu); 1464 dev = get_cpu_device(cpu);
1465 if (sysdev) 1465 if (dev)
1466 kobject_uevent(&sysdev->kobj, KOBJ_CHANGE); 1466 kobject_uevent(&dev->kobj, KOBJ_CHANGE);
1467 } 1467 }
1468 1468
1469 return 1; 1469 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) \
63struct sysdev_attribute attr_ ## _prefix ## _ ## _name = { \ 63struct 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
79static struct cbe_pmd_regs __iomem *get_pmd_regs(struct sys_device *sysdev) 79static 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 */
89static u8 spu_read_register_value(struct sys_device *sysdev, union spe_reg __iomem *reg) 89static 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(&reg->val); 95 value.val = in_be64(&reg->val);
96 96
97 return value.spe[spu->spe_id]; 97 return value.spe[spu->spe_id];
98} 98}
99 99
100static ssize_t spu_show_temp(struct sys_device *sysdev, struct sysdev_attribute *attr, 100static 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
150static ssize_t spu_show_throttle_end(struct sys_device *sysdev, 150static 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
156static ssize_t spu_show_throttle_begin(struct sys_device *sysdev, 156static 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
162static ssize_t spu_show_throttle_full_stop(struct sys_device *sysdev, 162static 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
168static ssize_t spu_store_throttle_end(struct sys_device *sysdev, 168static 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
174static ssize_t spu_store_throttle_begin(struct sys_device *sysdev, 174static 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
180static ssize_t spu_store_throttle_full_stop(struct sys_device *sysdev, 180static 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
186static ssize_t ppe_show_temp(struct sys_device *sysdev, char *buf, int pos) 186static 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 */
202static ssize_t ppe_show_temp0(struct sys_device *sysdev, 202static 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 */
209static ssize_t ppe_show_temp1(struct sys_device *sysdev, 209static 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
215static ssize_t ppe_show_throttle_end(struct sys_device *sysdev, 215static 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
221static ssize_t ppe_show_throttle_begin(struct sys_device *sysdev, 221static 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
227static ssize_t ppe_show_throttle_full_stop(struct sys_device *sysdev, 227static 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
233static ssize_t ppe_store_throttle_end(struct sys_device *sysdev, 233static 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
239static ssize_t ppe_store_throttle_begin(struct sys_device *sysdev, 239static 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
245static ssize_t ppe_store_throttle_full_stop(struct sys_device *sysdev, 245static 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
252static struct sysdev_attribute attr_spu_temperature = { 252static 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
257static SYSDEV_PREFIX_ATTR(spu, throttle_end, 0600); 257static DEVICE_PREFIX_ATTR(spu, throttle_end, 0600);
258static SYSDEV_PREFIX_ATTR(spu, throttle_begin, 0600); 258static DEVICE_PREFIX_ATTR(spu, throttle_begin, 0600);
259static SYSDEV_PREFIX_ATTR(spu, throttle_full_stop, 0600); 259static DEVICE_PREFIX_ATTR(spu, throttle_full_stop, 0600);
260 260
261 261
262static struct attribute *spu_attributes[] = { 262static 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
275static struct sysdev_attribute attr_ppe_temperature0 = { 275static 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
280static struct sysdev_attribute attr_ppe_temperature1 = { 280static 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
285static SYSDEV_PREFIX_ATTR(ppe, throttle_end, 0600); 285static DEVICE_PREFIX_ATTR(ppe, throttle_end, 0600);
286static SYSDEV_PREFIX_ATTR(ppe, throttle_begin, 0600); 286static DEVICE_PREFIX_ATTR(ppe, throttle_begin, 0600);
287static SYSDEV_PREFIX_ATTR(ppe, throttle_full_stop, 0600); 287static DEVICE_PREFIX_ATTR(ppe, throttle_full_stop, 0600);
288 288
289static struct attribute *ppe_attributes[] = { 289static 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
390static void __exit thermal_exit(void) 390static 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}
395module_exit(thermal_exit); 395module_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}
520EXPORT_SYMBOL_GPL(spu_init_channels); 520EXPORT_SYMBOL_GPL(spu_init_channels);
521 521
522static struct sysdev_class spu_sysdev_class = { 522static struct bus_type spu_subsys = {
523 .name = "spu", 523 .name = "spu",
524 .dev_name = "spu",
524}; 525};
525 526
526int spu_add_sysdev_attr(struct sysdev_attribute *attr) 527int 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}
537EXPORT_SYMBOL_GPL(spu_add_sysdev_attr); 538EXPORT_SYMBOL_GPL(spu_add_dev_attr);
538 539
539int spu_add_sysdev_attr_group(struct attribute_group *attrs) 540int 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}
564EXPORT_SYMBOL_GPL(spu_add_sysdev_attr_group); 565EXPORT_SYMBOL_GPL(spu_add_dev_attr_group);
565 566
566 567
567void spu_remove_sysdev_attr(struct sysdev_attribute *attr) 568void 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}
576EXPORT_SYMBOL_GPL(spu_remove_sysdev_attr); 577EXPORT_SYMBOL_GPL(spu_remove_dev_attr);
577 578
578void spu_remove_sysdev_attr_group(struct attribute_group *attrs) 579void 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}
587EXPORT_SYMBOL_GPL(spu_remove_sysdev_attr_group); 588EXPORT_SYMBOL_GPL(spu_remove_dev_attr_group);
588 589
589static int spu_create_sysdev(struct spu *spu) 590static 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
695static ssize_t spu_stat_show(struct sys_device *sysdev, 696static 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
717static SYSDEV_ATTR(stat, 0644, spu_stat_show, NULL); 718static 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;
65static unsigned int cmm_debug = CMM_DEBUG; 65static unsigned int cmm_debug = CMM_DEBUG;
66static unsigned int cmm_disabled = CMM_DISABLE; 66static unsigned int cmm_disabled = CMM_DISABLE;
67static unsigned long min_mem_mb = CMM_MIN_MEM_MB; 67static unsigned long min_mem_mb = CMM_MIN_MEM_MB;
68static struct sys_device cmm_sysdev; 68static struct device cmm_dev;
69 69
70MODULE_AUTHOR("Brian King <brking@linux.vnet.ibm.com>"); 70MODULE_AUTHOR("Brian King <brking@linux.vnet.ibm.com>");
71MODULE_DESCRIPTION("IBM System p Collaborative Memory Manager"); 71MODULE_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
358CMM_SHOW(loaned_kb, "%lu\n", PAGES2KB(loaned_pages)); 358CMM_SHOW(loaned_kb, "%lu\n", PAGES2KB(loaned_pages));
359CMM_SHOW(loaned_target_kb, "%lu\n", PAGES2KB(loaned_pages_target)); 359CMM_SHOW(loaned_target_kb, "%lu\n", PAGES2KB(loaned_pages_target));
360 360
361static ssize_t show_oom_pages(struct sys_device *dev, 361static 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
367static ssize_t store_oom_pages(struct sys_device *dev, 367static 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
382static SYSDEV_ATTR(oom_freed_kb, S_IWUSR| S_IRUGO, 382static 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
385static struct sysdev_attribute *cmm_attrs[] = { 385static 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
391static struct sysdev_class cmm_sysdev_class = { 391static 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 **/
401static int cmm_sysfs_register(struct sys_device *sysdev) 402static 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
421fail: 422fail:
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);
425class_unregister: 426subsys_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 **/
434static void cmm_unregister_sysfs(struct sys_device *sysdev) 435static 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)
678out_unregister_notifier: 679out_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);
682out_reboot_notifier: 683out_reboot_notifier:
683 unregister_reboot_notifier(&cmm_reboot_nb); 684 unregister_reboot_notifier(&cmm_reboot_nb);
684out_oom_notifier: 685out_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
187static ssize_t get_best_energy_data(struct sys_device *dev, 187static 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
210static ssize_t cpu_activate_hint_list_show(struct sysdev_class *class, 210static 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
216static ssize_t cpu_deactivate_hint_list_show(struct sysdev_class *class, 216static 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
222static ssize_t percpu_activate_hint_show(struct sys_device *dev, 222static 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
228static ssize_t percpu_deactivate_hint_show(struct sys_device *dev, 228static 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
244struct sysdev_class_attribute attr_cpu_activate_hint_list = 244struct 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
248struct sysdev_class_attribute attr_cpu_deactivate_hint_list = 248struct 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
252struct sysdev_attribute attr_percpu_activate_hint = 252struct 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
256struct sysdev_attribute attr_percpu_deactivate_hint = 256struct 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
260static int __init pseries_energy_init(void) 260static 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)
298static void __exit pseries_energy_cleanup(void) 298static 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
28static u64 stream_id; 28static u64 stream_id;
29static struct sys_device suspend_sysdev; 29static struct device suspend_dev;
30static DECLARE_COMPLETION(suspend_work); 30static DECLARE_COMPLETION(suspend_work);
31static struct rtas_suspend_me_data suspend_data; 31static struct rtas_suspend_me_data suspend_data;
32static atomic_t suspending; 32static 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 **/
124static ssize_t store_hibernate(struct sysdev_class *classdev, 124static 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
151static SYSDEV_CLASS_ATTR(hibernate, S_IWUSR, NULL, store_hibernate); 151static DEVICE_ATTR(hibernate, S_IWUSR, NULL, store_hibernate);
152 152
153static struct sysdev_class suspend_sysdev_class = { 153static struct bus_type suspend_subsys = {
154 .name = "power", 154 .name = "power",
155 .dev_name = "power",
155}; 156};
156 157
157static const struct platform_suspend_ops pseries_suspend_ops = { 158static 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 **/
170static int pseries_suspend_sysfs_register(struct sys_device *sysdev) 171static 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
185class_unregister: 186subsys_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
180static void cpm_idle_config_sysfs(void) 180static 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
487static struct sysdev_class qe_ic_sysclass = { 486static struct bus_type qe_ic_subsys = {
488 .name = "qe_ic", 487 .name = "qe_ic",
488 .dev_name = "qe_ic",
489}; 489};
490 490
491static struct sys_device device_qe_ic = { 491static 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
496static int __init init_qe_ic_sysfs(void) 496static 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>
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 3ea872890da2..66cca03c0282 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -831,8 +831,8 @@ int setup_profiling_timer(unsigned int multiplier)
831} 831}
832 832
833#ifdef CONFIG_HOTPLUG_CPU 833#ifdef CONFIG_HOTPLUG_CPU
834static ssize_t cpu_configure_show(struct sys_device *dev, 834static ssize_t cpu_configure_show(struct device *dev,
835 struct sysdev_attribute *attr, char *buf) 835 struct device_attribute *attr, char *buf)
836{ 836{
837 ssize_t count; 837 ssize_t count;
838 838
@@ -842,8 +842,8 @@ static ssize_t cpu_configure_show(struct sys_device *dev,
842 return count; 842 return count;
843} 843}
844 844
845static ssize_t cpu_configure_store(struct sys_device *dev, 845static ssize_t cpu_configure_store(struct device *dev,
846 struct sysdev_attribute *attr, 846 struct device_attribute *attr,
847 const char *buf, size_t count) 847 const char *buf, size_t count)
848{ 848{
849 int cpu = dev->id; 849 int cpu = dev->id;
@@ -889,11 +889,11 @@ out:
889 put_online_cpus(); 889 put_online_cpus();
890 return rc ? rc : count; 890 return rc ? rc : count;
891} 891}
892static SYSDEV_ATTR(configure, 0644, cpu_configure_show, cpu_configure_store); 892static DEVICE_ATTR(configure, 0644, cpu_configure_show, cpu_configure_store);
893#endif /* CONFIG_HOTPLUG_CPU */ 893#endif /* CONFIG_HOTPLUG_CPU */
894 894
895static ssize_t cpu_polarization_show(struct sys_device *dev, 895static ssize_t cpu_polarization_show(struct device *dev,
896 struct sysdev_attribute *attr, char *buf) 896 struct device_attribute *attr, char *buf)
897{ 897{
898 int cpu = dev->id; 898 int cpu = dev->id;
899 ssize_t count; 899 ssize_t count;
@@ -919,22 +919,22 @@ static ssize_t cpu_polarization_show(struct sys_device *dev,
919 mutex_unlock(&smp_cpu_state_mutex); 919 mutex_unlock(&smp_cpu_state_mutex);
920 return count; 920 return count;
921} 921}
922static SYSDEV_ATTR(polarization, 0444, cpu_polarization_show, NULL); 922static DEVICE_ATTR(polarization, 0444, cpu_polarization_show, NULL);
923 923
924static ssize_t show_cpu_address(struct sys_device *dev, 924static ssize_t show_cpu_address(struct device *dev,
925 struct sysdev_attribute *attr, char *buf) 925 struct device_attribute *attr, char *buf)
926{ 926{
927 return sprintf(buf, "%d\n", __cpu_logical_map[dev->id]); 927 return sprintf(buf, "%d\n", __cpu_logical_map[dev->id]);
928} 928}
929static SYSDEV_ATTR(address, 0444, show_cpu_address, NULL); 929static DEVICE_ATTR(address, 0444, show_cpu_address, NULL);
930 930
931 931
932static struct attribute *cpu_common_attrs[] = { 932static struct attribute *cpu_common_attrs[] = {
933#ifdef CONFIG_HOTPLUG_CPU 933#ifdef CONFIG_HOTPLUG_CPU
934 &attr_configure.attr, 934 &dev_attr_configure.attr,
935#endif 935#endif
936 &attr_address.attr, 936 &dev_attr_address.attr,
937 &attr_polarization.attr, 937 &dev_attr_polarization.attr,
938 NULL, 938 NULL,
939}; 939};
940 940
@@ -942,8 +942,8 @@ static struct attribute_group cpu_common_attr_group = {
942 .attrs = cpu_common_attrs, 942 .attrs = cpu_common_attrs,
943}; 943};
944 944
945static ssize_t show_capability(struct sys_device *dev, 945static ssize_t show_capability(struct device *dev,
946 struct sysdev_attribute *attr, char *buf) 946 struct device_attribute *attr, char *buf)
947{ 947{
948 unsigned int capability; 948 unsigned int capability;
949 int rc; 949 int rc;
@@ -953,10 +953,10 @@ static ssize_t show_capability(struct sys_device *dev,
953 return rc; 953 return rc;
954 return sprintf(buf, "%u\n", capability); 954 return sprintf(buf, "%u\n", capability);
955} 955}
956static SYSDEV_ATTR(capability, 0444, show_capability, NULL); 956static DEVICE_ATTR(capability, 0444, show_capability, NULL);
957 957
958static ssize_t show_idle_count(struct sys_device *dev, 958static ssize_t show_idle_count(struct device *dev,
959 struct sysdev_attribute *attr, char *buf) 959 struct device_attribute *attr, char *buf)
960{ 960{
961 struct s390_idle_data *idle; 961 struct s390_idle_data *idle;
962 unsigned long long idle_count; 962 unsigned long long idle_count;
@@ -976,10 +976,10 @@ repeat:
976 goto repeat; 976 goto repeat;
977 return sprintf(buf, "%llu\n", idle_count); 977 return sprintf(buf, "%llu\n", idle_count);
978} 978}
979static SYSDEV_ATTR(idle_count, 0444, show_idle_count, NULL); 979static DEVICE_ATTR(idle_count, 0444, show_idle_count, NULL);
980 980
981static ssize_t show_idle_time(struct sys_device *dev, 981static ssize_t show_idle_time(struct device *dev,
982 struct sysdev_attribute *attr, char *buf) 982 struct device_attribute *attr, char *buf)
983{ 983{
984 struct s390_idle_data *idle; 984 struct s390_idle_data *idle;
985 unsigned long long now, idle_time, idle_enter; 985 unsigned long long now, idle_time, idle_enter;
@@ -1001,12 +1001,12 @@ repeat:
1001 goto repeat; 1001 goto repeat;
1002 return sprintf(buf, "%llu\n", idle_time >> 12); 1002 return sprintf(buf, "%llu\n", idle_time >> 12);
1003} 1003}
1004static SYSDEV_ATTR(idle_time_us, 0444, show_idle_time, NULL); 1004static DEVICE_ATTR(idle_time_us, 0444, show_idle_time, NULL);
1005 1005
1006static struct attribute *cpu_online_attrs[] = { 1006static struct attribute *cpu_online_attrs[] = {
1007 &attr_capability.attr, 1007 &dev_attr_capability.attr,
1008 &attr_idle_count.attr, 1008 &dev_attr_idle_count.attr,
1009 &attr_idle_time_us.attr, 1009 &dev_attr_idle_time_us.attr,
1010 NULL, 1010 NULL,
1011}; 1011};
1012 1012
@@ -1019,7 +1019,7 @@ static int __cpuinit smp_cpu_notify(struct notifier_block *self,
1019{ 1019{
1020 unsigned int cpu = (unsigned int)(long)hcpu; 1020 unsigned int cpu = (unsigned int)(long)hcpu;
1021 struct cpu *c = &per_cpu(cpu_devices, cpu); 1021 struct cpu *c = &per_cpu(cpu_devices, cpu);
1022 struct sys_device *s = &c->sysdev; 1022 struct device *s = &c->dev;
1023 struct s390_idle_data *idle; 1023 struct s390_idle_data *idle;
1024 int err = 0; 1024 int err = 0;
1025 1025
@@ -1045,7 +1045,7 @@ static struct notifier_block __cpuinitdata smp_cpu_nb = {
1045static int __devinit smp_add_present_cpu(int cpu) 1045static int __devinit smp_add_present_cpu(int cpu)
1046{ 1046{
1047 struct cpu *c = &per_cpu(cpu_devices, cpu); 1047 struct cpu *c = &per_cpu(cpu_devices, cpu);
1048 struct sys_device *s = &c->sysdev; 1048 struct device *s = &c->dev;
1049 int rc; 1049 int rc;
1050 1050
1051 c->hotpluggable = 1; 1051 c->hotpluggable = 1;
@@ -1098,8 +1098,8 @@ out:
1098 return rc; 1098 return rc;
1099} 1099}
1100 1100
1101static ssize_t __ref rescan_store(struct sysdev_class *class, 1101static ssize_t __ref rescan_store(struct device *dev,
1102 struct sysdev_class_attribute *attr, 1102 struct device_attribute *attr,
1103 const char *buf, 1103 const char *buf,
1104 size_t count) 1104 size_t count)
1105{ 1105{
@@ -1108,11 +1108,11 @@ static ssize_t __ref rescan_store(struct sysdev_class *class,
1108 rc = smp_rescan_cpus(); 1108 rc = smp_rescan_cpus();
1109 return rc ? rc : count; 1109 return rc ? rc : count;
1110} 1110}
1111static SYSDEV_CLASS_ATTR(rescan, 0200, NULL, rescan_store); 1111static DEVICE_ATTR(rescan, 0200, NULL, rescan_store);
1112#endif /* CONFIG_HOTPLUG_CPU */ 1112#endif /* CONFIG_HOTPLUG_CPU */
1113 1113
1114static ssize_t dispatching_show(struct sysdev_class *class, 1114static ssize_t dispatching_show(struct device *dev,
1115 struct sysdev_class_attribute *attr, 1115 struct device_attribute *attr,
1116 char *buf) 1116 char *buf)
1117{ 1117{
1118 ssize_t count; 1118 ssize_t count;
@@ -1123,8 +1123,8 @@ static ssize_t dispatching_show(struct sysdev_class *class,
1123 return count; 1123 return count;
1124} 1124}
1125 1125
1126static ssize_t dispatching_store(struct sysdev_class *dev, 1126static ssize_t dispatching_store(struct device *dev,
1127 struct sysdev_class_attribute *attr, 1127 struct device_attribute *attr,
1128 const char *buf, 1128 const char *buf,
1129 size_t count) 1129 size_t count)
1130{ 1130{
@@ -1148,7 +1148,7 @@ out:
1148 put_online_cpus(); 1148 put_online_cpus();
1149 return rc ? rc : count; 1149 return rc ? rc : count;
1150} 1150}
1151static SYSDEV_CLASS_ATTR(dispatching, 0644, dispatching_show, 1151static DEVICE_ATTR(dispatching, 0644, dispatching_show,
1152 dispatching_store); 1152 dispatching_store);
1153 1153
1154static int __init topology_init(void) 1154static int __init topology_init(void)
@@ -1159,11 +1159,11 @@ static int __init topology_init(void)
1159 register_cpu_notifier(&smp_cpu_nb); 1159 register_cpu_notifier(&smp_cpu_nb);
1160 1160
1161#ifdef CONFIG_HOTPLUG_CPU 1161#ifdef CONFIG_HOTPLUG_CPU
1162 rc = sysdev_class_create_file(&cpu_sysdev_class, &attr_rescan); 1162 rc = device_create_file(cpu_subsys.dev_root, &dev_attr_rescan);
1163 if (rc) 1163 if (rc)
1164 return rc; 1164 return rc;
1165#endif 1165#endif
1166 rc = sysdev_class_create_file(&cpu_sysdev_class, &attr_dispatching); 1166 rc = device_create_file(cpu_subsys.dev_root, &dev_attr_dispatching);
1167 if (rc) 1167 if (rc)
1168 return rc; 1168 return rc;
1169 for_each_present_cpu(cpu) { 1169 for_each_present_cpu(cpu) {
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index ebbfab3c6e5a..fa02f443f5f6 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -27,7 +27,7 @@
27#include <linux/cpu.h> 27#include <linux/cpu.h>
28#include <linux/stop_machine.h> 28#include <linux/stop_machine.h>
29#include <linux/time.h> 29#include <linux/time.h>
30#include <linux/sysdev.h> 30#include <linux/device.h>
31#include <linux/delay.h> 31#include <linux/delay.h>
32#include <linux/init.h> 32#include <linux/init.h>
33#include <linux/smp.h> 33#include <linux/smp.h>
@@ -1116,34 +1116,35 @@ out_unlock:
1116/* 1116/*
1117 * Sysfs interface functions 1117 * Sysfs interface functions
1118 */ 1118 */
1119static struct sysdev_class etr_sysclass = { 1119static struct bus_type etr_subsys = {
1120 .name = "etr", 1120 .name = "etr",
1121 .dev_name = "etr",
1121}; 1122};
1122 1123
1123static struct sys_device etr_port0_dev = { 1124static struct device etr_port0_dev = {
1124 .id = 0, 1125 .id = 0,
1125 .cls = &etr_sysclass, 1126 .bus = &etr_subsys,
1126}; 1127};
1127 1128
1128static struct sys_device etr_port1_dev = { 1129static struct device etr_port1_dev = {
1129 .id = 1, 1130 .id = 1,
1130 .cls = &etr_sysclass, 1131 .bus = &etr_subsys,
1131}; 1132};
1132 1133
1133/* 1134/*
1134 * ETR class attributes 1135 * ETR subsys attributes
1135 */ 1136 */
1136static ssize_t etr_stepping_port_show(struct sysdev_class *class, 1137static ssize_t etr_stepping_port_show(struct device *dev,
1137 struct sysdev_class_attribute *attr, 1138 struct device_attribute *attr,
1138 char *buf) 1139 char *buf)
1139{ 1140{
1140 return sprintf(buf, "%i\n", etr_port0.esw.p); 1141 return sprintf(buf, "%i\n", etr_port0.esw.p);
1141} 1142}
1142 1143
1143static SYSDEV_CLASS_ATTR(stepping_port, 0400, etr_stepping_port_show, NULL); 1144static DEVICE_ATTR(stepping_port, 0400, etr_stepping_port_show, NULL);
1144 1145
1145static ssize_t etr_stepping_mode_show(struct sysdev_class *class, 1146static ssize_t etr_stepping_mode_show(struct device *dev,
1146 struct sysdev_class_attribute *attr, 1147 struct device_attribute *attr,
1147 char *buf) 1148 char *buf)
1148{ 1149{
1149 char *mode_str; 1150 char *mode_str;
@@ -1157,12 +1158,12 @@ static ssize_t etr_stepping_mode_show(struct sysdev_class *class,
1157 return sprintf(buf, "%s\n", mode_str); 1158 return sprintf(buf, "%s\n", mode_str);
1158} 1159}
1159 1160
1160static SYSDEV_CLASS_ATTR(stepping_mode, 0400, etr_stepping_mode_show, NULL); 1161static DEVICE_ATTR(stepping_mode, 0400, etr_stepping_mode_show, NULL);
1161 1162
1162/* 1163/*
1163 * ETR port attributes 1164 * ETR port attributes
1164 */ 1165 */
1165static inline struct etr_aib *etr_aib_from_dev(struct sys_device *dev) 1166static inline struct etr_aib *etr_aib_from_dev(struct device *dev)
1166{ 1167{
1167 if (dev == &etr_port0_dev) 1168 if (dev == &etr_port0_dev)
1168 return etr_port0_online ? &etr_port0 : NULL; 1169 return etr_port0_online ? &etr_port0 : NULL;
@@ -1170,8 +1171,8 @@ static inline struct etr_aib *etr_aib_from_dev(struct sys_device *dev)
1170 return etr_port1_online ? &etr_port1 : NULL; 1171 return etr_port1_online ? &etr_port1 : NULL;
1171} 1172}
1172 1173
1173static ssize_t etr_online_show(struct sys_device *dev, 1174static ssize_t etr_online_show(struct device *dev,
1174 struct sysdev_attribute *attr, 1175 struct device_attribute *attr,
1175 char *buf) 1176 char *buf)
1176{ 1177{
1177 unsigned int online; 1178 unsigned int online;
@@ -1180,8 +1181,8 @@ static ssize_t etr_online_show(struct sys_device *dev,
1180 return sprintf(buf, "%i\n", online); 1181 return sprintf(buf, "%i\n", online);
1181} 1182}
1182 1183
1183static ssize_t etr_online_store(struct sys_device *dev, 1184static ssize_t etr_online_store(struct device *dev,
1184 struct sysdev_attribute *attr, 1185 struct device_attribute *attr,
1185 const char *buf, size_t count) 1186 const char *buf, size_t count)
1186{ 1187{
1187 unsigned int value; 1188 unsigned int value;
@@ -1218,20 +1219,20 @@ out:
1218 return count; 1219 return count;
1219} 1220}
1220 1221
1221static SYSDEV_ATTR(online, 0600, etr_online_show, etr_online_store); 1222static DEVICE_ATTR(online, 0600, etr_online_show, etr_online_store);
1222 1223
1223static ssize_t etr_stepping_control_show(struct sys_device *dev, 1224static ssize_t etr_stepping_control_show(struct device *dev,
1224 struct sysdev_attribute *attr, 1225 struct device_attribute *attr,
1225 char *buf) 1226 char *buf)
1226{ 1227{
1227 return sprintf(buf, "%i\n", (dev == &etr_port0_dev) ? 1228 return sprintf(buf, "%i\n", (dev == &etr_port0_dev) ?
1228 etr_eacr.e0 : etr_eacr.e1); 1229 etr_eacr.e0 : etr_eacr.e1);
1229} 1230}
1230 1231
1231static SYSDEV_ATTR(stepping_control, 0400, etr_stepping_control_show, NULL); 1232static DEVICE_ATTR(stepping_control, 0400, etr_stepping_control_show, NULL);
1232 1233
1233static ssize_t etr_mode_code_show(struct sys_device *dev, 1234static ssize_t etr_mode_code_show(struct device *dev,
1234 struct sysdev_attribute *attr, char *buf) 1235 struct device_attribute *attr, char *buf)
1235{ 1236{
1236 if (!etr_port0_online && !etr_port1_online) 1237 if (!etr_port0_online && !etr_port1_online)
1237 /* Status word is not uptodate if both ports are offline. */ 1238 /* Status word is not uptodate if both ports are offline. */
@@ -1240,10 +1241,10 @@ static ssize_t etr_mode_code_show(struct sys_device *dev,
1240 etr_port0.esw.psc0 : etr_port0.esw.psc1); 1241 etr_port0.esw.psc0 : etr_port0.esw.psc1);
1241} 1242}
1242 1243
1243static SYSDEV_ATTR(state_code, 0400, etr_mode_code_show, NULL); 1244static DEVICE_ATTR(state_code, 0400, etr_mode_code_show, NULL);
1244 1245
1245static ssize_t etr_untuned_show(struct sys_device *dev, 1246static ssize_t etr_untuned_show(struct device *dev,
1246 struct sysdev_attribute *attr, char *buf) 1247 struct device_attribute *attr, char *buf)
1247{ 1248{
1248 struct etr_aib *aib = etr_aib_from_dev(dev); 1249 struct etr_aib *aib = etr_aib_from_dev(dev);
1249 1250
@@ -1252,10 +1253,10 @@ static ssize_t etr_untuned_show(struct sys_device *dev,
1252 return sprintf(buf, "%i\n", aib->edf1.u); 1253 return sprintf(buf, "%i\n", aib->edf1.u);
1253} 1254}
1254 1255
1255static SYSDEV_ATTR(untuned, 0400, etr_untuned_show, NULL); 1256static DEVICE_ATTR(untuned, 0400, etr_untuned_show, NULL);
1256 1257
1257static ssize_t etr_network_id_show(struct sys_device *dev, 1258static ssize_t etr_network_id_show(struct device *dev,
1258 struct sysdev_attribute *attr, char *buf) 1259 struct device_attribute *attr, char *buf)
1259{ 1260{
1260 struct etr_aib *aib = etr_aib_from_dev(dev); 1261 struct etr_aib *aib = etr_aib_from_dev(dev);
1261 1262
@@ -1264,10 +1265,10 @@ static ssize_t etr_network_id_show(struct sys_device *dev,
1264 return sprintf(buf, "%i\n", aib->edf1.net_id); 1265 return sprintf(buf, "%i\n", aib->edf1.net_id);
1265} 1266}
1266 1267
1267static SYSDEV_ATTR(network, 0400, etr_network_id_show, NULL); 1268static DEVICE_ATTR(network, 0400, etr_network_id_show, NULL);
1268 1269
1269static ssize_t etr_id_show(struct sys_device *dev, 1270static ssize_t etr_id_show(struct device *dev,
1270 struct sysdev_attribute *attr, char *buf) 1271 struct device_attribute *attr, char *buf)
1271{ 1272{
1272 struct etr_aib *aib = etr_aib_from_dev(dev); 1273 struct etr_aib *aib = etr_aib_from_dev(dev);
1273 1274
@@ -1276,10 +1277,10 @@ static ssize_t etr_id_show(struct sys_device *dev,
1276 return sprintf(buf, "%i\n", aib->edf1.etr_id); 1277 return sprintf(buf, "%i\n", aib->edf1.etr_id);
1277} 1278}
1278 1279
1279static SYSDEV_ATTR(id, 0400, etr_id_show, NULL); 1280static DEVICE_ATTR(id, 0400, etr_id_show, NULL);
1280 1281
1281static ssize_t etr_port_number_show(struct sys_device *dev, 1282static ssize_t etr_port_number_show(struct device *dev,
1282 struct sysdev_attribute *attr, char *buf) 1283 struct device_attribute *attr, char *buf)
1283{ 1284{
1284 struct etr_aib *aib = etr_aib_from_dev(dev); 1285 struct etr_aib *aib = etr_aib_from_dev(dev);
1285 1286
@@ -1288,10 +1289,10 @@ static ssize_t etr_port_number_show(struct sys_device *dev,
1288 return sprintf(buf, "%i\n", aib->edf1.etr_pn); 1289 return sprintf(buf, "%i\n", aib->edf1.etr_pn);
1289} 1290}
1290 1291
1291static SYSDEV_ATTR(port, 0400, etr_port_number_show, NULL); 1292static DEVICE_ATTR(port, 0400, etr_port_number_show, NULL);
1292 1293
1293static ssize_t etr_coupled_show(struct sys_device *dev, 1294static ssize_t etr_coupled_show(struct device *dev,
1294 struct sysdev_attribute *attr, char *buf) 1295 struct device_attribute *attr, char *buf)
1295{ 1296{
1296 struct etr_aib *aib = etr_aib_from_dev(dev); 1297 struct etr_aib *aib = etr_aib_from_dev(dev);
1297 1298
@@ -1300,10 +1301,10 @@ static ssize_t etr_coupled_show(struct sys_device *dev,
1300 return sprintf(buf, "%i\n", aib->edf3.c); 1301 return sprintf(buf, "%i\n", aib->edf3.c);
1301} 1302}
1302 1303
1303static SYSDEV_ATTR(coupled, 0400, etr_coupled_show, NULL); 1304static DEVICE_ATTR(coupled, 0400, etr_coupled_show, NULL);
1304 1305
1305static ssize_t etr_local_time_show(struct sys_device *dev, 1306static ssize_t etr_local_time_show(struct device *dev,
1306 struct sysdev_attribute *attr, char *buf) 1307 struct device_attribute *attr, char *buf)
1307{ 1308{
1308 struct etr_aib *aib = etr_aib_from_dev(dev); 1309 struct etr_aib *aib = etr_aib_from_dev(dev);
1309 1310
@@ -1312,10 +1313,10 @@ static ssize_t etr_local_time_show(struct sys_device *dev,
1312 return sprintf(buf, "%i\n", aib->edf3.blto); 1313 return sprintf(buf, "%i\n", aib->edf3.blto);
1313} 1314}
1314 1315
1315static SYSDEV_ATTR(local_time, 0400, etr_local_time_show, NULL); 1316static DEVICE_ATTR(local_time, 0400, etr_local_time_show, NULL);
1316 1317
1317static ssize_t etr_utc_offset_show(struct sys_device *dev, 1318static ssize_t etr_utc_offset_show(struct device *dev,
1318 struct sysdev_attribute *attr, char *buf) 1319 struct device_attribute *attr, char *buf)
1319{ 1320{
1320 struct etr_aib *aib = etr_aib_from_dev(dev); 1321 struct etr_aib *aib = etr_aib_from_dev(dev);
1321 1322
@@ -1324,64 +1325,64 @@ static ssize_t etr_utc_offset_show(struct sys_device *dev,
1324 return sprintf(buf, "%i\n", aib->edf3.buo); 1325 return sprintf(buf, "%i\n", aib->edf3.buo);
1325} 1326}
1326 1327
1327static SYSDEV_ATTR(utc_offset, 0400, etr_utc_offset_show, NULL); 1328static DEVICE_ATTR(utc_offset, 0400, etr_utc_offset_show, NULL);
1328 1329
1329static struct sysdev_attribute *etr_port_attributes[] = { 1330static struct device_attribute *etr_port_attributes[] = {
1330 &attr_online, 1331 &dev_attr_online,
1331 &attr_stepping_control, 1332 &dev_attr_stepping_control,
1332 &attr_state_code, 1333 &dev_attr_state_code,
1333 &attr_untuned, 1334 &dev_attr_untuned,
1334 &attr_network, 1335 &dev_attr_network,
1335 &attr_id, 1336 &dev_attr_id,
1336 &attr_port, 1337 &dev_attr_port,
1337 &attr_coupled, 1338 &dev_attr_coupled,
1338 &attr_local_time, 1339 &dev_attr_local_time,
1339 &attr_utc_offset, 1340 &dev_attr_utc_offset,
1340 NULL 1341 NULL
1341}; 1342};
1342 1343
1343static int __init etr_register_port(struct sys_device *dev) 1344static int __init etr_register_port(struct device *dev)
1344{ 1345{
1345 struct sysdev_attribute **attr; 1346 struct device_attribute **attr;
1346 int rc; 1347 int rc;
1347 1348
1348 rc = sysdev_register(dev); 1349 rc = device_register(dev);
1349 if (rc) 1350 if (rc)
1350 goto out; 1351 goto out;
1351 for (attr = etr_port_attributes; *attr; attr++) { 1352 for (attr = etr_port_attributes; *attr; attr++) {
1352 rc = sysdev_create_file(dev, *attr); 1353 rc = device_create_file(dev, *attr);
1353 if (rc) 1354 if (rc)
1354 goto out_unreg; 1355 goto out_unreg;
1355 } 1356 }
1356 return 0; 1357 return 0;
1357out_unreg: 1358out_unreg:
1358 for (; attr >= etr_port_attributes; attr--) 1359 for (; attr >= etr_port_attributes; attr--)
1359 sysdev_remove_file(dev, *attr); 1360 device_remove_file(dev, *attr);
1360 sysdev_unregister(dev); 1361 device_unregister(dev);
1361out: 1362out:
1362 return rc; 1363 return rc;
1363} 1364}
1364 1365
1365static void __init etr_unregister_port(struct sys_device *dev) 1366static void __init etr_unregister_port(struct device *dev)
1366{ 1367{
1367 struct sysdev_attribute **attr; 1368 struct device_attribute **attr;
1368 1369
1369 for (attr = etr_port_attributes; *attr; attr++) 1370 for (attr = etr_port_attributes; *attr; attr++)
1370 sysdev_remove_file(dev, *attr); 1371 device_remove_file(dev, *attr);
1371 sysdev_unregister(dev); 1372 device_unregister(dev);
1372} 1373}
1373 1374
1374static int __init etr_init_sysfs(void) 1375static int __init etr_init_sysfs(void)
1375{ 1376{
1376 int rc; 1377 int rc;
1377 1378
1378 rc = sysdev_class_register(&etr_sysclass); 1379 rc = subsys_system_register(&etr_subsys, NULL);
1379 if (rc) 1380 if (rc)
1380 goto out; 1381 goto out;
1381 rc = sysdev_class_create_file(&etr_sysclass, &attr_stepping_port); 1382 rc = device_create_file(etr_subsys.dev_root, &dev_attr_stepping_port);
1382 if (rc) 1383 if (rc)
1383 goto out_unreg_class; 1384 goto out_unreg_subsys;
1384 rc = sysdev_class_create_file(&etr_sysclass, &attr_stepping_mode); 1385 rc = device_create_file(etr_subsys.dev_root, &dev_attr_stepping_mode);
1385 if (rc) 1386 if (rc)
1386 goto out_remove_stepping_port; 1387 goto out_remove_stepping_port;
1387 rc = etr_register_port(&etr_port0_dev); 1388 rc = etr_register_port(&etr_port0_dev);
@@ -1395,11 +1396,11 @@ static int __init etr_init_sysfs(void)
1395out_remove_port0: 1396out_remove_port0:
1396 etr_unregister_port(&etr_port0_dev); 1397 etr_unregister_port(&etr_port0_dev);
1397out_remove_stepping_mode: 1398out_remove_stepping_mode:
1398 sysdev_class_remove_file(&etr_sysclass, &attr_stepping_mode); 1399 device_remove_file(etr_subsys.dev_root, &dev_attr_stepping_mode);
1399out_remove_stepping_port: 1400out_remove_stepping_port:
1400 sysdev_class_remove_file(&etr_sysclass, &attr_stepping_port); 1401 device_remove_file(etr_subsys.dev_root, &dev_attr_stepping_port);
1401out_unreg_class: 1402out_unreg_subsys:
1402 sysdev_class_unregister(&etr_sysclass); 1403 bus_unregister(&etr_subsys);
1403out: 1404out:
1404 return rc; 1405 return rc;
1405} 1406}
@@ -1599,14 +1600,15 @@ out_unlock:
1599} 1600}
1600 1601
1601/* 1602/*
1602 * STP class sysfs interface functions 1603 * STP subsys sysfs interface functions
1603 */ 1604 */
1604static struct sysdev_class stp_sysclass = { 1605static struct bus_type stp_subsys = {
1605 .name = "stp", 1606 .name = "stp",
1607 .dev_name = "stp",
1606}; 1608};
1607 1609
1608static ssize_t stp_ctn_id_show(struct sysdev_class *class, 1610static ssize_t stp_ctn_id_show(struct device *dev,
1609 struct sysdev_class_attribute *attr, 1611 struct device_attribute *attr,
1610 char *buf) 1612 char *buf)
1611{ 1613{
1612 if (!stp_online) 1614 if (!stp_online)
@@ -1615,10 +1617,10 @@ static ssize_t stp_ctn_id_show(struct sysdev_class *class,
1615 *(unsigned long long *) stp_info.ctnid); 1617 *(unsigned long long *) stp_info.ctnid);
1616} 1618}
1617 1619
1618static SYSDEV_CLASS_ATTR(ctn_id, 0400, stp_ctn_id_show, NULL); 1620static DEVICE_ATTR(ctn_id, 0400, stp_ctn_id_show, NULL);
1619 1621
1620static ssize_t stp_ctn_type_show(struct sysdev_class *class, 1622static ssize_t stp_ctn_type_show(struct device *dev,
1621 struct sysdev_class_attribute *attr, 1623 struct device_attribute *attr,
1622 char *buf) 1624 char *buf)
1623{ 1625{
1624 if (!stp_online) 1626 if (!stp_online)
@@ -1626,10 +1628,10 @@ static ssize_t stp_ctn_type_show(struct sysdev_class *class,
1626 return sprintf(buf, "%i\n", stp_info.ctn); 1628 return sprintf(buf, "%i\n", stp_info.ctn);
1627} 1629}
1628 1630
1629static SYSDEV_CLASS_ATTR(ctn_type, 0400, stp_ctn_type_show, NULL); 1631static DEVICE_ATTR(ctn_type, 0400, stp_ctn_type_show, NULL);
1630 1632
1631static ssize_t stp_dst_offset_show(struct sysdev_class *class, 1633static ssize_t stp_dst_offset_show(struct device *dev,
1632 struct sysdev_class_attribute *attr, 1634 struct device_attribute *attr,
1633 char *buf) 1635 char *buf)
1634{ 1636{
1635 if (!stp_online || !(stp_info.vbits & 0x2000)) 1637 if (!stp_online || !(stp_info.vbits & 0x2000))
@@ -1637,10 +1639,10 @@ static ssize_t stp_dst_offset_show(struct sysdev_class *class,
1637 return sprintf(buf, "%i\n", (int)(s16) stp_info.dsto); 1639 return sprintf(buf, "%i\n", (int)(s16) stp_info.dsto);
1638} 1640}
1639 1641
1640static SYSDEV_CLASS_ATTR(dst_offset, 0400, stp_dst_offset_show, NULL); 1642static DEVICE_ATTR(dst_offset, 0400, stp_dst_offset_show, NULL);
1641 1643
1642static ssize_t stp_leap_seconds_show(struct sysdev_class *class, 1644static ssize_t stp_leap_seconds_show(struct device *dev,
1643 struct sysdev_class_attribute *attr, 1645 struct device_attribute *attr,
1644 char *buf) 1646 char *buf)
1645{ 1647{
1646 if (!stp_online || !(stp_info.vbits & 0x8000)) 1648 if (!stp_online || !(stp_info.vbits & 0x8000))
@@ -1648,10 +1650,10 @@ static ssize_t stp_leap_seconds_show(struct sysdev_class *class,
1648 return sprintf(buf, "%i\n", (int)(s16) stp_info.leaps); 1650 return sprintf(buf, "%i\n", (int)(s16) stp_info.leaps);
1649} 1651}
1650 1652
1651static SYSDEV_CLASS_ATTR(leap_seconds, 0400, stp_leap_seconds_show, NULL); 1653static DEVICE_ATTR(leap_seconds, 0400, stp_leap_seconds_show, NULL);
1652 1654
1653static ssize_t stp_stratum_show(struct sysdev_class *class, 1655static ssize_t stp_stratum_show(struct device *dev,
1654 struct sysdev_class_attribute *attr, 1656 struct device_attribute *attr,
1655 char *buf) 1657 char *buf)
1656{ 1658{
1657 if (!stp_online) 1659 if (!stp_online)
@@ -1659,10 +1661,10 @@ static ssize_t stp_stratum_show(struct sysdev_class *class,
1659 return sprintf(buf, "%i\n", (int)(s16) stp_info.stratum); 1661 return sprintf(buf, "%i\n", (int)(s16) stp_info.stratum);
1660} 1662}
1661 1663
1662static SYSDEV_CLASS_ATTR(stratum, 0400, stp_stratum_show, NULL); 1664static DEVICE_ATTR(stratum, 0400, stp_stratum_show, NULL);
1663 1665
1664static ssize_t stp_time_offset_show(struct sysdev_class *class, 1666static ssize_t stp_time_offset_show(struct device *dev,
1665 struct sysdev_class_attribute *attr, 1667 struct device_attribute *attr,
1666 char *buf) 1668 char *buf)
1667{ 1669{
1668 if (!stp_online || !(stp_info.vbits & 0x0800)) 1670 if (!stp_online || !(stp_info.vbits & 0x0800))
@@ -1670,10 +1672,10 @@ static ssize_t stp_time_offset_show(struct sysdev_class *class,
1670 return sprintf(buf, "%i\n", (int) stp_info.tto); 1672 return sprintf(buf, "%i\n", (int) stp_info.tto);
1671} 1673}
1672 1674
1673static SYSDEV_CLASS_ATTR(time_offset, 0400, stp_time_offset_show, NULL); 1675static DEVICE_ATTR(time_offset, 0400, stp_time_offset_show, NULL);
1674 1676
1675static ssize_t stp_time_zone_offset_show(struct sysdev_class *class, 1677static ssize_t stp_time_zone_offset_show(struct device *dev,
1676 struct sysdev_class_attribute *attr, 1678 struct device_attribute *attr,
1677 char *buf) 1679 char *buf)
1678{ 1680{
1679 if (!stp_online || !(stp_info.vbits & 0x4000)) 1681 if (!stp_online || !(stp_info.vbits & 0x4000))
@@ -1681,11 +1683,11 @@ static ssize_t stp_time_zone_offset_show(struct sysdev_class *class,
1681 return sprintf(buf, "%i\n", (int)(s16) stp_info.tzo); 1683 return sprintf(buf, "%i\n", (int)(s16) stp_info.tzo);
1682} 1684}
1683 1685
1684static SYSDEV_CLASS_ATTR(time_zone_offset, 0400, 1686static DEVICE_ATTR(time_zone_offset, 0400,
1685 stp_time_zone_offset_show, NULL); 1687 stp_time_zone_offset_show, NULL);
1686 1688
1687static ssize_t stp_timing_mode_show(struct sysdev_class *class, 1689static ssize_t stp_timing_mode_show(struct device *dev,
1688 struct sysdev_class_attribute *attr, 1690 struct device_attribute *attr,
1689 char *buf) 1691 char *buf)
1690{ 1692{
1691 if (!stp_online) 1693 if (!stp_online)
@@ -1693,10 +1695,10 @@ static ssize_t stp_timing_mode_show(struct sysdev_class *class,
1693 return sprintf(buf, "%i\n", stp_info.tmd); 1695 return sprintf(buf, "%i\n", stp_info.tmd);
1694} 1696}
1695 1697
1696static SYSDEV_CLASS_ATTR(timing_mode, 0400, stp_timing_mode_show, NULL); 1698static DEVICE_ATTR(timing_mode, 0400, stp_timing_mode_show, NULL);
1697 1699
1698static ssize_t stp_timing_state_show(struct sysdev_class *class, 1700static ssize_t stp_timing_state_show(struct device *dev,
1699 struct sysdev_class_attribute *attr, 1701 struct device_attribute *attr,
1700 char *buf) 1702 char *buf)
1701{ 1703{
1702 if (!stp_online) 1704 if (!stp_online)
@@ -1704,17 +1706,17 @@ static ssize_t stp_timing_state_show(struct sysdev_class *class,
1704 return sprintf(buf, "%i\n", stp_info.tst); 1706 return sprintf(buf, "%i\n", stp_info.tst);
1705} 1707}
1706 1708
1707static SYSDEV_CLASS_ATTR(timing_state, 0400, stp_timing_state_show, NULL); 1709static DEVICE_ATTR(timing_state, 0400, stp_timing_state_show, NULL);
1708 1710
1709static ssize_t stp_online_show(struct sysdev_class *class, 1711static ssize_t stp_online_show(struct device *dev,
1710 struct sysdev_class_attribute *attr, 1712 struct device_attribute *attr,
1711 char *buf) 1713 char *buf)
1712{ 1714{
1713 return sprintf(buf, "%i\n", stp_online); 1715 return sprintf(buf, "%i\n", stp_online);
1714} 1716}
1715 1717
1716static ssize_t stp_online_store(struct sysdev_class *class, 1718static ssize_t stp_online_store(struct device *dev,
1717 struct sysdev_class_attribute *attr, 1719 struct device_attribute *attr,
1718 const char *buf, size_t count) 1720 const char *buf, size_t count)
1719{ 1721{
1720 unsigned int value; 1722 unsigned int value;
@@ -1736,47 +1738,47 @@ static ssize_t stp_online_store(struct sysdev_class *class,
1736} 1738}
1737 1739
1738/* 1740/*
1739 * Can't use SYSDEV_CLASS_ATTR because the attribute should be named 1741 * Can't use DEVICE_ATTR because the attribute should be named
1740 * stp/online but attr_online already exists in this file .. 1742 * stp/online but dev_attr_online already exists in this file ..
1741 */ 1743 */
1742static struct sysdev_class_attribute attr_stp_online = { 1744static struct device_attribute dev_attr_stp_online = {
1743 .attr = { .name = "online", .mode = 0600 }, 1745 .attr = { .name = "online", .mode = 0600 },
1744 .show = stp_online_show, 1746 .show = stp_online_show,
1745 .store = stp_online_store, 1747 .store = stp_online_store,
1746}; 1748};
1747 1749
1748static struct sysdev_class_attribute *stp_attributes[] = { 1750static struct device_attribute *stp_attributes[] = {
1749 &attr_ctn_id, 1751 &dev_attr_ctn_id,
1750 &attr_ctn_type, 1752 &dev_attr_ctn_type,
1751 &attr_dst_offset, 1753 &dev_attr_dst_offset,
1752 &attr_leap_seconds, 1754 &dev_attr_leap_seconds,
1753 &attr_stp_online, 1755 &dev_attr_stp_online,
1754 &attr_stratum, 1756 &dev_attr_stratum,
1755 &attr_time_offset, 1757 &dev_attr_time_offset,
1756 &attr_time_zone_offset, 1758 &dev_attr_time_zone_offset,
1757 &attr_timing_mode, 1759 &dev_attr_timing_mode,
1758 &attr_timing_state, 1760 &dev_attr_timing_state,
1759 NULL 1761 NULL
1760}; 1762};
1761 1763
1762static int __init stp_init_sysfs(void) 1764static int __init stp_init_sysfs(void)
1763{ 1765{
1764 struct sysdev_class_attribute **attr; 1766 struct device_attribute **attr;
1765 int rc; 1767 int rc;
1766 1768
1767 rc = sysdev_class_register(&stp_sysclass); 1769 rc = subsys_system_register(&stp_subsys, NULL);
1768 if (rc) 1770 if (rc)
1769 goto out; 1771 goto out;
1770 for (attr = stp_attributes; *attr; attr++) { 1772 for (attr = stp_attributes; *attr; attr++) {
1771 rc = sysdev_class_create_file(&stp_sysclass, *attr); 1773 rc = device_create_file(stp_subsys.dev_root, *attr);
1772 if (rc) 1774 if (rc)
1773 goto out_unreg; 1775 goto out_unreg;
1774 } 1776 }
1775 return 0; 1777 return 0;
1776out_unreg: 1778out_unreg:
1777 for (; attr >= stp_attributes; attr--) 1779 for (; attr >= stp_attributes; attr--)
1778 sysdev_class_remove_file(&stp_sysclass, *attr); 1780 device_remove_file(stp_subsys.dev_root, *attr);
1779 sysdev_class_unregister(&stp_sysclass); 1781 bus_unregister(&stp_subsys);
1780out: 1782out:
1781 return rc; 1783 return rc;
1782} 1784}
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c
index fdb5b8cb260f..6e0e29b29a7b 100644
--- a/arch/s390/kernel/topology.c
+++ b/arch/s390/kernel/topology.c
@@ -261,7 +261,7 @@ void store_topology(struct sysinfo_15_1_x *info)
261int arch_update_cpu_topology(void) 261int arch_update_cpu_topology(void)
262{ 262{
263 struct sysinfo_15_1_x *info = tl_info; 263 struct sysinfo_15_1_x *info = tl_info;
264 struct sys_device *sysdev; 264 struct device *dev;
265 int cpu; 265 int cpu;
266 266
267 if (!MACHINE_HAS_TOPOLOGY) { 267 if (!MACHINE_HAS_TOPOLOGY) {
@@ -273,8 +273,8 @@ int arch_update_cpu_topology(void)
273 tl_to_cores(info); 273 tl_to_cores(info);
274 update_cpu_core_map(); 274 update_cpu_core_map();
275 for_each_online_cpu(cpu) { 275 for_each_online_cpu(cpu) {
276 sysdev = get_cpu_sysdev(cpu); 276 dev = get_cpu_device(cpu);
277 kobject_uevent(&sysdev->kobj, KOBJ_CHANGE); 277 kobject_uevent(&dev->kobj, KOBJ_CHANGE);
278 } 278 }
279 return 1; 279 return 1;
280} 280}
diff --git a/arch/sh/drivers/dma/dma-sysfs.c b/arch/sh/drivers/dma/dma-sysfs.c
index 83cc704770d7..b1cb2715ad6e 100644
--- a/arch/sh/drivers/dma/dma-sysfs.c
+++ b/arch/sh/drivers/dma/dma-sysfs.c
@@ -12,18 +12,19 @@
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/stat.h> 14#include <linux/stat.h>
15#include <linux/sysdev.h> 15#include <linux/device.h>
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/err.h> 17#include <linux/err.h>
18#include <linux/string.h> 18#include <linux/string.h>
19#include <asm/dma.h> 19#include <asm/dma.h>
20 20
21static struct sysdev_class dma_sysclass = { 21static struct bus_type dma_subsys = {
22 .name = "dma", 22 .name = "dma",
23 .dev_name = "dma",
23}; 24};
24 25
25static ssize_t dma_show_devices(struct sys_device *dev, 26static ssize_t dma_show_devices(struct device *dev,
26 struct sysdev_attribute *attr, char *buf) 27 struct device_attribute *attr, char *buf)
27{ 28{
28 ssize_t len = 0; 29 ssize_t len = 0;
29 int i; 30 int i;
@@ -43,29 +44,29 @@ static ssize_t dma_show_devices(struct sys_device *dev,
43 return len; 44 return len;
44} 45}
45 46
46static SYSDEV_ATTR(devices, S_IRUGO, dma_show_devices, NULL); 47static DEVICE_ATTR(devices, S_IRUGO, dma_show_devices, NULL);
47 48
48static int __init dma_sysclass_init(void) 49static int __init dma_subsys_init(void)
49{ 50{
50 int ret; 51 int ret;
51 52
52 ret = sysdev_class_register(&dma_sysclass); 53 ret = subsys_system_register(&dma_subsys, NULL);
53 if (unlikely(ret)) 54 if (unlikely(ret))
54 return ret; 55 return ret;
55 56
56 return sysfs_create_file(&dma_sysclass.kset.kobj, &attr_devices.attr); 57 return device_create_file(dma_subsys.dev_root, &dev_attr_devices.attr);
57} 58}
58postcore_initcall(dma_sysclass_init); 59postcore_initcall(dma_subsys_init);
59 60
60static ssize_t dma_show_dev_id(struct sys_device *dev, 61static ssize_t dma_show_dev_id(struct device *dev,
61 struct sysdev_attribute *attr, char *buf) 62 struct device_attribute *attr, char *buf)
62{ 63{
63 struct dma_channel *channel = to_dma_channel(dev); 64 struct dma_channel *channel = to_dma_channel(dev);
64 return sprintf(buf, "%s\n", channel->dev_id); 65 return sprintf(buf, "%s\n", channel->dev_id);
65} 66}
66 67
67static ssize_t dma_store_dev_id(struct sys_device *dev, 68static ssize_t dma_store_dev_id(struct device *dev,
68 struct sysdev_attribute *attr, 69 struct device_attribute *attr,
69 const char *buf, size_t count) 70 const char *buf, size_t count)
70{ 71{
71 struct dma_channel *channel = to_dma_channel(dev); 72 struct dma_channel *channel = to_dma_channel(dev);
@@ -73,10 +74,10 @@ static ssize_t dma_store_dev_id(struct sys_device *dev,
73 return count; 74 return count;
74} 75}
75 76
76static SYSDEV_ATTR(dev_id, S_IRUGO | S_IWUSR, dma_show_dev_id, dma_store_dev_id); 77static DEVICE_ATTR(dev_id, S_IRUGO | S_IWUSR, dma_show_dev_id, dma_store_dev_id);
77 78
78static ssize_t dma_store_config(struct sys_device *dev, 79static ssize_t dma_store_config(struct device *dev,
79 struct sysdev_attribute *attr, 80 struct device_attribute *attr,
80 const char *buf, size_t count) 81 const char *buf, size_t count)
81{ 82{
82 struct dma_channel *channel = to_dma_channel(dev); 83 struct dma_channel *channel = to_dma_channel(dev);
@@ -88,17 +89,17 @@ static ssize_t dma_store_config(struct sys_device *dev,
88 return count; 89 return count;
89} 90}
90 91
91static SYSDEV_ATTR(config, S_IWUSR, NULL, dma_store_config); 92static DEVICE_ATTR(config, S_IWUSR, NULL, dma_store_config);
92 93
93static ssize_t dma_show_mode(struct sys_device *dev, 94static ssize_t dma_show_mode(struct device *dev,
94 struct sysdev_attribute *attr, char *buf) 95 struct device_attribute *attr, char *buf)
95{ 96{
96 struct dma_channel *channel = to_dma_channel(dev); 97 struct dma_channel *channel = to_dma_channel(dev);
97 return sprintf(buf, "0x%08x\n", channel->mode); 98 return sprintf(buf, "0x%08x\n", channel->mode);
98} 99}
99 100
100static ssize_t dma_store_mode(struct sys_device *dev, 101static ssize_t dma_store_mode(struct device *dev,
101 struct sysdev_attribute *attr, 102 struct device_attribute *attr,
102 const char *buf, size_t count) 103 const char *buf, size_t count)
103{ 104{
104 struct dma_channel *channel = to_dma_channel(dev); 105 struct dma_channel *channel = to_dma_channel(dev);
@@ -106,38 +107,38 @@ static ssize_t dma_store_mode(struct sys_device *dev,
106 return count; 107 return count;
107} 108}
108 109
109static SYSDEV_ATTR(mode, S_IRUGO | S_IWUSR, dma_show_mode, dma_store_mode); 110static DEVICE_ATTR(mode, S_IRUGO | S_IWUSR, dma_show_mode, dma_store_mode);
110 111
111#define dma_ro_attr(field, fmt) \ 112#define dma_ro_attr(field, fmt) \
112static ssize_t dma_show_##field(struct sys_device *dev, \ 113static ssize_t dma_show_##field(struct device *dev, \
113 struct sysdev_attribute *attr, char *buf)\ 114 struct device_attribute *attr, char *buf)\
114{ \ 115{ \
115 struct dma_channel *channel = to_dma_channel(dev); \ 116 struct dma_channel *channel = to_dma_channel(dev); \
116 return sprintf(buf, fmt, channel->field); \ 117 return sprintf(buf, fmt, channel->field); \
117} \ 118} \
118static SYSDEV_ATTR(field, S_IRUGO, dma_show_##field, NULL); 119static DEVICE_ATTR(field, S_IRUGO, dma_show_##field, NULL);
119 120
120dma_ro_attr(count, "0x%08x\n"); 121dma_ro_attr(count, "0x%08x\n");
121dma_ro_attr(flags, "0x%08lx\n"); 122dma_ro_attr(flags, "0x%08lx\n");
122 123
123int dma_create_sysfs_files(struct dma_channel *chan, struct dma_info *info) 124int dma_create_sysfs_files(struct dma_channel *chan, struct dma_info *info)
124{ 125{
125 struct sys_device *dev = &chan->dev; 126 struct device *dev = &chan->dev;
126 char name[16]; 127 char name[16];
127 int ret; 128 int ret;
128 129
129 dev->id = chan->vchan; 130 dev->id = chan->vchan;
130 dev->cls = &dma_sysclass; 131 dev->bus = &dma_subsys;
131 132
132 ret = sysdev_register(dev); 133 ret = device_register(dev);
133 if (ret) 134 if (ret)
134 return ret; 135 return ret;
135 136
136 ret |= sysdev_create_file(dev, &attr_dev_id); 137 ret |= device_create_file(dev, &dev_attr_dev_id);
137 ret |= sysdev_create_file(dev, &attr_count); 138 ret |= device_create_file(dev, &dev_attr_count);
138 ret |= sysdev_create_file(dev, &attr_mode); 139 ret |= device_create_file(dev, &dev_attr_mode);
139 ret |= sysdev_create_file(dev, &attr_flags); 140 ret |= device_create_file(dev, &dev_attr_flags);
140 ret |= sysdev_create_file(dev, &attr_config); 141 ret |= device_create_file(dev, &dev_attr_config);
141 142
142 if (unlikely(ret)) { 143 if (unlikely(ret)) {
143 dev_err(&info->pdev->dev, "Failed creating attrs\n"); 144 dev_err(&info->pdev->dev, "Failed creating attrs\n");
@@ -150,17 +151,17 @@ int dma_create_sysfs_files(struct dma_channel *chan, struct dma_info *info)
150 151
151void dma_remove_sysfs_files(struct dma_channel *chan, struct dma_info *info) 152void dma_remove_sysfs_files(struct dma_channel *chan, struct dma_info *info)
152{ 153{
153 struct sys_device *dev = &chan->dev; 154 struct device *dev = &chan->dev;
154 char name[16]; 155 char name[16];
155 156
156 sysdev_remove_file(dev, &attr_dev_id); 157 device_remove_file(dev, &dev_attr_dev_id);
157 sysdev_remove_file(dev, &attr_count); 158 device_remove_file(dev, &dev_attr_count);
158 sysdev_remove_file(dev, &attr_mode); 159 device_remove_file(dev, &dev_attr_mode);
159 sysdev_remove_file(dev, &attr_flags); 160 device_remove_file(dev, &dev_attr_flags);
160 sysdev_remove_file(dev, &attr_config); 161 device_remove_file(dev, &dev_attr_config);
161 162
162 snprintf(name, sizeof(name), "dma%d", chan->chan); 163 snprintf(name, sizeof(name), "dma%d", chan->chan);
163 sysfs_remove_link(&info->pdev->dev.kobj, name); 164 sysfs_remove_link(&info->pdev->dev.kobj, name);
164 165
165 sysdev_unregister(dev); 166 device_unregister(dev);
166} 167}
diff --git a/arch/sh/include/asm/dma.h b/arch/sh/include/asm/dma.h
index 07373a074090..6aa2080c0065 100644
--- a/arch/sh/include/asm/dma.h
+++ b/arch/sh/include/asm/dma.h
@@ -14,7 +14,7 @@
14#include <linux/spinlock.h> 14#include <linux/spinlock.h>
15#include <linux/wait.h> 15#include <linux/wait.h>
16#include <linux/sched.h> 16#include <linux/sched.h>
17#include <linux/sysdev.h> 17#include <linux/device.h>
18#include <cpu/dma.h> 18#include <cpu/dma.h>
19#include <asm-generic/dma.h> 19#include <asm-generic/dma.h>
20 20
@@ -91,7 +91,7 @@ struct dma_channel {
91 91
92 wait_queue_head_t wait_queue; 92 wait_queue_head_t wait_queue;
93 93
94 struct sys_device dev; 94 struct device dev;
95 void *priv_data; 95 void *priv_data;
96}; 96};
97 97
diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c
index f0907995b4c9..a8140f0bbf6c 100644
--- a/arch/sh/kernel/cpu/sh4/sq.c
+++ b/arch/sh/kernel/cpu/sh4/sq.c
@@ -13,7 +13,7 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/cpu.h> 14#include <linux/cpu.h>
15#include <linux/bitmap.h> 15#include <linux/bitmap.h>
16#include <linux/sysdev.h> 16#include <linux/device.h>
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
@@ -337,9 +337,9 @@ static struct kobj_type ktype_percpu_entry = {
337 .default_attrs = sq_sysfs_attrs, 337 .default_attrs = sq_sysfs_attrs,
338}; 338};
339 339
340static int __devinit sq_sysdev_add(struct sys_device *sysdev) 340static int __devinit sq_dev_add(struct device *dev)
341{ 341{
342 unsigned int cpu = sysdev->id; 342 unsigned int cpu = dev->id;
343 struct kobject *kobj; 343 struct kobject *kobj;
344 int error; 344 int error;
345 345
@@ -348,25 +348,27 @@ static int __devinit sq_sysdev_add(struct sys_device *sysdev)
348 return -ENOMEM; 348 return -ENOMEM;
349 349
350 kobj = sq_kobject[cpu]; 350 kobj = sq_kobject[cpu];
351 error = kobject_init_and_add(kobj, &ktype_percpu_entry, &sysdev->kobj, 351 error = kobject_init_and_add(kobj, &ktype_percpu_entry, &dev->kobj,
352 "%s", "sq"); 352 "%s", "sq");
353 if (!error) 353 if (!error)
354 kobject_uevent(kobj, KOBJ_ADD); 354 kobject_uevent(kobj, KOBJ_ADD);
355 return error; 355 return error;
356} 356}
357 357
358static int __devexit sq_sysdev_remove(struct sys_device *sysdev) 358static int __devexit sq_dev_remove(struct device *dev)
359{ 359{
360 unsigned int cpu = sysdev->id; 360 unsigned int cpu = dev->id;
361 struct kobject *kobj = sq_kobject[cpu]; 361 struct kobject *kobj = sq_kobject[cpu];
362 362
363 kobject_put(kobj); 363 kobject_put(kobj);
364 return 0; 364 return 0;
365} 365}
366 366
367static struct sysdev_driver sq_sysdev_driver = { 367static struct subsys_interface sq_interface = {
368 .add = sq_sysdev_add, 368 .name = "sq"
369 .remove = __devexit_p(sq_sysdev_remove), 369 .subsys = &cpu_subsys,
370 .add_dev = sq_dev_add,
371 .remove_dev = __devexit_p(sq_dev_remove),
370}; 372};
371 373
372static int __init sq_api_init(void) 374static int __init sq_api_init(void)
@@ -386,7 +388,7 @@ static int __init sq_api_init(void)
386 if (unlikely(!sq_bitmap)) 388 if (unlikely(!sq_bitmap))
387 goto out; 389 goto out;
388 390
389 ret = sysdev_driver_register(&cpu_sysdev_class, &sq_sysdev_driver); 391 ret = subsys_interface_register(&sq_interface);
390 if (unlikely(ret != 0)) 392 if (unlikely(ret != 0))
391 goto out; 393 goto out;
392 394
@@ -401,7 +403,7 @@ out:
401 403
402static void __exit sq_api_exit(void) 404static void __exit sq_api_exit(void)
403{ 405{
404 sysdev_driver_unregister(&cpu_sysdev_class, &sq_sysdev_driver); 406 subsys_interface_unregister(&sq_interface);
405 kfree(sq_bitmap); 407 kfree(sq_bitmap);
406 kmem_cache_destroy(sq_cache); 408 kmem_cache_destroy(sq_cache);
407} 409}
diff --git a/arch/sparc/kernel/sysfs.c b/arch/sparc/kernel/sysfs.c
index 7408201d7efb..654e8aad3bbe 100644
--- a/arch/sparc/kernel/sysfs.c
+++ b/arch/sparc/kernel/sysfs.c
@@ -3,7 +3,7 @@
3 * Copyright (C) 2007 David S. Miller <davem@davemloft.net> 3 * Copyright (C) 2007 David S. Miller <davem@davemloft.net>
4 */ 4 */
5#include <linux/sched.h> 5#include <linux/sched.h>
6#include <linux/sysdev.h> 6#include <linux/device.h>
7#include <linux/cpu.h> 7#include <linux/cpu.h>
8#include <linux/smp.h> 8#include <linux/smp.h>
9#include <linux/percpu.h> 9#include <linux/percpu.h>
@@ -16,13 +16,13 @@
16static DEFINE_PER_CPU(struct hv_mmu_statistics, mmu_stats) __attribute__((aligned(64))); 16static DEFINE_PER_CPU(struct hv_mmu_statistics, mmu_stats) __attribute__((aligned(64)));
17 17
18#define SHOW_MMUSTAT_ULONG(NAME) \ 18#define SHOW_MMUSTAT_ULONG(NAME) \
19static ssize_t show_##NAME(struct sys_device *dev, \ 19static ssize_t show_##NAME(struct device *dev, \
20 struct sysdev_attribute *attr, char *buf) \ 20 struct device_attribute *attr, char *buf) \
21{ \ 21{ \
22 struct hv_mmu_statistics *p = &per_cpu(mmu_stats, dev->id); \ 22 struct hv_mmu_statistics *p = &per_cpu(mmu_stats, dev->id); \
23 return sprintf(buf, "%lu\n", p->NAME); \ 23 return sprintf(buf, "%lu\n", p->NAME); \
24} \ 24} \
25static SYSDEV_ATTR(NAME, 0444, show_##NAME, NULL) 25static DEVICE_ATTR(NAME, 0444, show_##NAME, NULL)
26 26
27SHOW_MMUSTAT_ULONG(immu_tsb_hits_ctx0_8k_tte); 27SHOW_MMUSTAT_ULONG(immu_tsb_hits_ctx0_8k_tte);
28SHOW_MMUSTAT_ULONG(immu_tsb_ticks_ctx0_8k_tte); 28SHOW_MMUSTAT_ULONG(immu_tsb_ticks_ctx0_8k_tte);
@@ -58,38 +58,38 @@ SHOW_MMUSTAT_ULONG(dmmu_tsb_hits_ctxnon0_256mb_tte);
58SHOW_MMUSTAT_ULONG(dmmu_tsb_ticks_ctxnon0_256mb_tte); 58SHOW_MMUSTAT_ULONG(dmmu_tsb_ticks_ctxnon0_256mb_tte);
59 59
60static struct attribute *mmu_stat_attrs[] = { 60static struct attribute *mmu_stat_attrs[] = {
61 &attr_immu_tsb_hits_ctx0_8k_tte.attr, 61 &dev_attr_immu_tsb_hits_ctx0_8k_tte.attr,
62 &attr_immu_tsb_ticks_ctx0_8k_tte.attr, 62 &dev_attr_immu_tsb_ticks_ctx0_8k_tte.attr,
63 &attr_immu_tsb_hits_ctx0_64k_tte.attr, 63 &dev_attr_immu_tsb_hits_ctx0_64k_tte.attr,
64 &attr_immu_tsb_ticks_ctx0_64k_tte.attr, 64 &dev_attr_immu_tsb_ticks_ctx0_64k_tte.attr,
65 &attr_immu_tsb_hits_ctx0_4mb_tte.attr, 65 &dev_attr_immu_tsb_hits_ctx0_4mb_tte.attr,
66 &attr_immu_tsb_ticks_ctx0_4mb_tte.attr, 66 &dev_attr_immu_tsb_ticks_ctx0_4mb_tte.attr,
67 &attr_immu_tsb_hits_ctx0_256mb_tte.attr, 67 &dev_attr_immu_tsb_hits_ctx0_256mb_tte.attr,
68 &attr_immu_tsb_ticks_ctx0_256mb_tte.attr, 68 &dev_attr_immu_tsb_ticks_ctx0_256mb_tte.attr,
69 &attr_immu_tsb_hits_ctxnon0_8k_tte.attr, 69 &dev_attr_immu_tsb_hits_ctxnon0_8k_tte.attr,
70 &attr_immu_tsb_ticks_ctxnon0_8k_tte.attr, 70 &dev_attr_immu_tsb_ticks_ctxnon0_8k_tte.attr,
71 &attr_immu_tsb_hits_ctxnon0_64k_tte.attr, 71 &dev_attr_immu_tsb_hits_ctxnon0_64k_tte.attr,
72 &attr_immu_tsb_ticks_ctxnon0_64k_tte.attr, 72 &dev_attr_immu_tsb_ticks_ctxnon0_64k_tte.attr,
73 &attr_immu_tsb_hits_ctxnon0_4mb_tte.attr, 73 &dev_attr_immu_tsb_hits_ctxnon0_4mb_tte.attr,
74 &attr_immu_tsb_ticks_ctxnon0_4mb_tte.attr, 74 &dev_attr_immu_tsb_ticks_ctxnon0_4mb_tte.attr,
75 &attr_immu_tsb_hits_ctxnon0_256mb_tte.attr, 75 &dev_attr_immu_tsb_hits_ctxnon0_256mb_tte.attr,
76 &attr_immu_tsb_ticks_ctxnon0_256mb_tte.attr, 76 &dev_attr_immu_tsb_ticks_ctxnon0_256mb_tte.attr,
77 &attr_dmmu_tsb_hits_ctx0_8k_tte.attr, 77 &dev_attr_dmmu_tsb_hits_ctx0_8k_tte.attr,
78 &attr_dmmu_tsb_ticks_ctx0_8k_tte.attr, 78 &dev_attr_dmmu_tsb_ticks_ctx0_8k_tte.attr,
79 &attr_dmmu_tsb_hits_ctx0_64k_tte.attr, 79 &dev_attr_dmmu_tsb_hits_ctx0_64k_tte.attr,
80 &attr_dmmu_tsb_ticks_ctx0_64k_tte.attr, 80 &dev_attr_dmmu_tsb_ticks_ctx0_64k_tte.attr,
81 &attr_dmmu_tsb_hits_ctx0_4mb_tte.attr, 81 &dev_attr_dmmu_tsb_hits_ctx0_4mb_tte.attr,
82 &attr_dmmu_tsb_ticks_ctx0_4mb_tte.attr, 82 &dev_attr_dmmu_tsb_ticks_ctx0_4mb_tte.attr,
83 &attr_dmmu_tsb_hits_ctx0_256mb_tte.attr, 83 &dev_attr_dmmu_tsb_hits_ctx0_256mb_tte.attr,
84 &attr_dmmu_tsb_ticks_ctx0_256mb_tte.attr, 84 &dev_attr_dmmu_tsb_ticks_ctx0_256mb_tte.attr,
85 &attr_dmmu_tsb_hits_ctxnon0_8k_tte.attr, 85 &dev_attr_dmmu_tsb_hits_ctxnon0_8k_tte.attr,
86 &attr_dmmu_tsb_ticks_ctxnon0_8k_tte.attr, 86 &dev_attr_dmmu_tsb_ticks_ctxnon0_8k_tte.attr,
87 &attr_dmmu_tsb_hits_ctxnon0_64k_tte.attr, 87 &dev_attr_dmmu_tsb_hits_ctxnon0_64k_tte.attr,
88 &attr_dmmu_tsb_ticks_ctxnon0_64k_tte.attr, 88 &dev_attr_dmmu_tsb_ticks_ctxnon0_64k_tte.attr,
89 &attr_dmmu_tsb_hits_ctxnon0_4mb_tte.attr, 89 &dev_attr_dmmu_tsb_hits_ctxnon0_4mb_tte.attr,
90 &attr_dmmu_tsb_ticks_ctxnon0_4mb_tte.attr, 90 &dev_attr_dmmu_tsb_ticks_ctxnon0_4mb_tte.attr,
91 &attr_dmmu_tsb_hits_ctxnon0_256mb_tte.attr, 91 &dev_attr_dmmu_tsb_hits_ctxnon0_256mb_tte.attr,
92 &attr_dmmu_tsb_ticks_ctxnon0_256mb_tte.attr, 92 &dev_attr_dmmu_tsb_ticks_ctxnon0_256mb_tte.attr,
93 NULL, 93 NULL,
94}; 94};
95 95
@@ -139,15 +139,15 @@ static unsigned long write_mmustat_enable(unsigned long val)
139 return sun4v_mmustat_conf(ra, &orig_ra); 139 return sun4v_mmustat_conf(ra, &orig_ra);
140} 140}
141 141
142static ssize_t show_mmustat_enable(struct sys_device *s, 142static ssize_t show_mmustat_enable(struct device *s,
143 struct sysdev_attribute *attr, char *buf) 143 struct device_attribute *attr, char *buf)
144{ 144{
145 unsigned long val = run_on_cpu(s->id, read_mmustat_enable, 0); 145 unsigned long val = run_on_cpu(s->id, read_mmustat_enable, 0);
146 return sprintf(buf, "%lx\n", val); 146 return sprintf(buf, "%lx\n", val);
147} 147}
148 148
149static ssize_t store_mmustat_enable(struct sys_device *s, 149static ssize_t store_mmustat_enable(struct device *s,
150 struct sysdev_attribute *attr, const char *buf, 150 struct device_attribute *attr, const char *buf,
151 size_t count) 151 size_t count)
152{ 152{
153 unsigned long val, err; 153 unsigned long val, err;
@@ -163,39 +163,39 @@ static ssize_t store_mmustat_enable(struct sys_device *s,
163 return count; 163 return count;
164} 164}
165 165
166static SYSDEV_ATTR(mmustat_enable, 0644, show_mmustat_enable, store_mmustat_enable); 166static DEVICE_ATTR(mmustat_enable, 0644, show_mmustat_enable, store_mmustat_enable);
167 167
168static int mmu_stats_supported; 168static int mmu_stats_supported;
169 169
170static int register_mmu_stats(struct sys_device *s) 170static int register_mmu_stats(struct device *s)
171{ 171{
172 if (!mmu_stats_supported) 172 if (!mmu_stats_supported)
173 return 0; 173 return 0;
174 sysdev_create_file(s, &attr_mmustat_enable); 174 device_create_file(s, &dev_attr_mmustat_enable);
175 return sysfs_create_group(&s->kobj, &mmu_stat_group); 175 return sysfs_create_group(&s->kobj, &mmu_stat_group);
176} 176}
177 177
178#ifdef CONFIG_HOTPLUG_CPU 178#ifdef CONFIG_HOTPLUG_CPU
179static void unregister_mmu_stats(struct sys_device *s) 179static void unregister_mmu_stats(struct device *s)
180{ 180{
181 if (!mmu_stats_supported) 181 if (!mmu_stats_supported)
182 return; 182 return;
183 sysfs_remove_group(&s->kobj, &mmu_stat_group); 183 sysfs_remove_group(&s->kobj, &mmu_stat_group);
184 sysdev_remove_file(s, &attr_mmustat_enable); 184 device_remove_file(s, &dev_attr_mmustat_enable);
185} 185}
186#endif 186#endif
187 187
188#define SHOW_CPUDATA_ULONG_NAME(NAME, MEMBER) \ 188#define SHOW_CPUDATA_ULONG_NAME(NAME, MEMBER) \
189static ssize_t show_##NAME(struct sys_device *dev, \ 189static ssize_t show_##NAME(struct device *dev, \
190 struct sysdev_attribute *attr, char *buf) \ 190 struct device_attribute *attr, char *buf) \
191{ \ 191{ \
192 cpuinfo_sparc *c = &cpu_data(dev->id); \ 192 cpuinfo_sparc *c = &cpu_data(dev->id); \
193 return sprintf(buf, "%lu\n", c->MEMBER); \ 193 return sprintf(buf, "%lu\n", c->MEMBER); \
194} 194}
195 195
196#define SHOW_CPUDATA_UINT_NAME(NAME, MEMBER) \ 196#define SHOW_CPUDATA_UINT_NAME(NAME, MEMBER) \
197static ssize_t show_##NAME(struct sys_device *dev, \ 197static ssize_t show_##NAME(struct device *dev, \
198 struct sysdev_attribute *attr, char *buf) \ 198 struct device_attribute *attr, char *buf) \
199{ \ 199{ \
200 cpuinfo_sparc *c = &cpu_data(dev->id); \ 200 cpuinfo_sparc *c = &cpu_data(dev->id); \
201 return sprintf(buf, "%u\n", c->MEMBER); \ 201 return sprintf(buf, "%u\n", c->MEMBER); \
@@ -209,14 +209,14 @@ SHOW_CPUDATA_UINT_NAME(l1_icache_line_size, icache_line_size);
209SHOW_CPUDATA_UINT_NAME(l2_cache_size, ecache_size); 209SHOW_CPUDATA_UINT_NAME(l2_cache_size, ecache_size);
210SHOW_CPUDATA_UINT_NAME(l2_cache_line_size, ecache_line_size); 210SHOW_CPUDATA_UINT_NAME(l2_cache_line_size, ecache_line_size);
211 211
212static struct sysdev_attribute cpu_core_attrs[] = { 212static struct device_attribute cpu_core_attrs[] = {
213 _SYSDEV_ATTR(clock_tick, 0444, show_clock_tick, NULL), 213 __ATTR(clock_tick, 0444, show_clock_tick, NULL),
214 _SYSDEV_ATTR(l1_dcache_size, 0444, show_l1_dcache_size, NULL), 214 __ATTR(l1_dcache_size, 0444, show_l1_dcache_size, NULL),
215 _SYSDEV_ATTR(l1_dcache_line_size, 0444, show_l1_dcache_line_size, NULL), 215 __ATTR(l1_dcache_line_size, 0444, show_l1_dcache_line_size, NULL),
216 _SYSDEV_ATTR(l1_icache_size, 0444, show_l1_icache_size, NULL), 216 __ATTR(l1_icache_size, 0444, show_l1_icache_size, NULL),
217 _SYSDEV_ATTR(l1_icache_line_size, 0444, show_l1_icache_line_size, NULL), 217 __ATTR(l1_icache_line_size, 0444, show_l1_icache_line_size, NULL),
218 _SYSDEV_ATTR(l2_cache_size, 0444, show_l2_cache_size, NULL), 218 __ATTR(l2_cache_size, 0444, show_l2_cache_size, NULL),
219 _SYSDEV_ATTR(l2_cache_line_size, 0444, show_l2_cache_line_size, NULL), 219 __ATTR(l2_cache_line_size, 0444, show_l2_cache_line_size, NULL),
220}; 220};
221 221
222static DEFINE_PER_CPU(struct cpu, cpu_devices); 222static DEFINE_PER_CPU(struct cpu, cpu_devices);
@@ -224,11 +224,11 @@ static DEFINE_PER_CPU(struct cpu, cpu_devices);
224static void register_cpu_online(unsigned int cpu) 224static void register_cpu_online(unsigned int cpu)
225{ 225{
226 struct cpu *c = &per_cpu(cpu_devices, cpu); 226 struct cpu *c = &per_cpu(cpu_devices, cpu);
227 struct sys_device *s = &c->sysdev; 227 struct device *s = &c->dev;
228 int i; 228 int i;
229 229
230 for (i = 0; i < ARRAY_SIZE(cpu_core_attrs); i++) 230 for (i = 0; i < ARRAY_SIZE(cpu_core_attrs); i++)
231 sysdev_create_file(s, &cpu_core_attrs[i]); 231 device_create_file(s, &cpu_core_attrs[i]);
232 232
233 register_mmu_stats(s); 233 register_mmu_stats(s);
234} 234}
@@ -237,12 +237,12 @@ static void register_cpu_online(unsigned int cpu)
237static void unregister_cpu_online(unsigned int cpu) 237static void unregister_cpu_online(unsigned int cpu)
238{ 238{
239 struct cpu *c = &per_cpu(cpu_devices, cpu); 239 struct cpu *c = &per_cpu(cpu_devices, cpu);
240 struct sys_device *s = &c->sysdev; 240 struct device *s = &c->dev;
241 int i; 241 int i;
242 242
243 unregister_mmu_stats(s); 243 unregister_mmu_stats(s);
244 for (i = 0; i < ARRAY_SIZE(cpu_core_attrs); i++) 244 for (i = 0; i < ARRAY_SIZE(cpu_core_attrs); i++)
245 sysdev_remove_file(s, &cpu_core_attrs[i]); 245 device_remove_file(s, &cpu_core_attrs[i]);
246} 246}
247#endif 247#endif
248 248
diff --git a/arch/tile/kernel/sysfs.c b/arch/tile/kernel/sysfs.c
index 602908268093..f862b005eb73 100644
--- a/arch/tile/kernel/sysfs.c
+++ b/arch/tile/kernel/sysfs.c
@@ -14,7 +14,7 @@
14 * /sys entry support. 14 * /sys entry support.
15 */ 15 */
16 16
17#include <linux/sysdev.h> 17#include <linux/device.h>
18#include <linux/cpu.h> 18#include <linux/cpu.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <linux/smp.h> 20#include <linux/smp.h>
@@ -32,55 +32,55 @@ static ssize_t get_hv_confstr(char *page, int query)
32 return n; 32 return n;
33} 33}
34 34
35static ssize_t chip_width_show(struct sysdev_class *dev, 35static ssize_t chip_width_show(struct device *dev,
36 struct sysdev_class_attribute *attr, 36 struct device_attribute *attr,
37 char *page) 37 char *page)
38{ 38{
39 return sprintf(page, "%u\n", smp_width); 39 return sprintf(page, "%u\n", smp_width);
40} 40}
41static SYSDEV_CLASS_ATTR(chip_width, 0444, chip_width_show, NULL); 41static DEVICE_ATTR(chip_width, 0444, chip_width_show, NULL);
42 42
43static ssize_t chip_height_show(struct sysdev_class *dev, 43static ssize_t chip_height_show(struct device *dev,
44 struct sysdev_class_attribute *attr, 44 struct device_attribute *attr,
45 char *page) 45 char *page)
46{ 46{
47 return sprintf(page, "%u\n", smp_height); 47 return sprintf(page, "%u\n", smp_height);
48} 48}
49static SYSDEV_CLASS_ATTR(chip_height, 0444, chip_height_show, NULL); 49static DEVICE_ATTR(chip_height, 0444, chip_height_show, NULL);
50 50
51static ssize_t chip_serial_show(struct sysdev_class *dev, 51static ssize_t chip_serial_show(struct device *dev,
52 struct sysdev_class_attribute *attr, 52 struct device_attribute *attr,
53 char *page) 53 char *page)
54{ 54{
55 return get_hv_confstr(page, HV_CONFSTR_CHIP_SERIAL_NUM); 55 return get_hv_confstr(page, HV_CONFSTR_CHIP_SERIAL_NUM);
56} 56}
57static SYSDEV_CLASS_ATTR(chip_serial, 0444, chip_serial_show, NULL); 57static DEVICE_ATTR(chip_serial, 0444, chip_serial_show, NULL);
58 58
59static ssize_t chip_revision_show(struct sysdev_class *dev, 59static ssize_t chip_revision_show(struct device *dev,
60 struct sysdev_class_attribute *attr, 60 struct device_attribute *attr,
61 char *page) 61 char *page)
62{ 62{
63 return get_hv_confstr(page, HV_CONFSTR_CHIP_REV); 63 return get_hv_confstr(page, HV_CONFSTR_CHIP_REV);
64} 64}
65static SYSDEV_CLASS_ATTR(chip_revision, 0444, chip_revision_show, NULL); 65static DEVICE_ATTR(chip_revision, 0444, chip_revision_show, NULL);
66 66
67 67
68static ssize_t type_show(struct sysdev_class *dev, 68static ssize_t type_show(struct device *dev,
69 struct sysdev_class_attribute *attr, 69 struct device_attribute *attr,
70 char *page) 70 char *page)
71{ 71{
72 return sprintf(page, "tilera\n"); 72 return sprintf(page, "tilera\n");
73} 73}
74static SYSDEV_CLASS_ATTR(type, 0444, type_show, NULL); 74static DEVICE_ATTR(type, 0444, type_show, NULL);
75 75
76#define HV_CONF_ATTR(name, conf) \ 76#define HV_CONF_ATTR(name, conf) \
77 static ssize_t name ## _show(struct sysdev_class *dev, \ 77 static ssize_t name ## _show(struct device *dev, \
78 struct sysdev_class_attribute *attr, \ 78 struct device_attribute *attr, \
79 char *page) \ 79 char *page) \
80 { \ 80 { \
81 return get_hv_confstr(page, conf); \ 81 return get_hv_confstr(page, conf); \
82 } \ 82 } \
83 static SYSDEV_CLASS_ATTR(name, 0444, name ## _show, NULL); 83 static DEVICE_ATTR(name, 0444, name ## _show, NULL);
84 84
85HV_CONF_ATTR(version, HV_CONFSTR_HV_SW_VER) 85HV_CONF_ATTR(version, HV_CONFSTR_HV_SW_VER)
86HV_CONF_ATTR(config_version, HV_CONFSTR_HV_CONFIG_VER) 86HV_CONF_ATTR(config_version, HV_CONFSTR_HV_CONFIG_VER)
@@ -96,15 +96,15 @@ HV_CONF_ATTR(mezz_description, HV_CONFSTR_MEZZ_DESC)
96HV_CONF_ATTR(switch_control, HV_CONFSTR_SWITCH_CONTROL) 96HV_CONF_ATTR(switch_control, HV_CONFSTR_SWITCH_CONTROL)
97 97
98static struct attribute *board_attrs[] = { 98static struct attribute *board_attrs[] = {
99 &attr_board_part.attr, 99 &dev_attr_board_part.attr,
100 &attr_board_serial.attr, 100 &dev_attr_board_serial.attr,
101 &attr_board_revision.attr, 101 &dev_attr_board_revision.attr,
102 &attr_board_description.attr, 102 &dev_attr_board_description.attr,
103 &attr_mezz_part.attr, 103 &dev_attr_mezz_part.attr,
104 &attr_mezz_serial.attr, 104 &dev_attr_mezz_serial.attr,
105 &attr_mezz_revision.attr, 105 &dev_attr_mezz_revision.attr,
106 &attr_mezz_description.attr, 106 &dev_attr_mezz_description.attr,
107 &attr_switch_control.attr, 107 &dev_attr_switch_control.attr,
108 NULL 108 NULL
109}; 109};
110 110
@@ -151,12 +151,11 @@ hvconfig_bin_read(struct file *filp, struct kobject *kobj,
151 151
152static int __init create_sysfs_entries(void) 152static int __init create_sysfs_entries(void)
153{ 153{
154 struct sysdev_class *cls = &cpu_sysdev_class;
155 int err = 0; 154 int err = 0;
156 155
157#define create_cpu_attr(name) \ 156#define create_cpu_attr(name) \
158 if (!err) \ 157 if (!err) \
159 err = sysfs_create_file(&cls->kset.kobj, &attr_##name.attr); 158 err = device_create_file(cpu_subsys.dev_root, &dev_attr_##name);
160 create_cpu_attr(chip_width); 159 create_cpu_attr(chip_width);
161 create_cpu_attr(chip_height); 160 create_cpu_attr(chip_height);
162 create_cpu_attr(chip_serial); 161 create_cpu_attr(chip_serial);
@@ -164,7 +163,7 @@ static int __init create_sysfs_entries(void)
164 163
165#define create_hv_attr(name) \ 164#define create_hv_attr(name) \
166 if (!err) \ 165 if (!err) \
167 err = sysfs_create_file(hypervisor_kobj, &attr_##name.attr); 166 err = sysfs_create_file(hypervisor_kobj, &dev_attr_##name);
168 create_hv_attr(type); 167 create_hv_attr(type);
169 create_hv_attr(version); 168 create_hv_attr(version);
170 create_hv_attr(config_version); 169 create_hv_attr(config_version);
diff --git a/arch/unicore32/kernel/puv3-core.c b/arch/unicore32/kernel/puv3-core.c
index 1a505a787765..254adeecc61a 100644
--- a/arch/unicore32/kernel/puv3-core.c
+++ b/arch/unicore32/kernel/puv3-core.c
@@ -13,7 +13,6 @@
13 13
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/sysdev.h>
17#include <linux/amba/bus.h> 16#include <linux/amba/bus.h>
18#include <linux/platform_device.h> 17#include <linux/platform_device.h>
19#include <linux/io.h> 18#include <linux/io.h>
diff --git a/arch/unicore32/kernel/puv3-nb0916.c b/arch/unicore32/kernel/puv3-nb0916.c
index e731c561ed4e..37b12a06b499 100644
--- a/arch/unicore32/kernel/puv3-nb0916.c
+++ b/arch/unicore32/kernel/puv3-nb0916.c
@@ -13,7 +13,6 @@
13 13
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/sysdev.h>
17#include <linux/platform_device.h> 16#include <linux/platform_device.h>
18#include <linux/mtd/physmap.h> 17#include <linux/mtd/physmap.h>
19#include <linux/io.h> 18#include <linux/io.h>
diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h
index 6add827381c9..f35ce43c1a77 100644
--- a/arch/x86/include/asm/mce.h
+++ b/arch/x86/include/asm/mce.h
@@ -151,7 +151,7 @@ static inline void enable_p5_mce(void) {}
151 151
152void mce_setup(struct mce *m); 152void mce_setup(struct mce *m);
153void mce_log(struct mce *m); 153void mce_log(struct mce *m);
154DECLARE_PER_CPU(struct sys_device, mce_sysdev); 154DECLARE_PER_CPU(struct device, mce_device);
155 155
156/* 156/*
157 * Maximum banks number. 157 * Maximum banks number.
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
index a3b0811693c9..6b45e5e7a901 100644
--- a/arch/x86/kernel/cpu/intel_cacheinfo.c
+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
@@ -844,8 +844,7 @@ static int __cpuinit detect_cache_attributes(unsigned int cpu)
844 844
845#include <linux/kobject.h> 845#include <linux/kobject.h>
846#include <linux/sysfs.h> 846#include <linux/sysfs.h>
847 847#include <linux/cpu.h>
848extern struct sysdev_class cpu_sysdev_class; /* from drivers/base/cpu.c */
849 848
850/* pointer to kobject for cpuX/cache */ 849/* pointer to kobject for cpuX/cache */
851static DEFINE_PER_CPU(struct kobject *, ici_cache_kobject); 850static DEFINE_PER_CPU(struct kobject *, ici_cache_kobject);
@@ -1073,9 +1072,9 @@ err_out:
1073static DECLARE_BITMAP(cache_dev_map, NR_CPUS); 1072static DECLARE_BITMAP(cache_dev_map, NR_CPUS);
1074 1073
1075/* Add/Remove cache interface for CPU device */ 1074/* Add/Remove cache interface for CPU device */
1076static int __cpuinit cache_add_dev(struct sys_device * sys_dev) 1075static int __cpuinit cache_add_dev(struct device *dev)
1077{ 1076{
1078 unsigned int cpu = sys_dev->id; 1077 unsigned int cpu = dev->id;
1079 unsigned long i, j; 1078 unsigned long i, j;
1080 struct _index_kobject *this_object; 1079 struct _index_kobject *this_object;
1081 struct _cpuid4_info *this_leaf; 1080 struct _cpuid4_info *this_leaf;
@@ -1087,7 +1086,7 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
1087 1086
1088 retval = kobject_init_and_add(per_cpu(ici_cache_kobject, cpu), 1087 retval = kobject_init_and_add(per_cpu(ici_cache_kobject, cpu),
1089 &ktype_percpu_entry, 1088 &ktype_percpu_entry,
1090 &sys_dev->kobj, "%s", "cache"); 1089 &dev->kobj, "%s", "cache");
1091 if (retval < 0) { 1090 if (retval < 0) {
1092 cpuid4_cache_sysfs_exit(cpu); 1091 cpuid4_cache_sysfs_exit(cpu);
1093 return retval; 1092 return retval;
@@ -1124,9 +1123,9 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev)
1124 return 0; 1123 return 0;
1125} 1124}
1126 1125
1127static void __cpuinit cache_remove_dev(struct sys_device * sys_dev) 1126static void __cpuinit cache_remove_dev(struct device *dev)
1128{ 1127{
1129 unsigned int cpu = sys_dev->id; 1128 unsigned int cpu = dev->id;
1130 unsigned long i; 1129 unsigned long i;
1131 1130
1132 if (per_cpu(ici_cpuid4_info, cpu) == NULL) 1131 if (per_cpu(ici_cpuid4_info, cpu) == NULL)
@@ -1145,17 +1144,17 @@ static int __cpuinit cacheinfo_cpu_callback(struct notifier_block *nfb,
1145 unsigned long action, void *hcpu) 1144 unsigned long action, void *hcpu)
1146{ 1145{
1147 unsigned int cpu = (unsigned long)hcpu; 1146 unsigned int cpu = (unsigned long)hcpu;
1148 struct sys_device *sys_dev; 1147 struct device *dev;
1149 1148
1150 sys_dev = get_cpu_sysdev(cpu); 1149 dev = get_cpu_device(cpu);
1151 switch (action) { 1150 switch (action) {
1152 case CPU_ONLINE: 1151 case CPU_ONLINE:
1153 case CPU_ONLINE_FROZEN: 1152 case CPU_ONLINE_FROZEN:
1154 cache_add_dev(sys_dev); 1153 cache_add_dev(dev);
1155 break; 1154 break;
1156 case CPU_DEAD: 1155 case CPU_DEAD:
1157 case CPU_DEAD_FROZEN: 1156 case CPU_DEAD_FROZEN:
1158 cache_remove_dev(sys_dev); 1157 cache_remove_dev(dev);
1159 break; 1158 break;
1160 } 1159 }
1161 return NOTIFY_OK; 1160 return NOTIFY_OK;
@@ -1174,9 +1173,9 @@ static int __cpuinit cache_sysfs_init(void)
1174 1173
1175 for_each_online_cpu(i) { 1174 for_each_online_cpu(i) {
1176 int err; 1175 int err;
1177 struct sys_device *sys_dev = get_cpu_sysdev(i); 1176 struct device *dev = get_cpu_device(i);
1178 1177
1179 err = cache_add_dev(sys_dev); 1178 err = cache_add_dev(dev);
1180 if (err) 1179 if (err)
1181 return err; 1180 return err;
1182 } 1181 }
diff --git a/arch/x86/kernel/cpu/mcheck/mce-internal.h b/arch/x86/kernel/cpu/mcheck/mce-internal.h
index fefcc69ee8b5..ed44c8a65858 100644
--- a/arch/x86/kernel/cpu/mcheck/mce-internal.h
+++ b/arch/x86/kernel/cpu/mcheck/mce-internal.h
@@ -1,4 +1,4 @@
1#include <linux/sysdev.h> 1#include <linux/device.h>
2#include <asm/mce.h> 2#include <asm/mce.h>
3 3
4enum severity_level { 4enum severity_level {
@@ -17,7 +17,7 @@ enum severity_level {
17struct mce_bank { 17struct mce_bank {
18 u64 ctl; /* subevents to enable */ 18 u64 ctl; /* subevents to enable */
19 unsigned char init; /* initialise bank? */ 19 unsigned char init; /* initialise bank? */
20 struct sysdev_attribute attr; /* sysdev attribute */ 20 struct device_attribute attr; /* device attribute */
21 char attrname[ATTR_LEN]; /* attribute name */ 21 char attrname[ATTR_LEN]; /* attribute name */
22}; 22};
23 23
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index cbe82b5918ce..f22a9f7f6390 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -19,7 +19,7 @@
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/percpu.h> 20#include <linux/percpu.h>
21#include <linux/string.h> 21#include <linux/string.h>
22#include <linux/sysdev.h> 22#include <linux/device.h>
23#include <linux/syscore_ops.h> 23#include <linux/syscore_ops.h>
24#include <linux/delay.h> 24#include <linux/delay.h>
25#include <linux/ctype.h> 25#include <linux/ctype.h>
@@ -1818,7 +1818,7 @@ static struct syscore_ops mce_syscore_ops = {
1818}; 1818};
1819 1819
1820/* 1820/*
1821 * mce_sysdev: Sysfs support 1821 * mce_device: Sysfs support
1822 */ 1822 */
1823 1823
1824static void mce_cpu_restart(void *data) 1824static void mce_cpu_restart(void *data)
@@ -1854,27 +1854,28 @@ static void mce_enable_ce(void *all)
1854 __mcheck_cpu_init_timer(); 1854 __mcheck_cpu_init_timer();
1855} 1855}
1856 1856
1857static struct sysdev_class mce_sysdev_class = { 1857static struct bus_type mce_subsys = {
1858 .name = "machinecheck", 1858 .name = "machinecheck",
1859 .dev_name = "machinecheck",
1859}; 1860};
1860 1861
1861DEFINE_PER_CPU(struct sys_device, mce_sysdev); 1862DEFINE_PER_CPU(struct device, mce_device);
1862 1863
1863__cpuinitdata 1864__cpuinitdata
1864void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu); 1865void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu);
1865 1866
1866static inline struct mce_bank *attr_to_bank(struct sysdev_attribute *attr) 1867static inline struct mce_bank *attr_to_bank(struct device_attribute *attr)
1867{ 1868{
1868 return container_of(attr, struct mce_bank, attr); 1869 return container_of(attr, struct mce_bank, attr);
1869} 1870}
1870 1871
1871static ssize_t show_bank(struct sys_device *s, struct sysdev_attribute *attr, 1872static ssize_t show_bank(struct device *s, struct device_attribute *attr,
1872 char *buf) 1873 char *buf)
1873{ 1874{
1874 return sprintf(buf, "%llx\n", attr_to_bank(attr)->ctl); 1875 return sprintf(buf, "%llx\n", attr_to_bank(attr)->ctl);
1875} 1876}
1876 1877
1877static ssize_t set_bank(struct sys_device *s, struct sysdev_attribute *attr, 1878static ssize_t set_bank(struct device *s, struct device_attribute *attr,
1878 const char *buf, size_t size) 1879 const char *buf, size_t size)
1879{ 1880{
1880 u64 new; 1881 u64 new;
@@ -1889,14 +1890,14 @@ static ssize_t set_bank(struct sys_device *s, struct sysdev_attribute *attr,
1889} 1890}
1890 1891
1891static ssize_t 1892static ssize_t
1892show_trigger(struct sys_device *s, struct sysdev_attribute *attr, char *buf) 1893show_trigger(struct device *s, struct device_attribute *attr, char *buf)
1893{ 1894{
1894 strcpy(buf, mce_helper); 1895 strcpy(buf, mce_helper);
1895 strcat(buf, "\n"); 1896 strcat(buf, "\n");
1896 return strlen(mce_helper) + 1; 1897 return strlen(mce_helper) + 1;
1897} 1898}
1898 1899
1899static ssize_t set_trigger(struct sys_device *s, struct sysdev_attribute *attr, 1900static ssize_t set_trigger(struct device *s, struct device_attribute *attr,
1900 const char *buf, size_t siz) 1901 const char *buf, size_t siz)
1901{ 1902{
1902 char *p; 1903 char *p;
@@ -1911,8 +1912,8 @@ static ssize_t set_trigger(struct sys_device *s, struct sysdev_attribute *attr,
1911 return strlen(mce_helper) + !!p; 1912 return strlen(mce_helper) + !!p;
1912} 1913}
1913 1914
1914static ssize_t set_ignore_ce(struct sys_device *s, 1915static ssize_t set_ignore_ce(struct device *s,
1915 struct sysdev_attribute *attr, 1916 struct device_attribute *attr,
1916 const char *buf, size_t size) 1917 const char *buf, size_t size)
1917{ 1918{
1918 u64 new; 1919 u64 new;
@@ -1935,8 +1936,8 @@ static ssize_t set_ignore_ce(struct sys_device *s,
1935 return size; 1936 return size;
1936} 1937}
1937 1938
1938static ssize_t set_cmci_disabled(struct sys_device *s, 1939static ssize_t set_cmci_disabled(struct device *s,
1939 struct sysdev_attribute *attr, 1940 struct device_attribute *attr,
1940 const char *buf, size_t size) 1941 const char *buf, size_t size)
1941{ 1942{
1942 u64 new; 1943 u64 new;
@@ -1958,108 +1959,107 @@ static ssize_t set_cmci_disabled(struct sys_device *s,
1958 return size; 1959 return size;
1959} 1960}
1960 1961
1961static ssize_t store_int_with_restart(struct sys_device *s, 1962static ssize_t store_int_with_restart(struct device *s,
1962 struct sysdev_attribute *attr, 1963 struct device_attribute *attr,
1963 const char *buf, size_t size) 1964 const char *buf, size_t size)
1964{ 1965{
1965 ssize_t ret = sysdev_store_int(s, attr, buf, size); 1966 ssize_t ret = device_store_int(s, attr, buf, size);
1966 mce_restart(); 1967 mce_restart();
1967 return ret; 1968 return ret;
1968} 1969}
1969 1970
1970static SYSDEV_ATTR(trigger, 0644, show_trigger, set_trigger); 1971static DEVICE_ATTR(trigger, 0644, show_trigger, set_trigger);
1971static SYSDEV_INT_ATTR(tolerant, 0644, tolerant); 1972static DEVICE_INT_ATTR(tolerant, 0644, tolerant);
1972static SYSDEV_INT_ATTR(monarch_timeout, 0644, monarch_timeout); 1973static DEVICE_INT_ATTR(monarch_timeout, 0644, monarch_timeout);
1973static SYSDEV_INT_ATTR(dont_log_ce, 0644, mce_dont_log_ce); 1974static DEVICE_INT_ATTR(dont_log_ce, 0644, mce_dont_log_ce);
1974 1975
1975static struct sysdev_ext_attribute attr_check_interval = { 1976static struct dev_ext_attribute dev_attr_check_interval = {
1976 _SYSDEV_ATTR(check_interval, 0644, sysdev_show_int, 1977 __ATTR(check_interval, 0644, device_show_int, store_int_with_restart),
1977 store_int_with_restart),
1978 &check_interval 1978 &check_interval
1979}; 1979};
1980 1980
1981static struct sysdev_ext_attribute attr_ignore_ce = { 1981static struct dev_ext_attribute dev_attr_ignore_ce = {
1982 _SYSDEV_ATTR(ignore_ce, 0644, sysdev_show_int, set_ignore_ce), 1982 __ATTR(ignore_ce, 0644, device_show_int, set_ignore_ce),
1983 &mce_ignore_ce 1983 &mce_ignore_ce
1984}; 1984};
1985 1985
1986static struct sysdev_ext_attribute attr_cmci_disabled = { 1986static struct dev_ext_attribute dev_attr_cmci_disabled = {
1987 _SYSDEV_ATTR(cmci_disabled, 0644, sysdev_show_int, set_cmci_disabled), 1987 __ATTR(cmci_disabled, 0644, device_show_int, set_cmci_disabled),
1988 &mce_cmci_disabled 1988 &mce_cmci_disabled
1989}; 1989};
1990 1990
1991static struct sysdev_attribute *mce_sysdev_attrs[] = { 1991static struct device_attribute *mce_device_attrs[] = {
1992 &attr_tolerant.attr, 1992 &dev_attr_tolerant.attr,
1993 &attr_check_interval.attr, 1993 &dev_attr_check_interval.attr,
1994 &attr_trigger, 1994 &dev_attr_trigger,
1995 &attr_monarch_timeout.attr, 1995 &dev_attr_monarch_timeout.attr,
1996 &attr_dont_log_ce.attr, 1996 &dev_attr_dont_log_ce.attr,
1997 &attr_ignore_ce.attr, 1997 &dev_attr_ignore_ce.attr,
1998 &attr_cmci_disabled.attr, 1998 &dev_attr_cmci_disabled.attr,
1999 NULL 1999 NULL
2000}; 2000};
2001 2001
2002static cpumask_var_t mce_sysdev_initialized; 2002static cpumask_var_t mce_device_initialized;
2003 2003
2004/* Per cpu sysdev init. All of the cpus still share the same ctrl bank: */ 2004/* Per cpu device init. All of the cpus still share the same ctrl bank: */
2005static __cpuinit int mce_sysdev_create(unsigned int cpu) 2005static __cpuinit int mce_device_create(unsigned int cpu)
2006{ 2006{
2007 struct sys_device *sysdev = &per_cpu(mce_sysdev, cpu); 2007 struct device *dev = &per_cpu(mce_device, cpu);
2008 int err; 2008 int err;
2009 int i, j; 2009 int i, j;
2010 2010
2011 if (!mce_available(&boot_cpu_data)) 2011 if (!mce_available(&boot_cpu_data))
2012 return -EIO; 2012 return -EIO;
2013 2013
2014 memset(&sysdev->kobj, 0, sizeof(struct kobject)); 2014 memset(&dev->kobj, 0, sizeof(struct kobject));
2015 sysdev->id = cpu; 2015 dev->id = cpu;
2016 sysdev->cls = &mce_sysdev_class; 2016 dev->bus = &mce_subsys;
2017 2017
2018 err = sysdev_register(sysdev); 2018 err = device_register(dev);
2019 if (err) 2019 if (err)
2020 return err; 2020 return err;
2021 2021
2022 for (i = 0; mce_sysdev_attrs[i]; i++) { 2022 for (i = 0; mce_device_attrs[i]; i++) {
2023 err = sysdev_create_file(sysdev, mce_sysdev_attrs[i]); 2023 err = device_create_file(dev, mce_device_attrs[i]);
2024 if (err) 2024 if (err)
2025 goto error; 2025 goto error;
2026 } 2026 }
2027 for (j = 0; j < banks; j++) { 2027 for (j = 0; j < banks; j++) {
2028 err = sysdev_create_file(sysdev, &mce_banks[j].attr); 2028 err = device_create_file(dev, &mce_banks[j].attr);
2029 if (err) 2029 if (err)
2030 goto error2; 2030 goto error2;
2031 } 2031 }
2032 cpumask_set_cpu(cpu, mce_sysdev_initialized); 2032 cpumask_set_cpu(cpu, mce_device_initialized);
2033 2033
2034 return 0; 2034 return 0;
2035error2: 2035error2:
2036 while (--j >= 0) 2036 while (--j >= 0)
2037 sysdev_remove_file(sysdev, &mce_banks[j].attr); 2037 device_remove_file(dev, &mce_banks[j].attr);
2038error: 2038error:
2039 while (--i >= 0) 2039 while (--i >= 0)
2040 sysdev_remove_file(sysdev, mce_sysdev_attrs[i]); 2040 device_remove_file(dev, mce_device_attrs[i]);
2041 2041
2042 sysdev_unregister(sysdev); 2042 device_unregister(dev);
2043 2043
2044 return err; 2044 return err;
2045} 2045}
2046 2046
2047static __cpuinit void mce_sysdev_remove(unsigned int cpu) 2047static __cpuinit void mce_device_remove(unsigned int cpu)
2048{ 2048{
2049 struct sys_device *sysdev = &per_cpu(mce_sysdev, cpu); 2049 struct device *dev = &per_cpu(mce_device, cpu);
2050 int i; 2050 int i;
2051 2051
2052 if (!cpumask_test_cpu(cpu, mce_sysdev_initialized)) 2052 if (!cpumask_test_cpu(cpu, mce_device_initialized))
2053 return; 2053 return;
2054 2054
2055 for (i = 0; mce_sysdev_attrs[i]; i++) 2055 for (i = 0; mce_device_attrs[i]; i++)
2056 sysdev_remove_file(sysdev, mce_sysdev_attrs[i]); 2056 device_remove_file(dev, mce_device_attrs[i]);
2057 2057
2058 for (i = 0; i < banks; i++) 2058 for (i = 0; i < banks; i++)
2059 sysdev_remove_file(sysdev, &mce_banks[i].attr); 2059 device_remove_file(dev, &mce_banks[i].attr);
2060 2060
2061 sysdev_unregister(sysdev); 2061 device_unregister(dev);
2062 cpumask_clear_cpu(cpu, mce_sysdev_initialized); 2062 cpumask_clear_cpu(cpu, mce_device_initialized);
2063} 2063}
2064 2064
2065/* Make sure there are no machine checks on offlined CPUs. */ 2065/* Make sure there are no machine checks on offlined CPUs. */
@@ -2109,7 +2109,7 @@ mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
2109 switch (action) { 2109 switch (action) {
2110 case CPU_ONLINE: 2110 case CPU_ONLINE:
2111 case CPU_ONLINE_FROZEN: 2111 case CPU_ONLINE_FROZEN:
2112 mce_sysdev_create(cpu); 2112 mce_device_create(cpu);
2113 if (threshold_cpu_callback) 2113 if (threshold_cpu_callback)
2114 threshold_cpu_callback(action, cpu); 2114 threshold_cpu_callback(action, cpu);
2115 break; 2115 break;
@@ -2117,7 +2117,7 @@ mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
2117 case CPU_DEAD_FROZEN: 2117 case CPU_DEAD_FROZEN:
2118 if (threshold_cpu_callback) 2118 if (threshold_cpu_callback)
2119 threshold_cpu_callback(action, cpu); 2119 threshold_cpu_callback(action, cpu);
2120 mce_sysdev_remove(cpu); 2120 mce_device_remove(cpu);
2121 break; 2121 break;
2122 case CPU_DOWN_PREPARE: 2122 case CPU_DOWN_PREPARE:
2123 case CPU_DOWN_PREPARE_FROZEN: 2123 case CPU_DOWN_PREPARE_FROZEN:
@@ -2151,7 +2151,7 @@ static __init void mce_init_banks(void)
2151 2151
2152 for (i = 0; i < banks; i++) { 2152 for (i = 0; i < banks; i++) {
2153 struct mce_bank *b = &mce_banks[i]; 2153 struct mce_bank *b = &mce_banks[i];
2154 struct sysdev_attribute *a = &b->attr; 2154 struct device_attribute *a = &b->attr;
2155 2155
2156 sysfs_attr_init(&a->attr); 2156 sysfs_attr_init(&a->attr);
2157 a->attr.name = b->attrname; 2157 a->attr.name = b->attrname;
@@ -2171,16 +2171,16 @@ static __init int mcheck_init_device(void)
2171 if (!mce_available(&boot_cpu_data)) 2171 if (!mce_available(&boot_cpu_data))
2172 return -EIO; 2172 return -EIO;
2173 2173
2174 zalloc_cpumask_var(&mce_sysdev_initialized, GFP_KERNEL); 2174 zalloc_cpumask_var(&mce_device_initialized, GFP_KERNEL);
2175 2175
2176 mce_init_banks(); 2176 mce_init_banks();
2177 2177
2178 err = sysdev_class_register(&mce_sysdev_class); 2178 err = subsys_system_register(&mce_subsys, NULL);
2179 if (err) 2179 if (err)
2180 return err; 2180 return err;
2181 2181
2182 for_each_online_cpu(i) { 2182 for_each_online_cpu(i) {
2183 err = mce_sysdev_create(i); 2183 err = mce_device_create(i);
2184 if (err) 2184 if (err)
2185 return err; 2185 return err;
2186 } 2186 }
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c
index 1d76872b6a45..ba0b94a7e204 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
@@ -17,7 +17,6 @@
17#include <linux/notifier.h> 17#include <linux/notifier.h>
18#include <linux/kobject.h> 18#include <linux/kobject.h>
19#include <linux/percpu.h> 19#include <linux/percpu.h>
20#include <linux/sysdev.h>
21#include <linux/errno.h> 20#include <linux/errno.h>
22#include <linux/sched.h> 21#include <linux/sched.h>
23#include <linux/sysfs.h> 22#include <linux/sysfs.h>
@@ -544,7 +543,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
544 if (!b) 543 if (!b)
545 goto out; 544 goto out;
546 545
547 err = sysfs_create_link(&per_cpu(mce_sysdev, cpu).kobj, 546 err = sysfs_create_link(&per_cpu(mce_device, cpu).kobj,
548 b->kobj, name); 547 b->kobj, name);
549 if (err) 548 if (err)
550 goto out; 549 goto out;
@@ -566,7 +565,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
566 goto out; 565 goto out;
567 } 566 }
568 567
569 b->kobj = kobject_create_and_add(name, &per_cpu(mce_sysdev, cpu).kobj); 568 b->kobj = kobject_create_and_add(name, &per_cpu(mce_device, cpu).kobj);
570 if (!b->kobj) 569 if (!b->kobj)
571 goto out_free; 570 goto out_free;
572 571
@@ -586,7 +585,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
586 if (i == cpu) 585 if (i == cpu)
587 continue; 586 continue;
588 587
589 err = sysfs_create_link(&per_cpu(mce_sysdev, i).kobj, 588 err = sysfs_create_link(&per_cpu(mce_device, i).kobj,
590 b->kobj, name); 589 b->kobj, name);
591 if (err) 590 if (err)
592 goto out; 591 goto out;
@@ -664,7 +663,7 @@ static void threshold_remove_bank(unsigned int cpu, int bank)
664#ifdef CONFIG_SMP 663#ifdef CONFIG_SMP
665 /* sibling symlink */ 664 /* sibling symlink */
666 if (shared_bank[bank] && b->blocks->cpu != cpu) { 665 if (shared_bank[bank] && b->blocks->cpu != cpu) {
667 sysfs_remove_link(&per_cpu(mce_sysdev, cpu).kobj, name); 666 sysfs_remove_link(&per_cpu(mce_device, cpu).kobj, name);
668 per_cpu(threshold_banks, cpu)[bank] = NULL; 667 per_cpu(threshold_banks, cpu)[bank] = NULL;
669 668
670 return; 669 return;
@@ -676,7 +675,7 @@ static void threshold_remove_bank(unsigned int cpu, int bank)
676 if (i == cpu) 675 if (i == cpu)
677 continue; 676 continue;
678 677
679 sysfs_remove_link(&per_cpu(mce_sysdev, i).kobj, name); 678 sysfs_remove_link(&per_cpu(mce_device, i).kobj, name);
680 per_cpu(threshold_banks, i)[bank] = NULL; 679 per_cpu(threshold_banks, i)[bank] = NULL;
681 } 680 }
682 681
diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c
index 39c6089891e4..67bb17a37a0a 100644
--- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
+++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
@@ -19,7 +19,6 @@
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/percpu.h> 20#include <linux/percpu.h>
21#include <linux/export.h> 21#include <linux/export.h>
22#include <linux/sysdev.h>
23#include <linux/types.h> 22#include <linux/types.h>
24#include <linux/init.h> 23#include <linux/init.h>
25#include <linux/smp.h> 24#include <linux/smp.h>
@@ -69,16 +68,16 @@ static atomic_t therm_throt_en = ATOMIC_INIT(0);
69static u32 lvtthmr_init __read_mostly; 68static u32 lvtthmr_init __read_mostly;
70 69
71#ifdef CONFIG_SYSFS 70#ifdef CONFIG_SYSFS
72#define define_therm_throt_sysdev_one_ro(_name) \ 71#define define_therm_throt_device_one_ro(_name) \
73 static SYSDEV_ATTR(_name, 0444, \ 72 static DEVICE_ATTR(_name, 0444, \
74 therm_throt_sysdev_show_##_name, \ 73 therm_throt_device_show_##_name, \
75 NULL) \ 74 NULL) \
76 75
77#define define_therm_throt_sysdev_show_func(event, name) \ 76#define define_therm_throt_device_show_func(event, name) \
78 \ 77 \
79static ssize_t therm_throt_sysdev_show_##event##_##name( \ 78static ssize_t therm_throt_device_show_##event##_##name( \
80 struct sys_device *dev, \ 79 struct device *dev, \
81 struct sysdev_attribute *attr, \ 80 struct device_attribute *attr, \
82 char *buf) \ 81 char *buf) \
83{ \ 82{ \
84 unsigned int cpu = dev->id; \ 83 unsigned int cpu = dev->id; \
@@ -95,20 +94,20 @@ static ssize_t therm_throt_sysdev_show_##event##_##name( \
95 return ret; \ 94 return ret; \
96} 95}
97 96
98define_therm_throt_sysdev_show_func(core_throttle, count); 97define_therm_throt_device_show_func(core_throttle, count);
99define_therm_throt_sysdev_one_ro(core_throttle_count); 98define_therm_throt_device_one_ro(core_throttle_count);
100 99
101define_therm_throt_sysdev_show_func(core_power_limit, count); 100define_therm_throt_device_show_func(core_power_limit, count);
102define_therm_throt_sysdev_one_ro(core_power_limit_count); 101define_therm_throt_device_one_ro(core_power_limit_count);
103 102
104define_therm_throt_sysdev_show_func(package_throttle, count); 103define_therm_throt_device_show_func(package_throttle, count);
105define_therm_throt_sysdev_one_ro(package_throttle_count); 104define_therm_throt_device_one_ro(package_throttle_count);
106 105
107define_therm_throt_sysdev_show_func(package_power_limit, count); 106define_therm_throt_device_show_func(package_power_limit, count);
108define_therm_throt_sysdev_one_ro(package_power_limit_count); 107define_therm_throt_device_one_ro(package_power_limit_count);
109 108
110static struct attribute *thermal_throttle_attrs[] = { 109static struct attribute *thermal_throttle_attrs[] = {
111 &attr_core_throttle_count.attr, 110 &dev_attr_core_throttle_count.attr,
112 NULL 111 NULL
113}; 112};
114 113
@@ -223,36 +222,36 @@ static int thresh_event_valid(int event)
223 222
224#ifdef CONFIG_SYSFS 223#ifdef CONFIG_SYSFS
225/* Add/Remove thermal_throttle interface for CPU device: */ 224/* Add/Remove thermal_throttle interface for CPU device: */
226static __cpuinit int thermal_throttle_add_dev(struct sys_device *sys_dev, 225static __cpuinit int thermal_throttle_add_dev(struct device *dev,
227 unsigned int cpu) 226 unsigned int cpu)
228{ 227{
229 int err; 228 int err;
230 struct cpuinfo_x86 *c = &cpu_data(cpu); 229 struct cpuinfo_x86 *c = &cpu_data(cpu);
231 230
232 err = sysfs_create_group(&sys_dev->kobj, &thermal_attr_group); 231 err = sysfs_create_group(&dev->kobj, &thermal_attr_group);
233 if (err) 232 if (err)
234 return err; 233 return err;
235 234
236 if (cpu_has(c, X86_FEATURE_PLN)) 235 if (cpu_has(c, X86_FEATURE_PLN))
237 err = sysfs_add_file_to_group(&sys_dev->kobj, 236 err = sysfs_add_file_to_group(&dev->kobj,
238 &attr_core_power_limit_count.attr, 237 &dev_attr_core_power_limit_count.attr,
239 thermal_attr_group.name); 238 thermal_attr_group.name);
240 if (cpu_has(c, X86_FEATURE_PTS)) { 239 if (cpu_has(c, X86_FEATURE_PTS)) {
241 err = sysfs_add_file_to_group(&sys_dev->kobj, 240 err = sysfs_add_file_to_group(&dev->kobj,
242 &attr_package_throttle_count.attr, 241 &dev_attr_package_throttle_count.attr,
243 thermal_attr_group.name); 242 thermal_attr_group.name);
244 if (cpu_has(c, X86_FEATURE_PLN)) 243 if (cpu_has(c, X86_FEATURE_PLN))
245 err = sysfs_add_file_to_group(&sys_dev->kobj, 244 err = sysfs_add_file_to_group(&dev->kobj,
246 &attr_package_power_limit_count.attr, 245 &dev_attr_package_power_limit_count.attr,
247 thermal_attr_group.name); 246 thermal_attr_group.name);
248 } 247 }
249 248
250 return err; 249 return err;
251} 250}
252 251
253static __cpuinit void thermal_throttle_remove_dev(struct sys_device *sys_dev) 252static __cpuinit void thermal_throttle_remove_dev(struct device *dev)
254{ 253{
255 sysfs_remove_group(&sys_dev->kobj, &thermal_attr_group); 254 sysfs_remove_group(&dev->kobj, &thermal_attr_group);
256} 255}
257 256
258/* Mutex protecting device creation against CPU hotplug: */ 257/* Mutex protecting device creation against CPU hotplug: */
@@ -265,16 +264,16 @@ thermal_throttle_cpu_callback(struct notifier_block *nfb,
265 void *hcpu) 264 void *hcpu)
266{ 265{
267 unsigned int cpu = (unsigned long)hcpu; 266 unsigned int cpu = (unsigned long)hcpu;
268 struct sys_device *sys_dev; 267 struct device *dev;
269 int err = 0; 268 int err = 0;
270 269
271 sys_dev = get_cpu_sysdev(cpu); 270 dev = get_cpu_device(cpu);
272 271
273 switch (action) { 272 switch (action) {
274 case CPU_UP_PREPARE: 273 case CPU_UP_PREPARE:
275 case CPU_UP_PREPARE_FROZEN: 274 case CPU_UP_PREPARE_FROZEN:
276 mutex_lock(&therm_cpu_lock); 275 mutex_lock(&therm_cpu_lock);
277 err = thermal_throttle_add_dev(sys_dev, cpu); 276 err = thermal_throttle_add_dev(dev, cpu);
278 mutex_unlock(&therm_cpu_lock); 277 mutex_unlock(&therm_cpu_lock);
279 WARN_ON(err); 278 WARN_ON(err);
280 break; 279 break;
@@ -283,7 +282,7 @@ thermal_throttle_cpu_callback(struct notifier_block *nfb,
283 case CPU_DEAD: 282 case CPU_DEAD:
284 case CPU_DEAD_FROZEN: 283 case CPU_DEAD_FROZEN:
285 mutex_lock(&therm_cpu_lock); 284 mutex_lock(&therm_cpu_lock);
286 thermal_throttle_remove_dev(sys_dev); 285 thermal_throttle_remove_dev(dev);
287 mutex_unlock(&therm_cpu_lock); 286 mutex_unlock(&therm_cpu_lock);
288 break; 287 break;
289 } 288 }
@@ -310,7 +309,7 @@ static __init int thermal_throttle_init_device(void)
310#endif 309#endif
311 /* connect live CPUs to sysfs */ 310 /* connect live CPUs to sysfs */
312 for_each_online_cpu(cpu) { 311 for_each_online_cpu(cpu) {
313 err = thermal_throttle_add_dev(get_cpu_sysdev(cpu), cpu); 312 err = thermal_throttle_add_dev(get_cpu_device(cpu), cpu);
314 WARN_ON(err); 313 WARN_ON(err);
315 } 314 }
316#ifdef CONFIG_HOTPLUG_CPU 315#ifdef CONFIG_HOTPLUG_CPU
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index 07b0a56a754d..ad0de0c2714e 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -2,7 +2,6 @@
2#include <linux/clockchips.h> 2#include <linux/clockchips.h>
3#include <linux/interrupt.h> 3#include <linux/interrupt.h>
4#include <linux/export.h> 4#include <linux/export.h>
5#include <linux/sysdev.h>
6#include <linux/delay.h> 5#include <linux/delay.h>
7#include <linux/errno.h> 6#include <linux/errno.h>
8#include <linux/i8253.h> 7#include <linux/i8253.h>
diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c
index b3300e6bacef..313fb5cddbce 100644
--- a/arch/x86/kernel/irqinit.c
+++ b/arch/x86/kernel/irqinit.c
@@ -9,7 +9,7 @@
9#include <linux/kprobes.h> 9#include <linux/kprobes.h>
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/kernel_stat.h> 11#include <linux/kernel_stat.h>
12#include <linux/sysdev.h> 12#include <linux/device.h>
13#include <linux/bitops.h> 13#include <linux/bitops.h>
14#include <linux/acpi.h> 14#include <linux/acpi.h>
15#include <linux/io.h> 15#include <linux/io.h>
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c
index 9302e2d0eb4b..fda91c307104 100644
--- a/arch/x86/kernel/microcode_core.c
+++ b/arch/x86/kernel/microcode_core.c
@@ -292,8 +292,8 @@ static int reload_for_cpu(int cpu)
292 return err; 292 return err;
293} 293}
294 294
295static ssize_t reload_store(struct sys_device *dev, 295static ssize_t reload_store(struct device *dev,
296 struct sysdev_attribute *attr, 296 struct device_attribute *attr,
297 const char *buf, size_t size) 297 const char *buf, size_t size)
298{ 298{
299 unsigned long val; 299 unsigned long val;
@@ -318,30 +318,30 @@ static ssize_t reload_store(struct sys_device *dev,
318 return ret; 318 return ret;
319} 319}
320 320
321static ssize_t version_show(struct sys_device *dev, 321static ssize_t version_show(struct device *dev,
322 struct sysdev_attribute *attr, char *buf) 322 struct device_attribute *attr, char *buf)
323{ 323{
324 struct ucode_cpu_info *uci = ucode_cpu_info + dev->id; 324 struct ucode_cpu_info *uci = ucode_cpu_info + dev->id;
325 325
326 return sprintf(buf, "0x%x\n", uci->cpu_sig.rev); 326 return sprintf(buf, "0x%x\n", uci->cpu_sig.rev);
327} 327}
328 328
329static ssize_t pf_show(struct sys_device *dev, 329static ssize_t pf_show(struct device *dev,
330 struct sysdev_attribute *attr, char *buf) 330 struct device_attribute *attr, char *buf)
331{ 331{
332 struct ucode_cpu_info *uci = ucode_cpu_info + dev->id; 332 struct ucode_cpu_info *uci = ucode_cpu_info + dev->id;
333 333
334 return sprintf(buf, "0x%x\n", uci->cpu_sig.pf); 334 return sprintf(buf, "0x%x\n", uci->cpu_sig.pf);
335} 335}
336 336
337static SYSDEV_ATTR(reload, 0200, NULL, reload_store); 337static DEVICE_ATTR(reload, 0200, NULL, reload_store);
338static SYSDEV_ATTR(version, 0400, version_show, NULL); 338static DEVICE_ATTR(version, 0400, version_show, NULL);
339static SYSDEV_ATTR(processor_flags, 0400, pf_show, NULL); 339static DEVICE_ATTR(processor_flags, 0400, pf_show, NULL);
340 340
341static struct attribute *mc_default_attrs[] = { 341static struct attribute *mc_default_attrs[] = {
342 &attr_reload.attr, 342 &dev_attr_reload.attr,
343 &attr_version.attr, 343 &dev_attr_version.attr,
344 &attr_processor_flags.attr, 344 &dev_attr_processor_flags.attr,
345 NULL 345 NULL
346}; 346};
347 347
@@ -405,43 +405,45 @@ static enum ucode_state microcode_update_cpu(int cpu)
405 return ustate; 405 return ustate;
406} 406}
407 407
408static int mc_sysdev_add(struct sys_device *sys_dev) 408static int mc_device_add(struct device *dev, struct subsys_interface *sif)
409{ 409{
410 int err, cpu = sys_dev->id; 410 int err, cpu = dev->id;
411 411
412 if (!cpu_online(cpu)) 412 if (!cpu_online(cpu))
413 return 0; 413 return 0;
414 414
415 pr_debug("CPU%d added\n", cpu); 415 pr_debug("CPU%d added\n", cpu);
416 416
417 err = sysfs_create_group(&sys_dev->kobj, &mc_attr_group); 417 err = sysfs_create_group(&dev->kobj, &mc_attr_group);
418 if (err) 418 if (err)
419 return err; 419 return err;
420 420
421 if (microcode_init_cpu(cpu) == UCODE_ERROR) { 421 if (microcode_init_cpu(cpu) == UCODE_ERROR) {
422 sysfs_remove_group(&sys_dev->kobj, &mc_attr_group); 422 sysfs_remove_group(&dev->kobj, &mc_attr_group);
423 return -EINVAL; 423 return -EINVAL;
424 } 424 }
425 425
426 return err; 426 return err;
427} 427}
428 428
429static int mc_sysdev_remove(struct sys_device *sys_dev) 429static int mc_device_remove(struct device *dev, struct subsys_interface *sif)
430{ 430{
431 int cpu = sys_dev->id; 431 int cpu = dev->id;
432 432
433 if (!cpu_online(cpu)) 433 if (!cpu_online(cpu))
434 return 0; 434 return 0;
435 435
436 pr_debug("CPU%d removed\n", cpu); 436 pr_debug("CPU%d removed\n", cpu);
437 microcode_fini_cpu(cpu); 437 microcode_fini_cpu(cpu);
438 sysfs_remove_group(&sys_dev->kobj, &mc_attr_group); 438 sysfs_remove_group(&dev->kobj, &mc_attr_group);
439 return 0; 439 return 0;
440} 440}
441 441
442static struct sysdev_driver mc_sysdev_driver = { 442static struct subsys_interface mc_cpu_interface = {
443 .add = mc_sysdev_add, 443 .name = "microcode",
444 .remove = mc_sysdev_remove, 444 .subsys = &cpu_subsys,
445 .add_dev = mc_device_add,
446 .remove_dev = mc_device_remove,
445}; 447};
446 448
447/** 449/**
@@ -464,9 +466,9 @@ static __cpuinit int
464mc_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu) 466mc_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu)
465{ 467{
466 unsigned int cpu = (unsigned long)hcpu; 468 unsigned int cpu = (unsigned long)hcpu;
467 struct sys_device *sys_dev; 469 struct device *dev;
468 470
469 sys_dev = get_cpu_sysdev(cpu); 471 dev = get_cpu_device(cpu);
470 switch (action) { 472 switch (action) {
471 case CPU_ONLINE: 473 case CPU_ONLINE:
472 case CPU_ONLINE_FROZEN: 474 case CPU_ONLINE_FROZEN:
@@ -474,13 +476,13 @@ mc_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu)
474 case CPU_DOWN_FAILED: 476 case CPU_DOWN_FAILED:
475 case CPU_DOWN_FAILED_FROZEN: 477 case CPU_DOWN_FAILED_FROZEN:
476 pr_debug("CPU%d added\n", cpu); 478 pr_debug("CPU%d added\n", cpu);
477 if (sysfs_create_group(&sys_dev->kobj, &mc_attr_group)) 479 if (sysfs_create_group(&dev->kobj, &mc_attr_group))
478 pr_err("Failed to create group for CPU%d\n", cpu); 480 pr_err("Failed to create group for CPU%d\n", cpu);
479 break; 481 break;
480 case CPU_DOWN_PREPARE: 482 case CPU_DOWN_PREPARE:
481 case CPU_DOWN_PREPARE_FROZEN: 483 case CPU_DOWN_PREPARE_FROZEN:
482 /* Suspend is in progress, only remove the interface */ 484 /* Suspend is in progress, only remove the interface */
483 sysfs_remove_group(&sys_dev->kobj, &mc_attr_group); 485 sysfs_remove_group(&dev->kobj, &mc_attr_group);
484 pr_debug("CPU%d removed\n", cpu); 486 pr_debug("CPU%d removed\n", cpu);
485 break; 487 break;
486 488
@@ -525,7 +527,7 @@ static int __init microcode_init(void)
525 get_online_cpus(); 527 get_online_cpus();
526 mutex_lock(&microcode_mutex); 528 mutex_lock(&microcode_mutex);
527 529
528 error = sysdev_driver_register(&cpu_sysdev_class, &mc_sysdev_driver); 530 error = subsys_interface_register(&mc_cpu_interface);
529 531
530 mutex_unlock(&microcode_mutex); 532 mutex_unlock(&microcode_mutex);
531 put_online_cpus(); 533 put_online_cpus();
@@ -535,7 +537,7 @@ static int __init microcode_init(void)
535 537
536 error = microcode_dev_init(); 538 error = microcode_dev_init();
537 if (error) 539 if (error)
538 goto out_sysdev_driver; 540 goto out_driver;
539 541
540 register_syscore_ops(&mc_syscore_ops); 542 register_syscore_ops(&mc_syscore_ops);
541 register_hotcpu_notifier(&mc_cpu_notifier); 543 register_hotcpu_notifier(&mc_cpu_notifier);
@@ -545,11 +547,11 @@ static int __init microcode_init(void)
545 547
546 return 0; 548 return 0;
547 549
548out_sysdev_driver: 550out_driver:
549 get_online_cpus(); 551 get_online_cpus();
550 mutex_lock(&microcode_mutex); 552 mutex_lock(&microcode_mutex);
551 553
552 sysdev_driver_unregister(&cpu_sysdev_class, &mc_sysdev_driver); 554 subsys_interface_unregister(&mc_cpu_interface);
553 555
554 mutex_unlock(&microcode_mutex); 556 mutex_unlock(&microcode_mutex);
555 put_online_cpus(); 557 put_online_cpus();
@@ -573,7 +575,7 @@ static void __exit microcode_exit(void)
573 get_online_cpus(); 575 get_online_cpus();
574 mutex_lock(&microcode_mutex); 576 mutex_lock(&microcode_mutex);
575 577
576 sysdev_driver_unregister(&cpu_sysdev_class, &mc_sysdev_driver); 578 subsys_interface_unregister(&mc_cpu_interface);
577 579
578 mutex_unlock(&microcode_mutex); 580 mutex_unlock(&microcode_mutex);
579 put_online_cpus(); 581 put_online_cpus();
diff --git a/arch/x86/platform/uv/uv_sysfs.c b/arch/x86/platform/uv/uv_sysfs.c
index 309c70fb7759..5d4ba301e776 100644
--- a/arch/x86/platform/uv/uv_sysfs.c
+++ b/arch/x86/platform/uv/uv_sysfs.c
@@ -19,7 +19,7 @@
19 * Copyright (c) Russ Anderson 19 * Copyright (c) Russ Anderson
20 */ 20 */
21 21
22#include <linux/sysdev.h> 22#include <linux/device.h>
23#include <asm/uv/bios.h> 23#include <asm/uv/bios.h>
24#include <asm/uv/uv.h> 24#include <asm/uv/uv.h>
25 25