diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-07 15:03:30 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-07 15:03:30 -0500 |
commit | 7affca3537d74365128e477b40c529d6f2fe86c8 (patch) | |
tree | 20be92bd240029182fc89c2c4f25401b7715dcae | |
parent | 356b95424cfb456e14a59eaa579422ce014c424b (diff) | |
parent | ff4b8a57f0aaa2882d444ca44b2b9b333d22a4df (diff) |
Merge branch 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
* 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (73 commits)
arm: fix up some samsung merge sysdev conversion problems
firmware: Fix an oops on reading fw_priv->fw in sysfs loading file
Drivers:hv: Fix a bug in vmbus_driver_unregister()
driver core: remove __must_check from device_create_file
debugfs: add missing #ifdef HAS_IOMEM
arm: time.h: remove device.h #include
driver-core: remove sysdev.h usage.
clockevents: remove sysdev.h
arm: convert sysdev_class to a regular subsystem
arm: leds: convert sysdev_class to a regular subsystem
kobject: remove kset_find_obj_hinted()
m86k: gpio - convert sysdev_class to a regular subsystem
mips: txx9_sram - convert sysdev_class to a regular subsystem
mips: 7segled - convert sysdev_class to a regular subsystem
sh: dma - convert sysdev_class to a regular subsystem
sh: intc - convert sysdev_class to a regular subsystem
power: suspend - convert sysdev_class to a regular subsystem
power: qe_ic - convert sysdev_class to a regular subsystem
power: cmm - convert sysdev_class to a regular subsystem
s390: time - convert sysdev_class to a regular subsystem
...
Fix up conflicts with 'struct sysdev' removal from various platform
drivers that got changed:
- arch/arm/mach-exynos/cpu.c
- arch/arm/mach-exynos/irq-eint.c
- arch/arm/mach-s3c64xx/common.c
- arch/arm/mach-s3c64xx/cpu.c
- arch/arm/mach-s5p64x0/cpu.c
- arch/arm/mach-s5pv210/common.c
- arch/arm/plat-samsung/include/plat/cpu.h
- arch/powerpc/kernel/sysfs.c
and fix up cpu_is_hotpluggable() as per Greg in include/linux/cpu.h
517 files changed, 3169 insertions, 6891 deletions
diff --git a/Documentation/HOWTO b/Documentation/HOWTO index 81bc1a9ab9d8..f7ade3b3b40d 100644 --- a/Documentation/HOWTO +++ b/Documentation/HOWTO | |||
@@ -275,8 +275,8 @@ versions. | |||
275 | If no 2.6.x.y kernel is available, then the highest numbered 2.6.x | 275 | If no 2.6.x.y kernel is available, then the highest numbered 2.6.x |
276 | kernel is the current stable kernel. | 276 | kernel is the current stable kernel. |
277 | 277 | ||
278 | 2.6.x.y are maintained by the "stable" team <stable@kernel.org>, and are | 278 | 2.6.x.y are maintained by the "stable" team <stable@vger.kernel.org>, and |
279 | released as needs dictate. The normal release period is approximately | 279 | are released as needs dictate. The normal release period is approximately |
280 | two weeks, but it can be longer if there are no pressing problems. A | 280 | two weeks, but it can be longer if there are no pressing problems. A |
281 | security-related problem, instead, can cause a release to happen almost | 281 | security-related problem, instead, can cause a release to happen almost |
282 | instantly. | 282 | instantly. |
diff --git a/Documentation/development-process/5.Posting b/Documentation/development-process/5.Posting index 903a2546f138..8a48c9b62864 100644 --- a/Documentation/development-process/5.Posting +++ b/Documentation/development-process/5.Posting | |||
@@ -271,10 +271,10 @@ copies should go to: | |||
271 | the linux-kernel list. | 271 | the linux-kernel list. |
272 | 272 | ||
273 | - If you are fixing a bug, think about whether the fix should go into the | 273 | - If you are fixing a bug, think about whether the fix should go into the |
274 | next stable update. If so, stable@kernel.org should get a copy of the | 274 | next stable update. If so, stable@vger.kernel.org should get a copy of |
275 | patch. Also add a "Cc: stable@kernel.org" to the tags within the patch | 275 | the patch. Also add a "Cc: stable@vger.kernel.org" to the tags within |
276 | itself; that will cause the stable team to get a notification when your | 276 | the patch itself; that will cause the stable team to get a notification |
277 | fix goes into the mainline. | 277 | when your fix goes into the mainline. |
278 | 278 | ||
279 | When selecting recipients for a patch, it is good to have an idea of who | 279 | When selecting recipients for a patch, it is good to have an idea of who |
280 | you think will eventually accept the patch and get it merged. While it | 280 | you think will eventually accept the patch and get it merged. While it |
diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt index d79aead9418b..10c64c8a13d4 100644 --- a/Documentation/driver-model/devres.txt +++ b/Documentation/driver-model/devres.txt | |||
@@ -262,6 +262,7 @@ IOMAP | |||
262 | devm_ioremap() | 262 | devm_ioremap() |
263 | devm_ioremap_nocache() | 263 | devm_ioremap_nocache() |
264 | devm_iounmap() | 264 | devm_iounmap() |
265 | devm_request_and_ioremap() : checks resource, requests region, ioremaps | ||
265 | pcim_iomap() | 266 | pcim_iomap() |
266 | pcim_iounmap() | 267 | pcim_iounmap() |
267 | pcim_iomap_table() : array of mapped addresses indexed by BAR | 268 | pcim_iomap_table() : array of mapped addresses indexed by BAR |
diff --git a/Documentation/filesystems/debugfs.txt b/Documentation/filesystems/debugfs.txt index 742cc06e138f..f04066a37f4c 100644 --- a/Documentation/filesystems/debugfs.txt +++ b/Documentation/filesystems/debugfs.txt | |||
@@ -97,7 +97,8 @@ A read on the resulting file will yield either Y (for non-zero values) or | |||
97 | N, followed by a newline. If written to, it will accept either upper- or | 97 | N, followed by a newline. If written to, it will accept either upper- or |
98 | lower-case values, or 1 or 0. Any other input will be silently ignored. | 98 | lower-case values, or 1 or 0. Any other input will be silently ignored. |
99 | 99 | ||
100 | Finally, a block of arbitrary binary data can be exported with: | 100 | Another option is exporting a block of arbitrary binary data, with |
101 | this structure and function: | ||
101 | 102 | ||
102 | struct debugfs_blob_wrapper { | 103 | struct debugfs_blob_wrapper { |
103 | void *data; | 104 | void *data; |
@@ -115,6 +116,35 @@ can be used to export binary information, but there does not appear to be | |||
115 | any code which does so in the mainline. Note that all files created with | 116 | any code which does so in the mainline. Note that all files created with |
116 | debugfs_create_blob() are read-only. | 117 | debugfs_create_blob() are read-only. |
117 | 118 | ||
119 | If you want to dump a block of registers (something that happens quite | ||
120 | often during development, even if little such code reaches mainline. | ||
121 | Debugfs offers two functions: one to make a registers-only file, and | ||
122 | another to insert a register block in the middle of another sequential | ||
123 | file. | ||
124 | |||
125 | struct debugfs_reg32 { | ||
126 | char *name; | ||
127 | unsigned long offset; | ||
128 | }; | ||
129 | |||
130 | struct debugfs_regset32 { | ||
131 | struct debugfs_reg32 *regs; | ||
132 | int nregs; | ||
133 | void __iomem *base; | ||
134 | }; | ||
135 | |||
136 | struct dentry *debugfs_create_regset32(const char *name, mode_t mode, | ||
137 | struct dentry *parent, | ||
138 | struct debugfs_regset32 *regset); | ||
139 | |||
140 | int debugfs_print_regs32(struct seq_file *s, struct debugfs_reg32 *regs, | ||
141 | int nregs, void __iomem *base, char *prefix); | ||
142 | |||
143 | The "base" argument may be 0, but you may want to build the reg32 array | ||
144 | using __stringify, and a number of register names (macros) are actually | ||
145 | byte offsets over a base for the register block. | ||
146 | |||
147 | |||
118 | There are a couple of other directory-oriented helper functions: | 148 | There are a couple of other directory-oriented helper functions: |
119 | 149 | ||
120 | struct dentry *debugfs_rename(struct dentry *old_dir, | 150 | struct dentry *debugfs_rename(struct dentry *old_dir, |
diff --git a/MAINTAINERS b/MAINTAINERS index 4babed7836c7..2f42213925a8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -6259,7 +6259,7 @@ F: arch/alpha/kernel/srm_env.c | |||
6259 | 6259 | ||
6260 | STABLE BRANCH | 6260 | STABLE BRANCH |
6261 | M: Greg Kroah-Hartman <greg@kroah.com> | 6261 | M: Greg Kroah-Hartman <greg@kroah.com> |
6262 | L: stable@kernel.org | 6262 | L: stable@vger.kernel.org |
6263 | S: Maintained | 6263 | S: Maintained |
6264 | 6264 | ||
6265 | STAGING SUBSYSTEM | 6265 | STAGING SUBSYSTEM |
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 | ||
37 | static ssize_t leds_store(struct sys_device *dev, | 37 | static 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 | ||
72 | static SYSDEV_ATTR(event, 0200, NULL, leds_store); | 72 | static DEVICE_ATTR(event, 0200, NULL, leds_store); |
73 | 73 | ||
74 | static struct sysdev_class leds_sysclass = { | 74 | static struct bus_type leds_subsys = { |
75 | .name = "leds", | 75 | .name = "leds", |
76 | .dev_name = "leds", | ||
76 | }; | 77 | }; |
77 | 78 | ||
78 | static struct sys_device leds_device = { | 79 | static struct device leds_device = { |
79 | .id = 0, | 80 | .id = 0, |
80 | .cls = &leds_sysclass, | 81 | .bus = &leds_subsys, |
81 | }; | 82 | }; |
82 | 83 | ||
83 | static int leds_suspend(void) | 84 | static int leds_suspend(void) |
@@ -105,11 +106,11 @@ static struct syscore_ops leds_syscore_ops = { | |||
105 | static int __init leds_init(void) | 106 | static 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 | ||
426 | struct sysdev_class exynos4_sysclass = { | 426 | struct bus_type exynos4_subsys = { |
427 | .name = "exynos4-core", | 427 | .name = "exynos4-core", |
428 | .dev_name = "exynos4-core", | ||
428 | }; | 429 | }; |
429 | 430 | ||
430 | static struct sys_device exynos4_sysdev = { | 431 | static struct device exynos4_dev = { |
431 | .cls = &exynos4_sysclass, | 432 | .bus = &exynos4_subsys, |
432 | }; | 433 | }; |
433 | 434 | ||
434 | static int __init exynos4_core_init(void) | 435 | static 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 | } |
438 | core_initcall(exynos4_core_init); | 439 | core_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 | ||
476 | static struct s3c24xx_uart_clksrc exynos4_serial_clocks[] = { | 477 | static 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 | ||
208 | static int exynos4_pm_add(struct sys_device *sysdev) | 208 | static 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 | ||
304 | static struct sysdev_driver exynos4_pm_driver = { | 304 | static 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 | ||
308 | static __init int exynos4_pm_drvinit(void) | 310 | static __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 | } |
330 | arch_initcall(exynos4_pm_drvinit); | 332 | arch_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 | ||
118 | static int s3c2410_cpufreq_add(struct sys_device *sysdev) | 118 | static 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 | ||
123 | static struct sysdev_driver s3c2410_cpufreq_driver = { | 123 | static 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 | ||
127 | static int __init s3c2410_cpufreq_init(void) | 129 | static 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 | ||
133 | arch_initcall(s3c2410_cpufreq_init); | 134 | arch_initcall(s3c2410_cpufreq_init); |
134 | 135 | ||
135 | static int s3c2410a_cpufreq_add(struct sys_device *sysdev) | 136 | static 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 | ||
149 | static struct sysdev_driver s3c2410a_cpufreq_driver = { | 150 | static 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 | ||
153 | static int __init s3c2410a_cpufreq_init(void) | 156 | static 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 | ||
159 | arch_initcall(s3c2410a_cpufreq_init); | 161 | arch_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 | ||
135 | static int __init s3c2410_dma_add(struct sys_device *sysdev) | 135 | static 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) |
143 | static struct sysdev_driver s3c2410_dma_driver = { | 143 | static 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 | ||
147 | static int __init s3c2410_dma_drvinit(void) | 149 | static 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 | ||
152 | arch_initcall(s3c2410_dma_drvinit); | 154 | arch_initcall(s3c2410_dma_drvinit); |
153 | 155 | ||
154 | static struct sysdev_driver s3c2410a_dma_driver = { | 156 | static 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 | ||
158 | static int __init s3c2410a_dma_drvinit(void) | 162 | static 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 | ||
163 | arch_initcall(s3c2410a_dma_drvinit); | 167 | arch_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 */ |
168 | static struct sysdev_driver s3c2442_dma_driver = { | 172 | static 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 | ||
172 | static int __init s3c2442_dma_drvinit(void) | 178 | static 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 | ||
177 | arch_initcall(s3c2442_dma_drvinit); | 183 | arch_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 | ||
208 | typedef unsigned long dma_device_t; | 208 | typedef 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 | ||
69 | static int s3c2410_plls_add(struct sys_device *dev) | 69 | static 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 | ||
74 | static struct sysdev_driver s3c2410_plls_drv = { | 74 | static 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 | ||
78 | static int __init s3c2410_pll_init(void) | 80 | static 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 | ||
84 | arch_initcall(s3c2410_pll_init); | 86 | arch_initcall(s3c2410_pll_init); |
85 | 87 | ||
86 | static struct sysdev_driver s3c2410a_plls_drv = { | 88 | static 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 | ||
90 | static int __init s3c2410a_pll_init(void) | 94 | static 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 | ||
95 | arch_initcall(s3c2410a_pll_init); | 99 | arch_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 | ||
114 | static int s3c2410_pm_add(struct sys_device *dev) | 114 | static 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) |
123 | static struct sysdev_driver s3c2410_pm_driver = { | 123 | static 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 | ||
129 | static int __init s3c2410_pm_drvinit(void) | 131 | static 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 | ||
134 | arch_initcall(s3c2410_pm_drvinit); | 136 | arch_initcall(s3c2410_pm_drvinit); |
135 | 137 | ||
136 | static struct sysdev_driver s3c2410a_pm_driver = { | 138 | static 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 | ||
140 | static int __init s3c2410a_pm_drvinit(void) | 144 | static 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 | ||
145 | arch_initcall(s3c2410a_pm_drvinit); | 149 | arch_initcall(s3c2410a_pm_drvinit); |
146 | #endif | 150 | #endif |
147 | 151 | ||
148 | #if defined(CONFIG_CPU_S3C2440) | 152 | #if defined(CONFIG_CPU_S3C2440) |
149 | static struct sysdev_driver s3c2440_pm_driver = { | 153 | static 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 | ||
153 | static int __init s3c2440_pm_drvinit(void) | 159 | static 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 | ||
158 | arch_initcall(s3c2440_pm_drvinit); | 164 | arch_initcall(s3c2440_pm_drvinit); |
159 | #endif | 165 | #endif |
160 | 166 | ||
161 | #if defined(CONFIG_CPU_S3C2442) | 167 | #if defined(CONFIG_CPU_S3C2442) |
162 | static struct sysdev_driver s3c2442_pm_driver = { | 168 | static 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 | ||
166 | static int __init s3c2442_pm_drvinit(void) | 174 | static 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 | ||
171 | arch_initcall(s3c2442_pm_drvinit); | 179 | arch_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 | ||
135 | struct sysdev_class s3c2410_sysclass = { | 135 | struct 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 | */ |
142 | struct sysdev_class s3c2410a_sysclass = { | 143 | struct bus_type s3c2410a_subsys = { |
143 | .name = "s3c2410a-core", | 144 | .name = "s3c2410a-core", |
145 | .dev_name = "s3c2410a-core", | ||
144 | }; | 146 | }; |
145 | 147 | ||
146 | static struct sys_device s3c2410_sysdev = { | 148 | static 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 | ||
156 | static int __init s3c2410_core_init(void) | 158 | static 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 | ||
161 | core_initcall(s3c2410_core_init); | 163 | core_initcall(s3c2410_core_init); |
162 | 164 | ||
163 | static int __init s3c2410a_core_init(void) | 165 | static 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 | ||
168 | core_initcall(s3c2410a_core_init); | 170 | core_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 | ||
182 | int __init s3c2410a_init(void) | 184 | int __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 | ||
197 | static int s3c2412_cpufreq_add(struct sys_device *sysdev) | 197 | static 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 | ||
247 | static struct sysdev_driver s3c2412_cpufreq_driver = { | 247 | static 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 | ||
251 | static int s3c2412_cpufreq_init(void) | 253 | static 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 | ||
257 | arch_initcall(s3c2412_cpufreq_init); | 258 | arch_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 | ||
162 | static int __init s3c2412_dma_add(struct sys_device *sysdev) | 162 | static 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 | ||
168 | static struct sysdev_driver s3c2412_dma_driver = { | 168 | static 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 | ||
172 | static int __init s3c2412_dma_init(void) | 174 | static 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 | ||
177 | arch_initcall(s3c2412_dma_init); | 179 | arch_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 | ||
171 | static struct irq_chip s3c2412_irq_rtc_chip; | 171 | static struct irq_chip s3c2412_irq_rtc_chip; |
172 | 172 | ||
173 | static int s3c2412_irq_add(struct sys_device *sysdev) | 173 | static 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 | ||
203 | static struct sysdev_driver s3c2412_irq_driver = { | 203 | static 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 | ||
207 | static int s3c2412_irq_init(void) | 209 | static 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 | ||
212 | arch_initcall(s3c2412_irq_init); | 214 | arch_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 | ||
59 | static int s3c2412_pm_add(struct sys_device *sysdev) | 59 | static 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 | ||
90 | static struct sysdev_driver s3c2412_pm_driver = { | 90 | static 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 | ||
94 | static __init int s3c2412_pm_init(void) | 96 | static __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 | ||
99 | arch_initcall(s3c2412_pm_init); | 101 | arch_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 | ||
227 | struct sysdev_class s3c2412_sysclass = { | 227 | struct bus_type s3c2412_subsys = { |
228 | .name = "s3c2412-core", | 228 | .name = "s3c2412-core", |
229 | .dev_name = "s3c2412-core", | ||
229 | }; | 230 | }; |
230 | 231 | ||
231 | static int __init s3c2412_core_init(void) | 232 | static 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 | ||
236 | core_initcall(s3c2412_core_init); | 237 | core_initcall(s3c2412_core_init); |
237 | 238 | ||
238 | static struct sys_device s3c2412_sysdev = { | 239 | static struct device s3c2412_dev = { |
239 | .cls = &s3c2412_sysclass, | 240 | .bus = &s3c2412_subsys, |
240 | }; | 241 | }; |
241 | 242 | ||
242 | int __init s3c2412_init(void) | 243 | int __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 | ||
216 | static int __init s3c2416_irq_add(struct sys_device *sysdev) | 216 | static 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 | ||
237 | static struct sysdev_driver s3c2416_irq_driver = { | 237 | static 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 | ||
241 | static int __init s3c2416_irq_init(void) | 243 | static 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 | ||
246 | arch_initcall(s3c2416_irq_init); | 248 | arch_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 | ||
51 | static int s3c2416_pm_add(struct sys_device *sysdev) | 51 | static 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 | ||
59 | static struct sysdev_driver s3c2416_pm_driver = { | 59 | static 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 | ||
63 | static __init int s3c2416_pm_init(void) | 65 | static __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 | ||
68 | arch_initcall(s3c2416_pm_init); | 70 | arch_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 | ||
70 | struct sysdev_class s3c2416_sysclass = { | 70 | struct bus_type s3c2416_subsys = { |
71 | .name = "s3c2416-core", | 71 | .name = "s3c2416-core", |
72 | .dev_name = "s3c2416-core", | ||
72 | }; | 73 | }; |
73 | 74 | ||
74 | static struct sys_device s3c2416_sysdev = { | 75 | static struct device s3c2416_dev = { |
75 | .cls = &s3c2416_sysclass, | 76 | .bus = &s3c2416_subsys, |
76 | }; | 77 | }; |
77 | 78 | ||
78 | void s3c2416_restart(char mode, const char *cmd) | 79 | void 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 | ||
112 | void __init s3c2416_init_uarts(struct s3c2410_uartcfg *cfg, int no) | 113 | void __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 | ||
143 | static int __init s3c2416_core_init(void) | 144 | static 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 | ||
148 | core_initcall(s3c2416_core_init); | 149 | core_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 | ||
111 | static int s3c2440_clk_add(struct sys_device *sysdev) | 110 | static 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 | ||
140 | static struct sysdev_driver s3c2440_clk_driver = { | 139 | static 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 | ||
144 | static __init int s3c24xx_clk_driver(void) | 145 | static __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 | ||
149 | arch_initcall(s3c24xx_clk_driver); | 150 | arch_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 | ||
177 | static int __init s3c2440_dma_add(struct sys_device *sysdev) | 177 | static 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 | ||
184 | static struct sysdev_driver s3c2440_dma_driver = { | 184 | static 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 | ||
188 | static int __init s3c2440_dma_init(void) | 190 | static 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 | ||
193 | arch_initcall(s3c2440_dma_init); | 195 | arch_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 | ||
95 | static int s3c2440_irq_add(struct sys_device *sysdev) | 95 | static 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 | ||
116 | static struct sysdev_driver s3c2440_irq_driver = { | 116 | static 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 | ||
120 | static int s3c2440_irq_init(void) | 122 | static 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 | ||
125 | arch_initcall(s3c2440_irq_init); | 127 | arch_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 | ||
273 | static int s3c2440_cpufreq_add(struct sys_device *sysdev) | 273 | static 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 | ||
288 | static struct sysdev_driver s3c2440_cpufreq_driver = { | 288 | static 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 | ||
292 | static int s3c2440_cpufreq_init(void) | 294 | static 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. */ |
299 | subsys_initcall(s3c2440_cpufreq_init); | 300 | subsys_initcall(s3c2440_cpufreq_init); |
300 | 301 | ||
301 | static struct sysdev_driver s3c2442_cpufreq_driver = { | 302 | static 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 | ||
305 | static int s3c2442_cpufreq_init(void) | 308 | static 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 | ||
311 | subsys_initcall(s3c2442_cpufreq_init); | 313 | subsys_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 | ||
54 | static int s3c2440_plls12_add(struct sys_device *dev) | 54 | static 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 | ||
75 | static struct sysdev_driver s3c2440_plls12_drv = { | 75 | static 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 | ||
79 | static int __init s3c2440_pll_12mhz(void) | 81 | static 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 | ||
85 | arch_initcall(s3c2440_pll_12mhz); | 87 | arch_initcall(s3c2440_pll_12mhz); |
86 | 88 | ||
87 | static struct sysdev_driver s3c2442_plls12_drv = { | 89 | static 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 | ||
91 | static int __init s3c2442_pll_12mhz(void) | 95 | static 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 | ||
82 | static int s3c2440_plls169344_add(struct sys_device *dev) | 82 | static 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 | ||
103 | static struct sysdev_driver s3c2440_plls169344_drv = { | 103 | static 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 | ||
107 | static int __init s3c2440_pll_16934400(void) | 109 | static 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 | ||
114 | arch_initcall(s3c2440_pll_16934400); | 114 | arch_initcall(s3c2440_pll_16934400); |
115 | 115 | ||
116 | static struct sysdev_driver s3c2442_plls169344_drv = { | 116 | static 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 | ||
120 | static int __init s3c2442_pll_16934400(void) | 122 | static 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 | ||
127 | arch_initcall(s3c2442_pll_16934400); | 127 | arch_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 | ||
44 | static struct sys_device s3c2440_sysdev = { | 44 | static struct device s3c2440_dev = { |
45 | .cls = &s3c2440_sysclass, | 45 | .bus = &s3c2440_subsys, |
46 | }; | 46 | }; |
47 | 47 | ||
48 | int __init s3c2440_init(void) | 48 | int __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 | ||
70 | void __init s3c2440_map_io(void) | 70 | void __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 | ||
126 | static int s3c2442_clk_add(struct sys_device *sysdev) | 125 | static 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 | ||
152 | static struct sysdev_driver s3c2442_clk_driver = { | 151 | static 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 | ||
156 | static __init int s3c2442_clk_init(void) | 157 | static __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 | ||
161 | arch_initcall(s3c2442_clk_init); | 162 | arch_initcall(s3c2442_clk_init); |
162 | 163 | ||
163 | 164 | ||
164 | static struct sys_device s3c2442_sysdev = { | 165 | static struct device s3c2442_dev = { |
165 | .cls = &s3c2442_sysclass, | 166 | .bus = &s3c2442_subsys, |
166 | }; | 167 | }; |
167 | 168 | ||
168 | int __init s3c2442_init(void) | 169 | int __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 | ||
181 | void __init s3c2442_map_io(void) | 182 | void __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 | ||
76 | static int s3c244x_clk_add(struct sys_device *sysdev) | 75 | static 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 | ||
118 | static struct sysdev_driver s3c2440_clk_driver = { | 117 | static 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 | ||
122 | static int s3c2440_clk_init(void) | 123 | static 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 | ||
127 | arch_initcall(s3c2440_clk_init); | 128 | arch_initcall(s3c2440_clk_init); |
128 | 129 | ||
129 | static struct sysdev_driver s3c2442_clk_driver = { | 130 | static 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 | ||
133 | static int s3c2442_clk_init(void) | 136 | static 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 | ||
138 | arch_initcall(s3c2442_clk_init); | 141 | arch_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 | ||
94 | static int s3c244x_irq_add(struct sys_device *sysdev) | 94 | static 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 | ||
117 | static struct sysdev_driver s3c2440_irq_driver = { | 117 | static 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 | ||
121 | static int s3c2440_irq_init(void) | 123 | static 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 | ||
126 | arch_initcall(s3c2440_irq_init); | 128 | arch_initcall(s3c2440_irq_init); |
127 | 129 | ||
128 | static struct sysdev_driver s3c2442_irq_driver = { | 130 | static 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 | ||
133 | static int s3c2442_irq_init(void) | 137 | static 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 | ||
138 | arch_initcall(s3c2442_irq_init); | 142 | arch_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 | ||
140 | struct sysdev_class s3c2440_sysclass = { | 140 | struct bus_type s3c2440_subsys = { |
141 | .name = "s3c2440-core", | 141 | .name = "s3c2440-core", |
142 | .dev_name = "s3c2440-core", | ||
142 | }; | 143 | }; |
143 | 144 | ||
144 | struct sysdev_class s3c2442_sysclass = { | 145 | struct 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 | ||
154 | static int __init s3c2440_core_init(void) | 156 | static 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 | ||
159 | core_initcall(s3c2440_core_init); | 161 | core_initcall(s3c2440_core_init); |
160 | 162 | ||
161 | static int __init s3c2442_core_init(void) | 163 | static 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 | ||
166 | core_initcall(s3c2442_core_init); | 168 | core_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 | ||
138 | static int __init s3c2443_dma_add(struct sys_device *sysdev) | 138 | static 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 | ||
144 | static struct sysdev_driver s3c2443_dma_driver = { | 144 | static 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 | ||
148 | static int __init s3c2443_dma_init(void) | 150 | static 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 | ||
153 | arch_initcall(s3c2443_dma_init); | 155 | arch_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 | ||
244 | static int __init s3c2443_irq_add(struct sys_device *sysdev) | 244 | static 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 | ||
268 | static struct sysdev_driver s3c2443_irq_driver = { | 268 | static 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 | ||
272 | static int __init s3c2443_irq_init(void) | 274 | static 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 | ||
277 | arch_initcall(s3c2443_irq_init); | 279 | arch_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 | ||
51 | struct sysdev_class s3c2443_sysclass = { | 51 | struct bus_type s3c2443_subsys = { |
52 | .name = "s3c2443-core", | 52 | .name = "s3c2443-core", |
53 | .dev_name = "s3c2443-core", | ||
53 | }; | 54 | }; |
54 | 55 | ||
55 | static struct sys_device s3c2443_sysdev = { | 56 | static struct device s3c2443_dev = { |
56 | .cls = &s3c2443_sysclass, | 57 | .bus = &s3c2443_subsys, |
57 | }; | 58 | }; |
58 | 59 | ||
59 | void s3c2443_restart(char mode, const char *cmd) | 60 | void 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 | ||
83 | void __init s3c2443_init_uarts(struct s3c2410_uartcfg *cfg, int no) | 84 | void __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 | ||
108 | static int __init s3c2443_core_init(void) | 109 | static 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 | ||
113 | core_initcall(s3c2443_core_init); | 114 | core_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 | ||
142 | struct sysdev_class s3c64xx_sysclass = { | 141 | static struct bus_type s3c64xx_subsys = { |
143 | .name = "s3c64xx-core", | 142 | .name = "s3c64xx-core", |
143 | .dev_name = "s3c64xx-core", | ||
144 | }; | 144 | }; |
145 | 145 | ||
146 | static struct sys_device s3c64xx_sysdev = { | 146 | static 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 | ||
165 | static __init int s3c64xx_sysdev_init(void) | 165 | static __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 | } |
170 | core_initcall(s3c64xx_sysdev_init); | 170 | core_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); | |||
26 | void s3c64xx_restart(char mode, const char *cmd); | 26 | void s3c64xx_restart(char mode, const char *cmd); |
27 | 27 | ||
28 | extern struct syscore_ops s3c64xx_irq_syscore_ops; | 28 | extern struct syscore_ops s3c64xx_irq_syscore_ops; |
29 | extern 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 | ||
37 | struct s3c64xx_dmac { | 37 | struct 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 | ||
634 | static struct sysdev_class dma_sysclass = { | 634 | static struct bus_type dma_subsys = { |
635 | .name = "s3c64xx-dma", | 635 | .name = "s3c64xx-dma", |
636 | .dev_name = "s3c64xx-dma", | ||
636 | }; | 637 | }; |
637 | 638 | ||
638 | static int s3c64xx_dma_init1(int chno, enum dma_ch chbase, | 639 | static 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: | |||
715 | err_map: | 716 | err_map: |
716 | iounmap(regs); | 717 | iounmap(regs); |
717 | err_dev: | 718 | err_dev: |
718 | sysdev_unregister(&dmac->sysdev); | 719 | device_unregister(&dmac->dev); |
719 | err_alloc: | 720 | err_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 | ||
74 | static struct sysdev_class s3c6400_sysclass = { | 74 | static struct bus_type s3c6400_subsys = { |
75 | .name = "s3c6400-core", | 75 | .name = "s3c6400-core", |
76 | .dev_name = "s3c6400-core", | ||
76 | }; | 77 | }; |
77 | 78 | ||
78 | static struct sys_device s3c6400_sysdev = { | 79 | static struct device s3c6400_dev = { |
79 | .cls = &s3c6400_sysclass, | 80 | .bus = &s3c6400_subsys, |
80 | }; | 81 | }; |
81 | 82 | ||
82 | static int __init s3c6400_core_init(void) | 83 | static 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 | ||
87 | core_initcall(s3c6400_core_init); | 88 | core_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 | ||
78 | struct sysdev_class s3c6410_sysclass = { | 78 | struct bus_type s3c6410_subsys = { |
79 | .name = "s3c6410-core", | 79 | .name = "s3c6410-core", |
80 | .dev_name = "s3c6410-core", | ||
80 | }; | 81 | }; |
81 | 82 | ||
82 | static struct sys_device s3c6410_sysdev = { | 83 | static struct device s3c6410_dev = { |
83 | .cls = &s3c6410_sysclass, | 84 | .bus = &s3c6410_subsys, |
84 | }; | 85 | }; |
85 | 86 | ||
86 | static int __init s3c6410_core_init(void) | 87 | static 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 | ||
91 | core_initcall(s3c6410_core_init); | 92 | core_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 | ||
260 | struct sysdev_class s5p64x0_sysclass = { | 260 | struct bus_type s5p64x0_subsys = { |
261 | .name = "s5p64x0-core", | 261 | .name = "s5p64x0-core", |
262 | .dev_name = "s5p64x0-core", | ||
262 | }; | 263 | }; |
263 | 264 | ||
264 | static struct sys_device s5p64x0_sysdev = { | 265 | static struct device s5p64x0_dev = { |
265 | .cls = &s5p64x0_sysclass, | 266 | .bus = &s5p64x0_subsys, |
266 | }; | 267 | }; |
267 | 268 | ||
268 | static int __init s5p64x0_core_init(void) | 269 | static 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 | } |
272 | core_initcall(s5p64x0_core_init); | 273 | core_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 | ||
284 | static struct s3c24xx_uart_clksrc s5p64x0_serial_clocks[] = { | 285 | static 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 | ||
163 | static int s5p64x0_pm_add(struct sys_device *sysdev) | 163 | static 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 | ||
172 | static struct sysdev_driver s5p64x0_pm_driver = { | 172 | static 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 | ||
176 | static __init int s5p64x0_pm_drvinit(void) | 178 | static __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 | } |
182 | arch_initcall(s5p64x0_pm_drvinit); | 184 | arch_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 | ||
195 | static struct sysdev_class s5pc100_sysclass = { | 195 | static struct bus_type s5pc100_subsys = { |
196 | .name = "s5pc100-core", | 196 | .name = "s5pc100-core", |
197 | .dev_name = "s5pc100-core", | ||
197 | }; | 198 | }; |
198 | 199 | ||
199 | static struct sys_device s5pc100_sysdev = { | 200 | static struct device s5pc100_dev = { |
200 | .cls = &s5pc100_sysclass, | 201 | .bus = &s5pc100_subsys, |
201 | }; | 202 | }; |
202 | 203 | ||
203 | static int __init s5pc100_core_init(void) | 204 | static 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 | } |
207 | core_initcall(s5pc100_core_init); | 208 | core_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 | ||
232 | struct sysdev_class s5pv210_sysclass = { | 232 | struct bus_type s5pv210_subsys = { |
233 | .name = "s5pv210-core", | 233 | .name = "s5pv210-core", |
234 | .dev_name = "s5pv210-core", | ||
234 | }; | 235 | }; |
235 | 236 | ||
236 | static struct sys_device s5pv210_sysdev = { | 237 | static struct device s5pv210_dev = { |
237 | .cls = &s5pv210_sysclass, | 238 | .bus = &s5pv210_subsys, |
238 | }; | 239 | }; |
239 | 240 | ||
240 | static int __init s5pv210_core_init(void) | 241 | static 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 | } |
244 | core_initcall(s5pv210_core_init); | 245 | core_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 | ||
256 | static struct s3c24xx_uart_clksrc s5pv210_serial_clocks[] = { | 257 | static 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 | ||
136 | static int s5pv210_pm_add(struct sys_device *sysdev) | 136 | static 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 | ||
144 | static struct sysdev_driver s5pv210_pm_driver = { | 144 | static 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 | ||
148 | static __init int s5pv210_pm_drvinit(void) | 150 | static __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 | } |
152 | arch_initcall(s5pv210_pm_drvinit); | 154 | arch_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; | |||
180 | extern struct syscore_ops s3c2416_pm_syscore_ops; | 180 | extern struct syscore_ops s3c2416_pm_syscore_ops; |
181 | extern struct syscore_ops s3c244x_pm_syscore_ops; | 181 | extern struct syscore_ops s3c244x_pm_syscore_ops; |
182 | 182 | ||
183 | /* system device classes */ | 183 | /* system device subsystems */ |
184 | 184 | ||
185 | extern struct sysdev_class s3c2410_sysclass; | 185 | extern struct bus_type s3c2410_subsys; |
186 | extern struct sysdev_class s3c2410a_sysclass; | 186 | extern struct bus_type s3c2410a_subsys; |
187 | extern struct sysdev_class s3c2412_sysclass; | 187 | extern struct bus_type s3c2412_subsys; |
188 | extern struct sysdev_class s3c2416_sysclass; | 188 | extern struct bus_type s3c2416_subsys; |
189 | extern struct sysdev_class s3c2440_sysclass; | 189 | extern struct bus_type s3c2440_subsys; |
190 | extern struct sysdev_class s3c2442_sysclass; | 190 | extern struct bus_type s3c2442_subsys; |
191 | extern struct sysdev_class s3c2443_sysclass; | 191 | extern struct bus_type s3c2443_subsys; |
192 | extern struct sysdev_class s3c6410_sysclass; | 192 | extern struct bus_type s3c6410_subsys; |
193 | extern struct sysdev_class s5p64x0_sysclass; | 193 | extern struct bus_type s5p64x0_subsys; |
194 | extern struct sysdev_class s5pv210_sysclass; | 194 | extern struct bus_type s5pv210_subsys; |
195 | extern struct sysdev_class exynos4_sysclass; | 195 | extern struct bus_type exynos4_subsys; |
196 | 196 | ||
197 | extern void (*s5pc1xx_idle)(void); | 197 | extern 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 | ||
15 | extern struct sysdev_class dma_sysclass; | 15 | extern struct bus_type dma_subsys; |
16 | extern struct s3c2410_dma_chan s3c2410_chans[S3C_DMA_CHANNELS]; | 16 | extern 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 | ||
20 | struct sys_device; | 20 | struct 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 | */ |
29 | static ssize_t show_pc0event(struct sys_device *dev, | 29 | static 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 | } |
37 | static ssize_t store_pc0event(struct sys_device *dev, | 37 | static 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 | } |
51 | static ssize_t show_pc0count(struct sys_device *dev, | 51 | static 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 | } |
59 | static ssize_t store_pc0count(struct sys_device *dev, | 59 | static 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 | ||
74 | static ssize_t show_pc1event(struct sys_device *dev, | 74 | static 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 | } |
82 | static ssize_t store_pc1event(struct sys_device *dev, | 82 | static 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 | } |
96 | static ssize_t show_pc1count(struct sys_device *dev, | 96 | static 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 | } |
104 | static ssize_t store_pc1count(struct sys_device *dev, | 104 | static 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 | ||
119 | static ssize_t show_pccycles(struct sys_device *dev, | 119 | static 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 | } |
127 | static ssize_t store_pccycles(struct sys_device *dev, | 127 | static 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 | ||
142 | static ssize_t show_pcenable(struct sys_device *dev, | 142 | static 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 | } |
150 | static ssize_t store_pcenable(struct sys_device *dev, | 150 | static 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 | ||
170 | static SYSDEV_ATTR(pc0event, 0600, show_pc0event, store_pc0event); | 170 | static DEVICE_ATTR(pc0event, 0600, show_pc0event, store_pc0event); |
171 | static SYSDEV_ATTR(pc0count, 0600, show_pc0count, store_pc0count); | 171 | static DEVICE_ATTR(pc0count, 0600, show_pc0count, store_pc0count); |
172 | static SYSDEV_ATTR(pc1event, 0600, show_pc1event, store_pc1event); | 172 | static DEVICE_ATTR(pc1event, 0600, show_pc1event, store_pc1event); |
173 | static SYSDEV_ATTR(pc1count, 0600, show_pc1count, store_pc1count); | 173 | static DEVICE_ATTR(pc1count, 0600, show_pc1count, store_pc1count); |
174 | static SYSDEV_ATTR(pccycles, 0600, show_pccycles, store_pccycles); | 174 | static DEVICE_ATTR(pccycles, 0600, show_pccycles, store_pccycles); |
175 | static SYSDEV_ATTR(pcenable, 0600, show_pcenable, store_pcenable); | 175 | static 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 */ |
20 | int __weak nmi_enable(void) | 20 | int __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) \ |
38 | static SYSDEV_ATTR(name, 0444, show_##name, NULL) | 38 | static DEVICE_ATTR(name, 0444, show_##name, NULL) |
39 | 39 | ||
40 | #define define_one_rw(name) \ | 40 | #define define_one_rw(name) \ |
41 | static SYSDEV_ATTR(name, 0644, show_##name, store_##name) | 41 | static DEVICE_ATTR(name, 0644, show_##name, store_##name) |
42 | 42 | ||
43 | static u64 call_start[NR_CPUS]; | 43 | static u64 call_start[NR_CPUS]; |
44 | static u64 phys_addr[NR_CPUS]; | 44 | static u64 phys_addr[NR_CPUS]; |
@@ -55,7 +55,7 @@ static u64 resources[NR_CPUS]; | |||
55 | 55 | ||
56 | #define show(name) \ | 56 | #define show(name) \ |
57 | static ssize_t \ | 57 | static ssize_t \ |
58 | show_##name(struct sys_device *dev, struct sysdev_attribute *attr, \ | 58 | show_##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) \ |
66 | static ssize_t \ | 66 | static ssize_t \ |
67 | store_##name(struct sys_device *dev, struct sysdev_attribute *attr, \ | 67 | store_##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 | */ |
80 | static ssize_t | 80 | static ssize_t |
81 | store_call_start(struct sys_device *dev, struct sysdev_attribute *attr, | 81 | store_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) | |||
127 | store(err_type_info) | 127 | store(err_type_info) |
128 | 128 | ||
129 | static ssize_t | 129 | static ssize_t |
130 | show_virtual_to_phys(struct sys_device *dev, struct sysdev_attribute *attr, | 130 | show_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 | ||
137 | static ssize_t | 137 | static ssize_t |
138 | store_virtual_to_phys(struct sys_device *dev, struct sysdev_attribute *attr, | 138 | store_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) | |||
159 | store(err_struct_info) | 159 | store(err_struct_info) |
160 | 160 | ||
161 | static ssize_t | 161 | static ssize_t |
162 | show_err_data_buffer(struct sys_device *dev, | 162 | show_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 | ||
173 | static ssize_t | 173 | static ssize_t |
174 | store_err_data_buffer(struct sys_device *dev, | 174 | store_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); | |||
209 | define_one_ro(resources); | 209 | define_one_ro(resources); |
210 | 210 | ||
211 | static struct attribute *default_attrs[] = { | 211 | static 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 */ |
228 | static int __cpuinit err_inject_add_dev(struct sys_device * sys_dev) | 228 | static 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 | ||
233 | static int __cpuinit err_inject_remove_dev(struct sys_device * sys_dev) | 233 | static 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 | |||
283 | err_inject_exit(void) | 283 | err_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 */ |
353 | static int __cpuinit cache_add_dev(struct sys_device * sys_dev) | 353 | static 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 */ |
403 | static int __cpuinit cache_remove_dev(struct sys_device * sys_dev) | 403 | static 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 | ||
118 | struct sysdev_class mcf_gpio_sysclass = { | 118 | struct bus_type mcf_gpio_subsys = { |
119 | .name = "gpio", | 119 | .name = "gpio", |
120 | .dev_name = "gpio", | ||
120 | }; | 121 | }; |
121 | 122 | ||
122 | static int __init mcf_gpio_sysinit(void) | 123 | static 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 | ||
127 | core_initcall(mcf_gpio_sysinit); | 128 | core_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 | ||
40 | static ssize_t ascii_store(struct sys_device *dev, | 40 | static 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 | ||
49 | static ssize_t raw_store(struct sys_device *dev, | 49 | static 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 | ||
58 | static SYSDEV_ATTR(ascii, 0200, NULL, ascii_store); | 58 | static DEVICE_ATTR(ascii, 0200, NULL, ascii_store); |
59 | static SYSDEV_ATTR(raw, 0200, NULL, raw_store); | 59 | static DEVICE_ATTR(raw, 0200, NULL, raw_store); |
60 | 60 | ||
61 | static ssize_t map_seg7_show(struct sysdev_class *class, | 61 | static 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 | ||
69 | static ssize_t map_seg7_store(struct sysdev_class *class, | 69 | static 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 | ||
79 | static SYSDEV_CLASS_ATTR(map_seg7, 0600, map_seg7_show, map_seg7_store); | 79 | static DEVICE_ATTR(map_seg7, 0600, map_seg7_show, map_seg7_store); |
80 | 80 | ||
81 | static struct sysdev_class tx_7segled_sysdev_class = { | 81 | static struct bus_type tx_7segled_subsys = { |
82 | .name = "7segled", | 82 | .name = "7segled", |
83 | .dev_name = "7segled", | ||
83 | }; | 84 | }; |
84 | 85 | ||
85 | static int __init tx_7segled_init_sysfs(void) | 86 | static 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 | ||
900 | static struct sysdev_class txx9_sramc_sysdev_class; | 900 | static struct bus_type txx9_sramc_subsys = { |
901 | .name = "txx9_sram", | ||
902 | .dev_name = "txx9_sram", | ||
903 | }; | ||
901 | 904 | ||
902 | struct txx9_sramc_sysdev { | 905 | struct 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 | ||
938 | void __init txx9_sramc_init(struct resource *r) | 941 | void __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 { | |||
270 | int register_spu_syscalls(struct spufs_calls *calls); | 270 | int register_spu_syscalls(struct spufs_calls *calls); |
271 | void unregister_spu_syscalls(struct spufs_calls *calls); | 271 | void unregister_spu_syscalls(struct spufs_calls *calls); |
272 | 272 | ||
273 | int spu_add_sysdev_attr(struct sysdev_attribute *attr); | 273 | int spu_add_dev_attr(struct device_attribute *attr); |
274 | void spu_remove_sysdev_attr(struct sysdev_attribute *attr); | 274 | void spu_remove_dev_attr(struct device_attribute *attr); |
275 | 275 | ||
276 | int spu_add_sysdev_attr_group(struct attribute_group *attrs); | 276 | int spu_add_dev_attr_group(struct attribute_group *attrs); |
277 | void spu_remove_sysdev_attr_group(struct attribute_group *attrs); | 277 | void spu_remove_dev_attr_group(struct attribute_group *attrs); |
278 | 278 | ||
279 | int spu_handle_mm_fault(struct mm_struct *mm, unsigned long ea, | 279 | int spu_handle_mm_fault(struct mm_struct *mm, unsigned long ea, |
280 | unsigned long dsisr, unsigned *flt); | 280 | unsigned long dsisr, unsigned *flt); |
diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h index 1e104af08483..c97185885c6d 100644 --- a/arch/powerpc/include/asm/topology.h +++ b/arch/powerpc/include/asm/topology.h | |||
@@ -3,7 +3,7 @@ | |||
3 | #ifdef __KERNEL__ | 3 | #ifdef __KERNEL__ |
4 | 4 | ||
5 | 5 | ||
6 | struct sys_device; | 6 | struct device; |
7 | struct device_node; | 7 | struct device_node; |
8 | 8 | ||
9 | #ifdef CONFIG_NUMA | 9 | #ifdef CONFIG_NUMA |
@@ -86,19 +86,19 @@ extern int __node_distance(int, int); | |||
86 | 86 | ||
87 | extern void __init dump_numa_cpu_topology(void); | 87 | extern void __init dump_numa_cpu_topology(void); |
88 | 88 | ||
89 | extern int sysfs_add_device_to_node(struct sys_device *dev, int nid); | 89 | extern int sysfs_add_device_to_node(struct device *dev, int nid); |
90 | extern void sysfs_remove_device_from_node(struct sys_device *dev, int nid); | 90 | extern void sysfs_remove_device_from_node(struct device *dev, int nid); |
91 | 91 | ||
92 | #else | 92 | #else |
93 | 93 | ||
94 | static inline void dump_numa_cpu_topology(void) {} | 94 | static inline void dump_numa_cpu_topology(void) {} |
95 | 95 | ||
96 | static inline int sysfs_add_device_to_node(struct sys_device *dev, int nid) | 96 | static inline int sysfs_add_device_to_node(struct device *dev, int nid) |
97 | { | 97 | { |
98 | return 0; | 98 | return 0; |
99 | } | 99 | } |
100 | 100 | ||
101 | static inline void sysfs_remove_device_from_node(struct sys_device *dev, | 101 | static inline void sysfs_remove_device_from_node(struct device *dev, |
102 | int nid) | 102 | int nid) |
103 | { | 103 | { |
104 | } | 104 | } |
diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c index a3c684b4c862..92c6b008dd2b 100644 --- a/arch/powerpc/kernel/cacheinfo.c +++ b/arch/powerpc/kernel/cacheinfo.c | |||
@@ -451,15 +451,15 @@ out: | |||
451 | static struct cache_dir *__cpuinit cacheinfo_create_cache_dir(unsigned int cpu_id) | 451 | static struct cache_dir *__cpuinit cacheinfo_create_cache_dir(unsigned int cpu_id) |
452 | { | 452 | { |
453 | struct cache_dir *cache_dir; | 453 | struct cache_dir *cache_dir; |
454 | struct sys_device *sysdev; | 454 | struct device *dev; |
455 | struct kobject *kobj = NULL; | 455 | struct kobject *kobj = NULL; |
456 | 456 | ||
457 | sysdev = get_cpu_sysdev(cpu_id); | 457 | dev = get_cpu_device(cpu_id); |
458 | WARN_ONCE(!sysdev, "no sysdev for CPU %i\n", cpu_id); | 458 | WARN_ONCE(!dev, "no dev for CPU %i\n", cpu_id); |
459 | if (!sysdev) | 459 | if (!dev) |
460 | goto err; | 460 | goto err; |
461 | 461 | ||
462 | kobj = kobject_create_and_add("cache", &sysdev->kobj); | 462 | kobj = kobject_create_and_add("cache", &dev->kobj); |
463 | if (!kobj) | 463 | if (!kobj) |
464 | goto err; | 464 | goto err; |
465 | 465 | ||
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index 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 */ |
39 | DEFINE_PER_CPU(long, smt_snooze_delay) = { 100 }; | 39 | DEFINE_PER_CPU(long, smt_snooze_delay) = { 100 }; |
40 | 40 | ||
41 | static ssize_t store_smt_snooze_delay(struct sys_device *dev, | 41 | static 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 | ||
60 | static ssize_t show_smt_snooze_delay(struct sys_device *dev, | 60 | static 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 | ||
69 | static SYSDEV_ATTR(smt_snooze_delay, 0644, show_smt_snooze_delay, | 69 | static DEVICE_ATTR(smt_snooze_delay, 0644, show_smt_snooze_delay, |
70 | store_smt_snooze_delay); | 70 | store_smt_snooze_delay); |
71 | 71 | ||
72 | static int __init setup_smt_snooze_delay(char *str) | 72 | static 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 | } \ |
122 | static ssize_t show_##NAME(struct sys_device *dev, \ | 122 | static 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 | } \ |
131 | static ssize_t __used \ | 131 | static 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); | |||
181 | SYSFS_PMCSETUP(dscr, SPRN_DSCR); | 181 | SYSFS_PMCSETUP(dscr, SPRN_DSCR); |
182 | SYSFS_PMCSETUP(pir, SPRN_PIR); | 182 | SYSFS_PMCSETUP(pir, SPRN_PIR); |
183 | 183 | ||
184 | static SYSDEV_ATTR(mmcra, 0600, show_mmcra, store_mmcra); | 184 | static DEVICE_ATTR(mmcra, 0600, show_mmcra, store_mmcra); |
185 | static SYSDEV_ATTR(spurr, 0600, show_spurr, NULL); | 185 | static DEVICE_ATTR(spurr, 0600, show_spurr, NULL); |
186 | static SYSDEV_ATTR(dscr, 0600, show_dscr, store_dscr); | 186 | static DEVICE_ATTR(dscr, 0600, show_dscr, store_dscr); |
187 | static SYSDEV_ATTR(purr, 0600, show_purr, store_purr); | 187 | static DEVICE_ATTR(purr, 0600, show_purr, store_purr); |
188 | static SYSDEV_ATTR(pir, 0400, show_pir, NULL); | 188 | static DEVICE_ATTR(pir, 0400, show_pir, NULL); |
189 | 189 | ||
190 | unsigned long dscr_default = 0; | 190 | unsigned long dscr_default = 0; |
191 | EXPORT_SYMBOL(dscr_default); | 191 | EXPORT_SYMBOL(dscr_default); |
192 | 192 | ||
193 | static ssize_t show_dscr_default(struct sysdev_class *class, | 193 | static 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 | ||
199 | static ssize_t __used store_dscr_default(struct sysdev_class *class, | 199 | static 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 | ||
214 | static SYSDEV_CLASS_ATTR(dscr_default, 0600, | 214 | static DEVICE_ATTR(dscr_default, 0600, |
215 | show_dscr_default, store_dscr_default); | 215 | show_dscr_default, store_dscr_default); |
216 | 216 | ||
217 | static void sysfs_create_dscr_default(void) | 217 | static 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 |
266 | static struct sysdev_attribute ibm_common_attrs[] = { | 265 | static 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 |
273 | static struct sysdev_attribute g4_common_attrs[] = { | 272 | static 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 | ||
280 | static struct sysdev_attribute classic_pmc_attrs[] = { | 279 | static 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 |
294 | static struct sysdev_attribute pa6t_attrs[] = { | 293 | static 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[] = { | |||
337 | static void __cpuinit register_cpu_online(unsigned int cpu) | 336 | static 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) | |||
408 | static void unregister_cpu_online(unsigned int cpu) | 407 | static 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 | ||
524 | static DEFINE_MUTEX(cpu_mutex); | 523 | static DEFINE_MUTEX(cpu_mutex); |
525 | 524 | ||
526 | int cpu_add_sysdev_attr(struct sysdev_attribute *attr) | 525 | int 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 | } |
539 | EXPORT_SYMBOL_GPL(cpu_add_sysdev_attr); | 538 | EXPORT_SYMBOL_GPL(cpu_add_dev_attr); |
540 | 539 | ||
541 | int cpu_add_sysdev_attr_group(struct attribute_group *attrs) | 540 | int 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 | } |
558 | EXPORT_SYMBOL_GPL(cpu_add_sysdev_attr_group); | 557 | EXPORT_SYMBOL_GPL(cpu_add_dev_attr_group); |
559 | 558 | ||
560 | 559 | ||
561 | void cpu_remove_sysdev_attr(struct sysdev_attribute *attr) | 560 | void 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 | } |
573 | EXPORT_SYMBOL_GPL(cpu_remove_sysdev_attr); | 572 | EXPORT_SYMBOL_GPL(cpu_remove_dev_attr); |
574 | 573 | ||
575 | void cpu_remove_sysdev_attr_group(struct attribute_group *attrs) | 574 | void 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 | } |
589 | EXPORT_SYMBOL_GPL(cpu_remove_sysdev_attr_group); | 588 | EXPORT_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 | ||
603 | int sysfs_add_device_to_node(struct sys_device *dev, int nid) | 602 | int 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 | } |
609 | EXPORT_SYMBOL_GPL(sysfs_add_device_to_node); | 608 | EXPORT_SYMBOL_GPL(sysfs_add_device_to_node); |
610 | 609 | ||
611 | void sysfs_remove_device_from_node(struct sys_device *dev, int nid) | 610 | void 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 | } |
616 | EXPORT_SYMBOL_GPL(sysfs_remove_device_from_node); | 615 | EXPORT_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. */ |
627 | static ssize_t show_physical_id(struct sys_device *dev, | 626 | static 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 | } |
634 | static SYSDEV_ATTR(physical_id, 0444, show_physical_id, NULL); | 633 | static DEVICE_ATTR(physical_id, 0444, show_physical_id, NULL); |
635 | 634 | ||
636 | static int __init topology_init(void) | 635 | static 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) \ |
63 | struct sysdev_attribute attr_ ## _prefix ## _ ## _name = { \ | 63 | struct device_attribute attr_ ## _prefix ## _ ## _name = { \ |
64 | .attr = { .name = __stringify(_name), .mode = _mode }, \ | 64 | .attr = { .name = __stringify(_name), .mode = _mode }, \ |
65 | .show = _prefix ## _show_ ## _name, \ | 65 | .show = _prefix ## _show_ ## _name, \ |
66 | .store = _prefix ## _store_ ## _name, \ | 66 | .store = _prefix ## _store_ ## _name, \ |
@@ -76,36 +76,36 @@ static inline u8 temp_to_reg(u8 temp) | |||
76 | return ((temp - TEMP_MIN) >> 1) & 0x3f; | 76 | return ((temp - TEMP_MIN) >> 1) & 0x3f; |
77 | } | 77 | } |
78 | 78 | ||
79 | static struct cbe_pmd_regs __iomem *get_pmd_regs(struct sys_device *sysdev) | 79 | static struct cbe_pmd_regs __iomem *get_pmd_regs(struct device *dev) |
80 | { | 80 | { |
81 | struct spu *spu; | 81 | struct spu *spu; |
82 | 82 | ||
83 | spu = container_of(sysdev, struct spu, sysdev); | 83 | spu = container_of(dev, struct spu, dev); |
84 | 84 | ||
85 | return cbe_get_pmd_regs(spu_devnode(spu)); | 85 | return cbe_get_pmd_regs(spu_devnode(spu)); |
86 | } | 86 | } |
87 | 87 | ||
88 | /* returns the value for a given spu in a given register */ | 88 | /* returns the value for a given spu in a given register */ |
89 | static u8 spu_read_register_value(struct sys_device *sysdev, union spe_reg __iomem *reg) | 89 | static u8 spu_read_register_value(struct device *dev, union spe_reg __iomem *reg) |
90 | { | 90 | { |
91 | union spe_reg value; | 91 | union spe_reg value; |
92 | struct spu *spu; | 92 | struct spu *spu; |
93 | 93 | ||
94 | spu = container_of(sysdev, struct spu, sysdev); | 94 | spu = container_of(dev, struct spu, dev); |
95 | value.val = in_be64(®->val); | 95 | value.val = in_be64(®->val); |
96 | 96 | ||
97 | return value.spe[spu->spe_id]; | 97 | return value.spe[spu->spe_id]; |
98 | } | 98 | } |
99 | 99 | ||
100 | static ssize_t spu_show_temp(struct sys_device *sysdev, struct sysdev_attribute *attr, | 100 | static ssize_t spu_show_temp(struct device *dev, struct device_attribute *attr, |
101 | char *buf) | 101 | char *buf) |
102 | { | 102 | { |
103 | u8 value; | 103 | u8 value; |
104 | struct cbe_pmd_regs __iomem *pmd_regs; | 104 | struct cbe_pmd_regs __iomem *pmd_regs; |
105 | 105 | ||
106 | pmd_regs = get_pmd_regs(sysdev); | 106 | pmd_regs = get_pmd_regs(dev); |
107 | 107 | ||
108 | value = spu_read_register_value(sysdev, &pmd_regs->ts_ctsr1); | 108 | value = spu_read_register_value(dev, &pmd_regs->ts_ctsr1); |
109 | 109 | ||
110 | return sprintf(buf, "%d\n", reg_to_temp(value)); | 110 | return sprintf(buf, "%d\n", reg_to_temp(value)); |
111 | } | 111 | } |
@@ -147,48 +147,48 @@ static ssize_t store_throttle(struct cbe_pmd_regs __iomem *pmd_regs, const char | |||
147 | return size; | 147 | return size; |
148 | } | 148 | } |
149 | 149 | ||
150 | static ssize_t spu_show_throttle_end(struct sys_device *sysdev, | 150 | static ssize_t spu_show_throttle_end(struct device *dev, |
151 | struct sysdev_attribute *attr, char *buf) | 151 | struct device_attribute *attr, char *buf) |
152 | { | 152 | { |
153 | return show_throttle(get_pmd_regs(sysdev), buf, 0); | 153 | return show_throttle(get_pmd_regs(dev), buf, 0); |
154 | } | 154 | } |
155 | 155 | ||
156 | static ssize_t spu_show_throttle_begin(struct sys_device *sysdev, | 156 | static ssize_t spu_show_throttle_begin(struct device *dev, |
157 | struct sysdev_attribute *attr, char *buf) | 157 | struct device_attribute *attr, char *buf) |
158 | { | 158 | { |
159 | return show_throttle(get_pmd_regs(sysdev), buf, 8); | 159 | return show_throttle(get_pmd_regs(dev), buf, 8); |
160 | } | 160 | } |
161 | 161 | ||
162 | static ssize_t spu_show_throttle_full_stop(struct sys_device *sysdev, | 162 | static ssize_t spu_show_throttle_full_stop(struct device *dev, |
163 | struct sysdev_attribute *attr, char *buf) | 163 | struct device_attribute *attr, char *buf) |
164 | { | 164 | { |
165 | return show_throttle(get_pmd_regs(sysdev), buf, 16); | 165 | return show_throttle(get_pmd_regs(dev), buf, 16); |
166 | } | 166 | } |
167 | 167 | ||
168 | static ssize_t spu_store_throttle_end(struct sys_device *sysdev, | 168 | static ssize_t spu_store_throttle_end(struct device *dev, |
169 | struct sysdev_attribute *attr, const char *buf, size_t size) | 169 | struct device_attribute *attr, const char *buf, size_t size) |
170 | { | 170 | { |
171 | return store_throttle(get_pmd_regs(sysdev), buf, size, 0); | 171 | return store_throttle(get_pmd_regs(dev), buf, size, 0); |
172 | } | 172 | } |
173 | 173 | ||
174 | static ssize_t spu_store_throttle_begin(struct sys_device *sysdev, | 174 | static ssize_t spu_store_throttle_begin(struct device *dev, |
175 | struct sysdev_attribute *attr, const char *buf, size_t size) | 175 | struct device_attribute *attr, const char *buf, size_t size) |
176 | { | 176 | { |
177 | return store_throttle(get_pmd_regs(sysdev), buf, size, 8); | 177 | return store_throttle(get_pmd_regs(dev), buf, size, 8); |
178 | } | 178 | } |
179 | 179 | ||
180 | static ssize_t spu_store_throttle_full_stop(struct sys_device *sysdev, | 180 | static ssize_t spu_store_throttle_full_stop(struct device *dev, |
181 | struct sysdev_attribute *attr, const char *buf, size_t size) | 181 | struct device_attribute *attr, const char *buf, size_t size) |
182 | { | 182 | { |
183 | return store_throttle(get_pmd_regs(sysdev), buf, size, 16); | 183 | return store_throttle(get_pmd_regs(dev), buf, size, 16); |
184 | } | 184 | } |
185 | 185 | ||
186 | static ssize_t ppe_show_temp(struct sys_device *sysdev, char *buf, int pos) | 186 | static ssize_t ppe_show_temp(struct device *dev, char *buf, int pos) |
187 | { | 187 | { |
188 | struct cbe_pmd_regs __iomem *pmd_regs; | 188 | struct cbe_pmd_regs __iomem *pmd_regs; |
189 | u64 value; | 189 | u64 value; |
190 | 190 | ||
191 | pmd_regs = cbe_get_cpu_pmd_regs(sysdev->id); | 191 | pmd_regs = cbe_get_cpu_pmd_regs(dev->id); |
192 | value = in_be64(&pmd_regs->ts_ctsr2); | 192 | value = in_be64(&pmd_regs->ts_ctsr2); |
193 | 193 | ||
194 | value = (value >> pos) & 0x3f; | 194 | value = (value >> pos) & 0x3f; |
@@ -199,64 +199,64 @@ static ssize_t ppe_show_temp(struct sys_device *sysdev, char *buf, int pos) | |||
199 | 199 | ||
200 | /* shows the temperature of the DTS on the PPE, | 200 | /* shows the temperature of the DTS on the PPE, |
201 | * located near the linear thermal sensor */ | 201 | * located near the linear thermal sensor */ |
202 | static ssize_t ppe_show_temp0(struct sys_device *sysdev, | 202 | static ssize_t ppe_show_temp0(struct device *dev, |
203 | struct sysdev_attribute *attr, char *buf) | 203 | struct device_attribute *attr, char *buf) |
204 | { | 204 | { |
205 | return ppe_show_temp(sysdev, buf, 32); | 205 | return ppe_show_temp(dev, buf, 32); |
206 | } | 206 | } |
207 | 207 | ||
208 | /* shows the temperature of the second DTS on the PPE */ | 208 | /* shows the temperature of the second DTS on the PPE */ |
209 | static ssize_t ppe_show_temp1(struct sys_device *sysdev, | 209 | static ssize_t ppe_show_temp1(struct device *dev, |
210 | struct sysdev_attribute *attr, char *buf) | 210 | struct device_attribute *attr, char *buf) |
211 | { | 211 | { |
212 | return ppe_show_temp(sysdev, buf, 0); | 212 | return ppe_show_temp(dev, buf, 0); |
213 | } | 213 | } |
214 | 214 | ||
215 | static ssize_t ppe_show_throttle_end(struct sys_device *sysdev, | 215 | static ssize_t ppe_show_throttle_end(struct device *dev, |
216 | struct sysdev_attribute *attr, char *buf) | 216 | struct device_attribute *attr, char *buf) |
217 | { | 217 | { |
218 | return show_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, 32); | 218 | return show_throttle(cbe_get_cpu_pmd_regs(dev->id), buf, 32); |
219 | } | 219 | } |
220 | 220 | ||
221 | static ssize_t ppe_show_throttle_begin(struct sys_device *sysdev, | 221 | static ssize_t ppe_show_throttle_begin(struct device *dev, |
222 | struct sysdev_attribute *attr, char *buf) | 222 | struct device_attribute *attr, char *buf) |
223 | { | 223 | { |
224 | return show_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, 40); | 224 | return show_throttle(cbe_get_cpu_pmd_regs(dev->id), buf, 40); |
225 | } | 225 | } |
226 | 226 | ||
227 | static ssize_t ppe_show_throttle_full_stop(struct sys_device *sysdev, | 227 | static ssize_t ppe_show_throttle_full_stop(struct device *dev, |
228 | struct sysdev_attribute *attr, char *buf) | 228 | struct device_attribute *attr, char *buf) |
229 | { | 229 | { |
230 | return show_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, 48); | 230 | return show_throttle(cbe_get_cpu_pmd_regs(dev->id), buf, 48); |
231 | } | 231 | } |
232 | 232 | ||
233 | static ssize_t ppe_store_throttle_end(struct sys_device *sysdev, | 233 | static ssize_t ppe_store_throttle_end(struct device *dev, |
234 | struct sysdev_attribute *attr, const char *buf, size_t size) | 234 | struct device_attribute *attr, const char *buf, size_t size) |
235 | { | 235 | { |
236 | return store_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, size, 32); | 236 | return store_throttle(cbe_get_cpu_pmd_regs(dev->id), buf, size, 32); |
237 | } | 237 | } |
238 | 238 | ||
239 | static ssize_t ppe_store_throttle_begin(struct sys_device *sysdev, | 239 | static ssize_t ppe_store_throttle_begin(struct device *dev, |
240 | struct sysdev_attribute *attr, const char *buf, size_t size) | 240 | struct device_attribute *attr, const char *buf, size_t size) |
241 | { | 241 | { |
242 | return store_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, size, 40); | 242 | return store_throttle(cbe_get_cpu_pmd_regs(dev->id), buf, size, 40); |
243 | } | 243 | } |
244 | 244 | ||
245 | static ssize_t ppe_store_throttle_full_stop(struct sys_device *sysdev, | 245 | static ssize_t ppe_store_throttle_full_stop(struct device *dev, |
246 | struct sysdev_attribute *attr, const char *buf, size_t size) | 246 | struct device_attribute *attr, const char *buf, size_t size) |
247 | { | 247 | { |
248 | return store_throttle(cbe_get_cpu_pmd_regs(sysdev->id), buf, size, 48); | 248 | return store_throttle(cbe_get_cpu_pmd_regs(dev->id), buf, size, 48); |
249 | } | 249 | } |
250 | 250 | ||
251 | 251 | ||
252 | static struct sysdev_attribute attr_spu_temperature = { | 252 | static struct device_attribute attr_spu_temperature = { |
253 | .attr = {.name = "temperature", .mode = 0400 }, | 253 | .attr = {.name = "temperature", .mode = 0400 }, |
254 | .show = spu_show_temp, | 254 | .show = spu_show_temp, |
255 | }; | 255 | }; |
256 | 256 | ||
257 | static SYSDEV_PREFIX_ATTR(spu, throttle_end, 0600); | 257 | static DEVICE_PREFIX_ATTR(spu, throttle_end, 0600); |
258 | static SYSDEV_PREFIX_ATTR(spu, throttle_begin, 0600); | 258 | static DEVICE_PREFIX_ATTR(spu, throttle_begin, 0600); |
259 | static SYSDEV_PREFIX_ATTR(spu, throttle_full_stop, 0600); | 259 | static DEVICE_PREFIX_ATTR(spu, throttle_full_stop, 0600); |
260 | 260 | ||
261 | 261 | ||
262 | static struct attribute *spu_attributes[] = { | 262 | static struct attribute *spu_attributes[] = { |
@@ -272,19 +272,19 @@ static struct attribute_group spu_attribute_group = { | |||
272 | .attrs = spu_attributes, | 272 | .attrs = spu_attributes, |
273 | }; | 273 | }; |
274 | 274 | ||
275 | static struct sysdev_attribute attr_ppe_temperature0 = { | 275 | static struct device_attribute attr_ppe_temperature0 = { |
276 | .attr = {.name = "temperature0", .mode = 0400 }, | 276 | .attr = {.name = "temperature0", .mode = 0400 }, |
277 | .show = ppe_show_temp0, | 277 | .show = ppe_show_temp0, |
278 | }; | 278 | }; |
279 | 279 | ||
280 | static struct sysdev_attribute attr_ppe_temperature1 = { | 280 | static struct device_attribute attr_ppe_temperature1 = { |
281 | .attr = {.name = "temperature1", .mode = 0400 }, | 281 | .attr = {.name = "temperature1", .mode = 0400 }, |
282 | .show = ppe_show_temp1, | 282 | .show = ppe_show_temp1, |
283 | }; | 283 | }; |
284 | 284 | ||
285 | static SYSDEV_PREFIX_ATTR(ppe, throttle_end, 0600); | 285 | static DEVICE_PREFIX_ATTR(ppe, throttle_end, 0600); |
286 | static SYSDEV_PREFIX_ATTR(ppe, throttle_begin, 0600); | 286 | static DEVICE_PREFIX_ATTR(ppe, throttle_begin, 0600); |
287 | static SYSDEV_PREFIX_ATTR(ppe, throttle_full_stop, 0600); | 287 | static DEVICE_PREFIX_ATTR(ppe, throttle_full_stop, 0600); |
288 | 288 | ||
289 | static struct attribute *ppe_attributes[] = { | 289 | static struct attribute *ppe_attributes[] = { |
290 | &attr_ppe_temperature0.attr, | 290 | &attr_ppe_temperature0.attr, |
@@ -307,7 +307,7 @@ static int __init init_default_values(void) | |||
307 | { | 307 | { |
308 | int cpu; | 308 | int cpu; |
309 | struct cbe_pmd_regs __iomem *pmd_regs; | 309 | struct cbe_pmd_regs __iomem *pmd_regs; |
310 | struct sys_device *sysdev; | 310 | struct device *dev; |
311 | union ppe_spe_reg tpr; | 311 | union ppe_spe_reg tpr; |
312 | union spe_reg str1; | 312 | union spe_reg str1; |
313 | u64 str2; | 313 | u64 str2; |
@@ -349,14 +349,14 @@ static int __init init_default_values(void) | |||
349 | 349 | ||
350 | for_each_possible_cpu (cpu) { | 350 | for_each_possible_cpu (cpu) { |
351 | pr_debug("processing cpu %d\n", cpu); | 351 | pr_debug("processing cpu %d\n", cpu); |
352 | sysdev = get_cpu_sysdev(cpu); | 352 | dev = get_cpu_device(cpu); |
353 | 353 | ||
354 | if (!sysdev) { | 354 | if (!dev) { |
355 | pr_info("invalid sysdev pointer for cbe_thermal\n"); | 355 | pr_info("invalid dev pointer for cbe_thermal\n"); |
356 | return -EINVAL; | 356 | return -EINVAL; |
357 | } | 357 | } |
358 | 358 | ||
359 | pmd_regs = cbe_get_cpu_pmd_regs(sysdev->id); | 359 | pmd_regs = cbe_get_cpu_pmd_regs(dev->id); |
360 | 360 | ||
361 | if (!pmd_regs) { | 361 | if (!pmd_regs) { |
362 | pr_info("invalid CBE regs pointer for cbe_thermal\n"); | 362 | pr_info("invalid CBE regs pointer for cbe_thermal\n"); |
@@ -379,8 +379,8 @@ static int __init thermal_init(void) | |||
379 | int rc = init_default_values(); | 379 | int rc = init_default_values(); |
380 | 380 | ||
381 | if (rc == 0) { | 381 | if (rc == 0) { |
382 | spu_add_sysdev_attr_group(&spu_attribute_group); | 382 | spu_add_dev_attr_group(&spu_attribute_group); |
383 | cpu_add_sysdev_attr_group(&ppe_attribute_group); | 383 | cpu_add_dev_attr_group(&ppe_attribute_group); |
384 | } | 384 | } |
385 | 385 | ||
386 | return rc; | 386 | return rc; |
@@ -389,8 +389,8 @@ module_init(thermal_init); | |||
389 | 389 | ||
390 | static void __exit thermal_exit(void) | 390 | static void __exit thermal_exit(void) |
391 | { | 391 | { |
392 | spu_remove_sysdev_attr_group(&spu_attribute_group); | 392 | spu_remove_dev_attr_group(&spu_attribute_group); |
393 | cpu_remove_sysdev_attr_group(&ppe_attribute_group); | 393 | cpu_remove_dev_attr_group(&ppe_attribute_group); |
394 | } | 394 | } |
395 | module_exit(thermal_exit); | 395 | module_exit(thermal_exit); |
396 | 396 | ||
diff --git a/arch/powerpc/platforms/cell/smp.c b/arch/powerpc/platforms/cell/smp.c index f5c5c762d5a3..4a255cf8cd17 100644 --- a/arch/powerpc/platforms/cell/smp.c +++ b/arch/powerpc/platforms/cell/smp.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #include <linux/spinlock.h> | 23 | #include <linux/spinlock.h> |
24 | #include <linux/cache.h> | 24 | #include <linux/cache.h> |
25 | #include <linux/err.h> | 25 | #include <linux/err.h> |
26 | #include <linux/sysdev.h> | 26 | #include <linux/device.h> |
27 | #include <linux/cpu.h> | 27 | #include <linux/cpu.h> |
28 | 28 | ||
29 | #include <asm/ptrace.h> | 29 | #include <asm/ptrace.h> |
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c index e94d3ecdd8bb..8b1213993b10 100644 --- a/arch/powerpc/platforms/cell/spu_base.c +++ b/arch/powerpc/platforms/cell/spu_base.c | |||
@@ -519,31 +519,32 @@ void spu_init_channels(struct spu *spu) | |||
519 | } | 519 | } |
520 | EXPORT_SYMBOL_GPL(spu_init_channels); | 520 | EXPORT_SYMBOL_GPL(spu_init_channels); |
521 | 521 | ||
522 | static struct sysdev_class spu_sysdev_class = { | 522 | static struct bus_type spu_subsys = { |
523 | .name = "spu", | 523 | .name = "spu", |
524 | .dev_name = "spu", | ||
524 | }; | 525 | }; |
525 | 526 | ||
526 | int spu_add_sysdev_attr(struct sysdev_attribute *attr) | 527 | int spu_add_dev_attr(struct device_attribute *attr) |
527 | { | 528 | { |
528 | struct spu *spu; | 529 | struct spu *spu; |
529 | 530 | ||
530 | mutex_lock(&spu_full_list_mutex); | 531 | mutex_lock(&spu_full_list_mutex); |
531 | list_for_each_entry(spu, &spu_full_list, full_list) | 532 | list_for_each_entry(spu, &spu_full_list, full_list) |
532 | sysdev_create_file(&spu->sysdev, attr); | 533 | device_create_file(&spu->dev, attr); |
533 | mutex_unlock(&spu_full_list_mutex); | 534 | mutex_unlock(&spu_full_list_mutex); |
534 | 535 | ||
535 | return 0; | 536 | return 0; |
536 | } | 537 | } |
537 | EXPORT_SYMBOL_GPL(spu_add_sysdev_attr); | 538 | EXPORT_SYMBOL_GPL(spu_add_dev_attr); |
538 | 539 | ||
539 | int spu_add_sysdev_attr_group(struct attribute_group *attrs) | 540 | int spu_add_dev_attr_group(struct attribute_group *attrs) |
540 | { | 541 | { |
541 | struct spu *spu; | 542 | struct spu *spu; |
542 | int rc = 0; | 543 | int rc = 0; |
543 | 544 | ||
544 | mutex_lock(&spu_full_list_mutex); | 545 | mutex_lock(&spu_full_list_mutex); |
545 | list_for_each_entry(spu, &spu_full_list, full_list) { | 546 | list_for_each_entry(spu, &spu_full_list, full_list) { |
546 | rc = sysfs_create_group(&spu->sysdev.kobj, attrs); | 547 | rc = sysfs_create_group(&spu->dev.kobj, attrs); |
547 | 548 | ||
548 | /* we're in trouble here, but try unwinding anyway */ | 549 | /* we're in trouble here, but try unwinding anyway */ |
549 | if (rc) { | 550 | if (rc) { |
@@ -552,7 +553,7 @@ int spu_add_sysdev_attr_group(struct attribute_group *attrs) | |||
552 | 553 | ||
553 | list_for_each_entry_continue_reverse(spu, | 554 | list_for_each_entry_continue_reverse(spu, |
554 | &spu_full_list, full_list) | 555 | &spu_full_list, full_list) |
555 | sysfs_remove_group(&spu->sysdev.kobj, attrs); | 556 | sysfs_remove_group(&spu->dev.kobj, attrs); |
556 | break; | 557 | break; |
557 | } | 558 | } |
558 | } | 559 | } |
@@ -561,45 +562,45 @@ int spu_add_sysdev_attr_group(struct attribute_group *attrs) | |||
561 | 562 | ||
562 | return rc; | 563 | return rc; |
563 | } | 564 | } |
564 | EXPORT_SYMBOL_GPL(spu_add_sysdev_attr_group); | 565 | EXPORT_SYMBOL_GPL(spu_add_dev_attr_group); |
565 | 566 | ||
566 | 567 | ||
567 | void spu_remove_sysdev_attr(struct sysdev_attribute *attr) | 568 | void spu_remove_dev_attr(struct device_attribute *attr) |
568 | { | 569 | { |
569 | struct spu *spu; | 570 | struct spu *spu; |
570 | 571 | ||
571 | mutex_lock(&spu_full_list_mutex); | 572 | mutex_lock(&spu_full_list_mutex); |
572 | list_for_each_entry(spu, &spu_full_list, full_list) | 573 | list_for_each_entry(spu, &spu_full_list, full_list) |
573 | sysdev_remove_file(&spu->sysdev, attr); | 574 | device_remove_file(&spu->dev, attr); |
574 | mutex_unlock(&spu_full_list_mutex); | 575 | mutex_unlock(&spu_full_list_mutex); |
575 | } | 576 | } |
576 | EXPORT_SYMBOL_GPL(spu_remove_sysdev_attr); | 577 | EXPORT_SYMBOL_GPL(spu_remove_dev_attr); |
577 | 578 | ||
578 | void spu_remove_sysdev_attr_group(struct attribute_group *attrs) | 579 | void spu_remove_dev_attr_group(struct attribute_group *attrs) |
579 | { | 580 | { |
580 | struct spu *spu; | 581 | struct spu *spu; |
581 | 582 | ||
582 | mutex_lock(&spu_full_list_mutex); | 583 | mutex_lock(&spu_full_list_mutex); |
583 | list_for_each_entry(spu, &spu_full_list, full_list) | 584 | list_for_each_entry(spu, &spu_full_list, full_list) |
584 | sysfs_remove_group(&spu->sysdev.kobj, attrs); | 585 | sysfs_remove_group(&spu->dev.kobj, attrs); |
585 | mutex_unlock(&spu_full_list_mutex); | 586 | mutex_unlock(&spu_full_list_mutex); |
586 | } | 587 | } |
587 | EXPORT_SYMBOL_GPL(spu_remove_sysdev_attr_group); | 588 | EXPORT_SYMBOL_GPL(spu_remove_dev_attr_group); |
588 | 589 | ||
589 | static int spu_create_sysdev(struct spu *spu) | 590 | static int spu_create_dev(struct spu *spu) |
590 | { | 591 | { |
591 | int ret; | 592 | int ret; |
592 | 593 | ||
593 | spu->sysdev.id = spu->number; | 594 | spu->dev.id = spu->number; |
594 | spu->sysdev.cls = &spu_sysdev_class; | 595 | spu->dev.bus = &spu_subsys; |
595 | ret = sysdev_register(&spu->sysdev); | 596 | ret = device_register(&spu->dev); |
596 | if (ret) { | 597 | if (ret) { |
597 | printk(KERN_ERR "Can't register SPU %d with sysfs\n", | 598 | printk(KERN_ERR "Can't register SPU %d with sysfs\n", |
598 | spu->number); | 599 | spu->number); |
599 | return ret; | 600 | return ret; |
600 | } | 601 | } |
601 | 602 | ||
602 | sysfs_add_device_to_node(&spu->sysdev, spu->node); | 603 | sysfs_add_device_to_node(&spu->dev, spu->node); |
603 | 604 | ||
604 | return 0; | 605 | return 0; |
605 | } | 606 | } |
@@ -635,7 +636,7 @@ static int __init create_spu(void *data) | |||
635 | if (ret) | 636 | if (ret) |
636 | goto out_destroy; | 637 | goto out_destroy; |
637 | 638 | ||
638 | ret = spu_create_sysdev(spu); | 639 | ret = spu_create_dev(spu); |
639 | if (ret) | 640 | if (ret) |
640 | goto out_free_irqs; | 641 | goto out_free_irqs; |
641 | 642 | ||
@@ -692,10 +693,10 @@ static unsigned long long spu_acct_time(struct spu *spu, | |||
692 | } | 693 | } |
693 | 694 | ||
694 | 695 | ||
695 | static ssize_t spu_stat_show(struct sys_device *sysdev, | 696 | static ssize_t spu_stat_show(struct device *dev, |
696 | struct sysdev_attribute *attr, char *buf) | 697 | struct device_attribute *attr, char *buf) |
697 | { | 698 | { |
698 | struct spu *spu = container_of(sysdev, struct spu, sysdev); | 699 | struct spu *spu = container_of(dev, struct spu, dev); |
699 | 700 | ||
700 | return sprintf(buf, "%s %llu %llu %llu %llu " | 701 | return sprintf(buf, "%s %llu %llu %llu %llu " |
701 | "%llu %llu %llu %llu %llu %llu %llu %llu\n", | 702 | "%llu %llu %llu %llu %llu %llu %llu %llu\n", |
@@ -714,7 +715,7 @@ static ssize_t spu_stat_show(struct sys_device *sysdev, | |||
714 | spu->stats.libassist); | 715 | spu->stats.libassist); |
715 | } | 716 | } |
716 | 717 | ||
717 | static SYSDEV_ATTR(stat, 0644, spu_stat_show, NULL); | 718 | static DEVICE_ATTR(stat, 0644, spu_stat_show, NULL); |
718 | 719 | ||
719 | #ifdef CONFIG_KEXEC | 720 | #ifdef CONFIG_KEXEC |
720 | 721 | ||
@@ -813,8 +814,8 @@ static int __init init_spu_base(void) | |||
813 | if (!spu_management_ops) | 814 | if (!spu_management_ops) |
814 | goto out; | 815 | goto out; |
815 | 816 | ||
816 | /* create sysdev class for spus */ | 817 | /* create system subsystem for spus */ |
817 | ret = sysdev_class_register(&spu_sysdev_class); | 818 | ret = subsys_system_register(&spu_subsys, NULL); |
818 | if (ret) | 819 | if (ret) |
819 | goto out; | 820 | goto out; |
820 | 821 | ||
@@ -823,7 +824,7 @@ static int __init init_spu_base(void) | |||
823 | if (ret < 0) { | 824 | if (ret < 0) { |
824 | printk(KERN_WARNING "%s: Error initializing spus\n", | 825 | printk(KERN_WARNING "%s: Error initializing spus\n", |
825 | __func__); | 826 | __func__); |
826 | goto out_unregister_sysdev_class; | 827 | goto out_unregister_subsys; |
827 | } | 828 | } |
828 | 829 | ||
829 | if (ret > 0) | 830 | if (ret > 0) |
@@ -833,15 +834,15 @@ static int __init init_spu_base(void) | |||
833 | xmon_register_spus(&spu_full_list); | 834 | xmon_register_spus(&spu_full_list); |
834 | crash_register_spus(&spu_full_list); | 835 | crash_register_spus(&spu_full_list); |
835 | mutex_unlock(&spu_full_list_mutex); | 836 | mutex_unlock(&spu_full_list_mutex); |
836 | spu_add_sysdev_attr(&attr_stat); | 837 | spu_add_dev_attr(&dev_attr_stat); |
837 | register_syscore_ops(&spu_syscore_ops); | 838 | register_syscore_ops(&spu_syscore_ops); |
838 | 839 | ||
839 | spu_init_affinity(); | 840 | spu_init_affinity(); |
840 | 841 | ||
841 | return 0; | 842 | return 0; |
842 | 843 | ||
843 | out_unregister_sysdev_class: | 844 | out_unregister_subsys: |
844 | sysdev_class_unregister(&spu_sysdev_class); | 845 | bus_unregister(&spu_subsys); |
845 | out: | 846 | out: |
846 | return ret; | 847 | return ret; |
847 | } | 848 | } |
diff --git a/arch/powerpc/platforms/iseries/smp.c b/arch/powerpc/platforms/iseries/smp.c index 7e2a5515ed76..02df49fb59f0 100644 --- a/arch/powerpc/platforms/iseries/smp.c +++ b/arch/powerpc/platforms/iseries/smp.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <linux/spinlock.h> | 24 | #include <linux/spinlock.h> |
25 | #include <linux/cache.h> | 25 | #include <linux/cache.h> |
26 | #include <linux/err.h> | 26 | #include <linux/err.h> |
27 | #include <linux/sysdev.h> | 27 | #include <linux/device.h> |
28 | #include <linux/cpu.h> | 28 | #include <linux/cpu.h> |
29 | 29 | ||
30 | #include <asm/ptrace.h> | 30 | #include <asm/ptrace.h> |
diff --git a/arch/powerpc/platforms/powermac/cpufreq_32.c b/arch/powerpc/platforms/powermac/cpufreq_32.c index 04af5f48b4eb..1fc386a23f18 100644 --- a/arch/powerpc/platforms/powermac/cpufreq_32.c +++ b/arch/powerpc/platforms/powermac/cpufreq_32.c | |||
@@ -23,7 +23,7 @@ | |||
23 | #include <linux/pmu.h> | 23 | #include <linux/pmu.h> |
24 | #include <linux/cpufreq.h> | 24 | #include <linux/cpufreq.h> |
25 | #include <linux/init.h> | 25 | #include <linux/init.h> |
26 | #include <linux/sysdev.h> | 26 | #include <linux/device.h> |
27 | #include <linux/hardirq.h> | 27 | #include <linux/hardirq.h> |
28 | #include <asm/prom.h> | 28 | #include <asm/prom.h> |
29 | #include <asm/machdep.h> | 29 | #include <asm/machdep.h> |
diff --git a/arch/powerpc/platforms/pseries/cmm.c b/arch/powerpc/platforms/pseries/cmm.c index 3cafc306b971..c638535753df 100644 --- a/arch/powerpc/platforms/pseries/cmm.c +++ b/arch/powerpc/platforms/pseries/cmm.c | |||
@@ -33,7 +33,7 @@ | |||
33 | #include <linux/sched.h> | 33 | #include <linux/sched.h> |
34 | #include <linux/stringify.h> | 34 | #include <linux/stringify.h> |
35 | #include <linux/swap.h> | 35 | #include <linux/swap.h> |
36 | #include <linux/sysdev.h> | 36 | #include <linux/device.h> |
37 | #include <asm/firmware.h> | 37 | #include <asm/firmware.h> |
38 | #include <asm/hvcall.h> | 38 | #include <asm/hvcall.h> |
39 | #include <asm/mmu.h> | 39 | #include <asm/mmu.h> |
@@ -65,7 +65,7 @@ static unsigned int oom_kb = CMM_OOM_KB; | |||
65 | static unsigned int cmm_debug = CMM_DEBUG; | 65 | static unsigned int cmm_debug = CMM_DEBUG; |
66 | static unsigned int cmm_disabled = CMM_DISABLE; | 66 | static unsigned int cmm_disabled = CMM_DISABLE; |
67 | static unsigned long min_mem_mb = CMM_MIN_MEM_MB; | 67 | static unsigned long min_mem_mb = CMM_MIN_MEM_MB; |
68 | static struct sys_device cmm_sysdev; | 68 | static struct device cmm_dev; |
69 | 69 | ||
70 | MODULE_AUTHOR("Brian King <brking@linux.vnet.ibm.com>"); | 70 | MODULE_AUTHOR("Brian King <brking@linux.vnet.ibm.com>"); |
71 | MODULE_DESCRIPTION("IBM System p Collaborative Memory Manager"); | 71 | MODULE_DESCRIPTION("IBM System p Collaborative Memory Manager"); |
@@ -347,25 +347,25 @@ static int cmm_thread(void *dummy) | |||
347 | } | 347 | } |
348 | 348 | ||
349 | #define CMM_SHOW(name, format, args...) \ | 349 | #define CMM_SHOW(name, format, args...) \ |
350 | static ssize_t show_##name(struct sys_device *dev, \ | 350 | static ssize_t show_##name(struct device *dev, \ |
351 | struct sysdev_attribute *attr, \ | 351 | struct device_attribute *attr, \ |
352 | char *buf) \ | 352 | char *buf) \ |
353 | { \ | 353 | { \ |
354 | return sprintf(buf, format, ##args); \ | 354 | return sprintf(buf, format, ##args); \ |
355 | } \ | 355 | } \ |
356 | static SYSDEV_ATTR(name, S_IRUGO, show_##name, NULL) | 356 | static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL) |
357 | 357 | ||
358 | CMM_SHOW(loaned_kb, "%lu\n", PAGES2KB(loaned_pages)); | 358 | CMM_SHOW(loaned_kb, "%lu\n", PAGES2KB(loaned_pages)); |
359 | CMM_SHOW(loaned_target_kb, "%lu\n", PAGES2KB(loaned_pages_target)); | 359 | CMM_SHOW(loaned_target_kb, "%lu\n", PAGES2KB(loaned_pages_target)); |
360 | 360 | ||
361 | static ssize_t show_oom_pages(struct sys_device *dev, | 361 | static ssize_t show_oom_pages(struct device *dev, |
362 | struct sysdev_attribute *attr, char *buf) | 362 | struct device_attribute *attr, char *buf) |
363 | { | 363 | { |
364 | return sprintf(buf, "%lu\n", PAGES2KB(oom_freed_pages)); | 364 | return sprintf(buf, "%lu\n", PAGES2KB(oom_freed_pages)); |
365 | } | 365 | } |
366 | 366 | ||
367 | static ssize_t store_oom_pages(struct sys_device *dev, | 367 | static ssize_t store_oom_pages(struct device *dev, |
368 | struct sysdev_attribute *attr, | 368 | struct device_attribute *attr, |
369 | const char *buf, size_t count) | 369 | const char *buf, size_t count) |
370 | { | 370 | { |
371 | unsigned long val = simple_strtoul (buf, NULL, 10); | 371 | unsigned long val = simple_strtoul (buf, NULL, 10); |
@@ -379,17 +379,18 @@ static ssize_t store_oom_pages(struct sys_device *dev, | |||
379 | return count; | 379 | return count; |
380 | } | 380 | } |
381 | 381 | ||
382 | static SYSDEV_ATTR(oom_freed_kb, S_IWUSR| S_IRUGO, | 382 | static DEVICE_ATTR(oom_freed_kb, S_IWUSR | S_IRUGO, |
383 | show_oom_pages, store_oom_pages); | 383 | show_oom_pages, store_oom_pages); |
384 | 384 | ||
385 | static struct sysdev_attribute *cmm_attrs[] = { | 385 | static struct device_attribute *cmm_attrs[] = { |
386 | &attr_loaned_kb, | 386 | &dev_attr_loaned_kb, |
387 | &attr_loaned_target_kb, | 387 | &dev_attr_loaned_target_kb, |
388 | &attr_oom_freed_kb, | 388 | &dev_attr_oom_freed_kb, |
389 | }; | 389 | }; |
390 | 390 | ||
391 | static struct sysdev_class cmm_sysdev_class = { | 391 | static struct bus_type cmm_subsys = { |
392 | .name = "cmm", | 392 | .name = "cmm", |
393 | .dev_name = "cmm", | ||
393 | }; | 394 | }; |
394 | 395 | ||
395 | /** | 396 | /** |
@@ -398,21 +399,21 @@ static struct sysdev_class cmm_sysdev_class = { | |||
398 | * Return value: | 399 | * Return value: |
399 | * 0 on success / other on failure | 400 | * 0 on success / other on failure |
400 | **/ | 401 | **/ |
401 | static int cmm_sysfs_register(struct sys_device *sysdev) | 402 | static int cmm_sysfs_register(struct device *dev) |
402 | { | 403 | { |
403 | int i, rc; | 404 | int i, rc; |
404 | 405 | ||
405 | if ((rc = sysdev_class_register(&cmm_sysdev_class))) | 406 | if ((rc = subsys_system_register(&cmm_subsys, NULL))) |
406 | return rc; | 407 | return rc; |
407 | 408 | ||
408 | sysdev->id = 0; | 409 | dev->id = 0; |
409 | sysdev->cls = &cmm_sysdev_class; | 410 | dev->bus = &cmm_subsys; |
410 | 411 | ||
411 | if ((rc = sysdev_register(sysdev))) | 412 | if ((rc = device_register(dev))) |
412 | goto class_unregister; | 413 | goto subsys_unregister; |
413 | 414 | ||
414 | for (i = 0; i < ARRAY_SIZE(cmm_attrs); i++) { | 415 | for (i = 0; i < ARRAY_SIZE(cmm_attrs); i++) { |
415 | if ((rc = sysdev_create_file(sysdev, cmm_attrs[i]))) | 416 | if ((rc = device_create_file(dev, cmm_attrs[i]))) |
416 | goto fail; | 417 | goto fail; |
417 | } | 418 | } |
418 | 419 | ||
@@ -420,10 +421,10 @@ static int cmm_sysfs_register(struct sys_device *sysdev) | |||
420 | 421 | ||
421 | fail: | 422 | fail: |
422 | while (--i >= 0) | 423 | while (--i >= 0) |
423 | sysdev_remove_file(sysdev, cmm_attrs[i]); | 424 | device_remove_file(dev, cmm_attrs[i]); |
424 | sysdev_unregister(sysdev); | 425 | device_unregister(dev); |
425 | class_unregister: | 426 | subsys_unregister: |
426 | sysdev_class_unregister(&cmm_sysdev_class); | 427 | bus_unregister(&cmm_subsys); |
427 | return rc; | 428 | return rc; |
428 | } | 429 | } |
429 | 430 | ||
@@ -431,14 +432,14 @@ class_unregister: | |||
431 | * cmm_unregister_sysfs - Unregister from sysfs | 432 | * cmm_unregister_sysfs - Unregister from sysfs |
432 | * | 433 | * |
433 | **/ | 434 | **/ |
434 | static void cmm_unregister_sysfs(struct sys_device *sysdev) | 435 | static void cmm_unregister_sysfs(struct device *dev) |
435 | { | 436 | { |
436 | int i; | 437 | int i; |
437 | 438 | ||
438 | for (i = 0; i < ARRAY_SIZE(cmm_attrs); i++) | 439 | for (i = 0; i < ARRAY_SIZE(cmm_attrs); i++) |
439 | sysdev_remove_file(sysdev, cmm_attrs[i]); | 440 | device_remove_file(dev, cmm_attrs[i]); |
440 | sysdev_unregister(sysdev); | 441 | device_unregister(dev); |
441 | sysdev_class_unregister(&cmm_sysdev_class); | 442 | bus_unregister(&cmm_subsys); |
442 | } | 443 | } |
443 | 444 | ||
444 | /** | 445 | /** |
@@ -657,7 +658,7 @@ static int cmm_init(void) | |||
657 | if ((rc = register_reboot_notifier(&cmm_reboot_nb))) | 658 | if ((rc = register_reboot_notifier(&cmm_reboot_nb))) |
658 | goto out_oom_notifier; | 659 | goto out_oom_notifier; |
659 | 660 | ||
660 | if ((rc = cmm_sysfs_register(&cmm_sysdev))) | 661 | if ((rc = cmm_sysfs_register(&cmm_dev))) |
661 | goto out_reboot_notifier; | 662 | goto out_reboot_notifier; |
662 | 663 | ||
663 | if (register_memory_notifier(&cmm_mem_nb) || | 664 | if (register_memory_notifier(&cmm_mem_nb) || |
@@ -678,7 +679,7 @@ static int cmm_init(void) | |||
678 | out_unregister_notifier: | 679 | out_unregister_notifier: |
679 | unregister_memory_notifier(&cmm_mem_nb); | 680 | unregister_memory_notifier(&cmm_mem_nb); |
680 | unregister_memory_isolate_notifier(&cmm_mem_isolate_nb); | 681 | unregister_memory_isolate_notifier(&cmm_mem_isolate_nb); |
681 | cmm_unregister_sysfs(&cmm_sysdev); | 682 | cmm_unregister_sysfs(&cmm_dev); |
682 | out_reboot_notifier: | 683 | out_reboot_notifier: |
683 | unregister_reboot_notifier(&cmm_reboot_nb); | 684 | unregister_reboot_notifier(&cmm_reboot_nb); |
684 | out_oom_notifier: | 685 | out_oom_notifier: |
@@ -701,7 +702,7 @@ static void cmm_exit(void) | |||
701 | unregister_memory_notifier(&cmm_mem_nb); | 702 | unregister_memory_notifier(&cmm_mem_nb); |
702 | unregister_memory_isolate_notifier(&cmm_mem_isolate_nb); | 703 | unregister_memory_isolate_notifier(&cmm_mem_isolate_nb); |
703 | cmm_free_pages(loaned_pages); | 704 | cmm_free_pages(loaned_pages); |
704 | cmm_unregister_sysfs(&cmm_sysdev); | 705 | cmm_unregister_sysfs(&cmm_dev); |
705 | } | 706 | } |
706 | 707 | ||
707 | /** | 708 | /** |
diff --git a/arch/powerpc/platforms/pseries/pseries_energy.c b/arch/powerpc/platforms/pseries/pseries_energy.c index c8b3c69fe891..af281dce510a 100644 --- a/arch/powerpc/platforms/pseries/pseries_energy.c +++ b/arch/powerpc/platforms/pseries/pseries_energy.c | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <linux/errno.h> | 15 | #include <linux/errno.h> |
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/seq_file.h> | 17 | #include <linux/seq_file.h> |
18 | #include <linux/sysdev.h> | 18 | #include <linux/device.h> |
19 | #include <linux/cpu.h> | 19 | #include <linux/cpu.h> |
20 | #include <linux/of.h> | 20 | #include <linux/of.h> |
21 | #include <asm/cputhreads.h> | 21 | #include <asm/cputhreads.h> |
@@ -184,7 +184,7 @@ static ssize_t get_best_energy_list(char *page, int activate) | |||
184 | return s-page; | 184 | return s-page; |
185 | } | 185 | } |
186 | 186 | ||
187 | static ssize_t get_best_energy_data(struct sys_device *dev, | 187 | static ssize_t get_best_energy_data(struct device *dev, |
188 | char *page, int activate) | 188 | char *page, int activate) |
189 | { | 189 | { |
190 | int rc; | 190 | int rc; |
@@ -207,26 +207,26 @@ static ssize_t get_best_energy_data(struct sys_device *dev, | |||
207 | 207 | ||
208 | /* Wrapper functions */ | 208 | /* Wrapper functions */ |
209 | 209 | ||
210 | static ssize_t cpu_activate_hint_list_show(struct sysdev_class *class, | 210 | static ssize_t cpu_activate_hint_list_show(struct device *dev, |
211 | struct sysdev_class_attribute *attr, char *page) | 211 | struct device_attribute *attr, char *page) |
212 | { | 212 | { |
213 | return get_best_energy_list(page, 1); | 213 | return get_best_energy_list(page, 1); |
214 | } | 214 | } |
215 | 215 | ||
216 | static ssize_t cpu_deactivate_hint_list_show(struct sysdev_class *class, | 216 | static ssize_t cpu_deactivate_hint_list_show(struct device *dev, |
217 | struct sysdev_class_attribute *attr, char *page) | 217 | struct device_attribute *attr, char *page) |
218 | { | 218 | { |
219 | return get_best_energy_list(page, 0); | 219 | return get_best_energy_list(page, 0); |
220 | } | 220 | } |
221 | 221 | ||
222 | static ssize_t percpu_activate_hint_show(struct sys_device *dev, | 222 | static ssize_t percpu_activate_hint_show(struct device *dev, |
223 | struct sysdev_attribute *attr, char *page) | 223 | struct device_attribute *attr, char *page) |
224 | { | 224 | { |
225 | return get_best_energy_data(dev, page, 1); | 225 | return get_best_energy_data(dev, page, 1); |
226 | } | 226 | } |
227 | 227 | ||
228 | static ssize_t percpu_deactivate_hint_show(struct sys_device *dev, | 228 | static ssize_t percpu_deactivate_hint_show(struct device *dev, |
229 | struct sysdev_attribute *attr, char *page) | 229 | struct device_attribute *attr, char *page) |
230 | { | 230 | { |
231 | return get_best_energy_data(dev, page, 0); | 231 | return get_best_energy_data(dev, page, 0); |
232 | } | 232 | } |
@@ -241,48 +241,48 @@ static ssize_t percpu_deactivate_hint_show(struct sys_device *dev, | |||
241 | * Per-cpu value of the hint | 241 | * Per-cpu value of the hint |
242 | */ | 242 | */ |
243 | 243 | ||
244 | struct sysdev_class_attribute attr_cpu_activate_hint_list = | 244 | struct device_attribute attr_cpu_activate_hint_list = |
245 | _SYSDEV_CLASS_ATTR(pseries_activate_hint_list, 0444, | 245 | __ATTR(pseries_activate_hint_list, 0444, |
246 | cpu_activate_hint_list_show, NULL); | 246 | cpu_activate_hint_list_show, NULL); |
247 | 247 | ||
248 | struct sysdev_class_attribute attr_cpu_deactivate_hint_list = | 248 | struct device_attribute attr_cpu_deactivate_hint_list = |
249 | _SYSDEV_CLASS_ATTR(pseries_deactivate_hint_list, 0444, | 249 | __ATTR(pseries_deactivate_hint_list, 0444, |
250 | cpu_deactivate_hint_list_show, NULL); | 250 | cpu_deactivate_hint_list_show, NULL); |
251 | 251 | ||
252 | struct sysdev_attribute attr_percpu_activate_hint = | 252 | struct device_attribute attr_percpu_activate_hint = |
253 | _SYSDEV_ATTR(pseries_activate_hint, 0444, | 253 | __ATTR(pseries_activate_hint, 0444, |
254 | percpu_activate_hint_show, NULL); | 254 | percpu_activate_hint_show, NULL); |
255 | 255 | ||
256 | struct sysdev_attribute attr_percpu_deactivate_hint = | 256 | struct device_attribute attr_percpu_deactivate_hint = |
257 | _SYSDEV_ATTR(pseries_deactivate_hint, 0444, | 257 | __ATTR(pseries_deactivate_hint, 0444, |
258 | percpu_deactivate_hint_show, NULL); | 258 | percpu_deactivate_hint_show, NULL); |
259 | 259 | ||
260 | static int __init pseries_energy_init(void) | 260 | static int __init pseries_energy_init(void) |
261 | { | 261 | { |
262 | int cpu, err; | 262 | int cpu, err; |
263 | struct sys_device *cpu_sys_dev; | 263 | struct device *cpu_dev; |
264 | 264 | ||
265 | if (!check_for_h_best_energy()) { | 265 | if (!check_for_h_best_energy()) { |
266 | printk(KERN_INFO "Hypercall H_BEST_ENERGY not supported\n"); | 266 | printk(KERN_INFO "Hypercall H_BEST_ENERGY not supported\n"); |
267 | return 0; | 267 | return 0; |
268 | } | 268 | } |
269 | /* Create the sysfs files */ | 269 | /* Create the sysfs files */ |
270 | err = sysfs_create_file(&cpu_sysdev_class.kset.kobj, | 270 | err = device_create_file(cpu_subsys.dev_root, |
271 | &attr_cpu_activate_hint_list.attr); | 271 | &attr_cpu_activate_hint_list); |
272 | if (!err) | 272 | if (!err) |
273 | err = sysfs_create_file(&cpu_sysdev_class.kset.kobj, | 273 | err = device_create_file(cpu_subsys.dev_root, |
274 | &attr_cpu_deactivate_hint_list.attr); | 274 | &attr_cpu_deactivate_hint_list); |
275 | 275 | ||
276 | if (err) | 276 | if (err) |
277 | return err; | 277 | return err; |
278 | for_each_possible_cpu(cpu) { | 278 | for_each_possible_cpu(cpu) { |
279 | cpu_sys_dev = get_cpu_sysdev(cpu); | 279 | cpu_dev = get_cpu_device(cpu); |
280 | err = sysfs_create_file(&cpu_sys_dev->kobj, | 280 | err = device_create_file(cpu_dev, |
281 | &attr_percpu_activate_hint.attr); | 281 | &attr_percpu_activate_hint); |
282 | if (err) | 282 | if (err) |
283 | break; | 283 | break; |
284 | err = sysfs_create_file(&cpu_sys_dev->kobj, | 284 | err = device_create_file(cpu_dev, |
285 | &attr_percpu_deactivate_hint.attr); | 285 | &attr_percpu_deactivate_hint); |
286 | if (err) | 286 | if (err) |
287 | break; | 287 | break; |
288 | } | 288 | } |
@@ -298,23 +298,20 @@ static int __init pseries_energy_init(void) | |||
298 | static void __exit pseries_energy_cleanup(void) | 298 | static void __exit pseries_energy_cleanup(void) |
299 | { | 299 | { |
300 | int cpu; | 300 | int cpu; |
301 | struct sys_device *cpu_sys_dev; | 301 | struct device *cpu_dev; |
302 | 302 | ||
303 | if (!sysfs_entries) | 303 | if (!sysfs_entries) |
304 | return; | 304 | return; |
305 | 305 | ||
306 | /* Remove the sysfs files */ | 306 | /* Remove the sysfs files */ |
307 | sysfs_remove_file(&cpu_sysdev_class.kset.kobj, | 307 | device_remove_file(cpu_subsys.dev_root, &attr_cpu_activate_hint_list); |
308 | &attr_cpu_activate_hint_list.attr); | 308 | device_remove_file(cpu_subsys.dev_root, &attr_cpu_deactivate_hint_list); |
309 | |||
310 | sysfs_remove_file(&cpu_sysdev_class.kset.kobj, | ||
311 | &attr_cpu_deactivate_hint_list.attr); | ||
312 | 309 | ||
313 | for_each_possible_cpu(cpu) { | 310 | for_each_possible_cpu(cpu) { |
314 | cpu_sys_dev = get_cpu_sysdev(cpu); | 311 | cpu_dev = get_cpu_device(cpu); |
315 | sysfs_remove_file(&cpu_sys_dev->kobj, | 312 | sysfs_remove_file(&cpu_dev->kobj, |
316 | &attr_percpu_activate_hint.attr); | 313 | &attr_percpu_activate_hint.attr); |
317 | sysfs_remove_file(&cpu_sys_dev->kobj, | 314 | sysfs_remove_file(&cpu_dev->kobj, |
318 | &attr_percpu_deactivate_hint.attr); | 315 | &attr_percpu_deactivate_hint.attr); |
319 | } | 316 | } |
320 | } | 317 | } |
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c index bbc3c42f6730..eadba9521a35 100644 --- a/arch/powerpc/platforms/pseries/smp.c +++ b/arch/powerpc/platforms/pseries/smp.c | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <linux/spinlock.h> | 22 | #include <linux/spinlock.h> |
23 | #include <linux/cache.h> | 23 | #include <linux/cache.h> |
24 | #include <linux/err.h> | 24 | #include <linux/err.h> |
25 | #include <linux/sysdev.h> | 25 | #include <linux/device.h> |
26 | #include <linux/cpu.h> | 26 | #include <linux/cpu.h> |
27 | 27 | ||
28 | #include <asm/ptrace.h> | 28 | #include <asm/ptrace.h> |
diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c index d3de0849f296..b84a8b2238dd 100644 --- a/arch/powerpc/platforms/pseries/suspend.c +++ b/arch/powerpc/platforms/pseries/suspend.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <asm/rtas.h> | 26 | #include <asm/rtas.h> |
27 | 27 | ||
28 | static u64 stream_id; | 28 | static u64 stream_id; |
29 | static struct sys_device suspend_sysdev; | 29 | static struct device suspend_dev; |
30 | static DECLARE_COMPLETION(suspend_work); | 30 | static DECLARE_COMPLETION(suspend_work); |
31 | static struct rtas_suspend_me_data suspend_data; | 31 | static struct rtas_suspend_me_data suspend_data; |
32 | static atomic_t suspending; | 32 | static atomic_t suspending; |
@@ -110,8 +110,8 @@ static int pseries_prepare_late(void) | |||
110 | 110 | ||
111 | /** | 111 | /** |
112 | * store_hibernate - Initiate partition hibernation | 112 | * store_hibernate - Initiate partition hibernation |
113 | * @classdev: sysdev class struct | 113 | * @dev: subsys root device |
114 | * @attr: class device attribute struct | 114 | * @attr: device attribute struct |
115 | * @buf: buffer | 115 | * @buf: buffer |
116 | * @count: buffer size | 116 | * @count: buffer size |
117 | * | 117 | * |
@@ -121,8 +121,8 @@ static int pseries_prepare_late(void) | |||
121 | * Return value: | 121 | * Return value: |
122 | * number of bytes printed to buffer / other on failure | 122 | * number of bytes printed to buffer / other on failure |
123 | **/ | 123 | **/ |
124 | static ssize_t store_hibernate(struct sysdev_class *classdev, | 124 | static ssize_t store_hibernate(struct device *dev, |
125 | struct sysdev_class_attribute *attr, | 125 | struct device_attribute *attr, |
126 | const char *buf, size_t count) | 126 | const char *buf, size_t count) |
127 | { | 127 | { |
128 | int rc; | 128 | int rc; |
@@ -148,10 +148,11 @@ static ssize_t store_hibernate(struct sysdev_class *classdev, | |||
148 | return rc; | 148 | return rc; |
149 | } | 149 | } |
150 | 150 | ||
151 | static SYSDEV_CLASS_ATTR(hibernate, S_IWUSR, NULL, store_hibernate); | 151 | static DEVICE_ATTR(hibernate, S_IWUSR, NULL, store_hibernate); |
152 | 152 | ||
153 | static struct sysdev_class suspend_sysdev_class = { | 153 | static struct bus_type suspend_subsys = { |
154 | .name = "power", | 154 | .name = "power", |
155 | .dev_name = "power", | ||
155 | }; | 156 | }; |
156 | 157 | ||
157 | static const struct platform_suspend_ops pseries_suspend_ops = { | 158 | static const struct platform_suspend_ops pseries_suspend_ops = { |
@@ -167,23 +168,23 @@ static const struct platform_suspend_ops pseries_suspend_ops = { | |||
167 | * Return value: | 168 | * Return value: |
168 | * 0 on success / other on failure | 169 | * 0 on success / other on failure |
169 | **/ | 170 | **/ |
170 | static int pseries_suspend_sysfs_register(struct sys_device *sysdev) | 171 | static int pseries_suspend_sysfs_register(struct device *dev) |
171 | { | 172 | { |
172 | int rc; | 173 | int rc; |
173 | 174 | ||
174 | if ((rc = sysdev_class_register(&suspend_sysdev_class))) | 175 | if ((rc = subsys_system_register(&suspend_subsys, NULL))) |
175 | return rc; | 176 | return rc; |
176 | 177 | ||
177 | sysdev->id = 0; | 178 | dev->id = 0; |
178 | sysdev->cls = &suspend_sysdev_class; | 179 | dev->bus = &suspend_subsys; |
179 | 180 | ||
180 | if ((rc = sysdev_class_create_file(&suspend_sysdev_class, &attr_hibernate))) | 181 | if ((rc = device_create_file(suspend_subsys.dev_root, &dev_attr_hibernate))) |
181 | goto class_unregister; | 182 | goto subsys_unregister; |
182 | 183 | ||
183 | return 0; | 184 | return 0; |
184 | 185 | ||
185 | class_unregister: | 186 | subsys_unregister: |
186 | sysdev_class_unregister(&suspend_sysdev_class); | 187 | bus_unregister(&suspend_subsys); |
187 | return rc; | 188 | return rc; |
188 | } | 189 | } |
189 | 190 | ||
@@ -204,7 +205,7 @@ static int __init pseries_suspend_init(void) | |||
204 | if (suspend_data.token == RTAS_UNKNOWN_SERVICE) | 205 | if (suspend_data.token == RTAS_UNKNOWN_SERVICE) |
205 | return 0; | 206 | return 0; |
206 | 207 | ||
207 | if ((rc = pseries_suspend_sysfs_register(&suspend_sysdev))) | 208 | if ((rc = pseries_suspend_sysfs_register(&suspend_dev))) |
208 | return rc; | 209 | return rc; |
209 | 210 | ||
210 | ppc_md.suspend_disable_cpu = pseries_suspend_cpu; | 211 | ppc_md.suspend_disable_cpu = pseries_suspend_cpu; |
diff --git a/arch/powerpc/sysdev/ppc4xx_cpm.c b/arch/powerpc/sysdev/ppc4xx_cpm.c index 73b86cc5ea74..82e2cfe35c62 100644 --- a/arch/powerpc/sysdev/ppc4xx_cpm.c +++ b/arch/powerpc/sysdev/ppc4xx_cpm.c | |||
@@ -179,12 +179,12 @@ static struct kobj_attribute cpm_idle_attr = | |||
179 | 179 | ||
180 | static void cpm_idle_config_sysfs(void) | 180 | static void cpm_idle_config_sysfs(void) |
181 | { | 181 | { |
182 | struct sys_device *sys_dev; | 182 | struct device *dev; |
183 | unsigned long ret; | 183 | unsigned long ret; |
184 | 184 | ||
185 | sys_dev = get_cpu_sysdev(0); | 185 | dev = get_cpu_device(0); |
186 | 186 | ||
187 | ret = sysfs_create_file(&sys_dev->kobj, | 187 | ret = sysfs_create_file(&dev->kobj, |
188 | &cpm_idle_attr.attr); | 188 | &cpm_idle_attr.attr); |
189 | if (ret) | 189 | if (ret) |
190 | printk(KERN_WARNING | 190 | printk(KERN_WARNING |
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/arch/powerpc/sysdev/qe_lib/qe_ic.c index 18e75ca19fe6..73034bd203c4 100644 --- a/arch/powerpc/sysdev/qe_lib/qe_ic.c +++ b/arch/powerpc/sysdev/qe_lib/qe_ic.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <linux/stddef.h> | 22 | #include <linux/stddef.h> |
23 | #include <linux/sched.h> | 23 | #include <linux/sched.h> |
24 | #include <linux/signal.h> | 24 | #include <linux/signal.h> |
25 | #include <linux/sysdev.h> | ||
26 | #include <linux/device.h> | 25 | #include <linux/device.h> |
27 | #include <linux/bootmem.h> | 26 | #include <linux/bootmem.h> |
28 | #include <linux/spinlock.h> | 27 | #include <linux/spinlock.h> |
@@ -484,13 +483,14 @@ int qe_ic_set_high_priority(unsigned int virq, unsigned int priority, int high) | |||
484 | return 0; | 483 | return 0; |
485 | } | 484 | } |
486 | 485 | ||
487 | static struct sysdev_class qe_ic_sysclass = { | 486 | static struct bus_type qe_ic_subsys = { |
488 | .name = "qe_ic", | 487 | .name = "qe_ic", |
488 | .dev_name = "qe_ic", | ||
489 | }; | 489 | }; |
490 | 490 | ||
491 | static struct sys_device device_qe_ic = { | 491 | static struct device device_qe_ic = { |
492 | .id = 0, | 492 | .id = 0, |
493 | .cls = &qe_ic_sysclass, | 493 | .bus = &qe_ic_subsys, |
494 | }; | 494 | }; |
495 | 495 | ||
496 | static int __init init_qe_ic_sysfs(void) | 496 | static int __init init_qe_ic_sysfs(void) |
@@ -499,12 +499,12 @@ static int __init init_qe_ic_sysfs(void) | |||
499 | 499 | ||
500 | printk(KERN_DEBUG "Registering qe_ic with sysfs...\n"); | 500 | printk(KERN_DEBUG "Registering qe_ic with sysfs...\n"); |
501 | 501 | ||
502 | rc = sysdev_class_register(&qe_ic_sysclass); | 502 | rc = subsys_system_register(&qe_ic_subsys, NULL); |
503 | if (rc) { | 503 | if (rc) { |
504 | printk(KERN_ERR "Failed registering qe_ic sys class\n"); | 504 | printk(KERN_ERR "Failed registering qe_ic sys class\n"); |
505 | return -ENODEV; | 505 | return -ENODEV; |
506 | } | 506 | } |
507 | rc = sysdev_register(&device_qe_ic); | 507 | rc = device_register(&device_qe_ic); |
508 | if (rc) { | 508 | if (rc) { |
509 | printk(KERN_ERR "Failed registering qe_ic sys device\n"); | 509 | printk(KERN_ERR "Failed registering qe_ic sys device\n"); |
510 | return -ENODEV; | 510 | return -ENODEV; |
diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c index 3330feca7502..063c901b1265 100644 --- a/arch/powerpc/sysdev/uic.c +++ b/arch/powerpc/sysdev/uic.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <linux/stddef.h> | 18 | #include <linux/stddef.h> |
19 | #include <linux/sched.h> | 19 | #include <linux/sched.h> |
20 | #include <linux/signal.h> | 20 | #include <linux/signal.h> |
21 | #include <linux/sysdev.h> | ||
22 | #include <linux/device.h> | 21 | #include <linux/device.h> |
23 | #include <linux/bootmem.h> | 22 | #include <linux/bootmem.h> |
24 | #include <linux/spinlock.h> | 23 | #include <linux/spinlock.h> |
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 |
834 | static ssize_t cpu_configure_show(struct sys_device *dev, | 834 | static 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 | ||
845 | static ssize_t cpu_configure_store(struct sys_device *dev, | 845 | static 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 | } |
892 | static SYSDEV_ATTR(configure, 0644, cpu_configure_show, cpu_configure_store); | 892 | static DEVICE_ATTR(configure, 0644, cpu_configure_show, cpu_configure_store); |
893 | #endif /* CONFIG_HOTPLUG_CPU */ | 893 | #endif /* CONFIG_HOTPLUG_CPU */ |
894 | 894 | ||
895 | static ssize_t cpu_polarization_show(struct sys_device *dev, | 895 | static 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 | } |
922 | static SYSDEV_ATTR(polarization, 0444, cpu_polarization_show, NULL); | 922 | static DEVICE_ATTR(polarization, 0444, cpu_polarization_show, NULL); |
923 | 923 | ||
924 | static ssize_t show_cpu_address(struct sys_device *dev, | 924 | static 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 | } |
929 | static SYSDEV_ATTR(address, 0444, show_cpu_address, NULL); | 929 | static DEVICE_ATTR(address, 0444, show_cpu_address, NULL); |
930 | 930 | ||
931 | 931 | ||
932 | static struct attribute *cpu_common_attrs[] = { | 932 | static 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 | ||
945 | static ssize_t show_capability(struct sys_device *dev, | 945 | static 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 | } |
956 | static SYSDEV_ATTR(capability, 0444, show_capability, NULL); | 956 | static DEVICE_ATTR(capability, 0444, show_capability, NULL); |
957 | 957 | ||
958 | static ssize_t show_idle_count(struct sys_device *dev, | 958 | static 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 | } |
979 | static SYSDEV_ATTR(idle_count, 0444, show_idle_count, NULL); | 979 | static DEVICE_ATTR(idle_count, 0444, show_idle_count, NULL); |
980 | 980 | ||
981 | static ssize_t show_idle_time(struct sys_device *dev, | 981 | static 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 | } |
1004 | static SYSDEV_ATTR(idle_time_us, 0444, show_idle_time, NULL); | 1004 | static DEVICE_ATTR(idle_time_us, 0444, show_idle_time, NULL); |
1005 | 1005 | ||
1006 | static struct attribute *cpu_online_attrs[] = { | 1006 | static 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 = { | |||
1045 | static int __devinit smp_add_present_cpu(int cpu) | 1045 | static 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 | ||
1101 | static ssize_t __ref rescan_store(struct sysdev_class *class, | 1101 | static 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 | } |
1111 | static SYSDEV_CLASS_ATTR(rescan, 0200, NULL, rescan_store); | 1111 | static DEVICE_ATTR(rescan, 0200, NULL, rescan_store); |
1112 | #endif /* CONFIG_HOTPLUG_CPU */ | 1112 | #endif /* CONFIG_HOTPLUG_CPU */ |
1113 | 1113 | ||
1114 | static ssize_t dispatching_show(struct sysdev_class *class, | 1114 | static 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 | ||
1126 | static ssize_t dispatching_store(struct sysdev_class *dev, | 1126 | static 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 | } |
1151 | static SYSDEV_CLASS_ATTR(dispatching, 0644, dispatching_show, | 1151 | static DEVICE_ATTR(dispatching, 0644, dispatching_show, |
1152 | dispatching_store); | 1152 | dispatching_store); |
1153 | 1153 | ||
1154 | static int __init topology_init(void) | 1154 | static 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 | */ |
1119 | static struct sysdev_class etr_sysclass = { | 1119 | static struct bus_type etr_subsys = { |
1120 | .name = "etr", | 1120 | .name = "etr", |
1121 | .dev_name = "etr", | ||
1121 | }; | 1122 | }; |
1122 | 1123 | ||
1123 | static struct sys_device etr_port0_dev = { | 1124 | static struct device etr_port0_dev = { |
1124 | .id = 0, | 1125 | .id = 0, |
1125 | .cls = &etr_sysclass, | 1126 | .bus = &etr_subsys, |
1126 | }; | 1127 | }; |
1127 | 1128 | ||
1128 | static struct sys_device etr_port1_dev = { | 1129 | static 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 | */ |
1136 | static ssize_t etr_stepping_port_show(struct sysdev_class *class, | 1137 | static 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 | ||
1143 | static SYSDEV_CLASS_ATTR(stepping_port, 0400, etr_stepping_port_show, NULL); | 1144 | static DEVICE_ATTR(stepping_port, 0400, etr_stepping_port_show, NULL); |
1144 | 1145 | ||
1145 | static ssize_t etr_stepping_mode_show(struct sysdev_class *class, | 1146 | static 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 | ||
1160 | static SYSDEV_CLASS_ATTR(stepping_mode, 0400, etr_stepping_mode_show, NULL); | 1161 | static DEVICE_ATTR(stepping_mode, 0400, etr_stepping_mode_show, NULL); |
1161 | 1162 | ||
1162 | /* | 1163 | /* |
1163 | * ETR port attributes | 1164 | * ETR port attributes |
1164 | */ | 1165 | */ |
1165 | static inline struct etr_aib *etr_aib_from_dev(struct sys_device *dev) | 1166 | static 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 | ||
1173 | static ssize_t etr_online_show(struct sys_device *dev, | 1174 | static 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 | ||
1183 | static ssize_t etr_online_store(struct sys_device *dev, | 1184 | static 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 | ||
1221 | static SYSDEV_ATTR(online, 0600, etr_online_show, etr_online_store); | 1222 | static DEVICE_ATTR(online, 0600, etr_online_show, etr_online_store); |
1222 | 1223 | ||
1223 | static ssize_t etr_stepping_control_show(struct sys_device *dev, | 1224 | static 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 | ||
1231 | static SYSDEV_ATTR(stepping_control, 0400, etr_stepping_control_show, NULL); | 1232 | static DEVICE_ATTR(stepping_control, 0400, etr_stepping_control_show, NULL); |
1232 | 1233 | ||
1233 | static ssize_t etr_mode_code_show(struct sys_device *dev, | 1234 | static 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 | ||
1243 | static SYSDEV_ATTR(state_code, 0400, etr_mode_code_show, NULL); | 1244 | static DEVICE_ATTR(state_code, 0400, etr_mode_code_show, NULL); |
1244 | 1245 | ||
1245 | static ssize_t etr_untuned_show(struct sys_device *dev, | 1246 | static 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 | ||
1255 | static SYSDEV_ATTR(untuned, 0400, etr_untuned_show, NULL); | 1256 | static DEVICE_ATTR(untuned, 0400, etr_untuned_show, NULL); |
1256 | 1257 | ||
1257 | static ssize_t etr_network_id_show(struct sys_device *dev, | 1258 | static 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 | ||
1267 | static SYSDEV_ATTR(network, 0400, etr_network_id_show, NULL); | 1268 | static DEVICE_ATTR(network, 0400, etr_network_id_show, NULL); |
1268 | 1269 | ||
1269 | static ssize_t etr_id_show(struct sys_device *dev, | 1270 | static 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 | ||
1279 | static SYSDEV_ATTR(id, 0400, etr_id_show, NULL); | 1280 | static DEVICE_ATTR(id, 0400, etr_id_show, NULL); |
1280 | 1281 | ||
1281 | static ssize_t etr_port_number_show(struct sys_device *dev, | 1282 | static 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 | ||
1291 | static SYSDEV_ATTR(port, 0400, etr_port_number_show, NULL); | 1292 | static DEVICE_ATTR(port, 0400, etr_port_number_show, NULL); |
1292 | 1293 | ||
1293 | static ssize_t etr_coupled_show(struct sys_device *dev, | 1294 | static 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 | ||
1303 | static SYSDEV_ATTR(coupled, 0400, etr_coupled_show, NULL); | 1304 | static DEVICE_ATTR(coupled, 0400, etr_coupled_show, NULL); |
1304 | 1305 | ||
1305 | static ssize_t etr_local_time_show(struct sys_device *dev, | 1306 | static 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 | ||
1315 | static SYSDEV_ATTR(local_time, 0400, etr_local_time_show, NULL); | 1316 | static DEVICE_ATTR(local_time, 0400, etr_local_time_show, NULL); |
1316 | 1317 | ||
1317 | static ssize_t etr_utc_offset_show(struct sys_device *dev, | 1318 | static 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 | ||
1327 | static SYSDEV_ATTR(utc_offset, 0400, etr_utc_offset_show, NULL); | 1328 | static DEVICE_ATTR(utc_offset, 0400, etr_utc_offset_show, NULL); |
1328 | 1329 | ||
1329 | static struct sysdev_attribute *etr_port_attributes[] = { | 1330 | static 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 | ||
1343 | static int __init etr_register_port(struct sys_device *dev) | 1344 | static 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; |
1357 | out_unreg: | 1358 | out_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); |
1361 | out: | 1362 | out: |
1362 | return rc; | 1363 | return rc; |
1363 | } | 1364 | } |
1364 | 1365 | ||
1365 | static void __init etr_unregister_port(struct sys_device *dev) | 1366 | static 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 | ||
1374 | static int __init etr_init_sysfs(void) | 1375 | static 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) | |||
1395 | out_remove_port0: | 1396 | out_remove_port0: |
1396 | etr_unregister_port(&etr_port0_dev); | 1397 | etr_unregister_port(&etr_port0_dev); |
1397 | out_remove_stepping_mode: | 1398 | out_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); |
1399 | out_remove_stepping_port: | 1400 | out_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); |
1401 | out_unreg_class: | 1402 | out_unreg_subsys: |
1402 | sysdev_class_unregister(&etr_sysclass); | 1403 | bus_unregister(&etr_subsys); |
1403 | out: | 1404 | out: |
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 | */ |
1604 | static struct sysdev_class stp_sysclass = { | 1605 | static struct bus_type stp_subsys = { |
1605 | .name = "stp", | 1606 | .name = "stp", |
1607 | .dev_name = "stp", | ||
1606 | }; | 1608 | }; |
1607 | 1609 | ||
1608 | static ssize_t stp_ctn_id_show(struct sysdev_class *class, | 1610 | static 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 | ||
1618 | static SYSDEV_CLASS_ATTR(ctn_id, 0400, stp_ctn_id_show, NULL); | 1620 | static DEVICE_ATTR(ctn_id, 0400, stp_ctn_id_show, NULL); |
1619 | 1621 | ||
1620 | static ssize_t stp_ctn_type_show(struct sysdev_class *class, | 1622 | static 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 | ||
1629 | static SYSDEV_CLASS_ATTR(ctn_type, 0400, stp_ctn_type_show, NULL); | 1631 | static DEVICE_ATTR(ctn_type, 0400, stp_ctn_type_show, NULL); |
1630 | 1632 | ||
1631 | static ssize_t stp_dst_offset_show(struct sysdev_class *class, | 1633 | static 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 | ||
1640 | static SYSDEV_CLASS_ATTR(dst_offset, 0400, stp_dst_offset_show, NULL); | 1642 | static DEVICE_ATTR(dst_offset, 0400, stp_dst_offset_show, NULL); |
1641 | 1643 | ||
1642 | static ssize_t stp_leap_seconds_show(struct sysdev_class *class, | 1644 | static 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 | ||
1651 | static SYSDEV_CLASS_ATTR(leap_seconds, 0400, stp_leap_seconds_show, NULL); | 1653 | static DEVICE_ATTR(leap_seconds, 0400, stp_leap_seconds_show, NULL); |
1652 | 1654 | ||
1653 | static ssize_t stp_stratum_show(struct sysdev_class *class, | 1655 | static 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 | ||
1662 | static SYSDEV_CLASS_ATTR(stratum, 0400, stp_stratum_show, NULL); | 1664 | static DEVICE_ATTR(stratum, 0400, stp_stratum_show, NULL); |
1663 | 1665 | ||
1664 | static ssize_t stp_time_offset_show(struct sysdev_class *class, | 1666 | static 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 | ||
1673 | static SYSDEV_CLASS_ATTR(time_offset, 0400, stp_time_offset_show, NULL); | 1675 | static DEVICE_ATTR(time_offset, 0400, stp_time_offset_show, NULL); |
1674 | 1676 | ||
1675 | static ssize_t stp_time_zone_offset_show(struct sysdev_class *class, | 1677 | static 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 | ||
1684 | static SYSDEV_CLASS_ATTR(time_zone_offset, 0400, | 1686 | static DEVICE_ATTR(time_zone_offset, 0400, |
1685 | stp_time_zone_offset_show, NULL); | 1687 | stp_time_zone_offset_show, NULL); |
1686 | 1688 | ||
1687 | static ssize_t stp_timing_mode_show(struct sysdev_class *class, | 1689 | static 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 | ||
1696 | static SYSDEV_CLASS_ATTR(timing_mode, 0400, stp_timing_mode_show, NULL); | 1698 | static DEVICE_ATTR(timing_mode, 0400, stp_timing_mode_show, NULL); |
1697 | 1699 | ||
1698 | static ssize_t stp_timing_state_show(struct sysdev_class *class, | 1700 | static 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 | ||
1707 | static SYSDEV_CLASS_ATTR(timing_state, 0400, stp_timing_state_show, NULL); | 1709 | static DEVICE_ATTR(timing_state, 0400, stp_timing_state_show, NULL); |
1708 | 1710 | ||
1709 | static ssize_t stp_online_show(struct sysdev_class *class, | 1711 | static 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 | ||
1716 | static ssize_t stp_online_store(struct sysdev_class *class, | 1718 | static 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 | */ |
1742 | static struct sysdev_class_attribute attr_stp_online = { | 1744 | static 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 | ||
1748 | static struct sysdev_class_attribute *stp_attributes[] = { | 1750 | static 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 | ||
1762 | static int __init stp_init_sysfs(void) | 1764 | static 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; |
1776 | out_unreg: | 1778 | out_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); |
1780 | out: | 1782 | out: |
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) | |||
261 | int arch_update_cpu_topology(void) | 261 | int 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 | ||
21 | static struct sysdev_class dma_sysclass = { | 21 | static struct bus_type dma_subsys = { |
22 | .name = "dma", | 22 | .name = "dma", |
23 | .dev_name = "dma", | ||
23 | }; | 24 | }; |
24 | 25 | ||
25 | static ssize_t dma_show_devices(struct sys_device *dev, | 26 | static 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 | ||
46 | static SYSDEV_ATTR(devices, S_IRUGO, dma_show_devices, NULL); | 47 | static DEVICE_ATTR(devices, S_IRUGO, dma_show_devices, NULL); |
47 | 48 | ||
48 | static int __init dma_sysclass_init(void) | 49 | static 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 | } |
58 | postcore_initcall(dma_sysclass_init); | 59 | postcore_initcall(dma_subsys_init); |
59 | 60 | ||
60 | static ssize_t dma_show_dev_id(struct sys_device *dev, | 61 | static 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 | ||
67 | static ssize_t dma_store_dev_id(struct sys_device *dev, | 68 | static 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 | ||
76 | static SYSDEV_ATTR(dev_id, S_IRUGO | S_IWUSR, dma_show_dev_id, dma_store_dev_id); | 77 | static DEVICE_ATTR(dev_id, S_IRUGO | S_IWUSR, dma_show_dev_id, dma_store_dev_id); |
77 | 78 | ||
78 | static ssize_t dma_store_config(struct sys_device *dev, | 79 | static 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 | ||
91 | static SYSDEV_ATTR(config, S_IWUSR, NULL, dma_store_config); | 92 | static DEVICE_ATTR(config, S_IWUSR, NULL, dma_store_config); |
92 | 93 | ||
93 | static ssize_t dma_show_mode(struct sys_device *dev, | 94 | static 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 | ||
100 | static ssize_t dma_store_mode(struct sys_device *dev, | 101 | static 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 | ||
109 | static SYSDEV_ATTR(mode, S_IRUGO | S_IWUSR, dma_show_mode, dma_store_mode); | 110 | static 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) \ |
112 | static ssize_t dma_show_##field(struct sys_device *dev, \ | 113 | static 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 | } \ |
118 | static SYSDEV_ATTR(field, S_IRUGO, dma_show_##field, NULL); | 119 | static DEVICE_ATTR(field, S_IRUGO, dma_show_##field, NULL); |
119 | 120 | ||
120 | dma_ro_attr(count, "0x%08x\n"); | 121 | dma_ro_attr(count, "0x%08x\n"); |
121 | dma_ro_attr(flags, "0x%08lx\n"); | 122 | dma_ro_attr(flags, "0x%08lx\n"); |
122 | 123 | ||
123 | int dma_create_sysfs_files(struct dma_channel *chan, struct dma_info *info) | 124 | int 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 | ||
151 | void dma_remove_sysfs_files(struct dma_channel *chan, struct dma_info *info) | 152 | void 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 | ||
340 | static int __devinit sq_sysdev_add(struct sys_device *sysdev) | 340 | static 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 | ||
358 | static int __devexit sq_sysdev_remove(struct sys_device *sysdev) | 358 | static 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 | ||
367 | static struct sysdev_driver sq_sysdev_driver = { | 367 | static 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 | ||
372 | static int __init sq_api_init(void) | 374 | static 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 | ||
402 | static void __exit sq_api_exit(void) | 404 | static 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 @@ | |||
16 | static DEFINE_PER_CPU(struct hv_mmu_statistics, mmu_stats) __attribute__((aligned(64))); | 16 | static 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) \ |
19 | static ssize_t show_##NAME(struct sys_device *dev, \ | 19 | static 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 | } \ |
25 | static SYSDEV_ATTR(NAME, 0444, show_##NAME, NULL) | 25 | static DEVICE_ATTR(NAME, 0444, show_##NAME, NULL) |
26 | 26 | ||
27 | SHOW_MMUSTAT_ULONG(immu_tsb_hits_ctx0_8k_tte); | 27 | SHOW_MMUSTAT_ULONG(immu_tsb_hits_ctx0_8k_tte); |
28 | SHOW_MMUSTAT_ULONG(immu_tsb_ticks_ctx0_8k_tte); | 28 | SHOW_MMUSTAT_ULONG(immu_tsb_ticks_ctx0_8k_tte); |
@@ -58,38 +58,38 @@ SHOW_MMUSTAT_ULONG(dmmu_tsb_hits_ctxnon0_256mb_tte); | |||
58 | SHOW_MMUSTAT_ULONG(dmmu_tsb_ticks_ctxnon0_256mb_tte); | 58 | SHOW_MMUSTAT_ULONG(dmmu_tsb_ticks_ctxnon0_256mb_tte); |
59 | 59 | ||
60 | static struct attribute *mmu_stat_attrs[] = { | 60 | static 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 | ||
142 | static ssize_t show_mmustat_enable(struct sys_device *s, | 142 | static 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 | ||
149 | static ssize_t store_mmustat_enable(struct sys_device *s, | 149 | static 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 | ||
166 | static SYSDEV_ATTR(mmustat_enable, 0644, show_mmustat_enable, store_mmustat_enable); | 166 | static DEVICE_ATTR(mmustat_enable, 0644, show_mmustat_enable, store_mmustat_enable); |
167 | 167 | ||
168 | static int mmu_stats_supported; | 168 | static int mmu_stats_supported; |
169 | 169 | ||
170 | static int register_mmu_stats(struct sys_device *s) | 170 | static 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 |
179 | static void unregister_mmu_stats(struct sys_device *s) | 179 | static 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) \ |
189 | static ssize_t show_##NAME(struct sys_device *dev, \ | 189 | static 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) \ |
197 | static ssize_t show_##NAME(struct sys_device *dev, \ | 197 | static 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); | |||
209 | SHOW_CPUDATA_UINT_NAME(l2_cache_size, ecache_size); | 209 | SHOW_CPUDATA_UINT_NAME(l2_cache_size, ecache_size); |
210 | SHOW_CPUDATA_UINT_NAME(l2_cache_line_size, ecache_line_size); | 210 | SHOW_CPUDATA_UINT_NAME(l2_cache_line_size, ecache_line_size); |
211 | 211 | ||
212 | static struct sysdev_attribute cpu_core_attrs[] = { | 212 | static 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 | ||
222 | static DEFINE_PER_CPU(struct cpu, cpu_devices); | 222 | static DEFINE_PER_CPU(struct cpu, cpu_devices); |
@@ -224,11 +224,11 @@ static DEFINE_PER_CPU(struct cpu, cpu_devices); | |||
224 | static void register_cpu_online(unsigned int cpu) | 224 | static 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) | |||
237 | static void unregister_cpu_online(unsigned int cpu) | 237 | static 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 | ||
35 | static ssize_t chip_width_show(struct sysdev_class *dev, | 35 | static 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 | } |
41 | static SYSDEV_CLASS_ATTR(chip_width, 0444, chip_width_show, NULL); | 41 | static DEVICE_ATTR(chip_width, 0444, chip_width_show, NULL); |
42 | 42 | ||
43 | static ssize_t chip_height_show(struct sysdev_class *dev, | 43 | static 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 | } |
49 | static SYSDEV_CLASS_ATTR(chip_height, 0444, chip_height_show, NULL); | 49 | static DEVICE_ATTR(chip_height, 0444, chip_height_show, NULL); |
50 | 50 | ||
51 | static ssize_t chip_serial_show(struct sysdev_class *dev, | 51 | static 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 | } |
57 | static SYSDEV_CLASS_ATTR(chip_serial, 0444, chip_serial_show, NULL); | 57 | static DEVICE_ATTR(chip_serial, 0444, chip_serial_show, NULL); |
58 | 58 | ||
59 | static ssize_t chip_revision_show(struct sysdev_class *dev, | 59 | static 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 | } |
65 | static SYSDEV_CLASS_ATTR(chip_revision, 0444, chip_revision_show, NULL); | 65 | static DEVICE_ATTR(chip_revision, 0444, chip_revision_show, NULL); |
66 | 66 | ||
67 | 67 | ||
68 | static ssize_t type_show(struct sysdev_class *dev, | 68 | static 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 | } |
74 | static SYSDEV_CLASS_ATTR(type, 0444, type_show, NULL); | 74 | static 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 | ||
85 | HV_CONF_ATTR(version, HV_CONFSTR_HV_SW_VER) | 85 | HV_CONF_ATTR(version, HV_CONFSTR_HV_SW_VER) |
86 | HV_CONF_ATTR(config_version, HV_CONFSTR_HV_CONFIG_VER) | 86 | HV_CONF_ATTR(config_version, HV_CONFSTR_HV_CONFIG_VER) |
@@ -96,15 +96,15 @@ HV_CONF_ATTR(mezz_description, HV_CONFSTR_MEZZ_DESC) | |||
96 | HV_CONF_ATTR(switch_control, HV_CONFSTR_SWITCH_CONTROL) | 96 | HV_CONF_ATTR(switch_control, HV_CONFSTR_SWITCH_CONTROL) |
97 | 97 | ||
98 | static struct attribute *board_attrs[] = { | 98 | static 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 | ||
152 | static int __init create_sysfs_entries(void) | 152 | static 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 | ||
152 | void mce_setup(struct mce *m); | 152 | void mce_setup(struct mce *m); |
153 | void mce_log(struct mce *m); | 153 | void mce_log(struct mce *m); |
154 | DECLARE_PER_CPU(struct sys_device, mce_sysdev); | 154 | DECLARE_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> | |
848 | extern 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 */ |
851 | static DEFINE_PER_CPU(struct kobject *, ici_cache_kobject); | 850 | static DEFINE_PER_CPU(struct kobject *, ici_cache_kobject); |
@@ -1073,9 +1072,9 @@ err_out: | |||
1073 | static DECLARE_BITMAP(cache_dev_map, NR_CPUS); | 1072 | static 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 */ |
1076 | static int __cpuinit cache_add_dev(struct sys_device * sys_dev) | 1075 | static 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 | ||
1127 | static void __cpuinit cache_remove_dev(struct sys_device * sys_dev) | 1126 | static 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 | ||
4 | enum severity_level { | 4 | enum severity_level { |
@@ -17,7 +17,7 @@ enum severity_level { | |||
17 | struct mce_bank { | 17 | struct 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 | ||
1824 | static void mce_cpu_restart(void *data) | 1824 | static 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 | ||
1857 | static struct sysdev_class mce_sysdev_class = { | 1857 | static struct bus_type mce_subsys = { |
1858 | .name = "machinecheck", | 1858 | .name = "machinecheck", |
1859 | .dev_name = "machinecheck", | ||
1859 | }; | 1860 | }; |
1860 | 1861 | ||
1861 | DEFINE_PER_CPU(struct sys_device, mce_sysdev); | 1862 | DEFINE_PER_CPU(struct device, mce_device); |
1862 | 1863 | ||
1863 | __cpuinitdata | 1864 | __cpuinitdata |
1864 | void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu); | 1865 | void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu); |
1865 | 1866 | ||
1866 | static inline struct mce_bank *attr_to_bank(struct sysdev_attribute *attr) | 1867 | static 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 | ||
1871 | static ssize_t show_bank(struct sys_device *s, struct sysdev_attribute *attr, | 1872 | static 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 | ||
1877 | static ssize_t set_bank(struct sys_device *s, struct sysdev_attribute *attr, | 1878 | static 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 | ||
1891 | static ssize_t | 1892 | static ssize_t |
1892 | show_trigger(struct sys_device *s, struct sysdev_attribute *attr, char *buf) | 1893 | show_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 | ||
1899 | static ssize_t set_trigger(struct sys_device *s, struct sysdev_attribute *attr, | 1900 | static 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 | ||
1914 | static ssize_t set_ignore_ce(struct sys_device *s, | 1915 | static 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 | ||
1938 | static ssize_t set_cmci_disabled(struct sys_device *s, | 1939 | static 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 | ||
1961 | static ssize_t store_int_with_restart(struct sys_device *s, | 1962 | static 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 | ||
1970 | static SYSDEV_ATTR(trigger, 0644, show_trigger, set_trigger); | 1971 | static DEVICE_ATTR(trigger, 0644, show_trigger, set_trigger); |
1971 | static SYSDEV_INT_ATTR(tolerant, 0644, tolerant); | 1972 | static DEVICE_INT_ATTR(tolerant, 0644, tolerant); |
1972 | static SYSDEV_INT_ATTR(monarch_timeout, 0644, monarch_timeout); | 1973 | static DEVICE_INT_ATTR(monarch_timeout, 0644, monarch_timeout); |
1973 | static SYSDEV_INT_ATTR(dont_log_ce, 0644, mce_dont_log_ce); | 1974 | static DEVICE_INT_ATTR(dont_log_ce, 0644, mce_dont_log_ce); |
1974 | 1975 | ||
1975 | static struct sysdev_ext_attribute attr_check_interval = { | 1976 | static 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 | ||
1981 | static struct sysdev_ext_attribute attr_ignore_ce = { | 1981 | static 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 | ||
1986 | static struct sysdev_ext_attribute attr_cmci_disabled = { | 1986 | static 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 | ||
1991 | static struct sysdev_attribute *mce_sysdev_attrs[] = { | 1991 | static 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 | ||
2002 | static cpumask_var_t mce_sysdev_initialized; | 2002 | static 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: */ |
2005 | static __cpuinit int mce_sysdev_create(unsigned int cpu) | 2005 | static __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; |
2035 | error2: | 2035 | error2: |
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); |
2038 | error: | 2038 | error: |
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 | ||
2047 | static __cpuinit void mce_sysdev_remove(unsigned int cpu) | 2047 | static __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); | |||
69 | static u32 lvtthmr_init __read_mostly; | 68 | static 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 | \ |
79 | static ssize_t therm_throt_sysdev_show_##event##_##name( \ | 78 | static 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 | ||
98 | define_therm_throt_sysdev_show_func(core_throttle, count); | 97 | define_therm_throt_device_show_func(core_throttle, count); |
99 | define_therm_throt_sysdev_one_ro(core_throttle_count); | 98 | define_therm_throt_device_one_ro(core_throttle_count); |
100 | 99 | ||
101 | define_therm_throt_sysdev_show_func(core_power_limit, count); | 100 | define_therm_throt_device_show_func(core_power_limit, count); |
102 | define_therm_throt_sysdev_one_ro(core_power_limit_count); | 101 | define_therm_throt_device_one_ro(core_power_limit_count); |
103 | 102 | ||
104 | define_therm_throt_sysdev_show_func(package_throttle, count); | 103 | define_therm_throt_device_show_func(package_throttle, count); |
105 | define_therm_throt_sysdev_one_ro(package_throttle_count); | 104 | define_therm_throt_device_one_ro(package_throttle_count); |
106 | 105 | ||
107 | define_therm_throt_sysdev_show_func(package_power_limit, count); | 106 | define_therm_throt_device_show_func(package_power_limit, count); |
108 | define_therm_throt_sysdev_one_ro(package_power_limit_count); | 107 | define_therm_throt_device_one_ro(package_power_limit_count); |
109 | 108 | ||
110 | static struct attribute *thermal_throttle_attrs[] = { | 109 | static 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: */ |
226 | static __cpuinit int thermal_throttle_add_dev(struct sys_device *sys_dev, | 225 | static __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 | ||
253 | static __cpuinit void thermal_throttle_remove_dev(struct sys_device *sys_dev) | 252 | static __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 | ||
295 | static ssize_t reload_store(struct sys_device *dev, | 295 | static 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 | ||
321 | static ssize_t version_show(struct sys_device *dev, | 321 | static 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 | ||
329 | static ssize_t pf_show(struct sys_device *dev, | 329 | static 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 | ||
337 | static SYSDEV_ATTR(reload, 0200, NULL, reload_store); | 337 | static DEVICE_ATTR(reload, 0200, NULL, reload_store); |
338 | static SYSDEV_ATTR(version, 0400, version_show, NULL); | 338 | static DEVICE_ATTR(version, 0400, version_show, NULL); |
339 | static SYSDEV_ATTR(processor_flags, 0400, pf_show, NULL); | 339 | static DEVICE_ATTR(processor_flags, 0400, pf_show, NULL); |
340 | 340 | ||
341 | static struct attribute *mc_default_attrs[] = { | 341 | static 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 | ||
408 | static int mc_sysdev_add(struct sys_device *sys_dev) | 408 | static 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 | ||
429 | static int mc_sysdev_remove(struct sys_device *sys_dev) | 429 | static 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 | ||
442 | static struct sysdev_driver mc_sysdev_driver = { | 442 | static 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 | |||
464 | mc_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu) | 466 | mc_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(µcode_mutex); | 528 | mutex_lock(µcode_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(µcode_mutex); | 532 | mutex_unlock(µcode_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 | ||
548 | out_sysdev_driver: | 550 | out_driver: |
549 | get_online_cpus(); | 551 | get_online_cpus(); |
550 | mutex_lock(µcode_mutex); | 552 | mutex_lock(µcode_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(µcode_mutex); | 556 | mutex_unlock(µcode_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(µcode_mutex); | 576 | mutex_lock(µcode_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(µcode_mutex); | 580 | mutex_unlock(µcode_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 | ||
diff --git a/drivers/Kconfig b/drivers/Kconfig index b5e6f243f749..5afe5d1f199b 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig | |||
@@ -116,6 +116,8 @@ source "drivers/vlynq/Kconfig" | |||
116 | 116 | ||
117 | source "drivers/virtio/Kconfig" | 117 | source "drivers/virtio/Kconfig" |
118 | 118 | ||
119 | source "drivers/hv/Kconfig" | ||
120 | |||
119 | source "drivers/xen/Kconfig" | 121 | source "drivers/xen/Kconfig" |
120 | 122 | ||
121 | source "drivers/staging/Kconfig" | 123 | source "drivers/staging/Kconfig" |
@@ -132,8 +134,6 @@ source "drivers/iommu/Kconfig" | |||
132 | 134 | ||
133 | source "drivers/virt/Kconfig" | 135 | source "drivers/virt/Kconfig" |
134 | 136 | ||
135 | source "drivers/hv/Kconfig" | ||
136 | |||
137 | source "drivers/devfreq/Kconfig" | 137 | source "drivers/devfreq/Kconfig" |
138 | 138 | ||
139 | endmenu | 139 | endmenu |
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c index 9d7bc9f6b6cc..20a68ca386de 100644 --- a/drivers/acpi/processor_driver.c +++ b/drivers/acpi/processor_driver.c | |||
@@ -446,7 +446,7 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device) | |||
446 | { | 446 | { |
447 | struct acpi_processor *pr = NULL; | 447 | struct acpi_processor *pr = NULL; |
448 | int result = 0; | 448 | int result = 0; |
449 | struct sys_device *sysdev; | 449 | struct device *dev; |
450 | 450 | ||
451 | pr = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL); | 451 | pr = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL); |
452 | if (!pr) | 452 | if (!pr) |
@@ -491,8 +491,8 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device) | |||
491 | 491 | ||
492 | per_cpu(processors, pr->id) = pr; | 492 | per_cpu(processors, pr->id) = pr; |
493 | 493 | ||
494 | sysdev = get_cpu_sysdev(pr->id); | 494 | dev = get_cpu_device(pr->id); |
495 | if (sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev")) { | 495 | if (sysfs_create_link(&device->dev.kobj, &dev->kobj, "sysdev")) { |
496 | result = -EFAULT; | 496 | result = -EFAULT; |
497 | goto err_free_cpumask; | 497 | goto err_free_cpumask; |
498 | } | 498 | } |
diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c index 870550d6a4bf..3b599abf2b40 100644 --- a/drivers/acpi/processor_thermal.c +++ b/drivers/acpi/processor_thermal.c | |||
@@ -30,7 +30,6 @@ | |||
30 | #include <linux/module.h> | 30 | #include <linux/module.h> |
31 | #include <linux/init.h> | 31 | #include <linux/init.h> |
32 | #include <linux/cpufreq.h> | 32 | #include <linux/cpufreq.h> |
33 | #include <linux/sysdev.h> | ||
34 | 33 | ||
35 | #include <asm/uaccess.h> | 34 | #include <asm/uaccess.h> |
36 | 35 | ||
diff --git a/drivers/base/Makefile b/drivers/base/Makefile index 99a375ad2cc9..1334d893b560 100644 --- a/drivers/base/Makefile +++ b/drivers/base/Makefile | |||
@@ -3,7 +3,8 @@ | |||
3 | obj-y := core.o sys.o bus.o dd.o syscore.o \ | 3 | obj-y := core.o sys.o bus.o dd.o syscore.o \ |
4 | driver.o class.o platform.o \ | 4 | driver.o class.o platform.o \ |
5 | cpu.o firmware.o init.o map.o devres.o \ | 5 | cpu.o firmware.o init.o map.o devres.o \ |
6 | attribute_container.o transport_class.o | 6 | attribute_container.o transport_class.o \ |
7 | topology.o | ||
7 | obj-$(CONFIG_DEVTMPFS) += devtmpfs.o | 8 | obj-$(CONFIG_DEVTMPFS) += devtmpfs.o |
8 | obj-y += power/ | 9 | obj-y += power/ |
9 | obj-$(CONFIG_HAS_DMA) += dma-mapping.o | 10 | obj-$(CONFIG_HAS_DMA) += dma-mapping.o |
@@ -12,7 +13,6 @@ obj-$(CONFIG_ISA) += isa.o | |||
12 | obj-$(CONFIG_FW_LOADER) += firmware_class.o | 13 | obj-$(CONFIG_FW_LOADER) += firmware_class.o |
13 | obj-$(CONFIG_NUMA) += node.o | 14 | obj-$(CONFIG_NUMA) += node.o |
14 | obj-$(CONFIG_MEMORY_HOTPLUG_SPARSE) += memory.o | 15 | obj-$(CONFIG_MEMORY_HOTPLUG_SPARSE) += memory.o |
15 | obj-$(CONFIG_SMP) += topology.o | ||
16 | ifeq ($(CONFIG_SYSFS),y) | 16 | ifeq ($(CONFIG_SYSFS),y) |
17 | obj-$(CONFIG_MODULES) += module.o | 17 | obj-$(CONFIG_MODULES) += module.o |
18 | endif | 18 | endif |
diff --git a/drivers/base/base.h b/drivers/base/base.h index 21c1b96c34c6..7a6ae4228761 100644 --- a/drivers/base/base.h +++ b/drivers/base/base.h | |||
@@ -4,7 +4,9 @@ | |||
4 | * struct subsys_private - structure to hold the private to the driver core portions of the bus_type/class structure. | 4 | * struct subsys_private - structure to hold the private to the driver core portions of the bus_type/class structure. |
5 | * | 5 | * |
6 | * @subsys - the struct kset that defines this subsystem | 6 | * @subsys - the struct kset that defines this subsystem |
7 | * @devices_kset - the list of devices associated | 7 | * @devices_kset - the subsystem's 'devices' directory |
8 | * @interfaces - list of subsystem interfaces associated | ||
9 | * @mutex - protect the devices, and interfaces lists. | ||
8 | * | 10 | * |
9 | * @drivers_kset - the list of drivers associated | 11 | * @drivers_kset - the list of drivers associated |
10 | * @klist_devices - the klist to iterate over the @devices_kset | 12 | * @klist_devices - the klist to iterate over the @devices_kset |
@@ -14,10 +16,8 @@ | |||
14 | * @bus - pointer back to the struct bus_type that this structure is associated | 16 | * @bus - pointer back to the struct bus_type that this structure is associated |
15 | * with. | 17 | * with. |
16 | * | 18 | * |
17 | * @class_interfaces - list of class_interfaces associated | ||
18 | * @glue_dirs - "glue" directory to put in-between the parent device to | 19 | * @glue_dirs - "glue" directory to put in-between the parent device to |
19 | * avoid namespace conflicts | 20 | * avoid namespace conflicts |
20 | * @class_mutex - mutex to protect the children, devices, and interfaces lists. | ||
21 | * @class - pointer back to the struct class that this structure is associated | 21 | * @class - pointer back to the struct class that this structure is associated |
22 | * with. | 22 | * with. |
23 | * | 23 | * |
@@ -28,6 +28,8 @@ | |||
28 | struct subsys_private { | 28 | struct subsys_private { |
29 | struct kset subsys; | 29 | struct kset subsys; |
30 | struct kset *devices_kset; | 30 | struct kset *devices_kset; |
31 | struct list_head interfaces; | ||
32 | struct mutex mutex; | ||
31 | 33 | ||
32 | struct kset *drivers_kset; | 34 | struct kset *drivers_kset; |
33 | struct klist klist_devices; | 35 | struct klist klist_devices; |
@@ -36,9 +38,7 @@ struct subsys_private { | |||
36 | unsigned int drivers_autoprobe:1; | 38 | unsigned int drivers_autoprobe:1; |
37 | struct bus_type *bus; | 39 | struct bus_type *bus; |
38 | 40 | ||
39 | struct list_head class_interfaces; | ||
40 | struct kset glue_dirs; | 41 | struct kset glue_dirs; |
41 | struct mutex class_mutex; | ||
42 | struct class *class; | 42 | struct class *class; |
43 | }; | 43 | }; |
44 | #define to_subsys_private(obj) container_of(obj, struct subsys_private, subsys.kobj) | 44 | #define to_subsys_private(obj) container_of(obj, struct subsys_private, subsys.kobj) |
@@ -94,7 +94,6 @@ extern int hypervisor_init(void); | |||
94 | static inline int hypervisor_init(void) { return 0; } | 94 | static inline int hypervisor_init(void) { return 0; } |
95 | #endif | 95 | #endif |
96 | extern int platform_bus_init(void); | 96 | extern int platform_bus_init(void); |
97 | extern int system_bus_init(void); | ||
98 | extern int cpu_dev_init(void); | 97 | extern int cpu_dev_init(void); |
99 | 98 | ||
100 | extern int bus_add_device(struct device *dev); | 99 | extern int bus_add_device(struct device *dev); |
@@ -116,6 +115,7 @@ extern char *make_class_name(const char *name, struct kobject *kobj); | |||
116 | 115 | ||
117 | extern int devres_release_all(struct device *dev); | 116 | extern int devres_release_all(struct device *dev); |
118 | 117 | ||
118 | /* /sys/devices directory */ | ||
119 | extern struct kset *devices_kset; | 119 | extern struct kset *devices_kset; |
120 | 120 | ||
121 | #if defined(CONFIG_MODULES) && defined(CONFIG_SYSFS) | 121 | #if defined(CONFIG_MODULES) && defined(CONFIG_SYSFS) |
diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 000e7b2006f8..99dc5921e1dd 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c | |||
@@ -16,9 +16,14 @@ | |||
16 | #include <linux/slab.h> | 16 | #include <linux/slab.h> |
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/string.h> | 18 | #include <linux/string.h> |
19 | #include <linux/mutex.h> | ||
19 | #include "base.h" | 20 | #include "base.h" |
20 | #include "power/power.h" | 21 | #include "power/power.h" |
21 | 22 | ||
23 | /* /sys/devices/system */ | ||
24 | /* FIXME: make static after drivers/base/sys.c is deleted */ | ||
25 | struct kset *system_kset; | ||
26 | |||
22 | #define to_bus_attr(_attr) container_of(_attr, struct bus_attribute, attr) | 27 | #define to_bus_attr(_attr) container_of(_attr, struct bus_attribute, attr) |
23 | 28 | ||
24 | /* | 29 | /* |
@@ -360,6 +365,47 @@ struct device *bus_find_device_by_name(struct bus_type *bus, | |||
360 | } | 365 | } |
361 | EXPORT_SYMBOL_GPL(bus_find_device_by_name); | 366 | EXPORT_SYMBOL_GPL(bus_find_device_by_name); |
362 | 367 | ||
368 | /** | ||
369 | * subsys_find_device_by_id - find a device with a specific enumeration number | ||
370 | * @subsys: subsystem | ||
371 | * @id: index 'id' in struct device | ||
372 | * @hint: device to check first | ||
373 | * | ||
374 | * Check the hint's next object and if it is a match return it directly, | ||
375 | * otherwise, fall back to a full list search. Either way a reference for | ||
376 | * the returned object is taken. | ||
377 | */ | ||
378 | struct device *subsys_find_device_by_id(struct bus_type *subsys, unsigned int id, | ||
379 | struct device *hint) | ||
380 | { | ||
381 | struct klist_iter i; | ||
382 | struct device *dev; | ||
383 | |||
384 | if (!subsys) | ||
385 | return NULL; | ||
386 | |||
387 | if (hint) { | ||
388 | klist_iter_init_node(&subsys->p->klist_devices, &i, &hint->p->knode_bus); | ||
389 | dev = next_device(&i); | ||
390 | if (dev && dev->id == id && get_device(dev)) { | ||
391 | klist_iter_exit(&i); | ||
392 | return dev; | ||
393 | } | ||
394 | klist_iter_exit(&i); | ||
395 | } | ||
396 | |||
397 | klist_iter_init_node(&subsys->p->klist_devices, &i, NULL); | ||
398 | while ((dev = next_device(&i))) { | ||
399 | if (dev->id == id && get_device(dev)) { | ||
400 | klist_iter_exit(&i); | ||
401 | return dev; | ||
402 | } | ||
403 | } | ||
404 | klist_iter_exit(&i); | ||
405 | return NULL; | ||
406 | } | ||
407 | EXPORT_SYMBOL_GPL(subsys_find_device_by_id); | ||
408 | |||
363 | static struct device_driver *next_driver(struct klist_iter *i) | 409 | static struct device_driver *next_driver(struct klist_iter *i) |
364 | { | 410 | { |
365 | struct klist_node *n = klist_next(i); | 411 | struct klist_node *n = klist_next(i); |
@@ -487,38 +533,59 @@ out_put: | |||
487 | void bus_probe_device(struct device *dev) | 533 | void bus_probe_device(struct device *dev) |
488 | { | 534 | { |
489 | struct bus_type *bus = dev->bus; | 535 | struct bus_type *bus = dev->bus; |
536 | struct subsys_interface *sif; | ||
490 | int ret; | 537 | int ret; |
491 | 538 | ||
492 | if (bus && bus->p->drivers_autoprobe) { | 539 | if (!bus) |
540 | return; | ||
541 | |||
542 | if (bus->p->drivers_autoprobe) { | ||
493 | ret = device_attach(dev); | 543 | ret = device_attach(dev); |
494 | WARN_ON(ret < 0); | 544 | WARN_ON(ret < 0); |
495 | } | 545 | } |
546 | |||
547 | mutex_lock(&bus->p->mutex); | ||
548 | list_for_each_entry(sif, &bus->p->interfaces, node) | ||
549 | if (sif->add_dev) | ||
550 | sif->add_dev(dev, sif); | ||
551 | mutex_unlock(&bus->p->mutex); | ||
496 | } | 552 | } |
497 | 553 | ||
498 | /** | 554 | /** |
499 | * bus_remove_device - remove device from bus | 555 | * bus_remove_device - remove device from bus |
500 | * @dev: device to be removed | 556 | * @dev: device to be removed |
501 | * | 557 | * |
502 | * - Remove symlink from bus's directory. | 558 | * - Remove device from all interfaces. |
559 | * - Remove symlink from bus' directory. | ||
503 | * - Delete device from bus's list. | 560 | * - Delete device from bus's list. |
504 | * - Detach from its driver. | 561 | * - Detach from its driver. |
505 | * - Drop reference taken in bus_add_device(). | 562 | * - Drop reference taken in bus_add_device(). |
506 | */ | 563 | */ |
507 | void bus_remove_device(struct device *dev) | 564 | void bus_remove_device(struct device *dev) |
508 | { | 565 | { |
509 | if (dev->bus) { | 566 | struct bus_type *bus = dev->bus; |
510 | sysfs_remove_link(&dev->kobj, "subsystem"); | 567 | struct subsys_interface *sif; |
511 | sysfs_remove_link(&dev->bus->p->devices_kset->kobj, | 568 | |
512 | dev_name(dev)); | 569 | if (!bus) |
513 | device_remove_attrs(dev->bus, dev); | 570 | return; |
514 | if (klist_node_attached(&dev->p->knode_bus)) | 571 | |
515 | klist_del(&dev->p->knode_bus); | 572 | mutex_lock(&bus->p->mutex); |
516 | 573 | list_for_each_entry(sif, &bus->p->interfaces, node) | |
517 | pr_debug("bus: '%s': remove device %s\n", | 574 | if (sif->remove_dev) |
518 | dev->bus->name, dev_name(dev)); | 575 | sif->remove_dev(dev, sif); |
519 | device_release_driver(dev); | 576 | mutex_unlock(&bus->p->mutex); |
520 | bus_put(dev->bus); | 577 | |
521 | } | 578 | sysfs_remove_link(&dev->kobj, "subsystem"); |
579 | sysfs_remove_link(&dev->bus->p->devices_kset->kobj, | ||
580 | dev_name(dev)); | ||
581 | device_remove_attrs(dev->bus, dev); | ||
582 | if (klist_node_attached(&dev->p->knode_bus)) | ||
583 | klist_del(&dev->p->knode_bus); | ||
584 | |||
585 | pr_debug("bus: '%s': remove device %s\n", | ||
586 | dev->bus->name, dev_name(dev)); | ||
587 | device_release_driver(dev); | ||
588 | bus_put(dev->bus); | ||
522 | } | 589 | } |
523 | 590 | ||
524 | static int driver_add_attrs(struct bus_type *bus, struct device_driver *drv) | 591 | static int driver_add_attrs(struct bus_type *bus, struct device_driver *drv) |
@@ -847,14 +914,14 @@ static ssize_t bus_uevent_store(struct bus_type *bus, | |||
847 | static BUS_ATTR(uevent, S_IWUSR, NULL, bus_uevent_store); | 914 | static BUS_ATTR(uevent, S_IWUSR, NULL, bus_uevent_store); |
848 | 915 | ||
849 | /** | 916 | /** |
850 | * bus_register - register a bus with the system. | 917 | * __bus_register - register a driver-core subsystem |
851 | * @bus: bus. | 918 | * @bus: bus. |
852 | * | 919 | * |
853 | * Once we have that, we registered the bus with the kobject | 920 | * Once we have that, we registered the bus with the kobject |
854 | * infrastructure, then register the children subsystems it has: | 921 | * infrastructure, then register the children subsystems it has: |
855 | * the devices and drivers that belong to the bus. | 922 | * the devices and drivers that belong to the subsystem. |
856 | */ | 923 | */ |
857 | int bus_register(struct bus_type *bus) | 924 | int __bus_register(struct bus_type *bus, struct lock_class_key *key) |
858 | { | 925 | { |
859 | int retval; | 926 | int retval; |
860 | struct subsys_private *priv; | 927 | struct subsys_private *priv; |
@@ -898,6 +965,8 @@ int bus_register(struct bus_type *bus) | |||
898 | goto bus_drivers_fail; | 965 | goto bus_drivers_fail; |
899 | } | 966 | } |
900 | 967 | ||
968 | INIT_LIST_HEAD(&priv->interfaces); | ||
969 | __mutex_init(&priv->mutex, "subsys mutex", key); | ||
901 | klist_init(&priv->klist_devices, klist_devices_get, klist_devices_put); | 970 | klist_init(&priv->klist_devices, klist_devices_get, klist_devices_put); |
902 | klist_init(&priv->klist_drivers, NULL, NULL); | 971 | klist_init(&priv->klist_drivers, NULL, NULL); |
903 | 972 | ||
@@ -927,7 +996,7 @@ out: | |||
927 | bus->p = NULL; | 996 | bus->p = NULL; |
928 | return retval; | 997 | return retval; |
929 | } | 998 | } |
930 | EXPORT_SYMBOL_GPL(bus_register); | 999 | EXPORT_SYMBOL_GPL(__bus_register); |
931 | 1000 | ||
932 | /** | 1001 | /** |
933 | * bus_unregister - remove a bus from the system | 1002 | * bus_unregister - remove a bus from the system |
@@ -939,6 +1008,8 @@ EXPORT_SYMBOL_GPL(bus_register); | |||
939 | void bus_unregister(struct bus_type *bus) | 1008 | void bus_unregister(struct bus_type *bus) |
940 | { | 1009 | { |
941 | pr_debug("bus: '%s': unregistering\n", bus->name); | 1010 | pr_debug("bus: '%s': unregistering\n", bus->name); |
1011 | if (bus->dev_root) | ||
1012 | device_unregister(bus->dev_root); | ||
942 | bus_remove_attrs(bus); | 1013 | bus_remove_attrs(bus); |
943 | remove_probe_files(bus); | 1014 | remove_probe_files(bus); |
944 | kset_unregister(bus->p->drivers_kset); | 1015 | kset_unregister(bus->p->drivers_kset); |
@@ -1028,10 +1099,194 @@ void bus_sort_breadthfirst(struct bus_type *bus, | |||
1028 | } | 1099 | } |
1029 | EXPORT_SYMBOL_GPL(bus_sort_breadthfirst); | 1100 | EXPORT_SYMBOL_GPL(bus_sort_breadthfirst); |
1030 | 1101 | ||
1102 | /** | ||
1103 | * subsys_dev_iter_init - initialize subsys device iterator | ||
1104 | * @iter: subsys iterator to initialize | ||
1105 | * @subsys: the subsys we wanna iterate over | ||
1106 | * @start: the device to start iterating from, if any | ||
1107 | * @type: device_type of the devices to iterate over, NULL for all | ||
1108 | * | ||
1109 | * Initialize subsys iterator @iter such that it iterates over devices | ||
1110 | * of @subsys. If @start is set, the list iteration will start there, | ||
1111 | * otherwise if it is NULL, the iteration starts at the beginning of | ||
1112 | * the list. | ||
1113 | */ | ||
1114 | void subsys_dev_iter_init(struct subsys_dev_iter *iter, struct bus_type *subsys, | ||
1115 | struct device *start, const struct device_type *type) | ||
1116 | { | ||
1117 | struct klist_node *start_knode = NULL; | ||
1118 | |||
1119 | if (start) | ||
1120 | start_knode = &start->p->knode_bus; | ||
1121 | klist_iter_init_node(&subsys->p->klist_devices, &iter->ki, start_knode); | ||
1122 | iter->type = type; | ||
1123 | } | ||
1124 | EXPORT_SYMBOL_GPL(subsys_dev_iter_init); | ||
1125 | |||
1126 | /** | ||
1127 | * subsys_dev_iter_next - iterate to the next device | ||
1128 | * @iter: subsys iterator to proceed | ||
1129 | * | ||
1130 | * Proceed @iter to the next device and return it. Returns NULL if | ||
1131 | * iteration is complete. | ||
1132 | * | ||
1133 | * The returned device is referenced and won't be released till | ||
1134 | * iterator is proceed to the next device or exited. The caller is | ||
1135 | * free to do whatever it wants to do with the device including | ||
1136 | * calling back into subsys code. | ||
1137 | */ | ||
1138 | struct device *subsys_dev_iter_next(struct subsys_dev_iter *iter) | ||
1139 | { | ||
1140 | struct klist_node *knode; | ||
1141 | struct device *dev; | ||
1142 | |||
1143 | for (;;) { | ||
1144 | knode = klist_next(&iter->ki); | ||
1145 | if (!knode) | ||
1146 | return NULL; | ||
1147 | dev = container_of(knode, struct device_private, knode_bus)->device; | ||
1148 | if (!iter->type || iter->type == dev->type) | ||
1149 | return dev; | ||
1150 | } | ||
1151 | } | ||
1152 | EXPORT_SYMBOL_GPL(subsys_dev_iter_next); | ||
1153 | |||
1154 | /** | ||
1155 | * subsys_dev_iter_exit - finish iteration | ||
1156 | * @iter: subsys iterator to finish | ||
1157 | * | ||
1158 | * Finish an iteration. Always call this function after iteration is | ||
1159 | * complete whether the iteration ran till the end or not. | ||
1160 | */ | ||
1161 | void subsys_dev_iter_exit(struct subsys_dev_iter *iter) | ||
1162 | { | ||
1163 | klist_iter_exit(&iter->ki); | ||
1164 | } | ||
1165 | EXPORT_SYMBOL_GPL(subsys_dev_iter_exit); | ||
1166 | |||
1167 | int subsys_interface_register(struct subsys_interface *sif) | ||
1168 | { | ||
1169 | struct bus_type *subsys; | ||
1170 | struct subsys_dev_iter iter; | ||
1171 | struct device *dev; | ||
1172 | |||
1173 | if (!sif || !sif->subsys) | ||
1174 | return -ENODEV; | ||
1175 | |||
1176 | subsys = bus_get(sif->subsys); | ||
1177 | if (!subsys) | ||
1178 | return -EINVAL; | ||
1179 | |||
1180 | mutex_lock(&subsys->p->mutex); | ||
1181 | list_add_tail(&sif->node, &subsys->p->interfaces); | ||
1182 | if (sif->add_dev) { | ||
1183 | subsys_dev_iter_init(&iter, subsys, NULL, NULL); | ||
1184 | while ((dev = subsys_dev_iter_next(&iter))) | ||
1185 | sif->add_dev(dev, sif); | ||
1186 | subsys_dev_iter_exit(&iter); | ||
1187 | } | ||
1188 | mutex_unlock(&subsys->p->mutex); | ||
1189 | |||
1190 | return 0; | ||
1191 | } | ||
1192 | EXPORT_SYMBOL_GPL(subsys_interface_register); | ||
1193 | |||
1194 | void subsys_interface_unregister(struct subsys_interface *sif) | ||
1195 | { | ||
1196 | struct bus_type *subsys = sif->subsys; | ||
1197 | struct subsys_dev_iter iter; | ||
1198 | struct device *dev; | ||
1199 | |||
1200 | if (!sif) | ||
1201 | return; | ||
1202 | |||
1203 | mutex_lock(&subsys->p->mutex); | ||
1204 | list_del_init(&sif->node); | ||
1205 | if (sif->remove_dev) { | ||
1206 | subsys_dev_iter_init(&iter, subsys, NULL, NULL); | ||
1207 | while ((dev = subsys_dev_iter_next(&iter))) | ||
1208 | sif->remove_dev(dev, sif); | ||
1209 | subsys_dev_iter_exit(&iter); | ||
1210 | } | ||
1211 | mutex_unlock(&subsys->p->mutex); | ||
1212 | |||
1213 | bus_put(subsys); | ||
1214 | } | ||
1215 | EXPORT_SYMBOL_GPL(subsys_interface_unregister); | ||
1216 | |||
1217 | static void system_root_device_release(struct device *dev) | ||
1218 | { | ||
1219 | kfree(dev); | ||
1220 | } | ||
1221 | /** | ||
1222 | * subsys_system_register - register a subsystem at /sys/devices/system/ | ||
1223 | * @subsys - system subsystem | ||
1224 | * @groups - default attributes for the root device | ||
1225 | * | ||
1226 | * All 'system' subsystems have a /sys/devices/system/<name> root device | ||
1227 | * with the name of the subsystem. The root device can carry subsystem- | ||
1228 | * wide attributes. All registered devices are below this single root | ||
1229 | * device and are named after the subsystem with a simple enumeration | ||
1230 | * number appended. The registered devices are not explicitely named; | ||
1231 | * only 'id' in the device needs to be set. | ||
1232 | * | ||
1233 | * Do not use this interface for anything new, it exists for compatibility | ||
1234 | * with bad ideas only. New subsystems should use plain subsystems; and | ||
1235 | * add the subsystem-wide attributes should be added to the subsystem | ||
1236 | * directory itself and not some create fake root-device placed in | ||
1237 | * /sys/devices/system/<name>. | ||
1238 | */ | ||
1239 | int subsys_system_register(struct bus_type *subsys, | ||
1240 | const struct attribute_group **groups) | ||
1241 | { | ||
1242 | struct device *dev; | ||
1243 | int err; | ||
1244 | |||
1245 | err = bus_register(subsys); | ||
1246 | if (err < 0) | ||
1247 | return err; | ||
1248 | |||
1249 | dev = kzalloc(sizeof(struct device), GFP_KERNEL); | ||
1250 | if (!dev) { | ||
1251 | err = -ENOMEM; | ||
1252 | goto err_dev; | ||
1253 | } | ||
1254 | |||
1255 | err = dev_set_name(dev, "%s", subsys->name); | ||
1256 | if (err < 0) | ||
1257 | goto err_name; | ||
1258 | |||
1259 | dev->kobj.parent = &system_kset->kobj; | ||
1260 | dev->groups = groups; | ||
1261 | dev->release = system_root_device_release; | ||
1262 | |||
1263 | err = device_register(dev); | ||
1264 | if (err < 0) | ||
1265 | goto err_dev_reg; | ||
1266 | |||
1267 | subsys->dev_root = dev; | ||
1268 | return 0; | ||
1269 | |||
1270 | err_dev_reg: | ||
1271 | put_device(dev); | ||
1272 | dev = NULL; | ||
1273 | err_name: | ||
1274 | kfree(dev); | ||
1275 | err_dev: | ||
1276 | bus_unregister(subsys); | ||
1277 | return err; | ||
1278 | } | ||
1279 | EXPORT_SYMBOL_GPL(subsys_system_register); | ||
1280 | |||
1031 | int __init buses_init(void) | 1281 | int __init buses_init(void) |
1032 | { | 1282 | { |
1033 | bus_kset = kset_create_and_add("bus", &bus_uevent_ops, NULL); | 1283 | bus_kset = kset_create_and_add("bus", &bus_uevent_ops, NULL); |
1034 | if (!bus_kset) | 1284 | if (!bus_kset) |
1035 | return -ENOMEM; | 1285 | return -ENOMEM; |
1286 | |||
1287 | system_kset = kset_create_and_add("system", NULL, &devices_kset->kobj); | ||
1288 | if (!system_kset) | ||
1289 | return -ENOMEM; | ||
1290 | |||
1036 | return 0; | 1291 | return 0; |
1037 | } | 1292 | } |
diff --git a/drivers/base/class.c b/drivers/base/class.c index b80d91cc8c3a..03243d4002fd 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c | |||
@@ -184,9 +184,9 @@ int __class_register(struct class *cls, struct lock_class_key *key) | |||
184 | if (!cp) | 184 | if (!cp) |
185 | return -ENOMEM; | 185 | return -ENOMEM; |
186 | klist_init(&cp->klist_devices, klist_class_dev_get, klist_class_dev_put); | 186 | klist_init(&cp->klist_devices, klist_class_dev_get, klist_class_dev_put); |
187 | INIT_LIST_HEAD(&cp->class_interfaces); | 187 | INIT_LIST_HEAD(&cp->interfaces); |
188 | kset_init(&cp->glue_dirs); | 188 | kset_init(&cp->glue_dirs); |
189 | __mutex_init(&cp->class_mutex, "struct class mutex", key); | 189 | __mutex_init(&cp->mutex, "subsys mutex", key); |
190 | error = kobject_set_name(&cp->subsys.kobj, "%s", cls->name); | 190 | error = kobject_set_name(&cp->subsys.kobj, "%s", cls->name); |
191 | if (error) { | 191 | if (error) { |
192 | kfree(cp); | 192 | kfree(cp); |
@@ -460,15 +460,15 @@ int class_interface_register(struct class_interface *class_intf) | |||
460 | if (!parent) | 460 | if (!parent) |
461 | return -EINVAL; | 461 | return -EINVAL; |
462 | 462 | ||
463 | mutex_lock(&parent->p->class_mutex); | 463 | mutex_lock(&parent->p->mutex); |
464 | list_add_tail(&class_intf->node, &parent->p->class_interfaces); | 464 | list_add_tail(&class_intf->node, &parent->p->interfaces); |
465 | if (class_intf->add_dev) { | 465 | if (class_intf->add_dev) { |
466 | class_dev_iter_init(&iter, parent, NULL, NULL); | 466 | class_dev_iter_init(&iter, parent, NULL, NULL); |
467 | while ((dev = class_dev_iter_next(&iter))) | 467 | while ((dev = class_dev_iter_next(&iter))) |
468 | class_intf->add_dev(dev, class_intf); | 468 | class_intf->add_dev(dev, class_intf); |
469 | class_dev_iter_exit(&iter); | 469 | class_dev_iter_exit(&iter); |
470 | } | 470 | } |
471 | mutex_unlock(&parent->p->class_mutex); | 471 | mutex_unlock(&parent->p->mutex); |
472 | 472 | ||
473 | return 0; | 473 | return 0; |
474 | } | 474 | } |
@@ -482,7 +482,7 @@ void class_interface_unregister(struct class_interface *class_intf) | |||
482 | if (!parent) | 482 | if (!parent) |
483 | return; | 483 | return; |
484 | 484 | ||
485 | mutex_lock(&parent->p->class_mutex); | 485 | mutex_lock(&parent->p->mutex); |
486 | list_del_init(&class_intf->node); | 486 | list_del_init(&class_intf->node); |
487 | if (class_intf->remove_dev) { | 487 | if (class_intf->remove_dev) { |
488 | class_dev_iter_init(&iter, parent, NULL, NULL); | 488 | class_dev_iter_init(&iter, parent, NULL, NULL); |
@@ -490,7 +490,7 @@ void class_interface_unregister(struct class_interface *class_intf) | |||
490 | class_intf->remove_dev(dev, class_intf); | 490 | class_intf->remove_dev(dev, class_intf); |
491 | class_dev_iter_exit(&iter); | 491 | class_dev_iter_exit(&iter); |
492 | } | 492 | } |
493 | mutex_unlock(&parent->p->class_mutex); | 493 | mutex_unlock(&parent->p->mutex); |
494 | 494 | ||
495 | class_put(parent); | 495 | class_put(parent); |
496 | } | 496 | } |
diff --git a/drivers/base/core.c b/drivers/base/core.c index 919daa7cd5b1..4dac58aa4a0a 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
@@ -118,6 +118,56 @@ static const struct sysfs_ops dev_sysfs_ops = { | |||
118 | .store = dev_attr_store, | 118 | .store = dev_attr_store, |
119 | }; | 119 | }; |
120 | 120 | ||
121 | #define to_ext_attr(x) container_of(x, struct dev_ext_attribute, attr) | ||
122 | |||
123 | ssize_t device_store_ulong(struct device *dev, | ||
124 | struct device_attribute *attr, | ||
125 | const char *buf, size_t size) | ||
126 | { | ||
127 | struct dev_ext_attribute *ea = to_ext_attr(attr); | ||
128 | char *end; | ||
129 | unsigned long new = simple_strtoul(buf, &end, 0); | ||
130 | if (end == buf) | ||
131 | return -EINVAL; | ||
132 | *(unsigned long *)(ea->var) = new; | ||
133 | /* Always return full write size even if we didn't consume all */ | ||
134 | return size; | ||
135 | } | ||
136 | EXPORT_SYMBOL_GPL(device_store_ulong); | ||
137 | |||
138 | ssize_t device_show_ulong(struct device *dev, | ||
139 | struct device_attribute *attr, | ||
140 | char *buf) | ||
141 | { | ||
142 | struct dev_ext_attribute *ea = to_ext_attr(attr); | ||
143 | return snprintf(buf, PAGE_SIZE, "%lx\n", *(unsigned long *)(ea->var)); | ||
144 | } | ||
145 | EXPORT_SYMBOL_GPL(device_show_ulong); | ||
146 | |||
147 | ssize_t device_store_int(struct device *dev, | ||
148 | struct device_attribute *attr, | ||
149 | const char *buf, size_t size) | ||
150 | { | ||
151 | struct dev_ext_attribute *ea = to_ext_attr(attr); | ||
152 | char *end; | ||
153 | long new = simple_strtol(buf, &end, 0); | ||
154 | if (end == buf || new > INT_MAX || new < INT_MIN) | ||
155 | return -EINVAL; | ||
156 | *(int *)(ea->var) = new; | ||
157 | /* Always return full write size even if we didn't consume all */ | ||
158 | return size; | ||
159 | } | ||
160 | EXPORT_SYMBOL_GPL(device_store_int); | ||
161 | |||
162 | ssize_t device_show_int(struct device *dev, | ||
163 | struct device_attribute *attr, | ||
164 | char *buf) | ||
165 | { | ||
166 | struct dev_ext_attribute *ea = to_ext_attr(attr); | ||
167 | |||
168 | return snprintf(buf, PAGE_SIZE, "%d\n", *(int *)(ea->var)); | ||
169 | } | ||
170 | EXPORT_SYMBOL_GPL(device_show_int); | ||
121 | 171 | ||
122 | /** | 172 | /** |
123 | * device_release - free device structure. | 173 | * device_release - free device structure. |
@@ -464,7 +514,7 @@ static ssize_t show_dev(struct device *dev, struct device_attribute *attr, | |||
464 | static struct device_attribute devt_attr = | 514 | static struct device_attribute devt_attr = |
465 | __ATTR(dev, S_IRUGO, show_dev, NULL); | 515 | __ATTR(dev, S_IRUGO, show_dev, NULL); |
466 | 516 | ||
467 | /* kset to create /sys/devices/ */ | 517 | /* /sys/devices/ */ |
468 | struct kset *devices_kset; | 518 | struct kset *devices_kset; |
469 | 519 | ||
470 | /** | 520 | /** |
@@ -711,6 +761,10 @@ static struct kobject *get_device_parent(struct device *dev, | |||
711 | return k; | 761 | return k; |
712 | } | 762 | } |
713 | 763 | ||
764 | /* subsystems can specify a default root directory for their devices */ | ||
765 | if (!parent && dev->bus && dev->bus->dev_root) | ||
766 | return &dev->bus->dev_root->kobj; | ||
767 | |||
714 | if (parent) | 768 | if (parent) |
715 | return &parent->kobj; | 769 | return &parent->kobj; |
716 | return NULL; | 770 | return NULL; |
@@ -731,14 +785,6 @@ static void cleanup_device_parent(struct device *dev) | |||
731 | cleanup_glue_dir(dev, dev->kobj.parent); | 785 | cleanup_glue_dir(dev, dev->kobj.parent); |
732 | } | 786 | } |
733 | 787 | ||
734 | static void setup_parent(struct device *dev, struct device *parent) | ||
735 | { | ||
736 | struct kobject *kobj; | ||
737 | kobj = get_device_parent(dev, parent); | ||
738 | if (kobj) | ||
739 | dev->kobj.parent = kobj; | ||
740 | } | ||
741 | |||
742 | static int device_add_class_symlinks(struct device *dev) | 788 | static int device_add_class_symlinks(struct device *dev) |
743 | { | 789 | { |
744 | int error; | 790 | int error; |
@@ -891,6 +937,7 @@ int device_private_init(struct device *dev) | |||
891 | int device_add(struct device *dev) | 937 | int device_add(struct device *dev) |
892 | { | 938 | { |
893 | struct device *parent = NULL; | 939 | struct device *parent = NULL; |
940 | struct kobject *kobj; | ||
894 | struct class_interface *class_intf; | 941 | struct class_interface *class_intf; |
895 | int error = -EINVAL; | 942 | int error = -EINVAL; |
896 | 943 | ||
@@ -914,6 +961,10 @@ int device_add(struct device *dev) | |||
914 | dev->init_name = NULL; | 961 | dev->init_name = NULL; |
915 | } | 962 | } |
916 | 963 | ||
964 | /* subsystems can specify simple device enumeration */ | ||
965 | if (!dev_name(dev) && dev->bus && dev->bus->dev_name) | ||
966 | dev_set_name(dev, "%s%u", dev->bus->dev_name, dev->id); | ||
967 | |||
917 | if (!dev_name(dev)) { | 968 | if (!dev_name(dev)) { |
918 | error = -EINVAL; | 969 | error = -EINVAL; |
919 | goto name_error; | 970 | goto name_error; |
@@ -922,7 +973,9 @@ int device_add(struct device *dev) | |||
922 | pr_debug("device: '%s': %s\n", dev_name(dev), __func__); | 973 | pr_debug("device: '%s': %s\n", dev_name(dev), __func__); |
923 | 974 | ||
924 | parent = get_device(dev->parent); | 975 | parent = get_device(dev->parent); |
925 | setup_parent(dev, parent); | 976 | kobj = get_device_parent(dev, parent); |
977 | if (kobj) | ||
978 | dev->kobj.parent = kobj; | ||
926 | 979 | ||
927 | /* use parent numa_node */ | 980 | /* use parent numa_node */ |
928 | if (parent) | 981 | if (parent) |
@@ -982,17 +1035,17 @@ int device_add(struct device *dev) | |||
982 | &parent->p->klist_children); | 1035 | &parent->p->klist_children); |
983 | 1036 | ||
984 | if (dev->class) { | 1037 | if (dev->class) { |
985 | mutex_lock(&dev->class->p->class_mutex); | 1038 | mutex_lock(&dev->class->p->mutex); |
986 | /* tie the class to the device */ | 1039 | /* tie the class to the device */ |
987 | klist_add_tail(&dev->knode_class, | 1040 | klist_add_tail(&dev->knode_class, |
988 | &dev->class->p->klist_devices); | 1041 | &dev->class->p->klist_devices); |
989 | 1042 | ||
990 | /* notify any interfaces that the device is here */ | 1043 | /* notify any interfaces that the device is here */ |
991 | list_for_each_entry(class_intf, | 1044 | list_for_each_entry(class_intf, |
992 | &dev->class->p->class_interfaces, node) | 1045 | &dev->class->p->interfaces, node) |
993 | if (class_intf->add_dev) | 1046 | if (class_intf->add_dev) |
994 | class_intf->add_dev(dev, class_intf); | 1047 | class_intf->add_dev(dev, class_intf); |
995 | mutex_unlock(&dev->class->p->class_mutex); | 1048 | mutex_unlock(&dev->class->p->mutex); |
996 | } | 1049 | } |
997 | done: | 1050 | done: |
998 | put_device(dev); | 1051 | put_device(dev); |
@@ -1107,15 +1160,15 @@ void device_del(struct device *dev) | |||
1107 | if (dev->class) { | 1160 | if (dev->class) { |
1108 | device_remove_class_symlinks(dev); | 1161 | device_remove_class_symlinks(dev); |
1109 | 1162 | ||
1110 | mutex_lock(&dev->class->p->class_mutex); | 1163 | mutex_lock(&dev->class->p->mutex); |
1111 | /* notify any interfaces that the device is now gone */ | 1164 | /* notify any interfaces that the device is now gone */ |
1112 | list_for_each_entry(class_intf, | 1165 | list_for_each_entry(class_intf, |
1113 | &dev->class->p->class_interfaces, node) | 1166 | &dev->class->p->interfaces, node) |
1114 | if (class_intf->remove_dev) | 1167 | if (class_intf->remove_dev) |
1115 | class_intf->remove_dev(dev, class_intf); | 1168 | class_intf->remove_dev(dev, class_intf); |
1116 | /* remove the device from the class list */ | 1169 | /* remove the device from the class list */ |
1117 | klist_del(&dev->knode_class); | 1170 | klist_del(&dev->knode_class); |
1118 | mutex_unlock(&dev->class->p->class_mutex); | 1171 | mutex_unlock(&dev->class->p->mutex); |
1119 | } | 1172 | } |
1120 | device_remove_file(dev, &uevent_attr); | 1173 | device_remove_file(dev, &uevent_attr); |
1121 | device_remove_attrs(dev); | 1174 | device_remove_attrs(dev); |
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 3991502b21e5..9a5578efbc93 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c | |||
@@ -1,8 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * drivers/base/cpu.c - basic CPU class support | 2 | * CPU subsystem support |
3 | */ | 3 | */ |
4 | 4 | ||
5 | #include <linux/sysdev.h> | ||
6 | #include <linux/module.h> | 5 | #include <linux/module.h> |
7 | #include <linux/init.h> | 6 | #include <linux/init.h> |
8 | #include <linux/sched.h> | 7 | #include <linux/sched.h> |
@@ -14,40 +13,40 @@ | |||
14 | 13 | ||
15 | #include "base.h" | 14 | #include "base.h" |
16 | 15 | ||
17 | static struct sysdev_class_attribute *cpu_sysdev_class_attrs[]; | 16 | struct bus_type cpu_subsys = { |
18 | |||
19 | struct sysdev_class cpu_sysdev_class = { | ||
20 | .name = "cpu", | 17 | .name = "cpu", |
21 | .attrs = cpu_sysdev_class_attrs, | 18 | .dev_name = "cpu", |
22 | }; | 19 | }; |
23 | EXPORT_SYMBOL(cpu_sysdev_class); | 20 | EXPORT_SYMBOL_GPL(cpu_subsys); |
24 | 21 | ||
25 | static DEFINE_PER_CPU(struct sys_device *, cpu_sys_devices); | 22 | static DEFINE_PER_CPU(struct device *, cpu_sys_devices); |
26 | 23 | ||
27 | #ifdef CONFIG_HOTPLUG_CPU | 24 | #ifdef CONFIG_HOTPLUG_CPU |
28 | static ssize_t show_online(struct sys_device *dev, struct sysdev_attribute *attr, | 25 | static ssize_t show_online(struct device *dev, |
26 | struct device_attribute *attr, | ||
29 | char *buf) | 27 | char *buf) |
30 | { | 28 | { |
31 | struct cpu *cpu = container_of(dev, struct cpu, sysdev); | 29 | struct cpu *cpu = container_of(dev, struct cpu, dev); |
32 | 30 | ||
33 | return sprintf(buf, "%u\n", !!cpu_online(cpu->sysdev.id)); | 31 | return sprintf(buf, "%u\n", !!cpu_online(cpu->dev.id)); |
34 | } | 32 | } |
35 | 33 | ||
36 | static ssize_t __ref store_online(struct sys_device *dev, struct sysdev_attribute *attr, | 34 | static ssize_t __ref store_online(struct device *dev, |
37 | const char *buf, size_t count) | 35 | struct device_attribute *attr, |
36 | const char *buf, size_t count) | ||
38 | { | 37 | { |
39 | struct cpu *cpu = container_of(dev, struct cpu, sysdev); | 38 | struct cpu *cpu = container_of(dev, struct cpu, dev); |
40 | ssize_t ret; | 39 | ssize_t ret; |
41 | 40 | ||
42 | cpu_hotplug_driver_lock(); | 41 | cpu_hotplug_driver_lock(); |
43 | switch (buf[0]) { | 42 | switch (buf[0]) { |
44 | case '0': | 43 | case '0': |
45 | ret = cpu_down(cpu->sysdev.id); | 44 | ret = cpu_down(cpu->dev.id); |
46 | if (!ret) | 45 | if (!ret) |
47 | kobject_uevent(&dev->kobj, KOBJ_OFFLINE); | 46 | kobject_uevent(&dev->kobj, KOBJ_OFFLINE); |
48 | break; | 47 | break; |
49 | case '1': | 48 | case '1': |
50 | ret = cpu_up(cpu->sysdev.id); | 49 | ret = cpu_up(cpu->dev.id); |
51 | if (!ret) | 50 | if (!ret) |
52 | kobject_uevent(&dev->kobj, KOBJ_ONLINE); | 51 | kobject_uevent(&dev->kobj, KOBJ_ONLINE); |
53 | break; | 52 | break; |
@@ -60,44 +59,44 @@ static ssize_t __ref store_online(struct sys_device *dev, struct sysdev_attribut | |||
60 | ret = count; | 59 | ret = count; |
61 | return ret; | 60 | return ret; |
62 | } | 61 | } |
63 | static SYSDEV_ATTR(online, 0644, show_online, store_online); | 62 | static DEVICE_ATTR(online, 0644, show_online, store_online); |
64 | 63 | ||
65 | static void __cpuinit register_cpu_control(struct cpu *cpu) | 64 | static void __cpuinit register_cpu_control(struct cpu *cpu) |
66 | { | 65 | { |
67 | sysdev_create_file(&cpu->sysdev, &attr_online); | 66 | device_create_file(&cpu->dev, &dev_attr_online); |
68 | } | 67 | } |
69 | void unregister_cpu(struct cpu *cpu) | 68 | void unregister_cpu(struct cpu *cpu) |
70 | { | 69 | { |
71 | int logical_cpu = cpu->sysdev.id; | 70 | int logical_cpu = cpu->dev.id; |
72 | 71 | ||
73 | unregister_cpu_under_node(logical_cpu, cpu_to_node(logical_cpu)); | 72 | unregister_cpu_under_node(logical_cpu, cpu_to_node(logical_cpu)); |
74 | 73 | ||
75 | sysdev_remove_file(&cpu->sysdev, &attr_online); | 74 | device_remove_file(&cpu->dev, &dev_attr_online); |
76 | 75 | ||
77 | sysdev_unregister(&cpu->sysdev); | 76 | device_unregister(&cpu->dev); |
78 | per_cpu(cpu_sys_devices, logical_cpu) = NULL; | 77 | per_cpu(cpu_sys_devices, logical_cpu) = NULL; |
79 | return; | 78 | return; |
80 | } | 79 | } |
81 | 80 | ||
82 | #ifdef CONFIG_ARCH_CPU_PROBE_RELEASE | 81 | #ifdef CONFIG_ARCH_CPU_PROBE_RELEASE |
83 | static ssize_t cpu_probe_store(struct sysdev_class *class, | 82 | static ssize_t cpu_probe_store(struct device *dev, |
84 | struct sysdev_class_attribute *attr, | 83 | struct device_attribute *attr, |
85 | const char *buf, | 84 | const char *buf, |
86 | size_t count) | 85 | size_t count) |
87 | { | 86 | { |
88 | return arch_cpu_probe(buf, count); | 87 | return arch_cpu_probe(buf, count); |
89 | } | 88 | } |
90 | 89 | ||
91 | static ssize_t cpu_release_store(struct sysdev_class *class, | 90 | static ssize_t cpu_release_store(struct device *dev, |
92 | struct sysdev_class_attribute *attr, | 91 | struct device_attribute *attr, |
93 | const char *buf, | 92 | const char *buf, |
94 | size_t count) | 93 | size_t count) |
95 | { | 94 | { |
96 | return arch_cpu_release(buf, count); | 95 | return arch_cpu_release(buf, count); |
97 | } | 96 | } |
98 | 97 | ||
99 | static SYSDEV_CLASS_ATTR(probe, S_IWUSR, NULL, cpu_probe_store); | 98 | static DEVICE_ATTR(probe, S_IWUSR, NULL, cpu_probe_store); |
100 | static SYSDEV_CLASS_ATTR(release, S_IWUSR, NULL, cpu_release_store); | 99 | static DEVICE_ATTR(release, S_IWUSR, NULL, cpu_release_store); |
101 | #endif /* CONFIG_ARCH_CPU_PROBE_RELEASE */ | 100 | #endif /* CONFIG_ARCH_CPU_PROBE_RELEASE */ |
102 | 101 | ||
103 | #else /* ... !CONFIG_HOTPLUG_CPU */ | 102 | #else /* ... !CONFIG_HOTPLUG_CPU */ |
@@ -109,15 +108,15 @@ static inline void register_cpu_control(struct cpu *cpu) | |||
109 | #ifdef CONFIG_KEXEC | 108 | #ifdef CONFIG_KEXEC |
110 | #include <linux/kexec.h> | 109 | #include <linux/kexec.h> |
111 | 110 | ||
112 | static ssize_t show_crash_notes(struct sys_device *dev, struct sysdev_attribute *attr, | 111 | static ssize_t show_crash_notes(struct device *dev, struct device_attribute *attr, |
113 | char *buf) | 112 | char *buf) |
114 | { | 113 | { |
115 | struct cpu *cpu = container_of(dev, struct cpu, sysdev); | 114 | struct cpu *cpu = container_of(dev, struct cpu, dev); |
116 | ssize_t rc; | 115 | ssize_t rc; |
117 | unsigned long long addr; | 116 | unsigned long long addr; |
118 | int cpunum; | 117 | int cpunum; |
119 | 118 | ||
120 | cpunum = cpu->sysdev.id; | 119 | cpunum = cpu->dev.id; |
121 | 120 | ||
122 | /* | 121 | /* |
123 | * Might be reading other cpu's data based on which cpu read thread | 122 | * Might be reading other cpu's data based on which cpu read thread |
@@ -129,7 +128,7 @@ static ssize_t show_crash_notes(struct sys_device *dev, struct sysdev_attribute | |||
129 | rc = sprintf(buf, "%Lx\n", addr); | 128 | rc = sprintf(buf, "%Lx\n", addr); |
130 | return rc; | 129 | return rc; |
131 | } | 130 | } |
132 | static SYSDEV_ATTR(crash_notes, 0400, show_crash_notes, NULL); | 131 | static DEVICE_ATTR(crash_notes, 0400, show_crash_notes, NULL); |
133 | #endif | 132 | #endif |
134 | 133 | ||
135 | /* | 134 | /* |
@@ -137,12 +136,12 @@ static SYSDEV_ATTR(crash_notes, 0400, show_crash_notes, NULL); | |||
137 | */ | 136 | */ |
138 | 137 | ||
139 | struct cpu_attr { | 138 | struct cpu_attr { |
140 | struct sysdev_class_attribute attr; | 139 | struct device_attribute attr; |
141 | const struct cpumask *const * const map; | 140 | const struct cpumask *const * const map; |
142 | }; | 141 | }; |
143 | 142 | ||
144 | static ssize_t show_cpus_attr(struct sysdev_class *class, | 143 | static ssize_t show_cpus_attr(struct device *dev, |
145 | struct sysdev_class_attribute *attr, | 144 | struct device_attribute *attr, |
146 | char *buf) | 145 | char *buf) |
147 | { | 146 | { |
148 | struct cpu_attr *ca = container_of(attr, struct cpu_attr, attr); | 147 | struct cpu_attr *ca = container_of(attr, struct cpu_attr, attr); |
@@ -153,10 +152,10 @@ static ssize_t show_cpus_attr(struct sysdev_class *class, | |||
153 | return n; | 152 | return n; |
154 | } | 153 | } |
155 | 154 | ||
156 | #define _CPU_ATTR(name, map) \ | 155 | #define _CPU_ATTR(name, map) \ |
157 | { _SYSDEV_CLASS_ATTR(name, 0444, show_cpus_attr, NULL), map } | 156 | { __ATTR(name, 0444, show_cpus_attr, NULL), map } |
158 | 157 | ||
159 | /* Keep in sync with cpu_sysdev_class_attrs */ | 158 | /* Keep in sync with cpu_subsys_attrs */ |
160 | static struct cpu_attr cpu_attrs[] = { | 159 | static struct cpu_attr cpu_attrs[] = { |
161 | _CPU_ATTR(online, &cpu_online_mask), | 160 | _CPU_ATTR(online, &cpu_online_mask), |
162 | _CPU_ATTR(possible, &cpu_possible_mask), | 161 | _CPU_ATTR(possible, &cpu_possible_mask), |
@@ -166,19 +165,19 @@ static struct cpu_attr cpu_attrs[] = { | |||
166 | /* | 165 | /* |
167 | * Print values for NR_CPUS and offlined cpus | 166 | * Print values for NR_CPUS and offlined cpus |
168 | */ | 167 | */ |
169 | static ssize_t print_cpus_kernel_max(struct sysdev_class *class, | 168 | static ssize_t print_cpus_kernel_max(struct device *dev, |
170 | struct sysdev_class_attribute *attr, char *buf) | 169 | struct device_attribute *attr, char *buf) |
171 | { | 170 | { |
172 | int n = snprintf(buf, PAGE_SIZE-2, "%d\n", NR_CPUS - 1); | 171 | int n = snprintf(buf, PAGE_SIZE-2, "%d\n", NR_CPUS - 1); |
173 | return n; | 172 | return n; |
174 | } | 173 | } |
175 | static SYSDEV_CLASS_ATTR(kernel_max, 0444, print_cpus_kernel_max, NULL); | 174 | static DEVICE_ATTR(kernel_max, 0444, print_cpus_kernel_max, NULL); |
176 | 175 | ||
177 | /* arch-optional setting to enable display of offline cpus >= nr_cpu_ids */ | 176 | /* arch-optional setting to enable display of offline cpus >= nr_cpu_ids */ |
178 | unsigned int total_cpus; | 177 | unsigned int total_cpus; |
179 | 178 | ||
180 | static ssize_t print_cpus_offline(struct sysdev_class *class, | 179 | static ssize_t print_cpus_offline(struct device *dev, |
181 | struct sysdev_class_attribute *attr, char *buf) | 180 | struct device_attribute *attr, char *buf) |
182 | { | 181 | { |
183 | int n = 0, len = PAGE_SIZE-2; | 182 | int n = 0, len = PAGE_SIZE-2; |
184 | cpumask_var_t offline; | 183 | cpumask_var_t offline; |
@@ -205,7 +204,7 @@ static ssize_t print_cpus_offline(struct sysdev_class *class, | |||
205 | n += snprintf(&buf[n], len - n, "\n"); | 204 | n += snprintf(&buf[n], len - n, "\n"); |
206 | return n; | 205 | return n; |
207 | } | 206 | } |
208 | static SYSDEV_CLASS_ATTR(offline, 0444, print_cpus_offline, NULL); | 207 | static DEVICE_ATTR(offline, 0444, print_cpus_offline, NULL); |
209 | 208 | ||
210 | /* | 209 | /* |
211 | * register_cpu - Setup a sysfs device for a CPU. | 210 | * register_cpu - Setup a sysfs device for a CPU. |
@@ -218,39 +217,60 @@ static SYSDEV_CLASS_ATTR(offline, 0444, print_cpus_offline, NULL); | |||
218 | int __cpuinit register_cpu(struct cpu *cpu, int num) | 217 | int __cpuinit register_cpu(struct cpu *cpu, int num) |
219 | { | 218 | { |
220 | int error; | 219 | int error; |
221 | cpu->node_id = cpu_to_node(num); | ||
222 | cpu->sysdev.id = num; | ||
223 | cpu->sysdev.cls = &cpu_sysdev_class; | ||
224 | |||
225 | error = sysdev_register(&cpu->sysdev); | ||
226 | 220 | ||
221 | cpu->node_id = cpu_to_node(num); | ||
222 | cpu->dev.id = num; | ||
223 | cpu->dev.bus = &cpu_subsys; | ||
224 | error = device_register(&cpu->dev); | ||
227 | if (!error && cpu->hotpluggable) | 225 | if (!error && cpu->hotpluggable) |
228 | register_cpu_control(cpu); | 226 | register_cpu_control(cpu); |
229 | if (!error) | 227 | if (!error) |
230 | per_cpu(cpu_sys_devices, num) = &cpu->sysdev; | 228 | per_cpu(cpu_sys_devices, num) = &cpu->dev; |
231 | if (!error) | 229 | if (!error) |
232 | register_cpu_under_node(num, cpu_to_node(num)); | 230 | register_cpu_under_node(num, cpu_to_node(num)); |
233 | 231 | ||
234 | #ifdef CONFIG_KEXEC | 232 | #ifdef CONFIG_KEXEC |
235 | if (!error) | 233 | if (!error) |
236 | error = sysdev_create_file(&cpu->sysdev, &attr_crash_notes); | 234 | error = device_create_file(&cpu->dev, &dev_attr_crash_notes); |
237 | #endif | 235 | #endif |
238 | return error; | 236 | return error; |
239 | } | 237 | } |
240 | 238 | ||
241 | struct sys_device *get_cpu_sysdev(unsigned cpu) | 239 | struct device *get_cpu_device(unsigned cpu) |
242 | { | 240 | { |
243 | if (cpu < nr_cpu_ids && cpu_possible(cpu)) | 241 | if (cpu < nr_cpu_ids && cpu_possible(cpu)) |
244 | return per_cpu(cpu_sys_devices, cpu); | 242 | return per_cpu(cpu_sys_devices, cpu); |
245 | else | 243 | else |
246 | return NULL; | 244 | return NULL; |
247 | } | 245 | } |
248 | EXPORT_SYMBOL_GPL(get_cpu_sysdev); | 246 | EXPORT_SYMBOL_GPL(get_cpu_device); |
247 | |||
248 | static struct attribute *cpu_root_attrs[] = { | ||
249 | #ifdef CONFIG_ARCH_CPU_PROBE_RELEASE | ||
250 | &dev_attr_probe.attr, | ||
251 | &dev_attr_release.attr, | ||
252 | #endif | ||
253 | &cpu_attrs[0].attr.attr, | ||
254 | &cpu_attrs[1].attr.attr, | ||
255 | &cpu_attrs[2].attr.attr, | ||
256 | &dev_attr_kernel_max.attr, | ||
257 | &dev_attr_offline.attr, | ||
258 | NULL | ||
259 | }; | ||
260 | |||
261 | static struct attribute_group cpu_root_attr_group = { | ||
262 | .attrs = cpu_root_attrs, | ||
263 | }; | ||
264 | |||
265 | static const struct attribute_group *cpu_root_attr_groups[] = { | ||
266 | &cpu_root_attr_group, | ||
267 | NULL, | ||
268 | }; | ||
249 | 269 | ||
250 | bool cpu_is_hotpluggable(unsigned cpu) | 270 | bool cpu_is_hotpluggable(unsigned cpu) |
251 | { | 271 | { |
252 | struct sys_device *dev = get_cpu_sysdev(cpu); | 272 | struct device *dev = get_cpu_device(cpu); |
253 | return dev && container_of(dev, struct cpu, sysdev)->hotpluggable; | 273 | return dev && container_of(dev, struct cpu, dev)->hotpluggable; |
254 | } | 274 | } |
255 | EXPORT_SYMBOL_GPL(cpu_is_hotpluggable); | 275 | EXPORT_SYMBOL_GPL(cpu_is_hotpluggable); |
256 | 276 | ||
@@ -258,24 +278,12 @@ int __init cpu_dev_init(void) | |||
258 | { | 278 | { |
259 | int err; | 279 | int err; |
260 | 280 | ||
261 | err = sysdev_class_register(&cpu_sysdev_class); | 281 | err = subsys_system_register(&cpu_subsys, cpu_root_attr_groups); |
282 | if (err) | ||
283 | return err; | ||
284 | |||
262 | #if defined(CONFIG_SCHED_MC) || defined(CONFIG_SCHED_SMT) | 285 | #if defined(CONFIG_SCHED_MC) || defined(CONFIG_SCHED_SMT) |
263 | if (!err) | 286 | err = sched_create_sysfs_power_savings_entries(cpu_subsys.dev_root); |
264 | err = sched_create_sysfs_power_savings_entries(&cpu_sysdev_class); | ||
265 | #endif | 287 | #endif |
266 | |||
267 | return err; | 288 | return err; |
268 | } | 289 | } |
269 | |||
270 | static struct sysdev_class_attribute *cpu_sysdev_class_attrs[] = { | ||
271 | #ifdef CONFIG_ARCH_CPU_PROBE_RELEASE | ||
272 | &attr_probe, | ||
273 | &attr_release, | ||
274 | #endif | ||
275 | &cpu_attrs[0].attr, | ||
276 | &cpu_attrs[1].attr, | ||
277 | &cpu_attrs[2].attr, | ||
278 | &attr_kernel_max, | ||
279 | &attr_offline, | ||
280 | NULL | ||
281 | }; | ||
diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c index a4760e095ff5..2bb4bff3af7d 100644 --- a/drivers/base/devtmpfs.c +++ b/drivers/base/devtmpfs.c | |||
@@ -413,10 +413,9 @@ static int devtmpfsd(void *p) | |||
413 | } | 413 | } |
414 | spin_lock(&req_lock); | 414 | spin_lock(&req_lock); |
415 | } | 415 | } |
416 | set_current_state(TASK_INTERRUPTIBLE); | 416 | __set_current_state(TASK_INTERRUPTIBLE); |
417 | spin_unlock(&req_lock); | 417 | spin_unlock(&req_lock); |
418 | schedule(); | 418 | schedule(); |
419 | __set_current_state(TASK_RUNNING); | ||
420 | } | 419 | } |
421 | return 0; | 420 | return 0; |
422 | out: | 421 | out: |
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 06ed6b4e7df5..3719c94be19c 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c | |||
@@ -226,13 +226,13 @@ static ssize_t firmware_loading_store(struct device *dev, | |||
226 | int loading = simple_strtol(buf, NULL, 10); | 226 | int loading = simple_strtol(buf, NULL, 10); |
227 | int i; | 227 | int i; |
228 | 228 | ||
229 | mutex_lock(&fw_lock); | ||
230 | |||
231 | if (!fw_priv->fw) | ||
232 | goto out; | ||
233 | |||
229 | switch (loading) { | 234 | switch (loading) { |
230 | case 1: | 235 | case 1: |
231 | mutex_lock(&fw_lock); | ||
232 | if (!fw_priv->fw) { | ||
233 | mutex_unlock(&fw_lock); | ||
234 | break; | ||
235 | } | ||
236 | firmware_free_data(fw_priv->fw); | 236 | firmware_free_data(fw_priv->fw); |
237 | memset(fw_priv->fw, 0, sizeof(struct firmware)); | 237 | memset(fw_priv->fw, 0, sizeof(struct firmware)); |
238 | /* If the pages are not owned by 'struct firmware' */ | 238 | /* If the pages are not owned by 'struct firmware' */ |
@@ -243,7 +243,6 @@ static ssize_t firmware_loading_store(struct device *dev, | |||
243 | fw_priv->page_array_size = 0; | 243 | fw_priv->page_array_size = 0; |
244 | fw_priv->nr_pages = 0; | 244 | fw_priv->nr_pages = 0; |
245 | set_bit(FW_STATUS_LOADING, &fw_priv->status); | 245 | set_bit(FW_STATUS_LOADING, &fw_priv->status); |
246 | mutex_unlock(&fw_lock); | ||
247 | break; | 246 | break; |
248 | case 0: | 247 | case 0: |
249 | if (test_bit(FW_STATUS_LOADING, &fw_priv->status)) { | 248 | if (test_bit(FW_STATUS_LOADING, &fw_priv->status)) { |
@@ -274,7 +273,8 @@ static ssize_t firmware_loading_store(struct device *dev, | |||
274 | fw_load_abort(fw_priv); | 273 | fw_load_abort(fw_priv); |
275 | break; | 274 | break; |
276 | } | 275 | } |
277 | 276 | out: | |
277 | mutex_unlock(&fw_lock); | ||
278 | return count; | 278 | return count; |
279 | } | 279 | } |
280 | 280 | ||
diff --git a/drivers/base/init.c b/drivers/base/init.c index c8a934e79421..c16f0b808a17 100644 --- a/drivers/base/init.c +++ b/drivers/base/init.c | |||
@@ -31,7 +31,6 @@ void __init driver_init(void) | |||
31 | * core core pieces. | 31 | * core core pieces. |
32 | */ | 32 | */ |
33 | platform_bus_init(); | 33 | platform_bus_init(); |
34 | system_bus_init(); | ||
35 | cpu_dev_init(); | 34 | cpu_dev_init(); |
36 | memory_dev_init(); | 35 | memory_dev_init(); |
37 | } | 36 | } |
diff --git a/drivers/base/memory.c b/drivers/base/memory.c index 8272d92d22c0..f17e3ea041c0 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * drivers/base/memory.c - basic Memory class support | 2 | * Memory subsystem support |
3 | * | 3 | * |
4 | * Written by Matt Tolentino <matthew.e.tolentino@intel.com> | 4 | * Written by Matt Tolentino <matthew.e.tolentino@intel.com> |
5 | * Dave Hansen <haveblue@us.ibm.com> | 5 | * Dave Hansen <haveblue@us.ibm.com> |
@@ -10,7 +10,6 @@ | |||
10 | * SPARSEMEM should be contained here, or in mm/memory_hotplug.c. | 10 | * SPARSEMEM should be contained here, or in mm/memory_hotplug.c. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/sysdev.h> | ||
14 | #include <linux/module.h> | 13 | #include <linux/module.h> |
15 | #include <linux/init.h> | 14 | #include <linux/init.h> |
16 | #include <linux/topology.h> | 15 | #include <linux/topology.h> |
@@ -38,26 +37,9 @@ static inline int base_memory_block_id(int section_nr) | |||
38 | return section_nr / sections_per_block; | 37 | return section_nr / sections_per_block; |
39 | } | 38 | } |
40 | 39 | ||
41 | static struct sysdev_class memory_sysdev_class = { | 40 | static struct bus_type memory_subsys = { |
42 | .name = MEMORY_CLASS_NAME, | 41 | .name = MEMORY_CLASS_NAME, |
43 | }; | 42 | .dev_name = MEMORY_CLASS_NAME, |
44 | |||
45 | static const char *memory_uevent_name(struct kset *kset, struct kobject *kobj) | ||
46 | { | ||
47 | return MEMORY_CLASS_NAME; | ||
48 | } | ||
49 | |||
50 | static int memory_uevent(struct kset *kset, struct kobject *obj, | ||
51 | struct kobj_uevent_env *env) | ||
52 | { | ||
53 | int retval = 0; | ||
54 | |||
55 | return retval; | ||
56 | } | ||
57 | |||
58 | static const struct kset_uevent_ops memory_uevent_ops = { | ||
59 | .name = memory_uevent_name, | ||
60 | .uevent = memory_uevent, | ||
61 | }; | 43 | }; |
62 | 44 | ||
63 | static BLOCKING_NOTIFIER_HEAD(memory_chain); | 45 | static BLOCKING_NOTIFIER_HEAD(memory_chain); |
@@ -96,21 +78,21 @@ int register_memory(struct memory_block *memory) | |||
96 | { | 78 | { |
97 | int error; | 79 | int error; |
98 | 80 | ||
99 | memory->sysdev.cls = &memory_sysdev_class; | 81 | memory->dev.bus = &memory_subsys; |
100 | memory->sysdev.id = memory->start_section_nr / sections_per_block; | 82 | memory->dev.id = memory->start_section_nr / sections_per_block; |
101 | 83 | ||
102 | error = sysdev_register(&memory->sysdev); | 84 | error = device_register(&memory->dev); |
103 | return error; | 85 | return error; |
104 | } | 86 | } |
105 | 87 | ||
106 | static void | 88 | static void |
107 | unregister_memory(struct memory_block *memory) | 89 | unregister_memory(struct memory_block *memory) |
108 | { | 90 | { |
109 | BUG_ON(memory->sysdev.cls != &memory_sysdev_class); | 91 | BUG_ON(memory->dev.bus != &memory_subsys); |
110 | 92 | ||
111 | /* drop the ref. we got in remove_memory_block() */ | 93 | /* drop the ref. we got in remove_memory_block() */ |
112 | kobject_put(&memory->sysdev.kobj); | 94 | kobject_put(&memory->dev.kobj); |
113 | sysdev_unregister(&memory->sysdev); | 95 | device_unregister(&memory->dev); |
114 | } | 96 | } |
115 | 97 | ||
116 | unsigned long __weak memory_block_size_bytes(void) | 98 | unsigned long __weak memory_block_size_bytes(void) |
@@ -138,22 +120,22 @@ static unsigned long get_memory_block_size(void) | |||
138 | * uses. | 120 | * uses. |
139 | */ | 121 | */ |
140 | 122 | ||
141 | static ssize_t show_mem_start_phys_index(struct sys_device *dev, | 123 | static ssize_t show_mem_start_phys_index(struct device *dev, |
142 | struct sysdev_attribute *attr, char *buf) | 124 | struct device_attribute *attr, char *buf) |
143 | { | 125 | { |
144 | struct memory_block *mem = | 126 | struct memory_block *mem = |
145 | container_of(dev, struct memory_block, sysdev); | 127 | container_of(dev, struct memory_block, dev); |
146 | unsigned long phys_index; | 128 | unsigned long phys_index; |
147 | 129 | ||
148 | phys_index = mem->start_section_nr / sections_per_block; | 130 | phys_index = mem->start_section_nr / sections_per_block; |
149 | return sprintf(buf, "%08lx\n", phys_index); | 131 | return sprintf(buf, "%08lx\n", phys_index); |
150 | } | 132 | } |
151 | 133 | ||
152 | static ssize_t show_mem_end_phys_index(struct sys_device *dev, | 134 | static ssize_t show_mem_end_phys_index(struct device *dev, |
153 | struct sysdev_attribute *attr, char *buf) | 135 | struct device_attribute *attr, char *buf) |
154 | { | 136 | { |
155 | struct memory_block *mem = | 137 | struct memory_block *mem = |
156 | container_of(dev, struct memory_block, sysdev); | 138 | container_of(dev, struct memory_block, dev); |
157 | unsigned long phys_index; | 139 | unsigned long phys_index; |
158 | 140 | ||
159 | phys_index = mem->end_section_nr / sections_per_block; | 141 | phys_index = mem->end_section_nr / sections_per_block; |
@@ -163,13 +145,13 @@ static ssize_t show_mem_end_phys_index(struct sys_device *dev, | |||
163 | /* | 145 | /* |
164 | * Show whether the section of memory is likely to be hot-removable | 146 | * Show whether the section of memory is likely to be hot-removable |
165 | */ | 147 | */ |
166 | static ssize_t show_mem_removable(struct sys_device *dev, | 148 | static ssize_t show_mem_removable(struct device *dev, |
167 | struct sysdev_attribute *attr, char *buf) | 149 | struct device_attribute *attr, char *buf) |
168 | { | 150 | { |
169 | unsigned long i, pfn; | 151 | unsigned long i, pfn; |
170 | int ret = 1; | 152 | int ret = 1; |
171 | struct memory_block *mem = | 153 | struct memory_block *mem = |
172 | container_of(dev, struct memory_block, sysdev); | 154 | container_of(dev, struct memory_block, dev); |
173 | 155 | ||
174 | for (i = 0; i < sections_per_block; i++) { | 156 | for (i = 0; i < sections_per_block; i++) { |
175 | pfn = section_nr_to_pfn(mem->start_section_nr + i); | 157 | pfn = section_nr_to_pfn(mem->start_section_nr + i); |
@@ -182,11 +164,11 @@ static ssize_t show_mem_removable(struct sys_device *dev, | |||
182 | /* | 164 | /* |
183 | * online, offline, going offline, etc. | 165 | * online, offline, going offline, etc. |
184 | */ | 166 | */ |
185 | static ssize_t show_mem_state(struct sys_device *dev, | 167 | static ssize_t show_mem_state(struct device *dev, |
186 | struct sysdev_attribute *attr, char *buf) | 168 | struct device_attribute *attr, char *buf) |
187 | { | 169 | { |
188 | struct memory_block *mem = | 170 | struct memory_block *mem = |
189 | container_of(dev, struct memory_block, sysdev); | 171 | container_of(dev, struct memory_block, dev); |
190 | ssize_t len = 0; | 172 | ssize_t len = 0; |
191 | 173 | ||
192 | /* | 174 | /* |
@@ -324,13 +306,13 @@ out: | |||
324 | } | 306 | } |
325 | 307 | ||
326 | static ssize_t | 308 | static ssize_t |
327 | store_mem_state(struct sys_device *dev, | 309 | store_mem_state(struct device *dev, |
328 | struct sysdev_attribute *attr, const char *buf, size_t count) | 310 | struct device_attribute *attr, const char *buf, size_t count) |
329 | { | 311 | { |
330 | struct memory_block *mem; | 312 | struct memory_block *mem; |
331 | int ret = -EINVAL; | 313 | int ret = -EINVAL; |
332 | 314 | ||
333 | mem = container_of(dev, struct memory_block, sysdev); | 315 | mem = container_of(dev, struct memory_block, dev); |
334 | 316 | ||
335 | if (!strncmp(buf, "online", min((int)count, 6))) | 317 | if (!strncmp(buf, "online", min((int)count, 6))) |
336 | ret = memory_block_change_state(mem, MEM_ONLINE, MEM_OFFLINE); | 318 | ret = memory_block_change_state(mem, MEM_ONLINE, MEM_OFFLINE); |
@@ -351,41 +333,41 @@ store_mem_state(struct sys_device *dev, | |||
351 | * s.t. if I offline all of these sections I can then | 333 | * s.t. if I offline all of these sections I can then |
352 | * remove the physical device? | 334 | * remove the physical device? |
353 | */ | 335 | */ |
354 | static ssize_t show_phys_device(struct sys_device *dev, | 336 | static ssize_t show_phys_device(struct device *dev, |
355 | struct sysdev_attribute *attr, char *buf) | 337 | struct device_attribute *attr, char *buf) |
356 | { | 338 | { |
357 | struct memory_block *mem = | 339 | struct memory_block *mem = |
358 | container_of(dev, struct memory_block, sysdev); | 340 | container_of(dev, struct memory_block, dev); |
359 | return sprintf(buf, "%d\n", mem->phys_device); | 341 | return sprintf(buf, "%d\n", mem->phys_device); |
360 | } | 342 | } |
361 | 343 | ||
362 | static SYSDEV_ATTR(phys_index, 0444, show_mem_start_phys_index, NULL); | 344 | static DEVICE_ATTR(phys_index, 0444, show_mem_start_phys_index, NULL); |
363 | static SYSDEV_ATTR(end_phys_index, 0444, show_mem_end_phys_index, NULL); | 345 | static DEVICE_ATTR(end_phys_index, 0444, show_mem_end_phys_index, NULL); |
364 | static SYSDEV_ATTR(state, 0644, show_mem_state, store_mem_state); | 346 | static DEVICE_ATTR(state, 0644, show_mem_state, store_mem_state); |
365 | static SYSDEV_ATTR(phys_device, 0444, show_phys_device, NULL); | 347 | static DEVICE_ATTR(phys_device, 0444, show_phys_device, NULL); |
366 | static SYSDEV_ATTR(removable, 0444, show_mem_removable, NULL); | 348 | static DEVICE_ATTR(removable, 0444, show_mem_removable, NULL); |
367 | 349 | ||
368 | #define mem_create_simple_file(mem, attr_name) \ | 350 | #define mem_create_simple_file(mem, attr_name) \ |
369 | sysdev_create_file(&mem->sysdev, &attr_##attr_name) | 351 | device_create_file(&mem->dev, &dev_attr_##attr_name) |
370 | #define mem_remove_simple_file(mem, attr_name) \ | 352 | #define mem_remove_simple_file(mem, attr_name) \ |
371 | sysdev_remove_file(&mem->sysdev, &attr_##attr_name) | 353 | device_remove_file(&mem->dev, &dev_attr_##attr_name) |
372 | 354 | ||
373 | /* | 355 | /* |
374 | * Block size attribute stuff | 356 | * Block size attribute stuff |
375 | */ | 357 | */ |
376 | static ssize_t | 358 | static ssize_t |
377 | print_block_size(struct sysdev_class *class, struct sysdev_class_attribute *attr, | 359 | print_block_size(struct device *dev, struct device_attribute *attr, |
378 | char *buf) | 360 | char *buf) |
379 | { | 361 | { |
380 | return sprintf(buf, "%lx\n", get_memory_block_size()); | 362 | return sprintf(buf, "%lx\n", get_memory_block_size()); |
381 | } | 363 | } |
382 | 364 | ||
383 | static SYSDEV_CLASS_ATTR(block_size_bytes, 0444, print_block_size, NULL); | 365 | static DEVICE_ATTR(block_size_bytes, 0444, print_block_size, NULL); |
384 | 366 | ||
385 | static int block_size_init(void) | 367 | static int block_size_init(void) |
386 | { | 368 | { |
387 | return sysfs_create_file(&memory_sysdev_class.kset.kobj, | 369 | return device_create_file(memory_subsys.dev_root, |
388 | &attr_block_size_bytes.attr); | 370 | &dev_attr_block_size_bytes); |
389 | } | 371 | } |
390 | 372 | ||
391 | /* | 373 | /* |
@@ -396,7 +378,7 @@ static int block_size_init(void) | |||
396 | */ | 378 | */ |
397 | #ifdef CONFIG_ARCH_MEMORY_PROBE | 379 | #ifdef CONFIG_ARCH_MEMORY_PROBE |
398 | static ssize_t | 380 | static ssize_t |
399 | memory_probe_store(struct class *class, struct class_attribute *attr, | 381 | memory_probe_store(struct device *dev, struct device_attribute *attr, |
400 | const char *buf, size_t count) | 382 | const char *buf, size_t count) |
401 | { | 383 | { |
402 | u64 phys_addr; | 384 | u64 phys_addr; |
@@ -423,12 +405,11 @@ memory_probe_store(struct class *class, struct class_attribute *attr, | |||
423 | out: | 405 | out: |
424 | return ret; | 406 | return ret; |
425 | } | 407 | } |
426 | static CLASS_ATTR(probe, S_IWUSR, NULL, memory_probe_store); | 408 | static DEVICE_ATTR(probe, S_IWUSR, NULL, memory_probe_store); |
427 | 409 | ||
428 | static int memory_probe_init(void) | 410 | static int memory_probe_init(void) |
429 | { | 411 | { |
430 | return sysfs_create_file(&memory_sysdev_class.kset.kobj, | 412 | return device_create_file(memory_subsys.dev_root, &dev_attr_probe); |
431 | &class_attr_probe.attr); | ||
432 | } | 413 | } |
433 | #else | 414 | #else |
434 | static inline int memory_probe_init(void) | 415 | static inline int memory_probe_init(void) |
@@ -444,8 +425,8 @@ static inline int memory_probe_init(void) | |||
444 | 425 | ||
445 | /* Soft offline a page */ | 426 | /* Soft offline a page */ |
446 | static ssize_t | 427 | static ssize_t |
447 | store_soft_offline_page(struct class *class, | 428 | store_soft_offline_page(struct device *dev, |
448 | struct class_attribute *attr, | 429 | struct device_attribute *attr, |
449 | const char *buf, size_t count) | 430 | const char *buf, size_t count) |
450 | { | 431 | { |
451 | int ret; | 432 | int ret; |
@@ -463,8 +444,8 @@ store_soft_offline_page(struct class *class, | |||
463 | 444 | ||
464 | /* Forcibly offline a page, including killing processes. */ | 445 | /* Forcibly offline a page, including killing processes. */ |
465 | static ssize_t | 446 | static ssize_t |
466 | store_hard_offline_page(struct class *class, | 447 | store_hard_offline_page(struct device *dev, |
467 | struct class_attribute *attr, | 448 | struct device_attribute *attr, |
468 | const char *buf, size_t count) | 449 | const char *buf, size_t count) |
469 | { | 450 | { |
470 | int ret; | 451 | int ret; |
@@ -478,18 +459,18 @@ store_hard_offline_page(struct class *class, | |||
478 | return ret ? ret : count; | 459 | return ret ? ret : count; |
479 | } | 460 | } |
480 | 461 | ||
481 | static CLASS_ATTR(soft_offline_page, 0644, NULL, store_soft_offline_page); | 462 | static DEVICE_ATTR(soft_offline_page, 0644, NULL, store_soft_offline_page); |
482 | static CLASS_ATTR(hard_offline_page, 0644, NULL, store_hard_offline_page); | 463 | static DEVICE_ATTR(hard_offline_page, 0644, NULL, store_hard_offline_page); |
483 | 464 | ||
484 | static __init int memory_fail_init(void) | 465 | static __init int memory_fail_init(void) |
485 | { | 466 | { |
486 | int err; | 467 | int err; |
487 | 468 | ||
488 | err = sysfs_create_file(&memory_sysdev_class.kset.kobj, | 469 | err = device_create_file(memory_subsys.dev_root, |
489 | &class_attr_soft_offline_page.attr); | 470 | &dev_attr_soft_offline_page); |
490 | if (!err) | 471 | if (!err) |
491 | err = sysfs_create_file(&memory_sysdev_class.kset.kobj, | 472 | err = device_create_file(memory_subsys.dev_root, |
492 | &class_attr_hard_offline_page.attr); | 473 | &dev_attr_hard_offline_page); |
493 | return err; | 474 | return err; |
494 | } | 475 | } |
495 | #else | 476 | #else |
@@ -509,31 +490,23 @@ int __weak arch_get_memory_phys_device(unsigned long start_pfn) | |||
509 | return 0; | 490 | return 0; |
510 | } | 491 | } |
511 | 492 | ||
493 | /* | ||
494 | * A reference for the returned object is held and the reference for the | ||
495 | * hinted object is released. | ||
496 | */ | ||
512 | struct memory_block *find_memory_block_hinted(struct mem_section *section, | 497 | struct memory_block *find_memory_block_hinted(struct mem_section *section, |
513 | struct memory_block *hint) | 498 | struct memory_block *hint) |
514 | { | 499 | { |
515 | struct kobject *kobj; | ||
516 | struct sys_device *sysdev; | ||
517 | struct memory_block *mem; | ||
518 | char name[sizeof(MEMORY_CLASS_NAME) + 9 + 1]; | ||
519 | int block_id = base_memory_block_id(__section_nr(section)); | 500 | int block_id = base_memory_block_id(__section_nr(section)); |
501 | struct device *hintdev = hint ? &hint->dev : NULL; | ||
502 | struct device *dev; | ||
520 | 503 | ||
521 | kobj = hint ? &hint->sysdev.kobj : NULL; | 504 | dev = subsys_find_device_by_id(&memory_subsys, block_id, hintdev); |
522 | 505 | if (hint) | |
523 | /* | 506 | put_device(&hint->dev); |
524 | * This only works because we know that section == sysdev->id | 507 | if (!dev) |
525 | * slightly redundant with sysdev_register() | ||
526 | */ | ||
527 | sprintf(&name[0], "%s%d", MEMORY_CLASS_NAME, block_id); | ||
528 | |||
529 | kobj = kset_find_obj_hinted(&memory_sysdev_class.kset, name, kobj); | ||
530 | if (!kobj) | ||
531 | return NULL; | 508 | return NULL; |
532 | 509 | return container_of(dev, struct memory_block, dev); | |
533 | sysdev = container_of(kobj, struct sys_device, kobj); | ||
534 | mem = container_of(sysdev, struct memory_block, sysdev); | ||
535 | |||
536 | return mem; | ||
537 | } | 510 | } |
538 | 511 | ||
539 | /* | 512 | /* |
@@ -542,7 +515,7 @@ struct memory_block *find_memory_block_hinted(struct mem_section *section, | |||
542 | * this gets to be a real problem, we can always use a radix | 515 | * this gets to be a real problem, we can always use a radix |
543 | * tree or something here. | 516 | * tree or something here. |
544 | * | 517 | * |
545 | * This could be made generic for all sysdev classes. | 518 | * This could be made generic for all device subsystems. |
546 | */ | 519 | */ |
547 | struct memory_block *find_memory_block(struct mem_section *section) | 520 | struct memory_block *find_memory_block(struct mem_section *section) |
548 | { | 521 | { |
@@ -598,7 +571,7 @@ static int add_memory_section(int nid, struct mem_section *section, | |||
598 | mem = find_memory_block(section); | 571 | mem = find_memory_block(section); |
599 | if (mem) { | 572 | if (mem) { |
600 | mem->section_count++; | 573 | mem->section_count++; |
601 | kobject_put(&mem->sysdev.kobj); | 574 | kobject_put(&mem->dev.kobj); |
602 | } else | 575 | } else |
603 | ret = init_memory_block(&mem, section, state); | 576 | ret = init_memory_block(&mem, section, state); |
604 | 577 | ||
@@ -631,7 +604,7 @@ int remove_memory_block(unsigned long node_id, struct mem_section *section, | |||
631 | unregister_memory(mem); | 604 | unregister_memory(mem); |
632 | kfree(mem); | 605 | kfree(mem); |
633 | } else | 606 | } else |
634 | kobject_put(&mem->sysdev.kobj); | 607 | kobject_put(&mem->dev.kobj); |
635 | 608 | ||
636 | mutex_unlock(&mem_sysfs_mutex); | 609 | mutex_unlock(&mem_sysfs_mutex); |
637 | return 0; | 610 | return 0; |
@@ -664,8 +637,7 @@ int __init memory_dev_init(void) | |||
664 | int err; | 637 | int err; |
665 | unsigned long block_sz; | 638 | unsigned long block_sz; |
666 | 639 | ||
667 | memory_sysdev_class.kset.uevent_ops = &memory_uevent_ops; | 640 | ret = subsys_system_register(&memory_subsys, NULL); |
668 | ret = sysdev_class_register(&memory_sysdev_class); | ||
669 | if (ret) | 641 | if (ret) |
670 | goto out; | 642 | goto out; |
671 | 643 | ||
diff --git a/drivers/base/node.c b/drivers/base/node.c index 5693ecee9a40..44f427a66117 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c | |||
@@ -1,8 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * drivers/base/node.c - basic Node class support | 2 | * Basic Node interface support |
3 | */ | 3 | */ |
4 | 4 | ||
5 | #include <linux/sysdev.h> | ||
6 | #include <linux/module.h> | 5 | #include <linux/module.h> |
7 | #include <linux/init.h> | 6 | #include <linux/init.h> |
8 | #include <linux/mm.h> | 7 | #include <linux/mm.h> |
@@ -19,18 +18,16 @@ | |||
19 | #include <linux/swap.h> | 18 | #include <linux/swap.h> |
20 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
21 | 20 | ||
22 | static struct sysdev_class_attribute *node_state_attrs[]; | 21 | static struct bus_type node_subsys = { |
23 | |||
24 | static struct sysdev_class node_class = { | ||
25 | .name = "node", | 22 | .name = "node", |
26 | .attrs = node_state_attrs, | 23 | .dev_name = "node", |
27 | }; | 24 | }; |
28 | 25 | ||
29 | 26 | ||
30 | static ssize_t node_read_cpumap(struct sys_device *dev, int type, char *buf) | 27 | static ssize_t node_read_cpumap(struct device *dev, int type, char *buf) |
31 | { | 28 | { |
32 | struct node *node_dev = to_node(dev); | 29 | struct node *node_dev = to_node(dev); |
33 | const struct cpumask *mask = cpumask_of_node(node_dev->sysdev.id); | 30 | const struct cpumask *mask = cpumask_of_node(node_dev->dev.id); |
34 | int len; | 31 | int len; |
35 | 32 | ||
36 | /* 2008/04/07: buf currently PAGE_SIZE, need 9 chars per 32 bits. */ | 33 | /* 2008/04/07: buf currently PAGE_SIZE, need 9 chars per 32 bits. */ |
@@ -44,23 +41,23 @@ static ssize_t node_read_cpumap(struct sys_device *dev, int type, char *buf) | |||
44 | return len; | 41 | return len; |
45 | } | 42 | } |
46 | 43 | ||
47 | static inline ssize_t node_read_cpumask(struct sys_device *dev, | 44 | static inline ssize_t node_read_cpumask(struct device *dev, |
48 | struct sysdev_attribute *attr, char *buf) | 45 | struct device_attribute *attr, char *buf) |
49 | { | 46 | { |
50 | return node_read_cpumap(dev, 0, buf); | 47 | return node_read_cpumap(dev, 0, buf); |
51 | } | 48 | } |
52 | static inline ssize_t node_read_cpulist(struct sys_device *dev, | 49 | static inline ssize_t node_read_cpulist(struct device *dev, |
53 | struct sysdev_attribute *attr, char *buf) | 50 | struct device_attribute *attr, char *buf) |
54 | { | 51 | { |
55 | return node_read_cpumap(dev, 1, buf); | 52 | return node_read_cpumap(dev, 1, buf); |
56 | } | 53 | } |
57 | 54 | ||
58 | static SYSDEV_ATTR(cpumap, S_IRUGO, node_read_cpumask, NULL); | 55 | static DEVICE_ATTR(cpumap, S_IRUGO, node_read_cpumask, NULL); |
59 | static SYSDEV_ATTR(cpulist, S_IRUGO, node_read_cpulist, NULL); | 56 | static DEVICE_ATTR(cpulist, S_IRUGO, node_read_cpulist, NULL); |
60 | 57 | ||
61 | #define K(x) ((x) << (PAGE_SHIFT - 10)) | 58 | #define K(x) ((x) << (PAGE_SHIFT - 10)) |
62 | static ssize_t node_read_meminfo(struct sys_device * dev, | 59 | static ssize_t node_read_meminfo(struct device *dev, |
63 | struct sysdev_attribute *attr, char * buf) | 60 | struct device_attribute *attr, char *buf) |
64 | { | 61 | { |
65 | int n; | 62 | int n; |
66 | int nid = dev->id; | 63 | int nid = dev->id; |
@@ -157,10 +154,10 @@ static ssize_t node_read_meminfo(struct sys_device * dev, | |||
157 | } | 154 | } |
158 | 155 | ||
159 | #undef K | 156 | #undef K |
160 | static SYSDEV_ATTR(meminfo, S_IRUGO, node_read_meminfo, NULL); | 157 | static DEVICE_ATTR(meminfo, S_IRUGO, node_read_meminfo, NULL); |
161 | 158 | ||
162 | static ssize_t node_read_numastat(struct sys_device * dev, | 159 | static ssize_t node_read_numastat(struct device *dev, |
163 | struct sysdev_attribute *attr, char * buf) | 160 | struct device_attribute *attr, char *buf) |
164 | { | 161 | { |
165 | return sprintf(buf, | 162 | return sprintf(buf, |
166 | "numa_hit %lu\n" | 163 | "numa_hit %lu\n" |
@@ -176,10 +173,10 @@ static ssize_t node_read_numastat(struct sys_device * dev, | |||
176 | node_page_state(dev->id, NUMA_LOCAL), | 173 | node_page_state(dev->id, NUMA_LOCAL), |
177 | node_page_state(dev->id, NUMA_OTHER)); | 174 | node_page_state(dev->id, NUMA_OTHER)); |
178 | } | 175 | } |
179 | static SYSDEV_ATTR(numastat, S_IRUGO, node_read_numastat, NULL); | 176 | static DEVICE_ATTR(numastat, S_IRUGO, node_read_numastat, NULL); |
180 | 177 | ||
181 | static ssize_t node_read_vmstat(struct sys_device *dev, | 178 | static ssize_t node_read_vmstat(struct device *dev, |
182 | struct sysdev_attribute *attr, char *buf) | 179 | struct device_attribute *attr, char *buf) |
183 | { | 180 | { |
184 | int nid = dev->id; | 181 | int nid = dev->id; |
185 | int i; | 182 | int i; |
@@ -191,10 +188,10 @@ static ssize_t node_read_vmstat(struct sys_device *dev, | |||
191 | 188 | ||
192 | return n; | 189 | return n; |
193 | } | 190 | } |
194 | static SYSDEV_ATTR(vmstat, S_IRUGO, node_read_vmstat, NULL); | 191 | static DEVICE_ATTR(vmstat, S_IRUGO, node_read_vmstat, NULL); |
195 | 192 | ||
196 | static ssize_t node_read_distance(struct sys_device * dev, | 193 | static ssize_t node_read_distance(struct device *dev, |
197 | struct sysdev_attribute *attr, char * buf) | 194 | struct device_attribute *attr, char * buf) |
198 | { | 195 | { |
199 | int nid = dev->id; | 196 | int nid = dev->id; |
200 | int len = 0; | 197 | int len = 0; |
@@ -212,7 +209,7 @@ static ssize_t node_read_distance(struct sys_device * dev, | |||
212 | len += sprintf(buf + len, "\n"); | 209 | len += sprintf(buf + len, "\n"); |
213 | return len; | 210 | return len; |
214 | } | 211 | } |
215 | static SYSDEV_ATTR(distance, S_IRUGO, node_read_distance, NULL); | 212 | static DEVICE_ATTR(distance, S_IRUGO, node_read_distance, NULL); |
216 | 213 | ||
217 | #ifdef CONFIG_HUGETLBFS | 214 | #ifdef CONFIG_HUGETLBFS |
218 | /* | 215 | /* |
@@ -230,7 +227,7 @@ static node_registration_func_t __hugetlb_unregister_node; | |||
230 | static inline bool hugetlb_register_node(struct node *node) | 227 | static inline bool hugetlb_register_node(struct node *node) |
231 | { | 228 | { |
232 | if (__hugetlb_register_node && | 229 | if (__hugetlb_register_node && |
233 | node_state(node->sysdev.id, N_HIGH_MEMORY)) { | 230 | node_state(node->dev.id, N_HIGH_MEMORY)) { |
234 | __hugetlb_register_node(node); | 231 | __hugetlb_register_node(node); |
235 | return true; | 232 | return true; |
236 | } | 233 | } |
@@ -266,17 +263,17 @@ int register_node(struct node *node, int num, struct node *parent) | |||
266 | { | 263 | { |
267 | int error; | 264 | int error; |
268 | 265 | ||
269 | node->sysdev.id = num; | 266 | node->dev.id = num; |
270 | node->sysdev.cls = &node_class; | 267 | node->dev.bus = &node_subsys; |
271 | error = sysdev_register(&node->sysdev); | 268 | error = device_register(&node->dev); |
272 | 269 | ||
273 | if (!error){ | 270 | if (!error){ |
274 | sysdev_create_file(&node->sysdev, &attr_cpumap); | 271 | device_create_file(&node->dev, &dev_attr_cpumap); |
275 | sysdev_create_file(&node->sysdev, &attr_cpulist); | 272 | device_create_file(&node->dev, &dev_attr_cpulist); |
276 | sysdev_create_file(&node->sysdev, &attr_meminfo); | 273 | device_create_file(&node->dev, &dev_attr_meminfo); |
277 | sysdev_create_file(&node->sysdev, &attr_numastat); | 274 | device_create_file(&node->dev, &dev_attr_numastat); |
278 | sysdev_create_file(&node->sysdev, &attr_distance); | 275 | device_create_file(&node->dev, &dev_attr_distance); |
279 | sysdev_create_file(&node->sysdev, &attr_vmstat); | 276 | device_create_file(&node->dev, &dev_attr_vmstat); |
280 | 277 | ||
281 | scan_unevictable_register_node(node); | 278 | scan_unevictable_register_node(node); |
282 | 279 | ||
@@ -296,17 +293,17 @@ int register_node(struct node *node, int num, struct node *parent) | |||
296 | */ | 293 | */ |
297 | void unregister_node(struct node *node) | 294 | void unregister_node(struct node *node) |
298 | { | 295 | { |
299 | sysdev_remove_file(&node->sysdev, &attr_cpumap); | 296 | device_remove_file(&node->dev, &dev_attr_cpumap); |
300 | sysdev_remove_file(&node->sysdev, &attr_cpulist); | 297 | device_remove_file(&node->dev, &dev_attr_cpulist); |
301 | sysdev_remove_file(&node->sysdev, &attr_meminfo); | 298 | device_remove_file(&node->dev, &dev_attr_meminfo); |
302 | sysdev_remove_file(&node->sysdev, &attr_numastat); | 299 | device_remove_file(&node->dev, &dev_attr_numastat); |
303 | sysdev_remove_file(&node->sysdev, &attr_distance); | 300 | device_remove_file(&node->dev, &dev_attr_distance); |
304 | sysdev_remove_file(&node->sysdev, &attr_vmstat); | 301 | device_remove_file(&node->dev, &dev_attr_vmstat); |
305 | 302 | ||
306 | scan_unevictable_unregister_node(node); | 303 | scan_unevictable_unregister_node(node); |
307 | hugetlb_unregister_node(node); /* no-op, if memoryless node */ | 304 | hugetlb_unregister_node(node); /* no-op, if memoryless node */ |
308 | 305 | ||
309 | sysdev_unregister(&node->sysdev); | 306 | device_unregister(&node->dev); |
310 | } | 307 | } |
311 | 308 | ||
312 | struct node node_devices[MAX_NUMNODES]; | 309 | struct node node_devices[MAX_NUMNODES]; |
@@ -317,41 +314,41 @@ struct node node_devices[MAX_NUMNODES]; | |||
317 | int register_cpu_under_node(unsigned int cpu, unsigned int nid) | 314 | int register_cpu_under_node(unsigned int cpu, unsigned int nid) |
318 | { | 315 | { |
319 | int ret; | 316 | int ret; |
320 | struct sys_device *obj; | 317 | struct device *obj; |
321 | 318 | ||
322 | if (!node_online(nid)) | 319 | if (!node_online(nid)) |
323 | return 0; | 320 | return 0; |
324 | 321 | ||
325 | obj = get_cpu_sysdev(cpu); | 322 | obj = get_cpu_device(cpu); |
326 | if (!obj) | 323 | if (!obj) |
327 | return 0; | 324 | return 0; |
328 | 325 | ||
329 | ret = sysfs_create_link(&node_devices[nid].sysdev.kobj, | 326 | ret = sysfs_create_link(&node_devices[nid].dev.kobj, |
330 | &obj->kobj, | 327 | &obj->kobj, |
331 | kobject_name(&obj->kobj)); | 328 | kobject_name(&obj->kobj)); |
332 | if (ret) | 329 | if (ret) |
333 | return ret; | 330 | return ret; |
334 | 331 | ||
335 | return sysfs_create_link(&obj->kobj, | 332 | return sysfs_create_link(&obj->kobj, |
336 | &node_devices[nid].sysdev.kobj, | 333 | &node_devices[nid].dev.kobj, |
337 | kobject_name(&node_devices[nid].sysdev.kobj)); | 334 | kobject_name(&node_devices[nid].dev.kobj)); |
338 | } | 335 | } |
339 | 336 | ||
340 | int unregister_cpu_under_node(unsigned int cpu, unsigned int nid) | 337 | int unregister_cpu_under_node(unsigned int cpu, unsigned int nid) |
341 | { | 338 | { |
342 | struct sys_device *obj; | 339 | struct device *obj; |
343 | 340 | ||
344 | if (!node_online(nid)) | 341 | if (!node_online(nid)) |
345 | return 0; | 342 | return 0; |
346 | 343 | ||
347 | obj = get_cpu_sysdev(cpu); | 344 | obj = get_cpu_device(cpu); |
348 | if (!obj) | 345 | if (!obj) |
349 | return 0; | 346 | return 0; |
350 | 347 | ||
351 | sysfs_remove_link(&node_devices[nid].sysdev.kobj, | 348 | sysfs_remove_link(&node_devices[nid].dev.kobj, |
352 | kobject_name(&obj->kobj)); | 349 | kobject_name(&obj->kobj)); |
353 | sysfs_remove_link(&obj->kobj, | 350 | sysfs_remove_link(&obj->kobj, |
354 | kobject_name(&node_devices[nid].sysdev.kobj)); | 351 | kobject_name(&node_devices[nid].dev.kobj)); |
355 | 352 | ||
356 | return 0; | 353 | return 0; |
357 | } | 354 | } |
@@ -393,15 +390,15 @@ int register_mem_sect_under_node(struct memory_block *mem_blk, int nid) | |||
393 | continue; | 390 | continue; |
394 | if (page_nid != nid) | 391 | if (page_nid != nid) |
395 | continue; | 392 | continue; |
396 | ret = sysfs_create_link_nowarn(&node_devices[nid].sysdev.kobj, | 393 | ret = sysfs_create_link_nowarn(&node_devices[nid].dev.kobj, |
397 | &mem_blk->sysdev.kobj, | 394 | &mem_blk->dev.kobj, |
398 | kobject_name(&mem_blk->sysdev.kobj)); | 395 | kobject_name(&mem_blk->dev.kobj)); |
399 | if (ret) | 396 | if (ret) |
400 | return ret; | 397 | return ret; |
401 | 398 | ||
402 | return sysfs_create_link_nowarn(&mem_blk->sysdev.kobj, | 399 | return sysfs_create_link_nowarn(&mem_blk->dev.kobj, |
403 | &node_devices[nid].sysdev.kobj, | 400 | &node_devices[nid].dev.kobj, |
404 | kobject_name(&node_devices[nid].sysdev.kobj)); | 401 | kobject_name(&node_devices[nid].dev.kobj)); |
405 | } | 402 | } |
406 | /* mem section does not span the specified node */ | 403 | /* mem section does not span the specified node */ |
407 | return 0; | 404 | return 0; |
@@ -434,10 +431,10 @@ int unregister_mem_sect_under_nodes(struct memory_block *mem_blk, | |||
434 | continue; | 431 | continue; |
435 | if (node_test_and_set(nid, *unlinked_nodes)) | 432 | if (node_test_and_set(nid, *unlinked_nodes)) |
436 | continue; | 433 | continue; |
437 | sysfs_remove_link(&node_devices[nid].sysdev.kobj, | 434 | sysfs_remove_link(&node_devices[nid].dev.kobj, |
438 | kobject_name(&mem_blk->sysdev.kobj)); | 435 | kobject_name(&mem_blk->dev.kobj)); |
439 | sysfs_remove_link(&mem_blk->sysdev.kobj, | 436 | sysfs_remove_link(&mem_blk->dev.kobj, |
440 | kobject_name(&node_devices[nid].sysdev.kobj)); | 437 | kobject_name(&node_devices[nid].dev.kobj)); |
441 | } | 438 | } |
442 | NODEMASK_FREE(unlinked_nodes); | 439 | NODEMASK_FREE(unlinked_nodes); |
443 | return 0; | 440 | return 0; |
@@ -468,7 +465,7 @@ static int link_mem_sections(int nid) | |||
468 | } | 465 | } |
469 | 466 | ||
470 | if (mem_blk) | 467 | if (mem_blk) |
471 | kobject_put(&mem_blk->sysdev.kobj); | 468 | kobject_put(&mem_blk->dev.kobj); |
472 | return err; | 469 | return err; |
473 | } | 470 | } |
474 | 471 | ||
@@ -596,19 +593,19 @@ static ssize_t print_nodes_state(enum node_states state, char *buf) | |||
596 | } | 593 | } |
597 | 594 | ||
598 | struct node_attr { | 595 | struct node_attr { |
599 | struct sysdev_class_attribute attr; | 596 | struct device_attribute attr; |
600 | enum node_states state; | 597 | enum node_states state; |
601 | }; | 598 | }; |
602 | 599 | ||
603 | static ssize_t show_node_state(struct sysdev_class *class, | 600 | static ssize_t show_node_state(struct device *dev, |
604 | struct sysdev_class_attribute *attr, char *buf) | 601 | struct device_attribute *attr, char *buf) |
605 | { | 602 | { |
606 | struct node_attr *na = container_of(attr, struct node_attr, attr); | 603 | struct node_attr *na = container_of(attr, struct node_attr, attr); |
607 | return print_nodes_state(na->state, buf); | 604 | return print_nodes_state(na->state, buf); |
608 | } | 605 | } |
609 | 606 | ||
610 | #define _NODE_ATTR(name, state) \ | 607 | #define _NODE_ATTR(name, state) \ |
611 | { _SYSDEV_CLASS_ATTR(name, 0444, show_node_state, NULL), state } | 608 | { __ATTR(name, 0444, show_node_state, NULL), state } |
612 | 609 | ||
613 | static struct node_attr node_state_attr[] = { | 610 | static struct node_attr node_state_attr[] = { |
614 | _NODE_ATTR(possible, N_POSSIBLE), | 611 | _NODE_ATTR(possible, N_POSSIBLE), |
@@ -620,17 +617,26 @@ static struct node_attr node_state_attr[] = { | |||
620 | #endif | 617 | #endif |
621 | }; | 618 | }; |
622 | 619 | ||
623 | static struct sysdev_class_attribute *node_state_attrs[] = { | 620 | static struct attribute *node_state_attrs[] = { |
624 | &node_state_attr[0].attr, | 621 | &node_state_attr[0].attr.attr, |
625 | &node_state_attr[1].attr, | 622 | &node_state_attr[1].attr.attr, |
626 | &node_state_attr[2].attr, | 623 | &node_state_attr[2].attr.attr, |
627 | &node_state_attr[3].attr, | 624 | &node_state_attr[3].attr.attr, |
628 | #ifdef CONFIG_HIGHMEM | 625 | #ifdef CONFIG_HIGHMEM |
629 | &node_state_attr[4].attr, | 626 | &node_state_attr[4].attr.attr, |
630 | #endif | 627 | #endif |
631 | NULL | 628 | NULL |
632 | }; | 629 | }; |
633 | 630 | ||
631 | static struct attribute_group memory_root_attr_group = { | ||
632 | .attrs = node_state_attrs, | ||
633 | }; | ||
634 | |||
635 | static const struct attribute_group *cpu_root_attr_groups[] = { | ||
636 | &memory_root_attr_group, | ||
637 | NULL, | ||
638 | }; | ||
639 | |||
634 | #define NODE_CALLBACK_PRI 2 /* lower than SLAB */ | 640 | #define NODE_CALLBACK_PRI 2 /* lower than SLAB */ |
635 | static int __init register_node_type(void) | 641 | static int __init register_node_type(void) |
636 | { | 642 | { |
@@ -639,7 +645,7 @@ static int __init register_node_type(void) | |||
639 | BUILD_BUG_ON(ARRAY_SIZE(node_state_attr) != NR_NODE_STATES); | 645 | BUILD_BUG_ON(ARRAY_SIZE(node_state_attr) != NR_NODE_STATES); |
640 | BUILD_BUG_ON(ARRAY_SIZE(node_state_attrs)-1 != NR_NODE_STATES); | 646 | BUILD_BUG_ON(ARRAY_SIZE(node_state_attrs)-1 != NR_NODE_STATES); |
641 | 647 | ||
642 | ret = sysdev_class_register(&node_class); | 648 | ret = subsys_system_register(&node_subsys, cpu_root_attr_groups); |
643 | if (!ret) { | 649 | if (!ret) { |
644 | hotplug_memory_notifier(node_memory_callback, | 650 | hotplug_memory_notifier(node_memory_callback, |
645 | NODE_CALLBACK_PRI); | 651 | NODE_CALLBACK_PRI); |
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 7a24895543e7..a7c06374062e 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
@@ -383,7 +383,7 @@ EXPORT_SYMBOL_GPL(platform_device_unregister); | |||
383 | * Returns &struct platform_device pointer on success, or ERR_PTR() on error. | 383 | * Returns &struct platform_device pointer on success, or ERR_PTR() on error. |
384 | */ | 384 | */ |
385 | struct platform_device *platform_device_register_full( | 385 | struct platform_device *platform_device_register_full( |
386 | struct platform_device_info *pdevinfo) | 386 | const struct platform_device_info *pdevinfo) |
387 | { | 387 | { |
388 | int ret = -ENOMEM; | 388 | int ret = -ENOMEM; |
389 | struct platform_device *pdev; | 389 | struct platform_device *pdev; |
diff --git a/drivers/base/sys.c b/drivers/base/sys.c index 9dff77bfe1e3..409f5ce78829 100644 --- a/drivers/base/sys.c +++ b/drivers/base/sys.c | |||
@@ -126,7 +126,7 @@ void sysdev_class_remove_file(struct sysdev_class *c, | |||
126 | } | 126 | } |
127 | EXPORT_SYMBOL_GPL(sysdev_class_remove_file); | 127 | EXPORT_SYMBOL_GPL(sysdev_class_remove_file); |
128 | 128 | ||
129 | static struct kset *system_kset; | 129 | extern struct kset *system_kset; |
130 | 130 | ||
131 | int sysdev_class_register(struct sysdev_class *cls) | 131 | int sysdev_class_register(struct sysdev_class *cls) |
132 | { | 132 | { |
@@ -331,14 +331,6 @@ void sysdev_unregister(struct sys_device *sysdev) | |||
331 | EXPORT_SYMBOL_GPL(sysdev_register); | 331 | EXPORT_SYMBOL_GPL(sysdev_register); |
332 | EXPORT_SYMBOL_GPL(sysdev_unregister); | 332 | EXPORT_SYMBOL_GPL(sysdev_unregister); |
333 | 333 | ||
334 | int __init system_bus_init(void) | ||
335 | { | ||
336 | system_kset = kset_create_and_add("system", NULL, &devices_kset->kobj); | ||
337 | if (!system_kset) | ||
338 | return -ENOMEM; | ||
339 | return 0; | ||
340 | } | ||
341 | |||
342 | #define to_ext_attr(x) container_of(x, struct sysdev_ext_attribute, attr) | 334 | #define to_ext_attr(x) container_of(x, struct sysdev_ext_attribute, attr) |
343 | 335 | ||
344 | ssize_t sysdev_store_ulong(struct sys_device *sysdev, | 336 | ssize_t sysdev_store_ulong(struct sys_device *sysdev, |
diff --git a/drivers/base/topology.c b/drivers/base/topology.c index f6f37a05a0c3..ae989c57cd5e 100644 --- a/drivers/base/topology.c +++ b/drivers/base/topology.c | |||
@@ -23,7 +23,6 @@ | |||
23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
24 | * | 24 | * |
25 | */ | 25 | */ |
26 | #include <linux/sysdev.h> | ||
27 | #include <linux/init.h> | 26 | #include <linux/init.h> |
28 | #include <linux/mm.h> | 27 | #include <linux/mm.h> |
29 | #include <linux/cpu.h> | 28 | #include <linux/cpu.h> |
@@ -32,14 +31,14 @@ | |||
32 | #include <linux/topology.h> | 31 | #include <linux/topology.h> |
33 | 32 | ||
34 | #define define_one_ro_named(_name, _func) \ | 33 | #define define_one_ro_named(_name, _func) \ |
35 | static SYSDEV_ATTR(_name, 0444, _func, NULL) | 34 | static DEVICE_ATTR(_name, 0444, _func, NULL) |
36 | 35 | ||
37 | #define define_one_ro(_name) \ | 36 | #define define_one_ro(_name) \ |
38 | static SYSDEV_ATTR(_name, 0444, show_##_name, NULL) | 37 | static DEVICE_ATTR(_name, 0444, show_##_name, NULL) |
39 | 38 | ||
40 | #define define_id_show_func(name) \ | 39 | #define define_id_show_func(name) \ |
41 | static ssize_t show_##name(struct sys_device *dev, \ | 40 | static ssize_t show_##name(struct device *dev, \ |
42 | struct sysdev_attribute *attr, char *buf) \ | 41 | struct device_attribute *attr, char *buf) \ |
43 | { \ | 42 | { \ |
44 | unsigned int cpu = dev->id; \ | 43 | unsigned int cpu = dev->id; \ |
45 | return sprintf(buf, "%d\n", topology_##name(cpu)); \ | 44 | return sprintf(buf, "%d\n", topology_##name(cpu)); \ |
@@ -65,16 +64,16 @@ static ssize_t show_cpumap(int type, const struct cpumask *mask, char *buf) | |||
65 | 64 | ||
66 | #ifdef arch_provides_topology_pointers | 65 | #ifdef arch_provides_topology_pointers |
67 | #define define_siblings_show_map(name) \ | 66 | #define define_siblings_show_map(name) \ |
68 | static ssize_t show_##name(struct sys_device *dev, \ | 67 | static ssize_t show_##name(struct device *dev, \ |
69 | struct sysdev_attribute *attr, char *buf) \ | 68 | struct device_attribute *attr, char *buf) \ |
70 | { \ | 69 | { \ |
71 | unsigned int cpu = dev->id; \ | 70 | unsigned int cpu = dev->id; \ |
72 | return show_cpumap(0, topology_##name(cpu), buf); \ | 71 | return show_cpumap(0, topology_##name(cpu), buf); \ |
73 | } | 72 | } |
74 | 73 | ||
75 | #define define_siblings_show_list(name) \ | 74 | #define define_siblings_show_list(name) \ |
76 | static ssize_t show_##name##_list(struct sys_device *dev, \ | 75 | static ssize_t show_##name##_list(struct device *dev, \ |
77 | struct sysdev_attribute *attr, \ | 76 | struct device_attribute *attr, \ |
78 | char *buf) \ | 77 | char *buf) \ |
79 | { \ | 78 | { \ |
80 | unsigned int cpu = dev->id; \ | 79 | unsigned int cpu = dev->id; \ |
@@ -83,15 +82,15 @@ static ssize_t show_##name##_list(struct sys_device *dev, \ | |||
83 | 82 | ||
84 | #else | 83 | #else |
85 | #define define_siblings_show_map(name) \ | 84 | #define define_siblings_show_map(name) \ |
86 | static ssize_t show_##name(struct sys_device *dev, \ | 85 | static ssize_t show_##name(struct device *dev, \ |
87 | struct sysdev_attribute *attr, char *buf) \ | 86 | struct device_attribute *attr, char *buf) \ |
88 | { \ | 87 | { \ |
89 | return show_cpumap(0, topology_##name(dev->id), buf); \ | 88 | return show_cpumap(0, topology_##name(dev->id), buf); \ |
90 | } | 89 | } |
91 | 90 | ||
92 | #define define_siblings_show_list(name) \ | 91 | #define define_siblings_show_list(name) \ |
93 | static ssize_t show_##name##_list(struct sys_device *dev, \ | 92 | static ssize_t show_##name##_list(struct device *dev, \ |
94 | struct sysdev_attribute *attr, \ | 93 | struct device_attribute *attr, \ |
95 | char *buf) \ | 94 | char *buf) \ |
96 | { \ | 95 | { \ |
97 | return show_cpumap(1, topology_##name(dev->id), buf); \ | 96 | return show_cpumap(1, topology_##name(dev->id), buf); \ |
@@ -124,16 +123,16 @@ define_one_ro_named(book_siblings_list, show_book_cpumask_list); | |||
124 | #endif | 123 | #endif |
125 | 124 | ||
126 | static struct attribute *default_attrs[] = { | 125 | static struct attribute *default_attrs[] = { |
127 | &attr_physical_package_id.attr, | 126 | &dev_attr_physical_package_id.attr, |
128 | &attr_core_id.attr, | 127 | &dev_attr_core_id.attr, |
129 | &attr_thread_siblings.attr, | 128 | &dev_attr_thread_siblings.attr, |
130 | &attr_thread_siblings_list.attr, | 129 | &dev_attr_thread_siblings_list.attr, |
131 | &attr_core_siblings.attr, | 130 | &dev_attr_core_siblings.attr, |
132 | &attr_core_siblings_list.attr, | 131 | &dev_attr_core_siblings_list.attr, |
133 | #ifdef CONFIG_SCHED_BOOK | 132 | #ifdef CONFIG_SCHED_BOOK |
134 | &attr_book_id.attr, | 133 | &dev_attr_book_id.attr, |
135 | &attr_book_siblings.attr, | 134 | &dev_attr_book_siblings.attr, |
136 | &attr_book_siblings_list.attr, | 135 | &dev_attr_book_siblings_list.attr, |
137 | #endif | 136 | #endif |
138 | NULL | 137 | NULL |
139 | }; | 138 | }; |
@@ -146,16 +145,16 @@ static struct attribute_group topology_attr_group = { | |||
146 | /* Add/Remove cpu_topology interface for CPU device */ | 145 | /* Add/Remove cpu_topology interface for CPU device */ |
147 | static int __cpuinit topology_add_dev(unsigned int cpu) | 146 | static int __cpuinit topology_add_dev(unsigned int cpu) |
148 | { | 147 | { |
149 | struct sys_device *sys_dev = get_cpu_sysdev(cpu); | 148 | struct device *dev = get_cpu_device(cpu); |
150 | 149 | ||
151 | return sysfs_create_group(&sys_dev->kobj, &topology_attr_group); | 150 | return sysfs_create_group(&dev->kobj, &topology_attr_group); |
152 | } | 151 | } |
153 | 152 | ||
154 | static void __cpuinit topology_remove_dev(unsigned int cpu) | 153 | static void __cpuinit topology_remove_dev(unsigned int cpu) |
155 | { | 154 | { |
156 | struct sys_device *sys_dev = get_cpu_sysdev(cpu); | 155 | struct device *dev = get_cpu_device(cpu); |
157 | 156 | ||
158 | sysfs_remove_group(&sys_dev->kobj, &topology_attr_group); | 157 | sysfs_remove_group(&dev->kobj, &topology_attr_group); |
159 | } | 158 | } |
160 | 159 | ||
161 | static int __cpuinit topology_cpu_callback(struct notifier_block *nfb, | 160 | static int __cpuinit topology_cpu_callback(struct notifier_block *nfb, |
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c index 1622772f802d..07f14d10ea49 100644 --- a/drivers/bluetooth/ath3k.c +++ b/drivers/bluetooth/ath3k.c | |||
@@ -430,19 +430,7 @@ static struct usb_driver ath3k_driver = { | |||
430 | .id_table = ath3k_table, | 430 | .id_table = ath3k_table, |
431 | }; | 431 | }; |
432 | 432 | ||
433 | static int __init ath3k_init(void) | 433 | module_usb_driver(ath3k_driver); |
434 | { | ||
435 | BT_INFO("Atheros AR30xx firmware driver ver %s", VERSION); | ||
436 | return usb_register(&ath3k_driver); | ||
437 | } | ||
438 | |||
439 | static void __exit ath3k_exit(void) | ||
440 | { | ||
441 | usb_deregister(&ath3k_driver); | ||
442 | } | ||
443 | |||
444 | module_init(ath3k_init); | ||
445 | module_exit(ath3k_exit); | ||
446 | 434 | ||
447 | MODULE_AUTHOR("Atheros Communications"); | 435 | MODULE_AUTHOR("Atheros Communications"); |
448 | MODULE_DESCRIPTION("Atheros AR30xx firmware driver"); | 436 | MODULE_DESCRIPTION("Atheros AR30xx firmware driver"); |
diff --git a/drivers/bluetooth/bcm203x.c b/drivers/bluetooth/bcm203x.c index 54952ab800b8..1e742a50e2cd 100644 --- a/drivers/bluetooth/bcm203x.c +++ b/drivers/bluetooth/bcm203x.c | |||
@@ -281,26 +281,7 @@ static struct usb_driver bcm203x_driver = { | |||
281 | .id_table = bcm203x_table, | 281 | .id_table = bcm203x_table, |
282 | }; | 282 | }; |
283 | 283 | ||
284 | static int __init bcm203x_init(void) | 284 | module_usb_driver(bcm203x_driver); |
285 | { | ||
286 | int err; | ||
287 | |||
288 | BT_INFO("Broadcom Blutonium firmware driver ver %s", VERSION); | ||
289 | |||
290 | err = usb_register(&bcm203x_driver); | ||
291 | if (err < 0) | ||
292 | BT_ERR("Failed to register USB driver"); | ||
293 | |||
294 | return err; | ||
295 | } | ||
296 | |||
297 | static void __exit bcm203x_exit(void) | ||
298 | { | ||
299 | usb_deregister(&bcm203x_driver); | ||
300 | } | ||
301 | |||
302 | module_init(bcm203x_init); | ||
303 | module_exit(bcm203x_exit); | ||
304 | 285 | ||
305 | MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>"); | 286 | MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>"); |
306 | MODULE_DESCRIPTION("Broadcom Blutonium firmware driver ver " VERSION); | 287 | MODULE_DESCRIPTION("Broadcom Blutonium firmware driver ver " VERSION); |
diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c index a936763b8c3d..a323baee51b0 100644 --- a/drivers/bluetooth/bfusb.c +++ b/drivers/bluetooth/bfusb.c | |||
@@ -762,26 +762,7 @@ static struct usb_driver bfusb_driver = { | |||
762 | .id_table = bfusb_table, | 762 | .id_table = bfusb_table, |
763 | }; | 763 | }; |
764 | 764 | ||
765 | static int __init bfusb_init(void) | 765 | module_usb_driver(bfusb_driver); |
766 | { | ||
767 | int err; | ||
768 | |||
769 | BT_INFO("BlueFRITZ! USB driver ver %s", VERSION); | ||
770 | |||
771 | err = usb_register(&bfusb_driver); | ||
772 | if (err < 0) | ||
773 | BT_ERR("Failed to register BlueFRITZ! USB driver"); | ||
774 | |||
775 | return err; | ||
776 | } | ||
777 | |||
778 | static void __exit bfusb_exit(void) | ||
779 | { | ||
780 | usb_deregister(&bfusb_driver); | ||
781 | } | ||
782 | |||
783 | module_init(bfusb_init); | ||
784 | module_exit(bfusb_exit); | ||
785 | 766 | ||
786 | MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>"); | 767 | MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>"); |
787 | MODULE_DESCRIPTION("BlueFRITZ! USB driver ver " VERSION); | 768 | MODULE_DESCRIPTION("BlueFRITZ! USB driver ver " VERSION); |
diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c index 751b338d904a..62831603de5e 100644 --- a/drivers/bluetooth/bpa10x.c +++ b/drivers/bluetooth/bpa10x.c | |||
@@ -521,20 +521,7 @@ static struct usb_driver bpa10x_driver = { | |||
521 | .id_table = bpa10x_table, | 521 | .id_table = bpa10x_table, |
522 | }; | 522 | }; |
523 | 523 | ||
524 | static int __init bpa10x_init(void) | 524 | module_usb_driver(bpa10x_driver); |
525 | { | ||
526 | BT_INFO("Digianswer Bluetooth USB driver ver %s", VERSION); | ||
527 | |||
528 | return usb_register(&bpa10x_driver); | ||
529 | } | ||
530 | |||
531 | static void __exit bpa10x_exit(void) | ||
532 | { | ||
533 | usb_deregister(&bpa10x_driver); | ||
534 | } | ||
535 | |||
536 | module_init(bpa10x_init); | ||
537 | module_exit(bpa10x_exit); | ||
538 | 525 | ||
539 | MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>"); | 526 | MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>"); |
540 | MODULE_DESCRIPTION("Digianswer Bluetooth USB driver ver " VERSION); | 527 | MODULE_DESCRIPTION("Digianswer Bluetooth USB driver ver " VERSION); |
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index fbfba802a3d7..55ac349695c4 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c | |||
@@ -1226,20 +1226,7 @@ static struct usb_driver btusb_driver = { | |||
1226 | .supports_autosuspend = 1, | 1226 | .supports_autosuspend = 1, |
1227 | }; | 1227 | }; |
1228 | 1228 | ||
1229 | static int __init btusb_init(void) | 1229 | module_usb_driver(btusb_driver); |
1230 | { | ||
1231 | BT_INFO("Generic Bluetooth USB driver ver %s", VERSION); | ||
1232 | |||
1233 | return usb_register(&btusb_driver); | ||
1234 | } | ||
1235 | |||
1236 | static void __exit btusb_exit(void) | ||
1237 | { | ||
1238 | usb_deregister(&btusb_driver); | ||
1239 | } | ||
1240 | |||
1241 | module_init(btusb_init); | ||
1242 | module_exit(btusb_exit); | ||
1243 | 1230 | ||
1244 | module_param(ignore_dga, bool, 0644); | 1231 | module_param(ignore_dga, bool, 0644); |
1245 | MODULE_PARM_DESC(ignore_dga, "Ignore devices with id 08fd:0001"); | 1232 | MODULE_PARM_DESC(ignore_dga, "Ignore devices with id 08fd:0001"); |
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 987a165ede26..8c2df3499da7 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -679,7 +679,7 @@ static struct kobj_type ktype_cpufreq = { | |||
679 | */ | 679 | */ |
680 | static int cpufreq_add_dev_policy(unsigned int cpu, | 680 | static int cpufreq_add_dev_policy(unsigned int cpu, |
681 | struct cpufreq_policy *policy, | 681 | struct cpufreq_policy *policy, |
682 | struct sys_device *sys_dev) | 682 | struct device *dev) |
683 | { | 683 | { |
684 | int ret = 0; | 684 | int ret = 0; |
685 | #ifdef CONFIG_SMP | 685 | #ifdef CONFIG_SMP |
@@ -728,7 +728,7 @@ static int cpufreq_add_dev_policy(unsigned int cpu, | |||
728 | spin_unlock_irqrestore(&cpufreq_driver_lock, flags); | 728 | spin_unlock_irqrestore(&cpufreq_driver_lock, flags); |
729 | 729 | ||
730 | pr_debug("CPU already managed, adding link\n"); | 730 | pr_debug("CPU already managed, adding link\n"); |
731 | ret = sysfs_create_link(&sys_dev->kobj, | 731 | ret = sysfs_create_link(&dev->kobj, |
732 | &managed_policy->kobj, | 732 | &managed_policy->kobj, |
733 | "cpufreq"); | 733 | "cpufreq"); |
734 | if (ret) | 734 | if (ret) |
@@ -761,7 +761,7 @@ static int cpufreq_add_dev_symlink(unsigned int cpu, | |||
761 | 761 | ||
762 | for_each_cpu(j, policy->cpus) { | 762 | for_each_cpu(j, policy->cpus) { |
763 | struct cpufreq_policy *managed_policy; | 763 | struct cpufreq_policy *managed_policy; |
764 | struct sys_device *cpu_sys_dev; | 764 | struct device *cpu_dev; |
765 | 765 | ||
766 | if (j == cpu) | 766 | if (j == cpu) |
767 | continue; | 767 | continue; |
@@ -770,8 +770,8 @@ static int cpufreq_add_dev_symlink(unsigned int cpu, | |||
770 | 770 | ||
771 | pr_debug("CPU %u already managed, adding link\n", j); | 771 | pr_debug("CPU %u already managed, adding link\n", j); |
772 | managed_policy = cpufreq_cpu_get(cpu); | 772 | managed_policy = cpufreq_cpu_get(cpu); |
773 | cpu_sys_dev = get_cpu_sysdev(j); | 773 | cpu_dev = get_cpu_device(j); |
774 | ret = sysfs_create_link(&cpu_sys_dev->kobj, &policy->kobj, | 774 | ret = sysfs_create_link(&cpu_dev->kobj, &policy->kobj, |
775 | "cpufreq"); | 775 | "cpufreq"); |
776 | if (ret) { | 776 | if (ret) { |
777 | cpufreq_cpu_put(managed_policy); | 777 | cpufreq_cpu_put(managed_policy); |
@@ -783,7 +783,7 @@ static int cpufreq_add_dev_symlink(unsigned int cpu, | |||
783 | 783 | ||
784 | static int cpufreq_add_dev_interface(unsigned int cpu, | 784 | static int cpufreq_add_dev_interface(unsigned int cpu, |
785 | struct cpufreq_policy *policy, | 785 | struct cpufreq_policy *policy, |
786 | struct sys_device *sys_dev) | 786 | struct device *dev) |
787 | { | 787 | { |
788 | struct cpufreq_policy new_policy; | 788 | struct cpufreq_policy new_policy; |
789 | struct freq_attr **drv_attr; | 789 | struct freq_attr **drv_attr; |
@@ -793,7 +793,7 @@ static int cpufreq_add_dev_interface(unsigned int cpu, | |||
793 | 793 | ||
794 | /* prepare interface data */ | 794 | /* prepare interface data */ |
795 | ret = kobject_init_and_add(&policy->kobj, &ktype_cpufreq, | 795 | ret = kobject_init_and_add(&policy->kobj, &ktype_cpufreq, |
796 | &sys_dev->kobj, "cpufreq"); | 796 | &dev->kobj, "cpufreq"); |
797 | if (ret) | 797 | if (ret) |
798 | return ret; | 798 | return ret; |
799 | 799 | ||
@@ -866,9 +866,9 @@ err_out_kobj_put: | |||
866 | * with with cpu hotplugging and all hell will break loose. Tried to clean this | 866 | * with with cpu hotplugging and all hell will break loose. Tried to clean this |
867 | * mess up, but more thorough testing is needed. - Mathieu | 867 | * mess up, but more thorough testing is needed. - Mathieu |
868 | */ | 868 | */ |
869 | static int cpufreq_add_dev(struct sys_device *sys_dev) | 869 | static int cpufreq_add_dev(struct device *dev, struct subsys_interface *sif) |
870 | { | 870 | { |
871 | unsigned int cpu = sys_dev->id; | 871 | unsigned int cpu = dev->id; |
872 | int ret = 0, found = 0; | 872 | int ret = 0, found = 0; |
873 | struct cpufreq_policy *policy; | 873 | struct cpufreq_policy *policy; |
874 | unsigned long flags; | 874 | unsigned long flags; |
@@ -947,7 +947,7 @@ static int cpufreq_add_dev(struct sys_device *sys_dev) | |||
947 | blocking_notifier_call_chain(&cpufreq_policy_notifier_list, | 947 | blocking_notifier_call_chain(&cpufreq_policy_notifier_list, |
948 | CPUFREQ_START, policy); | 948 | CPUFREQ_START, policy); |
949 | 949 | ||
950 | ret = cpufreq_add_dev_policy(cpu, policy, sys_dev); | 950 | ret = cpufreq_add_dev_policy(cpu, policy, dev); |
951 | if (ret) { | 951 | if (ret) { |
952 | if (ret > 0) | 952 | if (ret > 0) |
953 | /* This is a managed cpu, symlink created, | 953 | /* This is a managed cpu, symlink created, |
@@ -956,7 +956,7 @@ static int cpufreq_add_dev(struct sys_device *sys_dev) | |||
956 | goto err_unlock_policy; | 956 | goto err_unlock_policy; |
957 | } | 957 | } |
958 | 958 | ||
959 | ret = cpufreq_add_dev_interface(cpu, policy, sys_dev); | 959 | ret = cpufreq_add_dev_interface(cpu, policy, dev); |
960 | if (ret) | 960 | if (ret) |
961 | goto err_out_unregister; | 961 | goto err_out_unregister; |
962 | 962 | ||
@@ -999,15 +999,15 @@ module_out: | |||
999 | * Caller should already have policy_rwsem in write mode for this CPU. | 999 | * Caller should already have policy_rwsem in write mode for this CPU. |
1000 | * This routine frees the rwsem before returning. | 1000 | * This routine frees the rwsem before returning. |
1001 | */ | 1001 | */ |
1002 | static int __cpufreq_remove_dev(struct sys_device *sys_dev) | 1002 | static int __cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif) |
1003 | { | 1003 | { |
1004 | unsigned int cpu = sys_dev->id; | 1004 | unsigned int cpu = dev->id; |
1005 | unsigned long flags; | 1005 | unsigned long flags; |
1006 | struct cpufreq_policy *data; | 1006 | struct cpufreq_policy *data; |
1007 | struct kobject *kobj; | 1007 | struct kobject *kobj; |
1008 | struct completion *cmp; | 1008 | struct completion *cmp; |
1009 | #ifdef CONFIG_SMP | 1009 | #ifdef CONFIG_SMP |
1010 | struct sys_device *cpu_sys_dev; | 1010 | struct device *cpu_dev; |
1011 | unsigned int j; | 1011 | unsigned int j; |
1012 | #endif | 1012 | #endif |
1013 | 1013 | ||
@@ -1032,7 +1032,7 @@ static int __cpufreq_remove_dev(struct sys_device *sys_dev) | |||
1032 | pr_debug("removing link\n"); | 1032 | pr_debug("removing link\n"); |
1033 | cpumask_clear_cpu(cpu, data->cpus); | 1033 | cpumask_clear_cpu(cpu, data->cpus); |
1034 | spin_unlock_irqrestore(&cpufreq_driver_lock, flags); | 1034 | spin_unlock_irqrestore(&cpufreq_driver_lock, flags); |
1035 | kobj = &sys_dev->kobj; | 1035 | kobj = &dev->kobj; |
1036 | cpufreq_cpu_put(data); | 1036 | cpufreq_cpu_put(data); |
1037 | unlock_policy_rwsem_write(cpu); | 1037 | unlock_policy_rwsem_write(cpu); |
1038 | sysfs_remove_link(kobj, "cpufreq"); | 1038 | sysfs_remove_link(kobj, "cpufreq"); |
@@ -1071,8 +1071,8 @@ static int __cpufreq_remove_dev(struct sys_device *sys_dev) | |||
1071 | strncpy(per_cpu(cpufreq_cpu_governor, j), | 1071 | strncpy(per_cpu(cpufreq_cpu_governor, j), |
1072 | data->governor->name, CPUFREQ_NAME_LEN); | 1072 | data->governor->name, CPUFREQ_NAME_LEN); |
1073 | #endif | 1073 | #endif |
1074 | cpu_sys_dev = get_cpu_sysdev(j); | 1074 | cpu_dev = get_cpu_device(j); |
1075 | kobj = &cpu_sys_dev->kobj; | 1075 | kobj = &cpu_dev->kobj; |
1076 | unlock_policy_rwsem_write(cpu); | 1076 | unlock_policy_rwsem_write(cpu); |
1077 | sysfs_remove_link(kobj, "cpufreq"); | 1077 | sysfs_remove_link(kobj, "cpufreq"); |
1078 | lock_policy_rwsem_write(cpu); | 1078 | lock_policy_rwsem_write(cpu); |
@@ -1112,11 +1112,11 @@ static int __cpufreq_remove_dev(struct sys_device *sys_dev) | |||
1112 | if (unlikely(cpumask_weight(data->cpus) > 1)) { | 1112 | if (unlikely(cpumask_weight(data->cpus) > 1)) { |
1113 | /* first sibling now owns the new sysfs dir */ | 1113 | /* first sibling now owns the new sysfs dir */ |
1114 | cpumask_clear_cpu(cpu, data->cpus); | 1114 | cpumask_clear_cpu(cpu, data->cpus); |
1115 | cpufreq_add_dev(get_cpu_sysdev(cpumask_first(data->cpus))); | 1115 | cpufreq_add_dev(get_cpu_device(cpumask_first(data->cpus)), NULL); |
1116 | 1116 | ||
1117 | /* finally remove our own symlink */ | 1117 | /* finally remove our own symlink */ |
1118 | lock_policy_rwsem_write(cpu); | 1118 | lock_policy_rwsem_write(cpu); |
1119 | __cpufreq_remove_dev(sys_dev); | 1119 | __cpufreq_remove_dev(dev, sif); |
1120 | } | 1120 | } |
1121 | #endif | 1121 | #endif |
1122 | 1122 | ||
@@ -1128,9 +1128,9 @@ static int __cpufreq_remove_dev(struct sys_device *sys_dev) | |||
1128 | } | 1128 | } |
1129 | 1129 | ||
1130 | 1130 | ||
1131 | static int cpufreq_remove_dev(struct sys_device *sys_dev) | 1131 | static int cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif) |
1132 | { | 1132 | { |
1133 | unsigned int cpu = sys_dev->id; | 1133 | unsigned int cpu = dev->id; |
1134 | int retval; | 1134 | int retval; |
1135 | 1135 | ||
1136 | if (cpu_is_offline(cpu)) | 1136 | if (cpu_is_offline(cpu)) |
@@ -1139,7 +1139,7 @@ static int cpufreq_remove_dev(struct sys_device *sys_dev) | |||
1139 | if (unlikely(lock_policy_rwsem_write(cpu))) | 1139 | if (unlikely(lock_policy_rwsem_write(cpu))) |
1140 | BUG(); | 1140 | BUG(); |
1141 | 1141 | ||
1142 | retval = __cpufreq_remove_dev(sys_dev); | 1142 | retval = __cpufreq_remove_dev(dev, sif); |
1143 | return retval; | 1143 | return retval; |
1144 | } | 1144 | } |
1145 | 1145 | ||
@@ -1271,9 +1271,11 @@ out: | |||
1271 | } | 1271 | } |
1272 | EXPORT_SYMBOL(cpufreq_get); | 1272 | EXPORT_SYMBOL(cpufreq_get); |
1273 | 1273 | ||
1274 | static struct sysdev_driver cpufreq_sysdev_driver = { | 1274 | static struct subsys_interface cpufreq_interface = { |
1275 | .add = cpufreq_add_dev, | 1275 | .name = "cpufreq", |
1276 | .remove = cpufreq_remove_dev, | 1276 | .subsys = &cpu_subsys, |
1277 | .add_dev = cpufreq_add_dev, | ||
1278 | .remove_dev = cpufreq_remove_dev, | ||
1277 | }; | 1279 | }; |
1278 | 1280 | ||
1279 | 1281 | ||
@@ -1765,25 +1767,25 @@ static int __cpuinit cpufreq_cpu_callback(struct notifier_block *nfb, | |||
1765 | unsigned long action, void *hcpu) | 1767 | unsigned long action, void *hcpu) |
1766 | { | 1768 | { |
1767 | unsigned int cpu = (unsigned long)hcpu; | 1769 | unsigned int cpu = (unsigned long)hcpu; |
1768 | struct sys_device *sys_dev; | 1770 | struct device *dev; |
1769 | 1771 | ||
1770 | sys_dev = get_cpu_sysdev(cpu); | 1772 | dev = get_cpu_device(cpu); |
1771 | if (sys_dev) { | 1773 | if (dev) { |
1772 | switch (action) { | 1774 | switch (action) { |
1773 | case CPU_ONLINE: | 1775 | case CPU_ONLINE: |
1774 | case CPU_ONLINE_FROZEN: | 1776 | case CPU_ONLINE_FROZEN: |
1775 | cpufreq_add_dev(sys_dev); | 1777 | cpufreq_add_dev(dev, NULL); |
1776 | break; | 1778 | break; |
1777 | case CPU_DOWN_PREPARE: | 1779 | case CPU_DOWN_PREPARE: |
1778 | case CPU_DOWN_PREPARE_FROZEN: | 1780 | case CPU_DOWN_PREPARE_FROZEN: |
1779 | if (unlikely(lock_policy_rwsem_write(cpu))) | 1781 | if (unlikely(lock_policy_rwsem_write(cpu))) |
1780 | BUG(); | 1782 | BUG(); |
1781 | 1783 | ||
1782 | __cpufreq_remove_dev(sys_dev); | 1784 | __cpufreq_remove_dev(dev, NULL); |
1783 | break; | 1785 | break; |
1784 | case CPU_DOWN_FAILED: | 1786 | case CPU_DOWN_FAILED: |
1785 | case CPU_DOWN_FAILED_FROZEN: | 1787 | case CPU_DOWN_FAILED_FROZEN: |
1786 | cpufreq_add_dev(sys_dev); | 1788 | cpufreq_add_dev(dev, NULL); |
1787 | break; | 1789 | break; |
1788 | } | 1790 | } |
1789 | } | 1791 | } |
@@ -1830,8 +1832,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data) | |||
1830 | cpufreq_driver = driver_data; | 1832 | cpufreq_driver = driver_data; |
1831 | spin_unlock_irqrestore(&cpufreq_driver_lock, flags); | 1833 | spin_unlock_irqrestore(&cpufreq_driver_lock, flags); |
1832 | 1834 | ||
1833 | ret = sysdev_driver_register(&cpu_sysdev_class, | 1835 | ret = subsys_interface_register(&cpufreq_interface); |
1834 | &cpufreq_sysdev_driver); | ||
1835 | if (ret) | 1836 | if (ret) |
1836 | goto err_null_driver; | 1837 | goto err_null_driver; |
1837 | 1838 | ||
@@ -1850,7 +1851,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data) | |||
1850 | if (ret) { | 1851 | if (ret) { |
1851 | pr_debug("no CPU initialized for driver %s\n", | 1852 | pr_debug("no CPU initialized for driver %s\n", |
1852 | driver_data->name); | 1853 | driver_data->name); |
1853 | goto err_sysdev_unreg; | 1854 | goto err_if_unreg; |
1854 | } | 1855 | } |
1855 | } | 1856 | } |
1856 | 1857 | ||
@@ -1858,9 +1859,8 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data) | |||
1858 | pr_debug("driver %s up and running\n", driver_data->name); | 1859 | pr_debug("driver %s up and running\n", driver_data->name); |
1859 | 1860 | ||
1860 | return 0; | 1861 | return 0; |
1861 | err_sysdev_unreg: | 1862 | err_if_unreg: |
1862 | sysdev_driver_unregister(&cpu_sysdev_class, | 1863 | subsys_interface_unregister(&cpufreq_interface); |
1863 | &cpufreq_sysdev_driver); | ||
1864 | err_null_driver: | 1864 | err_null_driver: |
1865 | spin_lock_irqsave(&cpufreq_driver_lock, flags); | 1865 | spin_lock_irqsave(&cpufreq_driver_lock, flags); |
1866 | cpufreq_driver = NULL; | 1866 | cpufreq_driver = NULL; |
@@ -1887,7 +1887,7 @@ int cpufreq_unregister_driver(struct cpufreq_driver *driver) | |||
1887 | 1887 | ||
1888 | pr_debug("unregistering driver %s\n", driver->name); | 1888 | pr_debug("unregistering driver %s\n", driver->name); |
1889 | 1889 | ||
1890 | sysdev_driver_unregister(&cpu_sysdev_class, &cpufreq_sysdev_driver); | 1890 | subsys_interface_unregister(&cpufreq_interface); |
1891 | unregister_hotcpu_notifier(&cpufreq_cpu_notifier); | 1891 | unregister_hotcpu_notifier(&cpufreq_cpu_notifier); |
1892 | 1892 | ||
1893 | spin_lock_irqsave(&cpufreq_driver_lock, flags); | 1893 | spin_lock_irqsave(&cpufreq_driver_lock, flags); |
@@ -1907,8 +1907,7 @@ static int __init cpufreq_core_init(void) | |||
1907 | init_rwsem(&per_cpu(cpu_policy_rwsem, cpu)); | 1907 | init_rwsem(&per_cpu(cpu_policy_rwsem, cpu)); |
1908 | } | 1908 | } |
1909 | 1909 | ||
1910 | cpufreq_global_kobject = kobject_create_and_add("cpufreq", | 1910 | cpufreq_global_kobject = kobject_create_and_add("cpufreq", &cpu_subsys.dev_root->kobj); |
1911 | &cpu_sysdev_class.kset.kobj); | ||
1912 | BUG_ON(!cpufreq_global_kobject); | 1911 | BUG_ON(!cpufreq_global_kobject); |
1913 | register_syscore_ops(&cpufreq_syscore_ops); | 1912 | register_syscore_ops(&cpufreq_syscore_ops); |
1914 | 1913 | ||
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c index 2a508edd768b..b40ee1403be9 100644 --- a/drivers/cpufreq/cpufreq_stats.c +++ b/drivers/cpufreq/cpufreq_stats.c | |||
@@ -11,7 +11,6 @@ | |||
11 | 11 | ||
12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
14 | #include <linux/sysdev.h> | ||
15 | #include <linux/cpu.h> | 14 | #include <linux/cpu.h> |
16 | #include <linux/sysfs.h> | 15 | #include <linux/sysfs.h> |
17 | #include <linux/cpufreq.h> | 16 | #include <linux/cpufreq.h> |
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index 06ce2680d00d..59f4261c753a 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c | |||
@@ -291,10 +291,10 @@ EXPORT_SYMBOL_GPL(cpuidle_disable_device); | |||
291 | static int __cpuidle_register_device(struct cpuidle_device *dev) | 291 | static int __cpuidle_register_device(struct cpuidle_device *dev) |
292 | { | 292 | { |
293 | int ret; | 293 | int ret; |
294 | struct sys_device *sys_dev = get_cpu_sysdev((unsigned long)dev->cpu); | 294 | struct device *cpu_dev = get_cpu_device((unsigned long)dev->cpu); |
295 | struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver(); | 295 | struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver(); |
296 | 296 | ||
297 | if (!sys_dev) | 297 | if (!dev) |
298 | return -EINVAL; | 298 | return -EINVAL; |
299 | if (!try_module_get(cpuidle_driver->owner)) | 299 | if (!try_module_get(cpuidle_driver->owner)) |
300 | return -EINVAL; | 300 | return -EINVAL; |
@@ -303,7 +303,7 @@ static int __cpuidle_register_device(struct cpuidle_device *dev) | |||
303 | 303 | ||
304 | per_cpu(cpuidle_devices, dev->cpu) = dev; | 304 | per_cpu(cpuidle_devices, dev->cpu) = dev; |
305 | list_add(&dev->device_list, &cpuidle_detected_devices); | 305 | list_add(&dev->device_list, &cpuidle_detected_devices); |
306 | if ((ret = cpuidle_add_sysfs(sys_dev))) { | 306 | if ((ret = cpuidle_add_sysfs(cpu_dev))) { |
307 | module_put(cpuidle_driver->owner); | 307 | module_put(cpuidle_driver->owner); |
308 | return ret; | 308 | return ret; |
309 | } | 309 | } |
@@ -344,7 +344,7 @@ EXPORT_SYMBOL_GPL(cpuidle_register_device); | |||
344 | */ | 344 | */ |
345 | void cpuidle_unregister_device(struct cpuidle_device *dev) | 345 | void cpuidle_unregister_device(struct cpuidle_device *dev) |
346 | { | 346 | { |
347 | struct sys_device *sys_dev = get_cpu_sysdev((unsigned long)dev->cpu); | 347 | struct device *cpu_dev = get_cpu_device((unsigned long)dev->cpu); |
348 | struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver(); | 348 | struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver(); |
349 | 349 | ||
350 | if (dev->registered == 0) | 350 | if (dev->registered == 0) |
@@ -354,7 +354,7 @@ void cpuidle_unregister_device(struct cpuidle_device *dev) | |||
354 | 354 | ||
355 | cpuidle_disable_device(dev); | 355 | cpuidle_disable_device(dev); |
356 | 356 | ||
357 | cpuidle_remove_sysfs(sys_dev); | 357 | cpuidle_remove_sysfs(cpu_dev); |
358 | list_del(&dev->device_list); | 358 | list_del(&dev->device_list); |
359 | wait_for_completion(&dev->kobj_unregister); | 359 | wait_for_completion(&dev->kobj_unregister); |
360 | per_cpu(cpuidle_devices, dev->cpu) = NULL; | 360 | per_cpu(cpuidle_devices, dev->cpu) = NULL; |
@@ -411,7 +411,7 @@ static int __init cpuidle_init(void) | |||
411 | if (cpuidle_disabled()) | 411 | if (cpuidle_disabled()) |
412 | return -ENODEV; | 412 | return -ENODEV; |
413 | 413 | ||
414 | ret = cpuidle_add_class_sysfs(&cpu_sysdev_class); | 414 | ret = cpuidle_add_interface(cpu_subsys.dev_root); |
415 | if (ret) | 415 | if (ret) |
416 | return ret; | 416 | return ret; |
417 | 417 | ||
diff --git a/drivers/cpuidle/cpuidle.h b/drivers/cpuidle/cpuidle.h index 38c3fd8b9d76..7db186685c27 100644 --- a/drivers/cpuidle/cpuidle.h +++ b/drivers/cpuidle/cpuidle.h | |||
@@ -5,7 +5,7 @@ | |||
5 | #ifndef __DRIVER_CPUIDLE_H | 5 | #ifndef __DRIVER_CPUIDLE_H |
6 | #define __DRIVER_CPUIDLE_H | 6 | #define __DRIVER_CPUIDLE_H |
7 | 7 | ||
8 | #include <linux/sysdev.h> | 8 | #include <linux/device.h> |
9 | 9 | ||
10 | /* For internal use only */ | 10 | /* For internal use only */ |
11 | extern struct cpuidle_governor *cpuidle_curr_governor; | 11 | extern struct cpuidle_governor *cpuidle_curr_governor; |
@@ -23,11 +23,11 @@ extern void cpuidle_uninstall_idle_handler(void); | |||
23 | extern int cpuidle_switch_governor(struct cpuidle_governor *gov); | 23 | extern int cpuidle_switch_governor(struct cpuidle_governor *gov); |
24 | 24 | ||
25 | /* sysfs */ | 25 | /* sysfs */ |
26 | extern int cpuidle_add_class_sysfs(struct sysdev_class *cls); | 26 | extern int cpuidle_add_interface(struct device *dev); |
27 | extern void cpuidle_remove_class_sysfs(struct sysdev_class *cls); | 27 | extern void cpuidle_remove_interface(struct device *dev); |
28 | extern int cpuidle_add_state_sysfs(struct cpuidle_device *device); | 28 | extern int cpuidle_add_state_sysfs(struct cpuidle_device *device); |
29 | extern void cpuidle_remove_state_sysfs(struct cpuidle_device *device); | 29 | extern void cpuidle_remove_state_sysfs(struct cpuidle_device *device); |
30 | extern int cpuidle_add_sysfs(struct sys_device *sysdev); | 30 | extern int cpuidle_add_sysfs(struct device *dev); |
31 | extern void cpuidle_remove_sysfs(struct sys_device *sysdev); | 31 | extern void cpuidle_remove_sysfs(struct device *dev); |
32 | 32 | ||
33 | #endif /* __DRIVER_CPUIDLE_H */ | 33 | #endif /* __DRIVER_CPUIDLE_H */ |
diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c index 1e756e160dca..3fe41fe4851a 100644 --- a/drivers/cpuidle/sysfs.c +++ b/drivers/cpuidle/sysfs.c | |||
@@ -22,8 +22,8 @@ static int __init cpuidle_sysfs_setup(char *unused) | |||
22 | } | 22 | } |
23 | __setup("cpuidle_sysfs_switch", cpuidle_sysfs_setup); | 23 | __setup("cpuidle_sysfs_switch", cpuidle_sysfs_setup); |
24 | 24 | ||
25 | static ssize_t show_available_governors(struct sysdev_class *class, | 25 | static ssize_t show_available_governors(struct device *dev, |
26 | struct sysdev_class_attribute *attr, | 26 | struct device_attribute *attr, |
27 | char *buf) | 27 | char *buf) |
28 | { | 28 | { |
29 | ssize_t i = 0; | 29 | ssize_t i = 0; |
@@ -42,8 +42,8 @@ out: | |||
42 | return i; | 42 | return i; |
43 | } | 43 | } |
44 | 44 | ||
45 | static ssize_t show_current_driver(struct sysdev_class *class, | 45 | static ssize_t show_current_driver(struct device *dev, |
46 | struct sysdev_class_attribute *attr, | 46 | struct device_attribute *attr, |
47 | char *buf) | 47 | char *buf) |
48 | { | 48 | { |
49 | ssize_t ret; | 49 | ssize_t ret; |
@@ -59,8 +59,8 @@ static ssize_t show_current_driver(struct sysdev_class *class, | |||
59 | return ret; | 59 | return ret; |
60 | } | 60 | } |
61 | 61 | ||
62 | static ssize_t show_current_governor(struct sysdev_class *class, | 62 | static ssize_t show_current_governor(struct device *dev, |
63 | struct sysdev_class_attribute *attr, | 63 | struct device_attribute *attr, |
64 | char *buf) | 64 | char *buf) |
65 | { | 65 | { |
66 | ssize_t ret; | 66 | ssize_t ret; |
@@ -75,8 +75,8 @@ static ssize_t show_current_governor(struct sysdev_class *class, | |||
75 | return ret; | 75 | return ret; |
76 | } | 76 | } |
77 | 77 | ||
78 | static ssize_t store_current_governor(struct sysdev_class *class, | 78 | static ssize_t store_current_governor(struct device *dev, |
79 | struct sysdev_class_attribute *attr, | 79 | struct device_attribute *attr, |
80 | const char *buf, size_t count) | 80 | const char *buf, size_t count) |
81 | { | 81 | { |
82 | char gov_name[CPUIDLE_NAME_LEN]; | 82 | char gov_name[CPUIDLE_NAME_LEN]; |
@@ -109,50 +109,48 @@ static ssize_t store_current_governor(struct sysdev_class *class, | |||
109 | return count; | 109 | return count; |
110 | } | 110 | } |
111 | 111 | ||
112 | static SYSDEV_CLASS_ATTR(current_driver, 0444, show_current_driver, NULL); | 112 | static DEVICE_ATTR(current_driver, 0444, show_current_driver, NULL); |
113 | static SYSDEV_CLASS_ATTR(current_governor_ro, 0444, show_current_governor, | 113 | static DEVICE_ATTR(current_governor_ro, 0444, show_current_governor, NULL); |
114 | NULL); | ||
115 | 114 | ||
116 | static struct attribute *cpuclass_default_attrs[] = { | 115 | static struct attribute *cpuidle_default_attrs[] = { |
117 | &attr_current_driver.attr, | 116 | &dev_attr_current_driver.attr, |
118 | &attr_current_governor_ro.attr, | 117 | &dev_attr_current_governor_ro.attr, |
119 | NULL | 118 | NULL |
120 | }; | 119 | }; |
121 | 120 | ||
122 | static SYSDEV_CLASS_ATTR(available_governors, 0444, show_available_governors, | 121 | static DEVICE_ATTR(available_governors, 0444, show_available_governors, NULL); |
123 | NULL); | 122 | static DEVICE_ATTR(current_governor, 0644, show_current_governor, |
124 | static SYSDEV_CLASS_ATTR(current_governor, 0644, show_current_governor, | 123 | store_current_governor); |
125 | store_current_governor); | ||
126 | 124 | ||
127 | static struct attribute *cpuclass_switch_attrs[] = { | 125 | static struct attribute *cpuidle_switch_attrs[] = { |
128 | &attr_available_governors.attr, | 126 | &dev_attr_available_governors.attr, |
129 | &attr_current_driver.attr, | 127 | &dev_attr_current_driver.attr, |
130 | &attr_current_governor.attr, | 128 | &dev_attr_current_governor.attr, |
131 | NULL | 129 | NULL |
132 | }; | 130 | }; |
133 | 131 | ||
134 | static struct attribute_group cpuclass_attr_group = { | 132 | static struct attribute_group cpuidle_attr_group = { |
135 | .attrs = cpuclass_default_attrs, | 133 | .attrs = cpuidle_default_attrs, |
136 | .name = "cpuidle", | 134 | .name = "cpuidle", |
137 | }; | 135 | }; |
138 | 136 | ||
139 | /** | 137 | /** |
140 | * cpuidle_add_class_sysfs - add CPU global sysfs attributes | 138 | * cpuidle_add_interface - add CPU global sysfs attributes |
141 | */ | 139 | */ |
142 | int cpuidle_add_class_sysfs(struct sysdev_class *cls) | 140 | int cpuidle_add_interface(struct device *dev) |
143 | { | 141 | { |
144 | if (sysfs_switch) | 142 | if (sysfs_switch) |
145 | cpuclass_attr_group.attrs = cpuclass_switch_attrs; | 143 | cpuidle_attr_group.attrs = cpuidle_switch_attrs; |
146 | 144 | ||
147 | return sysfs_create_group(&cls->kset.kobj, &cpuclass_attr_group); | 145 | return sysfs_create_group(&dev->kobj, &cpuidle_attr_group); |
148 | } | 146 | } |
149 | 147 | ||
150 | /** | 148 | /** |
151 | * cpuidle_remove_class_sysfs - remove CPU global sysfs attributes | 149 | * cpuidle_remove_interface - remove CPU global sysfs attributes |
152 | */ | 150 | */ |
153 | void cpuidle_remove_class_sysfs(struct sysdev_class *cls) | 151 | void cpuidle_remove_interface(struct device *dev) |
154 | { | 152 | { |
155 | sysfs_remove_group(&cls->kset.kobj, &cpuclass_attr_group); | 153 | sysfs_remove_group(&dev->kobj, &cpuidle_attr_group); |
156 | } | 154 | } |
157 | 155 | ||
158 | struct cpuidle_attr { | 156 | struct cpuidle_attr { |
@@ -365,16 +363,16 @@ void cpuidle_remove_state_sysfs(struct cpuidle_device *device) | |||
365 | 363 | ||
366 | /** | 364 | /** |
367 | * cpuidle_add_sysfs - creates a sysfs instance for the target device | 365 | * cpuidle_add_sysfs - creates a sysfs instance for the target device |
368 | * @sysdev: the target device | 366 | * @dev: the target device |
369 | */ | 367 | */ |
370 | int cpuidle_add_sysfs(struct sys_device *sysdev) | 368 | int cpuidle_add_sysfs(struct device *cpu_dev) |
371 | { | 369 | { |
372 | int cpu = sysdev->id; | 370 | int cpu = cpu_dev->id; |
373 | struct cpuidle_device *dev; | 371 | struct cpuidle_device *dev; |
374 | int error; | 372 | int error; |
375 | 373 | ||
376 | dev = per_cpu(cpuidle_devices, cpu); | 374 | dev = per_cpu(cpuidle_devices, cpu); |
377 | error = kobject_init_and_add(&dev->kobj, &ktype_cpuidle, &sysdev->kobj, | 375 | error = kobject_init_and_add(&dev->kobj, &ktype_cpuidle, &cpu_dev->kobj, |
378 | "cpuidle"); | 376 | "cpuidle"); |
379 | if (!error) | 377 | if (!error) |
380 | kobject_uevent(&dev->kobj, KOBJ_ADD); | 378 | kobject_uevent(&dev->kobj, KOBJ_ADD); |
@@ -383,11 +381,11 @@ int cpuidle_add_sysfs(struct sys_device *sysdev) | |||
383 | 381 | ||
384 | /** | 382 | /** |
385 | * cpuidle_remove_sysfs - deletes a sysfs instance on the target device | 383 | * cpuidle_remove_sysfs - deletes a sysfs instance on the target device |
386 | * @sysdev: the target device | 384 | * @dev: the target device |
387 | */ | 385 | */ |
388 | void cpuidle_remove_sysfs(struct sys_device *sysdev) | 386 | void cpuidle_remove_sysfs(struct device *cpu_dev) |
389 | { | 387 | { |
390 | int cpu = sysdev->id; | 388 | int cpu = cpu_dev->id; |
391 | struct cpuidle_device *dev; | 389 | struct cpuidle_device *dev; |
392 | 390 | ||
393 | dev = per_cpu(cpuidle_devices, cpu); | 391 | dev = per_cpu(cpuidle_devices, cpu); |
diff --git a/drivers/edac/edac_core.h b/drivers/edac/edac_core.h index fe90cd4a7ebc..e48ab3108ad8 100644 --- a/drivers/edac/edac_core.h +++ b/drivers/edac/edac_core.h | |||
@@ -32,7 +32,6 @@ | |||
32 | #include <linux/completion.h> | 32 | #include <linux/completion.h> |
33 | #include <linux/kobject.h> | 33 | #include <linux/kobject.h> |
34 | #include <linux/platform_device.h> | 34 | #include <linux/platform_device.h> |
35 | #include <linux/sysdev.h> | ||
36 | #include <linux/workqueue.h> | 35 | #include <linux/workqueue.h> |
37 | #include <linux/edac.h> | 36 | #include <linux/edac.h> |
38 | 37 | ||
@@ -243,8 +242,8 @@ struct edac_device_ctl_info { | |||
243 | */ | 242 | */ |
244 | struct edac_dev_sysfs_attribute *sysfs_attributes; | 243 | struct edac_dev_sysfs_attribute *sysfs_attributes; |
245 | 244 | ||
246 | /* pointer to main 'edac' class in sysfs */ | 245 | /* pointer to main 'edac' subsys in sysfs */ |
247 | struct sysdev_class *edac_class; | 246 | struct bus_type *edac_subsys; |
248 | 247 | ||
249 | /* the internal state of this controller instance */ | 248 | /* the internal state of this controller instance */ |
250 | int op_state; | 249 | int op_state; |
@@ -342,7 +341,7 @@ struct edac_pci_ctl_info { | |||
342 | 341 | ||
343 | int pci_idx; | 342 | int pci_idx; |
344 | 343 | ||
345 | struct sysdev_class *edac_class; /* pointer to class */ | 344 | struct bus_type *edac_subsys; /* pointer to subsystem */ |
346 | 345 | ||
347 | /* the internal state of this controller instance */ | 346 | /* the internal state of this controller instance */ |
348 | int op_state; | 347 | int op_state; |
diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c index c3f67437afb6..4b154593343a 100644 --- a/drivers/edac/edac_device.c +++ b/drivers/edac/edac_device.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/jiffies.h> | 23 | #include <linux/jiffies.h> |
24 | #include <linux/spinlock.h> | 24 | #include <linux/spinlock.h> |
25 | #include <linux/list.h> | 25 | #include <linux/list.h> |
26 | #include <linux/sysdev.h> | ||
27 | #include <linux/ctype.h> | 26 | #include <linux/ctype.h> |
28 | #include <linux/workqueue.h> | 27 | #include <linux/workqueue.h> |
29 | #include <asm/uaccess.h> | 28 | #include <asm/uaccess.h> |
diff --git a/drivers/edac/edac_device_sysfs.c b/drivers/edac/edac_device_sysfs.c index 86649df00285..b4ea185ccebf 100644 --- a/drivers/edac/edac_device_sysfs.c +++ b/drivers/edac/edac_device_sysfs.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * file for managing the edac_device class of devices for EDAC | 2 | * file for managing the edac_device subsystem of devices for EDAC |
3 | * | 3 | * |
4 | * (C) 2007 SoftwareBitMaker | 4 | * (C) 2007 SoftwareBitMaker |
5 | * | 5 | * |
@@ -230,21 +230,21 @@ static struct kobj_type ktype_device_ctrl = { | |||
230 | */ | 230 | */ |
231 | int edac_device_register_sysfs_main_kobj(struct edac_device_ctl_info *edac_dev) | 231 | int edac_device_register_sysfs_main_kobj(struct edac_device_ctl_info *edac_dev) |
232 | { | 232 | { |
233 | struct sysdev_class *edac_class; | 233 | struct bus_type *edac_subsys; |
234 | int err; | 234 | int err; |
235 | 235 | ||
236 | debugf1("%s()\n", __func__); | 236 | debugf1("%s()\n", __func__); |
237 | 237 | ||
238 | /* get the /sys/devices/system/edac reference */ | 238 | /* get the /sys/devices/system/edac reference */ |
239 | edac_class = edac_get_sysfs_class(); | 239 | edac_subsys = edac_get_sysfs_subsys(); |
240 | if (edac_class == NULL) { | 240 | if (edac_subsys == NULL) { |
241 | debugf1("%s() no edac_class error\n", __func__); | 241 | debugf1("%s() no edac_subsys error\n", __func__); |
242 | err = -ENODEV; | 242 | err = -ENODEV; |
243 | goto err_out; | 243 | goto err_out; |
244 | } | 244 | } |
245 | 245 | ||
246 | /* Point to the 'edac_class' this instance 'reports' to */ | 246 | /* Point to the 'edac_subsys' this instance 'reports' to */ |
247 | edac_dev->edac_class = edac_class; | 247 | edac_dev->edac_subsys = edac_subsys; |
248 | 248 | ||
249 | /* Init the devices's kobject */ | 249 | /* Init the devices's kobject */ |
250 | memset(&edac_dev->kobj, 0, sizeof(struct kobject)); | 250 | memset(&edac_dev->kobj, 0, sizeof(struct kobject)); |
@@ -261,7 +261,7 @@ int edac_device_register_sysfs_main_kobj(struct edac_device_ctl_info *edac_dev) | |||
261 | 261 | ||
262 | /* register */ | 262 | /* register */ |
263 | err = kobject_init_and_add(&edac_dev->kobj, &ktype_device_ctrl, | 263 | err = kobject_init_and_add(&edac_dev->kobj, &ktype_device_ctrl, |
264 | &edac_class->kset.kobj, | 264 | &edac_subsys->dev_root->kobj, |
265 | "%s", edac_dev->name); | 265 | "%s", edac_dev->name); |
266 | if (err) { | 266 | if (err) { |
267 | debugf1("%s()Failed to register '.../edac/%s'\n", | 267 | debugf1("%s()Failed to register '.../edac/%s'\n", |
@@ -284,7 +284,7 @@ err_kobj_reg: | |||
284 | module_put(edac_dev->owner); | 284 | module_put(edac_dev->owner); |
285 | 285 | ||
286 | err_mod_get: | 286 | err_mod_get: |
287 | edac_put_sysfs_class(); | 287 | edac_put_sysfs_subsys(); |
288 | 288 | ||
289 | err_out: | 289 | err_out: |
290 | return err; | 290 | return err; |
@@ -308,7 +308,7 @@ void edac_device_unregister_sysfs_main_kobj(struct edac_device_ctl_info *dev) | |||
308 | * b) 'kfree' the memory | 308 | * b) 'kfree' the memory |
309 | */ | 309 | */ |
310 | kobject_put(&dev->kobj); | 310 | kobject_put(&dev->kobj); |
311 | edac_put_sysfs_class(); | 311 | edac_put_sysfs_subsys(); |
312 | } | 312 | } |
313 | 313 | ||
314 | /* edac_dev -> instance information */ | 314 | /* edac_dev -> instance information */ |
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index d69144a09043..ca6c04d350ee 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include <linux/jiffies.h> | 25 | #include <linux/jiffies.h> |
26 | #include <linux/spinlock.h> | 26 | #include <linux/spinlock.h> |
27 | #include <linux/list.h> | 27 | #include <linux/list.h> |
28 | #include <linux/sysdev.h> | ||
29 | #include <linux/ctype.h> | 28 | #include <linux/ctype.h> |
30 | #include <linux/edac.h> | 29 | #include <linux/edac.h> |
31 | #include <asm/uaccess.h> | 30 | #include <asm/uaccess.h> |
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index 29ffa350bfbe..d56e63477d5c 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c | |||
@@ -1021,19 +1021,19 @@ void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci) | |||
1021 | int edac_sysfs_setup_mc_kset(void) | 1021 | int edac_sysfs_setup_mc_kset(void) |
1022 | { | 1022 | { |
1023 | int err = -EINVAL; | 1023 | int err = -EINVAL; |
1024 | struct sysdev_class *edac_class; | 1024 | struct bus_type *edac_subsys; |
1025 | 1025 | ||
1026 | debugf1("%s()\n", __func__); | 1026 | debugf1("%s()\n", __func__); |
1027 | 1027 | ||
1028 | /* get the /sys/devices/system/edac class reference */ | 1028 | /* get the /sys/devices/system/edac subsys reference */ |
1029 | edac_class = edac_get_sysfs_class(); | 1029 | edac_subsys = edac_get_sysfs_subsys(); |
1030 | if (edac_class == NULL) { | 1030 | if (edac_subsys == NULL) { |
1031 | debugf1("%s() no edac_class error=%d\n", __func__, err); | 1031 | debugf1("%s() no edac_subsys error=%d\n", __func__, err); |
1032 | goto fail_out; | 1032 | goto fail_out; |
1033 | } | 1033 | } |
1034 | 1034 | ||
1035 | /* Init the MC's kobject */ | 1035 | /* Init the MC's kobject */ |
1036 | mc_kset = kset_create_and_add("mc", NULL, &edac_class->kset.kobj); | 1036 | mc_kset = kset_create_and_add("mc", NULL, &edac_subsys->dev_root->kobj); |
1037 | if (!mc_kset) { | 1037 | if (!mc_kset) { |
1038 | err = -ENOMEM; | 1038 | err = -ENOMEM; |
1039 | debugf1("%s() Failed to register '.../edac/mc'\n", __func__); | 1039 | debugf1("%s() Failed to register '.../edac/mc'\n", __func__); |
@@ -1045,7 +1045,7 @@ int edac_sysfs_setup_mc_kset(void) | |||
1045 | return 0; | 1045 | return 0; |
1046 | 1046 | ||
1047 | fail_kset: | 1047 | fail_kset: |
1048 | edac_put_sysfs_class(); | 1048 | edac_put_sysfs_subsys(); |
1049 | 1049 | ||
1050 | fail_out: | 1050 | fail_out: |
1051 | return err; | 1051 | return err; |
@@ -1059,6 +1059,6 @@ fail_out: | |||
1059 | void edac_sysfs_teardown_mc_kset(void) | 1059 | void edac_sysfs_teardown_mc_kset(void) |
1060 | { | 1060 | { |
1061 | kset_unregister(mc_kset); | 1061 | kset_unregister(mc_kset); |
1062 | edac_put_sysfs_class(); | 1062 | edac_put_sysfs_subsys(); |
1063 | } | 1063 | } |
1064 | 1064 | ||
diff --git a/drivers/edac/edac_module.h b/drivers/edac/edac_module.h index 17aabb7b90ec..00f81b47a51f 100644 --- a/drivers/edac/edac_module.h +++ b/drivers/edac/edac_module.h | |||
@@ -10,8 +10,6 @@ | |||
10 | #ifndef __EDAC_MODULE_H__ | 10 | #ifndef __EDAC_MODULE_H__ |
11 | #define __EDAC_MODULE_H__ | 11 | #define __EDAC_MODULE_H__ |
12 | 12 | ||
13 | #include <linux/sysdev.h> | ||
14 | |||
15 | #include "edac_core.h" | 13 | #include "edac_core.h" |
16 | 14 | ||
17 | /* | 15 | /* |
diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c index 2b378207d571..63af1c5673d1 100644 --- a/drivers/edac/edac_pci.c +++ b/drivers/edac/edac_pci.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
20 | #include <linux/spinlock.h> | 20 | #include <linux/spinlock.h> |
21 | #include <linux/list.h> | 21 | #include <linux/list.h> |
22 | #include <linux/sysdev.h> | ||
23 | #include <linux/ctype.h> | 22 | #include <linux/ctype.h> |
24 | #include <linux/workqueue.h> | 23 | #include <linux/workqueue.h> |
25 | #include <asm/uaccess.h> | 24 | #include <asm/uaccess.h> |
diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c index 495198ad059c..97f5064e3992 100644 --- a/drivers/edac/edac_pci_sysfs.c +++ b/drivers/edac/edac_pci_sysfs.c | |||
@@ -338,12 +338,12 @@ static struct kobj_type ktype_edac_pci_main_kobj = { | |||
338 | * edac_pci_main_kobj_setup() | 338 | * edac_pci_main_kobj_setup() |
339 | * | 339 | * |
340 | * setup the sysfs for EDAC PCI attributes | 340 | * setup the sysfs for EDAC PCI attributes |
341 | * assumes edac_class has already been initialized | 341 | * assumes edac_subsys has already been initialized |
342 | */ | 342 | */ |
343 | static int edac_pci_main_kobj_setup(void) | 343 | static int edac_pci_main_kobj_setup(void) |
344 | { | 344 | { |
345 | int err; | 345 | int err; |
346 | struct sysdev_class *edac_class; | 346 | struct bus_type *edac_subsys; |
347 | 347 | ||
348 | debugf0("%s()\n", __func__); | 348 | debugf0("%s()\n", __func__); |
349 | 349 | ||
@@ -354,9 +354,9 @@ static int edac_pci_main_kobj_setup(void) | |||
354 | /* First time, so create the main kobject and its | 354 | /* First time, so create the main kobject and its |
355 | * controls and attributes | 355 | * controls and attributes |
356 | */ | 356 | */ |
357 | edac_class = edac_get_sysfs_class(); | 357 | edac_subsys = edac_get_sysfs_subsys(); |
358 | if (edac_class == NULL) { | 358 | if (edac_subsys == NULL) { |
359 | debugf1("%s() no edac_class\n", __func__); | 359 | debugf1("%s() no edac_subsys\n", __func__); |
360 | err = -ENODEV; | 360 | err = -ENODEV; |
361 | goto decrement_count_fail; | 361 | goto decrement_count_fail; |
362 | } | 362 | } |
@@ -381,7 +381,7 @@ static int edac_pci_main_kobj_setup(void) | |||
381 | /* Instanstiate the pci object */ | 381 | /* Instanstiate the pci object */ |
382 | err = kobject_init_and_add(edac_pci_top_main_kobj, | 382 | err = kobject_init_and_add(edac_pci_top_main_kobj, |
383 | &ktype_edac_pci_main_kobj, | 383 | &ktype_edac_pci_main_kobj, |
384 | &edac_class->kset.kobj, "pci"); | 384 | &edac_subsys->dev_root->kobj, "pci"); |
385 | if (err) { | 385 | if (err) { |
386 | debugf1("Failed to register '.../edac/pci'\n"); | 386 | debugf1("Failed to register '.../edac/pci'\n"); |
387 | goto kobject_init_and_add_fail; | 387 | goto kobject_init_and_add_fail; |
@@ -404,7 +404,7 @@ kzalloc_fail: | |||
404 | module_put(THIS_MODULE); | 404 | module_put(THIS_MODULE); |
405 | 405 | ||
406 | mod_get_fail: | 406 | mod_get_fail: |
407 | edac_put_sysfs_class(); | 407 | edac_put_sysfs_subsys(); |
408 | 408 | ||
409 | decrement_count_fail: | 409 | decrement_count_fail: |
410 | /* if are on this error exit, nothing to tear down */ | 410 | /* if are on this error exit, nothing to tear down */ |
@@ -432,7 +432,7 @@ static void edac_pci_main_kobj_teardown(void) | |||
432 | __func__); | 432 | __func__); |
433 | kobject_put(edac_pci_top_main_kobj); | 433 | kobject_put(edac_pci_top_main_kobj); |
434 | } | 434 | } |
435 | edac_put_sysfs_class(); | 435 | edac_put_sysfs_subsys(); |
436 | } | 436 | } |
437 | 437 | ||
438 | /* | 438 | /* |
diff --git a/drivers/edac/edac_stub.c b/drivers/edac/edac_stub.c index 86ad2eee1201..670c4481453b 100644 --- a/drivers/edac/edac_stub.c +++ b/drivers/edac/edac_stub.c | |||
@@ -26,7 +26,7 @@ EXPORT_SYMBOL_GPL(edac_handlers); | |||
26 | int edac_err_assert = 0; | 26 | int edac_err_assert = 0; |
27 | EXPORT_SYMBOL_GPL(edac_err_assert); | 27 | EXPORT_SYMBOL_GPL(edac_err_assert); |
28 | 28 | ||
29 | static atomic_t edac_class_valid = ATOMIC_INIT(0); | 29 | static atomic_t edac_subsys_valid = ATOMIC_INIT(0); |
30 | 30 | ||
31 | /* | 31 | /* |
32 | * called to determine if there is an EDAC driver interested in | 32 | * called to determine if there is an EDAC driver interested in |
@@ -54,36 +54,37 @@ EXPORT_SYMBOL_GPL(edac_atomic_assert_error); | |||
54 | * sysfs object: /sys/devices/system/edac | 54 | * sysfs object: /sys/devices/system/edac |
55 | * need to export to other files | 55 | * need to export to other files |
56 | */ | 56 | */ |
57 | struct sysdev_class edac_class = { | 57 | struct bus_type edac_subsys = { |
58 | .name = "edac", | 58 | .name = "edac", |
59 | .dev_name = "edac", | ||
59 | }; | 60 | }; |
60 | EXPORT_SYMBOL_GPL(edac_class); | 61 | EXPORT_SYMBOL_GPL(edac_subsys); |
61 | 62 | ||
62 | /* return pointer to the 'edac' node in sysfs */ | 63 | /* return pointer to the 'edac' node in sysfs */ |
63 | struct sysdev_class *edac_get_sysfs_class(void) | 64 | struct bus_type *edac_get_sysfs_subsys(void) |
64 | { | 65 | { |
65 | int err = 0; | 66 | int err = 0; |
66 | 67 | ||
67 | if (atomic_read(&edac_class_valid)) | 68 | if (atomic_read(&edac_subsys_valid)) |
68 | goto out; | 69 | goto out; |
69 | 70 | ||
70 | /* create the /sys/devices/system/edac directory */ | 71 | /* create the /sys/devices/system/edac directory */ |
71 | err = sysdev_class_register(&edac_class); | 72 | err = subsys_system_register(&edac_subsys, NULL); |
72 | if (err) { | 73 | if (err) { |
73 | printk(KERN_ERR "Error registering toplevel EDAC sysfs dir\n"); | 74 | printk(KERN_ERR "Error registering toplevel EDAC sysfs dir\n"); |
74 | return NULL; | 75 | return NULL; |
75 | } | 76 | } |
76 | 77 | ||
77 | out: | 78 | out: |
78 | atomic_inc(&edac_class_valid); | 79 | atomic_inc(&edac_subsys_valid); |
79 | return &edac_class; | 80 | return &edac_subsys; |
80 | } | 81 | } |
81 | EXPORT_SYMBOL_GPL(edac_get_sysfs_class); | 82 | EXPORT_SYMBOL_GPL(edac_get_sysfs_subsys); |
82 | 83 | ||
83 | void edac_put_sysfs_class(void) | 84 | void edac_put_sysfs_subsys(void) |
84 | { | 85 | { |
85 | /* last user unregisters it */ | 86 | /* last user unregisters it */ |
86 | if (atomic_dec_and_test(&edac_class_valid)) | 87 | if (atomic_dec_and_test(&edac_subsys_valid)) |
87 | sysdev_class_unregister(&edac_class); | 88 | bus_unregister(&edac_subsys); |
88 | } | 89 | } |
89 | EXPORT_SYMBOL_GPL(edac_put_sysfs_class); | 90 | EXPORT_SYMBOL_GPL(edac_put_sysfs_subsys); |
diff --git a/drivers/edac/mce_amd_inj.c b/drivers/edac/mce_amd_inj.c index 73c3e26a0bce..885e8ad8fdcf 100644 --- a/drivers/edac/mce_amd_inj.c +++ b/drivers/edac/mce_amd_inj.c | |||
@@ -11,7 +11,6 @@ | |||
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/kobject.h> | 13 | #include <linux/kobject.h> |
14 | #include <linux/sysdev.h> | ||
15 | #include <linux/edac.h> | 14 | #include <linux/edac.h> |
16 | #include <linux/module.h> | 15 | #include <linux/module.h> |
17 | #include <asm/mce.h> | 16 | #include <asm/mce.h> |
@@ -116,14 +115,14 @@ static struct edac_mce_attr *sysfs_attrs[] = { &mce_attr_status, &mce_attr_misc, | |||
116 | 115 | ||
117 | static int __init edac_init_mce_inject(void) | 116 | static int __init edac_init_mce_inject(void) |
118 | { | 117 | { |
119 | struct sysdev_class *edac_class = NULL; | 118 | struct bus_type *edac_subsys = NULL; |
120 | int i, err = 0; | 119 | int i, err = 0; |
121 | 120 | ||
122 | edac_class = edac_get_sysfs_class(); | 121 | edac_subsys = edac_get_sysfs_subsys(); |
123 | if (!edac_class) | 122 | if (!edac_subsys) |
124 | return -EINVAL; | 123 | return -EINVAL; |
125 | 124 | ||
126 | mce_kobj = kobject_create_and_add("mce", &edac_class->kset.kobj); | 125 | mce_kobj = kobject_create_and_add("mce", &edac_subsys->dev_root->kobj); |
127 | if (!mce_kobj) { | 126 | if (!mce_kobj) { |
128 | printk(KERN_ERR "Error creating a mce kset.\n"); | 127 | printk(KERN_ERR "Error creating a mce kset.\n"); |
129 | err = -ENOMEM; | 128 | err = -ENOMEM; |
@@ -147,7 +146,7 @@ err_sysfs_create: | |||
147 | kobject_del(mce_kobj); | 146 | kobject_del(mce_kobj); |
148 | 147 | ||
149 | err_mce_kobj: | 148 | err_mce_kobj: |
150 | edac_put_sysfs_class(); | 149 | edac_put_sysfs_subsys(); |
151 | 150 | ||
152 | return err; | 151 | return err; |
153 | } | 152 | } |
@@ -161,7 +160,7 @@ static void __exit edac_exit_mce_inject(void) | |||
161 | 160 | ||
162 | kobject_del(mce_kobj); | 161 | kobject_del(mce_kobj); |
163 | 162 | ||
164 | edac_put_sysfs_class(); | 163 | edac_put_sysfs_subsys(); |
165 | } | 164 | } |
166 | 165 | ||
167 | module_init(edac_init_mce_inject); | 166 | module_init(edac_init_mce_inject); |
diff --git a/drivers/firmware/google/gsmi.c b/drivers/firmware/google/gsmi.c index c4e7c59d1c63..91ddf0f7a1b9 100644 --- a/drivers/firmware/google/gsmi.c +++ b/drivers/firmware/google/gsmi.c | |||
@@ -345,7 +345,8 @@ static efi_status_t gsmi_get_variable(efi_char16_t *name, | |||
345 | memcpy(¶m, gsmi_dev.param_buf->start, sizeof(param)); | 345 | memcpy(¶m, gsmi_dev.param_buf->start, sizeof(param)); |
346 | 346 | ||
347 | /* The size reported is the min of all of our buffers */ | 347 | /* The size reported is the min of all of our buffers */ |
348 | *data_size = min(*data_size, gsmi_dev.data_buf->length); | 348 | *data_size = min_t(unsigned long, *data_size, |
349 | gsmi_dev.data_buf->length); | ||
349 | *data_size = min_t(unsigned long, *data_size, param.data_len); | 350 | *data_size = min_t(unsigned long, *data_size, param.data_len); |
350 | 351 | ||
351 | /* Copy data back to return buffer. */ | 352 | /* Copy data back to return buffer. */ |
diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c index 866251852719..dcbe4541fe49 100644 --- a/drivers/gpio/gpio-samsung.c +++ b/drivers/gpio/gpio-samsung.c | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <linux/spinlock.h> | 22 | #include <linux/spinlock.h> |
23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
24 | #include <linux/interrupt.h> | 24 | #include <linux/interrupt.h> |
25 | #include <linux/sysdev.h> | 25 | #include <linux/device.h> |
26 | #include <linux/ioport.h> | 26 | #include <linux/ioport.h> |
27 | 27 | ||
28 | #include <asm/irq.h> | 28 | #include <asm/irq.h> |
diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c index 065817329f03..bc445d7e3bf5 100644 --- a/drivers/hid/usbhid/usbkbd.c +++ b/drivers/hid/usbhid/usbkbd.c | |||
@@ -354,19 +354,4 @@ static struct usb_driver usb_kbd_driver = { | |||
354 | .id_table = usb_kbd_id_table, | 354 | .id_table = usb_kbd_id_table, |
355 | }; | 355 | }; |
356 | 356 | ||
357 | static int __init usb_kbd_init(void) | 357 | module_usb_driver(usb_kbd_driver); |
358 | { | ||
359 | int result = usb_register(&usb_kbd_driver); | ||
360 | if (result == 0) | ||
361 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
362 | DRIVER_DESC "\n"); | ||
363 | return result; | ||
364 | } | ||
365 | |||
366 | static void __exit usb_kbd_exit(void) | ||
367 | { | ||
368 | usb_deregister(&usb_kbd_driver); | ||
369 | } | ||
370 | |||
371 | module_init(usb_kbd_init); | ||
372 | module_exit(usb_kbd_exit); | ||
diff --git a/drivers/hid/usbhid/usbmouse.c b/drivers/hid/usbhid/usbmouse.c index 79b2bf81a059..0f6be45d43d5 100644 --- a/drivers/hid/usbhid/usbmouse.c +++ b/drivers/hid/usbhid/usbmouse.c | |||
@@ -241,19 +241,4 @@ static struct usb_driver usb_mouse_driver = { | |||
241 | .id_table = usb_mouse_id_table, | 241 | .id_table = usb_mouse_id_table, |
242 | }; | 242 | }; |
243 | 243 | ||
244 | static int __init usb_mouse_init(void) | 244 | module_usb_driver(usb_mouse_driver); |
245 | { | ||
246 | int retval = usb_register(&usb_mouse_driver); | ||
247 | if (retval == 0) | ||
248 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
249 | DRIVER_DESC "\n"); | ||
250 | return retval; | ||
251 | } | ||
252 | |||
253 | static void __exit usb_mouse_exit(void) | ||
254 | { | ||
255 | usb_deregister(&usb_mouse_driver); | ||
256 | } | ||
257 | |||
258 | module_init(usb_mouse_init); | ||
259 | module_exit(usb_mouse_exit); | ||
diff --git a/drivers/hv/Kconfig b/drivers/hv/Kconfig index 9fa09ac000ad..70f5dde1cc52 100644 --- a/drivers/hv/Kconfig +++ b/drivers/hv/Kconfig | |||
@@ -1,3 +1,5 @@ | |||
1 | menu "Microsoft Hyper-V guest support" | ||
2 | |||
1 | config HYPERV | 3 | config HYPERV |
2 | tristate "Microsoft Hyper-V client drivers" | 4 | tristate "Microsoft Hyper-V client drivers" |
3 | depends on X86 && ACPI && PCI | 5 | depends on X86 && ACPI && PCI |
@@ -11,4 +13,4 @@ config HYPERV_UTILS | |||
11 | help | 13 | help |
12 | Select this option to enable the Hyper-V Utilities. | 14 | Select this option to enable the Hyper-V Utilities. |
13 | 15 | ||
14 | 16 | endmenu | |
diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 12b85ff957fd..36484db36baf 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c | |||
@@ -223,6 +223,17 @@ static void vmbus_process_rescind_offer(struct work_struct *work) | |||
223 | vmbus_device_unregister(channel->device_obj); | 223 | vmbus_device_unregister(channel->device_obj); |
224 | } | 224 | } |
225 | 225 | ||
226 | void vmbus_free_channels(void) | ||
227 | { | ||
228 | struct vmbus_channel *channel; | ||
229 | |||
230 | list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) { | ||
231 | vmbus_device_unregister(channel->device_obj); | ||
232 | kfree(channel->device_obj); | ||
233 | free_channel(channel); | ||
234 | } | ||
235 | } | ||
236 | |||
226 | /* | 237 | /* |
227 | * vmbus_process_offer - Process the offer by creating a channel/device | 238 | * vmbus_process_offer - Process the offer by creating a channel/device |
228 | * associated with this offer | 239 | * associated with this offer |
@@ -287,6 +298,7 @@ static void vmbus_process_offer(struct work_struct *work) | |||
287 | spin_lock_irqsave(&vmbus_connection.channel_lock, flags); | 298 | spin_lock_irqsave(&vmbus_connection.channel_lock, flags); |
288 | list_del(&newchannel->listentry); | 299 | list_del(&newchannel->listentry); |
289 | spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags); | 300 | spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags); |
301 | kfree(newchannel->device_obj); | ||
290 | 302 | ||
291 | free_channel(newchannel); | 303 | free_channel(newchannel); |
292 | } else { | 304 | } else { |
diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index 0fb100ed91a3..12aa97f31f93 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c | |||
@@ -164,11 +164,6 @@ int hv_init(void) | |||
164 | 164 | ||
165 | max_leaf = query_hypervisor_info(); | 165 | max_leaf = query_hypervisor_info(); |
166 | 166 | ||
167 | rdmsrl(HV_X64_MSR_GUEST_OS_ID, hv_context.guestid); | ||
168 | |||
169 | if (hv_context.guestid != 0) | ||
170 | goto cleanup; | ||
171 | |||
172 | /* Write our OS info */ | 167 | /* Write our OS info */ |
173 | wrmsrl(HV_X64_MSR_GUEST_OS_ID, HV_LINUX_GUEST_ID); | 168 | wrmsrl(HV_X64_MSR_GUEST_OS_ID, HV_LINUX_GUEST_ID); |
174 | hv_context.guestid = HV_LINUX_GUEST_ID; | 169 | hv_context.guestid = HV_LINUX_GUEST_ID; |
@@ -237,6 +232,9 @@ void hv_cleanup(void) | |||
237 | { | 232 | { |
238 | union hv_x64_msr_hypercall_contents hypercall_msr; | 233 | union hv_x64_msr_hypercall_contents hypercall_msr; |
239 | 234 | ||
235 | /* Reset our OS id */ | ||
236 | wrmsrl(HV_X64_MSR_GUEST_OS_ID, 0); | ||
237 | |||
240 | kfree(hv_context.signal_event_buffer); | 238 | kfree(hv_context.signal_event_buffer); |
241 | hv_context.signal_event_buffer = NULL; | 239 | hv_context.signal_event_buffer = NULL; |
242 | hv_context.signal_event_param = NULL; | 240 | hv_context.signal_event_param = NULL; |
diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h index 0aee1122734c..6d7d286d5440 100644 --- a/drivers/hv/hyperv_vmbus.h +++ b/drivers/hv/hyperv_vmbus.h | |||
@@ -611,6 +611,7 @@ void vmbus_device_unregister(struct hv_device *device_obj); | |||
611 | 611 | ||
612 | struct vmbus_channel *relid2channel(u32 relid); | 612 | struct vmbus_channel *relid2channel(u32 relid); |
613 | 613 | ||
614 | void vmbus_free_channels(void); | ||
614 | 615 | ||
615 | /* Connection interface */ | 616 | /* Connection interface */ |
616 | 617 | ||
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 0c048dd8013f..a220e5746d67 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c | |||
@@ -62,6 +62,14 @@ struct hv_device_info { | |||
62 | struct hv_dev_port_info outbound; | 62 | struct hv_dev_port_info outbound; |
63 | }; | 63 | }; |
64 | 64 | ||
65 | static int vmbus_exists(void) | ||
66 | { | ||
67 | if (hv_acpi_dev == NULL) | ||
68 | return -ENODEV; | ||
69 | |||
70 | return 0; | ||
71 | } | ||
72 | |||
65 | 73 | ||
66 | static void get_channel_info(struct hv_device *device, | 74 | static void get_channel_info(struct hv_device *device, |
67 | struct hv_device_info *info) | 75 | struct hv_device_info *info) |
@@ -590,6 +598,10 @@ int __vmbus_driver_register(struct hv_driver *hv_driver, struct module *owner, c | |||
590 | 598 | ||
591 | pr_info("registering driver %s\n", hv_driver->name); | 599 | pr_info("registering driver %s\n", hv_driver->name); |
592 | 600 | ||
601 | ret = vmbus_exists(); | ||
602 | if (ret < 0) | ||
603 | return ret; | ||
604 | |||
593 | hv_driver->driver.name = hv_driver->name; | 605 | hv_driver->driver.name = hv_driver->name; |
594 | hv_driver->driver.owner = owner; | 606 | hv_driver->driver.owner = owner; |
595 | hv_driver->driver.mod_name = mod_name; | 607 | hv_driver->driver.mod_name = mod_name; |
@@ -614,8 +626,8 @@ void vmbus_driver_unregister(struct hv_driver *hv_driver) | |||
614 | { | 626 | { |
615 | pr_info("unregistering driver %s\n", hv_driver->name); | 627 | pr_info("unregistering driver %s\n", hv_driver->name); |
616 | 628 | ||
617 | driver_unregister(&hv_driver->driver); | 629 | if (!vmbus_exists()) |
618 | 630 | driver_unregister(&hv_driver->driver); | |
619 | } | 631 | } |
620 | EXPORT_SYMBOL_GPL(vmbus_driver_unregister); | 632 | EXPORT_SYMBOL_GPL(vmbus_driver_unregister); |
621 | 633 | ||
@@ -776,11 +788,23 @@ static int __init hv_acpi_init(void) | |||
776 | 788 | ||
777 | cleanup: | 789 | cleanup: |
778 | acpi_bus_unregister_driver(&vmbus_acpi_driver); | 790 | acpi_bus_unregister_driver(&vmbus_acpi_driver); |
791 | hv_acpi_dev = NULL; | ||
779 | return ret; | 792 | return ret; |
780 | } | 793 | } |
781 | 794 | ||
795 | static void __exit vmbus_exit(void) | ||
796 | { | ||
797 | |||
798 | free_irq(irq, hv_acpi_dev); | ||
799 | vmbus_free_channels(); | ||
800 | bus_unregister(&hv_bus); | ||
801 | hv_cleanup(); | ||
802 | acpi_bus_unregister_driver(&vmbus_acpi_driver); | ||
803 | } | ||
804 | |||
782 | 805 | ||
783 | MODULE_LICENSE("GPL"); | 806 | MODULE_LICENSE("GPL"); |
784 | MODULE_VERSION(HV_DRV_VERSION); | 807 | MODULE_VERSION(HV_DRV_VERSION); |
785 | 808 | ||
786 | module_init(hv_acpi_init); | 809 | subsys_initcall(hv_acpi_init); |
810 | module_exit(vmbus_exit); | ||
diff --git a/drivers/i2c/busses/i2c-diolan-u2c.c b/drivers/i2c/busses/i2c-diolan-u2c.c index 76366716a854..7eb19a5222f2 100644 --- a/drivers/i2c/busses/i2c-diolan-u2c.c +++ b/drivers/i2c/busses/i2c-diolan-u2c.c | |||
@@ -515,20 +515,7 @@ static struct usb_driver diolan_u2c_driver = { | |||
515 | .id_table = diolan_u2c_table, | 515 | .id_table = diolan_u2c_table, |
516 | }; | 516 | }; |
517 | 517 | ||
518 | static int __init diolan_u2c_init(void) | 518 | module_usb_driver(diolan_u2c_driver); |
519 | { | ||
520 | /* register this driver with the USB subsystem */ | ||
521 | return usb_register(&diolan_u2c_driver); | ||
522 | } | ||
523 | |||
524 | static void __exit diolan_u2c_exit(void) | ||
525 | { | ||
526 | /* deregister this driver with the USB subsystem */ | ||
527 | usb_deregister(&diolan_u2c_driver); | ||
528 | } | ||
529 | |||
530 | module_init(diolan_u2c_init); | ||
531 | module_exit(diolan_u2c_exit); | ||
532 | 519 | ||
533 | MODULE_AUTHOR("Guenter Roeck <guenter.roeck@ericsson.com>"); | 520 | MODULE_AUTHOR("Guenter Roeck <guenter.roeck@ericsson.com>"); |
534 | MODULE_DESCRIPTION(DRIVER_NAME " driver"); | 521 | MODULE_DESCRIPTION(DRIVER_NAME " driver"); |
diff --git a/drivers/i2c/busses/i2c-tiny-usb.c b/drivers/i2c/busses/i2c-tiny-usb.c index d03b04002f0d..f07307ff360d 100644 --- a/drivers/i2c/busses/i2c-tiny-usb.c +++ b/drivers/i2c/busses/i2c-tiny-usb.c | |||
@@ -262,20 +262,7 @@ static struct usb_driver i2c_tiny_usb_driver = { | |||
262 | .id_table = i2c_tiny_usb_table, | 262 | .id_table = i2c_tiny_usb_table, |
263 | }; | 263 | }; |
264 | 264 | ||
265 | static int __init usb_i2c_tiny_usb_init(void) | 265 | module_usb_driver(i2c_tiny_usb_driver); |
266 | { | ||
267 | /* register this driver with the USB subsystem */ | ||
268 | return usb_register(&i2c_tiny_usb_driver); | ||
269 | } | ||
270 | |||
271 | static void __exit usb_i2c_tiny_usb_exit(void) | ||
272 | { | ||
273 | /* deregister this driver with the USB subsystem */ | ||
274 | usb_deregister(&i2c_tiny_usb_driver); | ||
275 | } | ||
276 | |||
277 | module_init(usb_i2c_tiny_usb_init); | ||
278 | module_exit(usb_i2c_tiny_usb_exit); | ||
279 | 266 | ||
280 | /* ----- end of usb layer ------------------------------------------------ */ | 267 | /* ----- end of usb layer ------------------------------------------------ */ |
281 | 268 | ||
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index d72887585a14..32bbd4c77b7c 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c | |||
@@ -1041,18 +1041,7 @@ static struct usb_driver xpad_driver = { | |||
1041 | .id_table = xpad_table, | 1041 | .id_table = xpad_table, |
1042 | }; | 1042 | }; |
1043 | 1043 | ||
1044 | static int __init usb_xpad_init(void) | 1044 | module_usb_driver(xpad_driver); |
1045 | { | ||
1046 | return usb_register(&xpad_driver); | ||
1047 | } | ||
1048 | |||
1049 | static void __exit usb_xpad_exit(void) | ||
1050 | { | ||
1051 | usb_deregister(&xpad_driver); | ||
1052 | } | ||
1053 | |||
1054 | module_init(usb_xpad_init); | ||
1055 | module_exit(usb_xpad_exit); | ||
1056 | 1045 | ||
1057 | MODULE_AUTHOR(DRIVER_AUTHOR); | 1046 | MODULE_AUTHOR(DRIVER_AUTHOR); |
1058 | MODULE_DESCRIPTION(DRIVER_DESC); | 1047 | MODULE_DESCRIPTION(DRIVER_DESC); |
diff --git a/drivers/input/misc/ati_remote2.c b/drivers/input/misc/ati_remote2.c index 8d345e87075e..874a51c2fbb2 100644 --- a/drivers/input/misc/ati_remote2.c +++ b/drivers/input/misc/ati_remote2.c | |||
@@ -1010,23 +1010,4 @@ static int ati_remote2_post_reset(struct usb_interface *interface) | |||
1010 | return r; | 1010 | return r; |
1011 | } | 1011 | } |
1012 | 1012 | ||
1013 | static int __init ati_remote2_init(void) | 1013 | module_usb_driver(ati_remote2_driver); |
1014 | { | ||
1015 | int r; | ||
1016 | |||
1017 | r = usb_register(&ati_remote2_driver); | ||
1018 | if (r) | ||
1019 | printk(KERN_ERR "ati_remote2: usb_register() = %d\n", r); | ||
1020 | else | ||
1021 | printk(KERN_INFO "ati_remote2: " DRIVER_DESC " " DRIVER_VERSION "\n"); | ||
1022 | |||
1023 | return r; | ||
1024 | } | ||
1025 | |||
1026 | static void __exit ati_remote2_exit(void) | ||
1027 | { | ||
1028 | usb_deregister(&ati_remote2_driver); | ||
1029 | } | ||
1030 | |||
1031 | module_init(ati_remote2_init); | ||
1032 | module_exit(ati_remote2_exit); | ||
diff --git a/drivers/input/misc/keyspan_remote.c b/drivers/input/misc/keyspan_remote.c index fc62256c963f..d99151a8bf10 100644 --- a/drivers/input/misc/keyspan_remote.c +++ b/drivers/input/misc/keyspan_remote.c | |||
@@ -580,26 +580,7 @@ static struct usb_driver keyspan_driver = | |||
580 | .id_table = keyspan_table | 580 | .id_table = keyspan_table |
581 | }; | 581 | }; |
582 | 582 | ||
583 | static int __init usb_keyspan_init(void) | 583 | module_usb_driver(keyspan_driver); |
584 | { | ||
585 | int result; | ||
586 | |||
587 | /* register this driver with the USB subsystem */ | ||
588 | result = usb_register(&keyspan_driver); | ||
589 | if (result) | ||
590 | err("usb_register failed. Error number %d\n", result); | ||
591 | |||
592 | return result; | ||
593 | } | ||
594 | |||
595 | static void __exit usb_keyspan_exit(void) | ||
596 | { | ||
597 | /* deregister this driver with the USB subsystem */ | ||
598 | usb_deregister(&keyspan_driver); | ||
599 | } | ||
600 | |||
601 | module_init(usb_keyspan_init); | ||
602 | module_exit(usb_keyspan_exit); | ||
603 | 584 | ||
604 | MODULE_DEVICE_TABLE(usb, keyspan_table); | 585 | MODULE_DEVICE_TABLE(usb, keyspan_table); |
605 | MODULE_AUTHOR(DRIVER_AUTHOR); | 586 | MODULE_AUTHOR(DRIVER_AUTHOR); |
diff --git a/drivers/input/misc/powermate.c b/drivers/input/misc/powermate.c index f45947190e4f..538f7049ec64 100644 --- a/drivers/input/misc/powermate.c +++ b/drivers/input/misc/powermate.c | |||
@@ -441,18 +441,7 @@ static struct usb_driver powermate_driver = { | |||
441 | .id_table = powermate_devices, | 441 | .id_table = powermate_devices, |
442 | }; | 442 | }; |
443 | 443 | ||
444 | static int __init powermate_init(void) | 444 | module_usb_driver(powermate_driver); |
445 | { | ||
446 | return usb_register(&powermate_driver); | ||
447 | } | ||
448 | |||
449 | static void __exit powermate_cleanup(void) | ||
450 | { | ||
451 | usb_deregister(&powermate_driver); | ||
452 | } | ||
453 | |||
454 | module_init(powermate_init); | ||
455 | module_exit(powermate_cleanup); | ||
456 | 445 | ||
457 | MODULE_AUTHOR( "William R Sowerbutts" ); | 446 | MODULE_AUTHOR( "William R Sowerbutts" ); |
458 | MODULE_DESCRIPTION( "Griffin Technology, Inc PowerMate driver" ); | 447 | MODULE_DESCRIPTION( "Griffin Technology, Inc PowerMate driver" ); |
diff --git a/drivers/input/misc/yealink.c b/drivers/input/misc/yealink.c index 41201c6b5e68..f4776e7f8c15 100644 --- a/drivers/input/misc/yealink.c +++ b/drivers/input/misc/yealink.c | |||
@@ -988,22 +988,7 @@ static struct usb_driver yealink_driver = { | |||
988 | .id_table = usb_table, | 988 | .id_table = usb_table, |
989 | }; | 989 | }; |
990 | 990 | ||
991 | static int __init yealink_dev_init(void) | 991 | module_usb_driver(yealink_driver); |
992 | { | ||
993 | int ret = usb_register(&yealink_driver); | ||
994 | if (ret == 0) | ||
995 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
996 | DRIVER_DESC "\n"); | ||
997 | return ret; | ||
998 | } | ||
999 | |||
1000 | static void __exit yealink_dev_exit(void) | ||
1001 | { | ||
1002 | usb_deregister(&yealink_driver); | ||
1003 | } | ||
1004 | |||
1005 | module_init(yealink_dev_init); | ||
1006 | module_exit(yealink_dev_exit); | ||
1007 | 992 | ||
1008 | MODULE_DEVICE_TABLE (usb, usb_table); | 993 | MODULE_DEVICE_TABLE (usb, usb_table); |
1009 | 994 | ||
diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c index b77f9991278e..0acbc7d50d05 100644 --- a/drivers/input/mouse/appletouch.c +++ b/drivers/input/mouse/appletouch.c | |||
@@ -938,15 +938,4 @@ static struct usb_driver atp_driver = { | |||
938 | .id_table = atp_table, | 938 | .id_table = atp_table, |
939 | }; | 939 | }; |
940 | 940 | ||
941 | static int __init atp_init(void) | 941 | module_usb_driver(atp_driver); |
942 | { | ||
943 | return usb_register(&atp_driver); | ||
944 | } | ||
945 | |||
946 | static void __exit atp_exit(void) | ||
947 | { | ||
948 | usb_deregister(&atp_driver); | ||
949 | } | ||
950 | |||
951 | module_init(atp_init); | ||
952 | module_exit(atp_exit); | ||
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index 5ec617e28f7e..cf87f8b18e34 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c | |||
@@ -940,16 +940,4 @@ static struct usb_driver bcm5974_driver = { | |||
940 | .supports_autosuspend = 1, | 940 | .supports_autosuspend = 1, |
941 | }; | 941 | }; |
942 | 942 | ||
943 | static int __init bcm5974_init(void) | 943 | module_usb_driver(bcm5974_driver); |
944 | { | ||
945 | return usb_register(&bcm5974_driver); | ||
946 | } | ||
947 | |||
948 | static void __exit bcm5974_exit(void) | ||
949 | { | ||
950 | usb_deregister(&bcm5974_driver); | ||
951 | } | ||
952 | |||
953 | module_init(bcm5974_init); | ||
954 | module_exit(bcm5974_exit); | ||
955 | |||
diff --git a/drivers/input/tablet/acecad.c b/drivers/input/tablet/acecad.c index d94f7e9aa997..f8b0b1df9138 100644 --- a/drivers/input/tablet/acecad.c +++ b/drivers/input/tablet/acecad.c | |||
@@ -269,19 +269,4 @@ static struct usb_driver usb_acecad_driver = { | |||
269 | .id_table = usb_acecad_id_table, | 269 | .id_table = usb_acecad_id_table, |
270 | }; | 270 | }; |
271 | 271 | ||
272 | static int __init usb_acecad_init(void) | 272 | module_usb_driver(usb_acecad_driver); |
273 | { | ||
274 | int result = usb_register(&usb_acecad_driver); | ||
275 | if (result == 0) | ||
276 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
277 | DRIVER_DESC "\n"); | ||
278 | return result; | ||
279 | } | ||
280 | |||
281 | static void __exit usb_acecad_exit(void) | ||
282 | { | ||
283 | usb_deregister(&usb_acecad_driver); | ||
284 | } | ||
285 | |||
286 | module_init(usb_acecad_init); | ||
287 | module_exit(usb_acecad_exit); | ||
diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c index 6d89fd1842c3..d5ef3debd045 100644 --- a/drivers/input/tablet/aiptek.c +++ b/drivers/input/tablet/aiptek.c | |||
@@ -1919,21 +1919,7 @@ static struct usb_driver aiptek_driver = { | |||
1919 | .id_table = aiptek_ids, | 1919 | .id_table = aiptek_ids, |
1920 | }; | 1920 | }; |
1921 | 1921 | ||
1922 | static int __init aiptek_init(void) | 1922 | module_usb_driver(aiptek_driver); |
1923 | { | ||
1924 | int result = usb_register(&aiptek_driver); | ||
1925 | if (result == 0) { | ||
1926 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
1927 | DRIVER_DESC "\n"); | ||
1928 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_AUTHOR "\n"); | ||
1929 | } | ||
1930 | return result; | ||
1931 | } | ||
1932 | |||
1933 | static void __exit aiptek_exit(void) | ||
1934 | { | ||
1935 | usb_deregister(&aiptek_driver); | ||
1936 | } | ||
1937 | 1923 | ||
1938 | MODULE_AUTHOR(DRIVER_AUTHOR); | 1924 | MODULE_AUTHOR(DRIVER_AUTHOR); |
1939 | MODULE_DESCRIPTION(DRIVER_DESC); | 1925 | MODULE_DESCRIPTION(DRIVER_DESC); |
@@ -1943,6 +1929,3 @@ module_param(programmableDelay, int, 0); | |||
1943 | MODULE_PARM_DESC(programmableDelay, "delay used during tablet programming"); | 1929 | MODULE_PARM_DESC(programmableDelay, "delay used during tablet programming"); |
1944 | module_param(jitterDelay, int, 0); | 1930 | module_param(jitterDelay, int, 0); |
1945 | MODULE_PARM_DESC(jitterDelay, "stylus/mouse settlement delay"); | 1931 | MODULE_PARM_DESC(jitterDelay, "stylus/mouse settlement delay"); |
1946 | |||
1947 | module_init(aiptek_init); | ||
1948 | module_exit(aiptek_exit); | ||
diff --git a/drivers/input/tablet/gtco.c b/drivers/input/tablet/gtco.c index 8ea6afe2e992..89a297801dce 100644 --- a/drivers/input/tablet/gtco.c +++ b/drivers/input/tablet/gtco.c | |||
@@ -1022,33 +1022,7 @@ static struct usb_driver gtco_driverinfo_table = { | |||
1022 | .disconnect = gtco_disconnect, | 1022 | .disconnect = gtco_disconnect, |
1023 | }; | 1023 | }; |
1024 | 1024 | ||
1025 | /* | 1025 | module_usb_driver(gtco_driverinfo_table); |
1026 | * Register this module with the USB subsystem | ||
1027 | */ | ||
1028 | static int __init gtco_init(void) | ||
1029 | { | ||
1030 | int error; | ||
1031 | |||
1032 | error = usb_register(>co_driverinfo_table); | ||
1033 | if (error) { | ||
1034 | err("usb_register() failed rc=0x%x", error); | ||
1035 | return error; | ||
1036 | } | ||
1037 | |||
1038 | printk("GTCO usb driver version: %s", GTCO_VERSION); | ||
1039 | return 0; | ||
1040 | } | ||
1041 | |||
1042 | /* | ||
1043 | * Deregister this module with the USB subsystem | ||
1044 | */ | ||
1045 | static void __exit gtco_exit(void) | ||
1046 | { | ||
1047 | usb_deregister(>co_driverinfo_table); | ||
1048 | } | ||
1049 | |||
1050 | module_init(gtco_init); | ||
1051 | module_exit(gtco_exit); | ||
1052 | 1026 | ||
1053 | MODULE_DESCRIPTION("GTCO digitizer USB driver"); | 1027 | MODULE_DESCRIPTION("GTCO digitizer USB driver"); |
1054 | MODULE_LICENSE("GPL"); | 1028 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/input/tablet/hanwang.c b/drivers/input/tablet/hanwang.c index 6504b627b234..b2db3cfe3084 100644 --- a/drivers/input/tablet/hanwang.c +++ b/drivers/input/tablet/hanwang.c | |||
@@ -432,15 +432,4 @@ static struct usb_driver hanwang_driver = { | |||
432 | .id_table = hanwang_ids, | 432 | .id_table = hanwang_ids, |
433 | }; | 433 | }; |
434 | 434 | ||
435 | static int __init hanwang_init(void) | 435 | module_usb_driver(hanwang_driver); |
436 | { | ||
437 | return usb_register(&hanwang_driver); | ||
438 | } | ||
439 | |||
440 | static void __exit hanwang_exit(void) | ||
441 | { | ||
442 | usb_deregister(&hanwang_driver); | ||
443 | } | ||
444 | |||
445 | module_init(hanwang_init); | ||
446 | module_exit(hanwang_exit); | ||
diff --git a/drivers/input/tablet/kbtab.c b/drivers/input/tablet/kbtab.c index 290f4e57b589..85a5b40333ac 100644 --- a/drivers/input/tablet/kbtab.c +++ b/drivers/input/tablet/kbtab.c | |||
@@ -198,22 +198,4 @@ static struct usb_driver kbtab_driver = { | |||
198 | .id_table = kbtab_ids, | 198 | .id_table = kbtab_ids, |
199 | }; | 199 | }; |
200 | 200 | ||
201 | static int __init kbtab_init(void) | 201 | module_usb_driver(kbtab_driver); |
202 | { | ||
203 | int retval; | ||
204 | retval = usb_register(&kbtab_driver); | ||
205 | if (retval) | ||
206 | goto out; | ||
207 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
208 | DRIVER_DESC "\n"); | ||
209 | out: | ||
210 | return retval; | ||
211 | } | ||
212 | |||
213 | static void __exit kbtab_exit(void) | ||
214 | { | ||
215 | usb_deregister(&kbtab_driver); | ||
216 | } | ||
217 | |||
218 | module_init(kbtab_init); | ||
219 | module_exit(kbtab_exit); | ||
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index 1c1b7b43cf92..8f9cde3e0ec2 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c | |||
@@ -919,21 +919,4 @@ static struct usb_driver wacom_driver = { | |||
919 | .supports_autosuspend = 1, | 919 | .supports_autosuspend = 1, |
920 | }; | 920 | }; |
921 | 921 | ||
922 | static int __init wacom_init(void) | 922 | module_usb_driver(wacom_driver); |
923 | { | ||
924 | int result; | ||
925 | |||
926 | result = usb_register(&wacom_driver); | ||
927 | if (result == 0) | ||
928 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
929 | DRIVER_DESC "\n"); | ||
930 | return result; | ||
931 | } | ||
932 | |||
933 | static void __exit wacom_exit(void) | ||
934 | { | ||
935 | usb_deregister(&wacom_driver); | ||
936 | } | ||
937 | |||
938 | module_init(wacom_init); | ||
939 | module_exit(wacom_exit); | ||
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c index 73fd6642b681..e539d92cc626 100644 --- a/drivers/input/touchscreen/usbtouchscreen.c +++ b/drivers/input/touchscreen/usbtouchscreen.c | |||
@@ -1580,18 +1580,7 @@ static struct usb_driver usbtouch_driver = { | |||
1580 | .supports_autosuspend = 1, | 1580 | .supports_autosuspend = 1, |
1581 | }; | 1581 | }; |
1582 | 1582 | ||
1583 | static int __init usbtouch_init(void) | 1583 | module_usb_driver(usbtouch_driver); |
1584 | { | ||
1585 | return usb_register(&usbtouch_driver); | ||
1586 | } | ||
1587 | |||
1588 | static void __exit usbtouch_cleanup(void) | ||
1589 | { | ||
1590 | usb_deregister(&usbtouch_driver); | ||
1591 | } | ||
1592 | |||
1593 | module_init(usbtouch_init); | ||
1594 | module_exit(usbtouch_cleanup); | ||
1595 | 1584 | ||
1596 | MODULE_AUTHOR(DRIVER_AUTHOR); | 1585 | MODULE_AUTHOR(DRIVER_AUTHOR); |
1597 | MODULE_DESCRIPTION(DRIVER_DESC); | 1586 | MODULE_DESCRIPTION(DRIVER_DESC); |
diff --git a/drivers/isdn/hardware/mISDN/hfcsusb.c b/drivers/isdn/hardware/mISDN/hfcsusb.c index 71a8eb6ef71e..0e1f4d5b9774 100644 --- a/drivers/isdn/hardware/mISDN/hfcsusb.c +++ b/drivers/isdn/hardware/mISDN/hfcsusb.c | |||
@@ -2154,30 +2154,4 @@ static struct usb_driver hfcsusb_drv = { | |||
2154 | .disconnect = hfcsusb_disconnect, | 2154 | .disconnect = hfcsusb_disconnect, |
2155 | }; | 2155 | }; |
2156 | 2156 | ||
2157 | static int __init | 2157 | module_usb_driver(hfcsusb_drv); |
2158 | hfcsusb_init(void) | ||
2159 | { | ||
2160 | printk(KERN_INFO DRIVER_NAME " driver Rev. %s debug(0x%x) poll(%i)\n", | ||
2161 | hfcsusb_rev, debug, poll); | ||
2162 | |||
2163 | if (usb_register(&hfcsusb_drv)) { | ||
2164 | printk(KERN_INFO DRIVER_NAME | ||
2165 | ": Unable to register hfcsusb module at usb stack\n"); | ||
2166 | return -ENODEV; | ||
2167 | } | ||
2168 | |||
2169 | return 0; | ||
2170 | } | ||
2171 | |||
2172 | static void __exit | ||
2173 | hfcsusb_cleanup(void) | ||
2174 | { | ||
2175 | if (debug & DBG_HFC_CALL_TRACE) | ||
2176 | printk(KERN_INFO DRIVER_NAME ": %s\n", __func__); | ||
2177 | |||
2178 | /* unregister Hardware */ | ||
2179 | usb_deregister(&hfcsusb_drv); /* release our driver */ | ||
2180 | } | ||
2181 | |||
2182 | module_init(hfcsusb_init); | ||
2183 | module_exit(hfcsusb_cleanup); | ||
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c index 6d5628bb0601..0c8739c448b1 100644 --- a/drivers/leds/led-class.c +++ b/drivers/leds/led-class.c | |||
@@ -15,7 +15,6 @@ | |||
15 | #include <linux/list.h> | 15 | #include <linux/list.h> |
16 | #include <linux/spinlock.h> | 16 | #include <linux/spinlock.h> |
17 | #include <linux/device.h> | 17 | #include <linux/device.h> |
18 | #include <linux/sysdev.h> | ||
19 | #include <linux/timer.h> | 18 | #include <linux/timer.h> |
20 | #include <linux/err.h> | 19 | #include <linux/err.h> |
21 | #include <linux/ctype.h> | 20 | #include <linux/ctype.h> |
diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c index 6f1ff93d7cec..46b4c766335d 100644 --- a/drivers/leds/led-triggers.c +++ b/drivers/leds/led-triggers.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/list.h> | 17 | #include <linux/list.h> |
18 | #include <linux/spinlock.h> | 18 | #include <linux/spinlock.h> |
19 | #include <linux/device.h> | 19 | #include <linux/device.h> |
20 | #include <linux/sysdev.h> | ||
21 | #include <linux/timer.h> | 20 | #include <linux/timer.h> |
22 | #include <linux/rwsem.h> | 21 | #include <linux/rwsem.h> |
23 | #include <linux/leds.h> | 22 | #include <linux/leds.h> |
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c index 116a49ce74b2..54ac7ffacb40 100644 --- a/drivers/macintosh/smu.c +++ b/drivers/macintosh/smu.c | |||
@@ -32,7 +32,6 @@ | |||
32 | #include <linux/completion.h> | 32 | #include <linux/completion.h> |
33 | #include <linux/miscdevice.h> | 33 | #include <linux/miscdevice.h> |
34 | #include <linux/delay.h> | 34 | #include <linux/delay.h> |
35 | #include <linux/sysdev.h> | ||
36 | #include <linux/poll.h> | 35 | #include <linux/poll.h> |
37 | #include <linux/mutex.h> | 36 | #include <linux/mutex.h> |
38 | #include <linux/of_device.h> | 37 | #include <linux/of_device.h> |
@@ -681,9 +680,6 @@ static struct platform_driver smu_of_platform_driver = | |||
681 | static int __init smu_init_sysfs(void) | 680 | static int __init smu_init_sysfs(void) |
682 | { | 681 | { |
683 | /* | 682 | /* |
684 | * Due to sysfs bogosity, a sysdev is not a real device, so | ||
685 | * we should in fact create both if we want sysdev semantics | ||
686 | * for power management. | ||
687 | * For now, we don't power manage machines with an SMU chip, | 683 | * For now, we don't power manage machines with an SMU chip, |
688 | * I'm a bit too far from figuring out how that works with those | 684 | * I'm a bit too far from figuring out how that works with those |
689 | * new chipsets, but that will come back and bite us | 685 | * new chipsets, but that will come back and bite us |
diff --git a/drivers/media/dvb/b2c2/flexcop-usb.c b/drivers/media/dvb/b2c2/flexcop-usb.c index bedcfb671624..26c666dd3514 100644 --- a/drivers/media/dvb/b2c2/flexcop-usb.c +++ b/drivers/media/dvb/b2c2/flexcop-usb.c | |||
@@ -583,25 +583,7 @@ static struct usb_driver flexcop_usb_driver = { | |||
583 | .id_table = flexcop_usb_table, | 583 | .id_table = flexcop_usb_table, |
584 | }; | 584 | }; |
585 | 585 | ||
586 | /* module stuff */ | 586 | module_usb_driver(flexcop_usb_driver); |
587 | static int __init flexcop_usb_module_init(void) | ||
588 | { | ||
589 | int result; | ||
590 | if ((result = usb_register(&flexcop_usb_driver))) { | ||
591 | err("usb_register failed. (%d)", result); | ||
592 | return result; | ||
593 | } | ||
594 | return 0; | ||
595 | } | ||
596 | |||
597 | static void __exit flexcop_usb_module_exit(void) | ||
598 | { | ||
599 | /* deregister this driver from the USB subsystem */ | ||
600 | usb_deregister(&flexcop_usb_driver); | ||
601 | } | ||
602 | |||
603 | module_init(flexcop_usb_module_init); | ||
604 | module_exit(flexcop_usb_module_exit); | ||
605 | 587 | ||
606 | MODULE_AUTHOR(DRIVER_AUTHOR); | 588 | MODULE_AUTHOR(DRIVER_AUTHOR); |
607 | MODULE_DESCRIPTION(DRIVER_NAME); | 589 | MODULE_DESCRIPTION(DRIVER_NAME); |
diff --git a/drivers/media/dvb/dvb-usb/a800.c b/drivers/media/dvb/dvb-usb/a800.c index 2aef3c89e9fa..8d7fef84afd8 100644 --- a/drivers/media/dvb/dvb-usb/a800.c +++ b/drivers/media/dvb/dvb-usb/a800.c | |||
@@ -183,26 +183,7 @@ static struct usb_driver a800_driver = { | |||
183 | .id_table = a800_table, | 183 | .id_table = a800_table, |
184 | }; | 184 | }; |
185 | 185 | ||
186 | /* module stuff */ | 186 | module_usb_driver(a800_driver); |
187 | static int __init a800_module_init(void) | ||
188 | { | ||
189 | int result; | ||
190 | if ((result = usb_register(&a800_driver))) { | ||
191 | err("usb_register failed. Error number %d",result); | ||
192 | return result; | ||
193 | } | ||
194 | |||
195 | return 0; | ||
196 | } | ||
197 | |||
198 | static void __exit a800_module_exit(void) | ||
199 | { | ||
200 | /* deregister this driver from the USB subsystem */ | ||
201 | usb_deregister(&a800_driver); | ||
202 | } | ||
203 | |||
204 | module_init (a800_module_init); | ||
205 | module_exit (a800_module_exit); | ||
206 | 187 | ||
207 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); | 188 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); |
208 | MODULE_DESCRIPTION("AVerMedia AverTV DVB-T USB 2.0 (A800)"); | 189 | MODULE_DESCRIPTION("AVerMedia AverTV DVB-T USB 2.0 (A800)"); |
diff --git a/drivers/media/dvb/dvb-usb/af9015.c b/drivers/media/dvb/dvb-usb/af9015.c index c6c275bac08e..56cbd3636c31 100644 --- a/drivers/media/dvb/dvb-usb/af9015.c +++ b/drivers/media/dvb/dvb-usb/af9015.c | |||
@@ -1713,25 +1713,7 @@ static struct usb_driver af9015_usb_driver = { | |||
1713 | .id_table = af9015_usb_table, | 1713 | .id_table = af9015_usb_table, |
1714 | }; | 1714 | }; |
1715 | 1715 | ||
1716 | /* module stuff */ | 1716 | module_usb_driver(af9015_usb_driver); |
1717 | static int __init af9015_usb_module_init(void) | ||
1718 | { | ||
1719 | int ret; | ||
1720 | ret = usb_register(&af9015_usb_driver); | ||
1721 | if (ret) | ||
1722 | err("module init failed:%d", ret); | ||
1723 | |||
1724 | return ret; | ||
1725 | } | ||
1726 | |||
1727 | static void __exit af9015_usb_module_exit(void) | ||
1728 | { | ||
1729 | /* deregister this driver from the USB subsystem */ | ||
1730 | usb_deregister(&af9015_usb_driver); | ||
1731 | } | ||
1732 | |||
1733 | module_init(af9015_usb_module_init); | ||
1734 | module_exit(af9015_usb_module_exit); | ||
1735 | 1717 | ||
1736 | MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>"); | 1718 | MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>"); |
1737 | MODULE_DESCRIPTION("Driver for Afatech AF9015 DVB-T"); | 1719 | MODULE_DESCRIPTION("Driver for Afatech AF9015 DVB-T"); |
diff --git a/drivers/media/dvb/dvb-usb/anysee.c b/drivers/media/dvb/dvb-usb/anysee.c index 5f2278b73ee9..b39f14f85e71 100644 --- a/drivers/media/dvb/dvb-usb/anysee.c +++ b/drivers/media/dvb/dvb-usb/anysee.c | |||
@@ -1091,26 +1091,7 @@ static struct usb_driver anysee_driver = { | |||
1091 | .id_table = anysee_table, | 1091 | .id_table = anysee_table, |
1092 | }; | 1092 | }; |
1093 | 1093 | ||
1094 | /* module stuff */ | 1094 | module_usb_driver(anysee_driver); |
1095 | static int __init anysee_module_init(void) | ||
1096 | { | ||
1097 | int ret; | ||
1098 | |||
1099 | ret = usb_register(&anysee_driver); | ||
1100 | if (ret) | ||
1101 | err("%s: usb_register failed. Error number %d", __func__, ret); | ||
1102 | |||
1103 | return ret; | ||
1104 | } | ||
1105 | |||
1106 | static void __exit anysee_module_exit(void) | ||
1107 | { | ||
1108 | /* deregister this driver from the USB subsystem */ | ||
1109 | usb_deregister(&anysee_driver); | ||
1110 | } | ||
1111 | |||
1112 | module_init(anysee_module_init); | ||
1113 | module_exit(anysee_module_exit); | ||
1114 | 1095 | ||
1115 | MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>"); | 1096 | MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>"); |
1116 | MODULE_DESCRIPTION("Driver Anysee E30 DVB-C & DVB-T USB2.0"); | 1097 | MODULE_DESCRIPTION("Driver Anysee E30 DVB-C & DVB-T USB2.0"); |
diff --git a/drivers/media/dvb/dvb-usb/au6610.c b/drivers/media/dvb/dvb-usb/au6610.c index b77994967b9b..16210c060302 100644 --- a/drivers/media/dvb/dvb-usb/au6610.c +++ b/drivers/media/dvb/dvb-usb/au6610.c | |||
@@ -244,26 +244,7 @@ static struct usb_driver au6610_driver = { | |||
244 | .id_table = au6610_table, | 244 | .id_table = au6610_table, |
245 | }; | 245 | }; |
246 | 246 | ||
247 | /* module stuff */ | 247 | module_usb_driver(au6610_driver); |
248 | static int __init au6610_module_init(void) | ||
249 | { | ||
250 | int ret; | ||
251 | |||
252 | ret = usb_register(&au6610_driver); | ||
253 | if (ret) | ||
254 | err("usb_register failed. Error number %d", ret); | ||
255 | |||
256 | return ret; | ||
257 | } | ||
258 | |||
259 | static void __exit au6610_module_exit(void) | ||
260 | { | ||
261 | /* deregister this driver from the USB subsystem */ | ||
262 | usb_deregister(&au6610_driver); | ||
263 | } | ||
264 | |||
265 | module_init(au6610_module_init); | ||
266 | module_exit(au6610_module_exit); | ||
267 | 248 | ||
268 | MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>"); | 249 | MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>"); |
269 | MODULE_DESCRIPTION("Driver for Alcor Micro AU6610 DVB-T USB2.0"); | 250 | MODULE_DESCRIPTION("Driver for Alcor Micro AU6610 DVB-T USB2.0"); |
diff --git a/drivers/media/dvb/dvb-usb/az6027.c b/drivers/media/dvb/dvb-usb/az6027.c index bf67b4dfd82b..5e45ae605427 100644 --- a/drivers/media/dvb/dvb-usb/az6027.c +++ b/drivers/media/dvb/dvb-usb/az6027.c | |||
@@ -1174,28 +1174,7 @@ static struct usb_driver az6027_usb_driver = { | |||
1174 | .id_table = az6027_usb_table, | 1174 | .id_table = az6027_usb_table, |
1175 | }; | 1175 | }; |
1176 | 1176 | ||
1177 | /* module stuff */ | 1177 | module_usb_driver(az6027_usb_driver); |
1178 | static int __init az6027_usb_module_init(void) | ||
1179 | { | ||
1180 | int result; | ||
1181 | |||
1182 | result = usb_register(&az6027_usb_driver); | ||
1183 | if (result) { | ||
1184 | err("usb_register failed. (%d)", result); | ||
1185 | return result; | ||
1186 | } | ||
1187 | |||
1188 | return 0; | ||
1189 | } | ||
1190 | |||
1191 | static void __exit az6027_usb_module_exit(void) | ||
1192 | { | ||
1193 | /* deregister this driver from the USB subsystem */ | ||
1194 | usb_deregister(&az6027_usb_driver); | ||
1195 | } | ||
1196 | |||
1197 | module_init(az6027_usb_module_init); | ||
1198 | module_exit(az6027_usb_module_exit); | ||
1199 | 1178 | ||
1200 | MODULE_AUTHOR("Adams Xu <Adams.xu@azwave.com.cn>"); | 1179 | MODULE_AUTHOR("Adams Xu <Adams.xu@azwave.com.cn>"); |
1201 | MODULE_DESCRIPTION("Driver for AZUREWAVE DVB-S/S2 USB2.0 (AZ6027)"); | 1180 | MODULE_DESCRIPTION("Driver for AZUREWAVE DVB-S/S2 USB2.0 (AZ6027)"); |
diff --git a/drivers/media/dvb/dvb-usb/ce6230.c b/drivers/media/dvb/dvb-usb/ce6230.c index 57afb5a9157e..fa637255729c 100644 --- a/drivers/media/dvb/dvb-usb/ce6230.c +++ b/drivers/media/dvb/dvb-usb/ce6230.c | |||
@@ -317,27 +317,7 @@ static struct usb_driver ce6230_driver = { | |||
317 | .id_table = ce6230_table, | 317 | .id_table = ce6230_table, |
318 | }; | 318 | }; |
319 | 319 | ||
320 | /* module stuff */ | 320 | module_usb_driver(ce6230_driver); |
321 | static int __init ce6230_module_init(void) | ||
322 | { | ||
323 | int ret; | ||
324 | deb_info("%s:\n", __func__); | ||
325 | ret = usb_register(&ce6230_driver); | ||
326 | if (ret) | ||
327 | err("usb_register failed with error:%d", ret); | ||
328 | |||
329 | return ret; | ||
330 | } | ||
331 | |||
332 | static void __exit ce6230_module_exit(void) | ||
333 | { | ||
334 | deb_info("%s:\n", __func__); | ||
335 | /* deregister this driver from the USB subsystem */ | ||
336 | usb_deregister(&ce6230_driver); | ||
337 | } | ||
338 | |||
339 | module_init(ce6230_module_init); | ||
340 | module_exit(ce6230_module_exit); | ||
341 | 321 | ||
342 | MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>"); | 322 | MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>"); |
343 | MODULE_DESCRIPTION("Driver for Intel CE6230 DVB-T USB2.0"); | 323 | MODULE_DESCRIPTION("Driver for Intel CE6230 DVB-T USB2.0"); |
diff --git a/drivers/media/dvb/dvb-usb/cinergyT2-core.c b/drivers/media/dvb/dvb-usb/cinergyT2-core.c index f9d905002ec9..0a98548ecd17 100644 --- a/drivers/media/dvb/dvb-usb/cinergyT2-core.c +++ b/drivers/media/dvb/dvb-usb/cinergyT2-core.c | |||
@@ -247,25 +247,7 @@ static struct usb_driver cinergyt2_driver = { | |||
247 | .id_table = cinergyt2_usb_table | 247 | .id_table = cinergyt2_usb_table |
248 | }; | 248 | }; |
249 | 249 | ||
250 | static int __init cinergyt2_usb_init(void) | 250 | module_usb_driver(cinergyt2_driver); |
251 | { | ||
252 | int err; | ||
253 | |||
254 | err = usb_register(&cinergyt2_driver); | ||
255 | if (err) { | ||
256 | err("usb_register() failed! (err %i)\n", err); | ||
257 | return err; | ||
258 | } | ||
259 | return 0; | ||
260 | } | ||
261 | |||
262 | static void __exit cinergyt2_usb_exit(void) | ||
263 | { | ||
264 | usb_deregister(&cinergyt2_driver); | ||
265 | } | ||
266 | |||
267 | module_init(cinergyt2_usb_init); | ||
268 | module_exit(cinergyt2_usb_exit); | ||
269 | 251 | ||
270 | MODULE_DESCRIPTION("Terratec Cinergy T2 DVB-T driver"); | 252 | MODULE_DESCRIPTION("Terratec Cinergy T2 DVB-T driver"); |
271 | MODULE_LICENSE("GPL"); | 253 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c index 9f2a02c48377..949ea1bc0aae 100644 --- a/drivers/media/dvb/dvb-usb/cxusb.c +++ b/drivers/media/dvb/dvb-usb/cxusb.c | |||
@@ -2034,26 +2034,7 @@ static struct usb_driver cxusb_driver = { | |||
2034 | .id_table = cxusb_table, | 2034 | .id_table = cxusb_table, |
2035 | }; | 2035 | }; |
2036 | 2036 | ||
2037 | /* module stuff */ | 2037 | module_usb_driver(cxusb_driver); |
2038 | static int __init cxusb_module_init(void) | ||
2039 | { | ||
2040 | int result; | ||
2041 | if ((result = usb_register(&cxusb_driver))) { | ||
2042 | err("usb_register failed. Error number %d",result); | ||
2043 | return result; | ||
2044 | } | ||
2045 | |||
2046 | return 0; | ||
2047 | } | ||
2048 | |||
2049 | static void __exit cxusb_module_exit(void) | ||
2050 | { | ||
2051 | /* deregister this driver from the USB subsystem */ | ||
2052 | usb_deregister(&cxusb_driver); | ||
2053 | } | ||
2054 | |||
2055 | module_init (cxusb_module_init); | ||
2056 | module_exit (cxusb_module_exit); | ||
2057 | 2038 | ||
2058 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); | 2039 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); |
2059 | MODULE_AUTHOR("Michael Krufky <mkrufky@linuxtv.org>"); | 2040 | MODULE_AUTHOR("Michael Krufky <mkrufky@linuxtv.org>"); |
diff --git a/drivers/media/dvb/dvb-usb/dib0700_core.c b/drivers/media/dvb/dvb-usb/dib0700_core.c index 156cbfc9c79d..206999476f02 100644 --- a/drivers/media/dvb/dvb-usb/dib0700_core.c +++ b/drivers/media/dvb/dvb-usb/dib0700_core.c | |||
@@ -832,27 +832,7 @@ static struct usb_driver dib0700_driver = { | |||
832 | .id_table = dib0700_usb_id_table, | 832 | .id_table = dib0700_usb_id_table, |
833 | }; | 833 | }; |
834 | 834 | ||
835 | /* module stuff */ | 835 | module_usb_driver(dib0700_driver); |
836 | static int __init dib0700_module_init(void) | ||
837 | { | ||
838 | int result; | ||
839 | info("loaded with support for %d different device-types", dib0700_device_count); | ||
840 | if ((result = usb_register(&dib0700_driver))) { | ||
841 | err("usb_register failed. Error number %d",result); | ||
842 | return result; | ||
843 | } | ||
844 | |||
845 | return 0; | ||
846 | } | ||
847 | |||
848 | static void __exit dib0700_module_exit(void) | ||
849 | { | ||
850 | /* deregister this driver from the USB subsystem */ | ||
851 | usb_deregister(&dib0700_driver); | ||
852 | } | ||
853 | |||
854 | module_init (dib0700_module_init); | ||
855 | module_exit (dib0700_module_exit); | ||
856 | 836 | ||
857 | MODULE_AUTHOR("Patrick Boettcher <pboettcher@dibcom.fr>"); | 837 | MODULE_AUTHOR("Patrick Boettcher <pboettcher@dibcom.fr>"); |
858 | MODULE_DESCRIPTION("Driver for devices based on DiBcom DiB0700 - USB bridge"); | 838 | MODULE_DESCRIPTION("Driver for devices based on DiBcom DiB0700 - USB bridge"); |
diff --git a/drivers/media/dvb/dvb-usb/dibusb-mb.c b/drivers/media/dvb/dvb-usb/dibusb-mb.c index 7270791f8340..a4ac37e0e98b 100644 --- a/drivers/media/dvb/dvb-usb/dibusb-mb.c +++ b/drivers/media/dvb/dvb-usb/dibusb-mb.c | |||
@@ -463,26 +463,7 @@ static struct usb_driver dibusb_driver = { | |||
463 | .id_table = dibusb_dib3000mb_table, | 463 | .id_table = dibusb_dib3000mb_table, |
464 | }; | 464 | }; |
465 | 465 | ||
466 | /* module stuff */ | 466 | module_usb_driver(dibusb_driver); |
467 | static int __init dibusb_module_init(void) | ||
468 | { | ||
469 | int result; | ||
470 | if ((result = usb_register(&dibusb_driver))) { | ||
471 | err("usb_register failed. Error number %d",result); | ||
472 | return result; | ||
473 | } | ||
474 | |||
475 | return 0; | ||
476 | } | ||
477 | |||
478 | static void __exit dibusb_module_exit(void) | ||
479 | { | ||
480 | /* deregister this driver from the USB subsystem */ | ||
481 | usb_deregister(&dibusb_driver); | ||
482 | } | ||
483 | |||
484 | module_init (dibusb_module_init); | ||
485 | module_exit (dibusb_module_exit); | ||
486 | 467 | ||
487 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); | 468 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); |
488 | MODULE_DESCRIPTION("Driver for DiBcom USB DVB-T devices (DiB3000M-B based)"); | 469 | MODULE_DESCRIPTION("Driver for DiBcom USB DVB-T devices (DiB3000M-B based)"); |
diff --git a/drivers/media/dvb/dvb-usb/dibusb-mc.c b/drivers/media/dvb/dvb-usb/dibusb-mc.c index 9c165e2569d4..9d1a59d09c52 100644 --- a/drivers/media/dvb/dvb-usb/dibusb-mc.c +++ b/drivers/media/dvb/dvb-usb/dibusb-mc.c | |||
@@ -141,26 +141,7 @@ static struct usb_driver dibusb_mc_driver = { | |||
141 | .id_table = dibusb_dib3000mc_table, | 141 | .id_table = dibusb_dib3000mc_table, |
142 | }; | 142 | }; |
143 | 143 | ||
144 | /* module stuff */ | 144 | module_usb_driver(dibusb_mc_driver); |
145 | static int __init dibusb_mc_module_init(void) | ||
146 | { | ||
147 | int result; | ||
148 | if ((result = usb_register(&dibusb_mc_driver))) { | ||
149 | err("usb_register failed. Error number %d",result); | ||
150 | return result; | ||
151 | } | ||
152 | |||
153 | return 0; | ||
154 | } | ||
155 | |||
156 | static void __exit dibusb_mc_module_exit(void) | ||
157 | { | ||
158 | /* deregister this driver from the USB subsystem */ | ||
159 | usb_deregister(&dibusb_mc_driver); | ||
160 | } | ||
161 | |||
162 | module_init (dibusb_mc_module_init); | ||
163 | module_exit (dibusb_mc_module_exit); | ||
164 | 145 | ||
165 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); | 146 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); |
166 | MODULE_DESCRIPTION("Driver for DiBcom USB2.0 DVB-T (DiB3000M-C/P based) devices"); | 147 | MODULE_DESCRIPTION("Driver for DiBcom USB2.0 DVB-T (DiB3000M-C/P based) devices"); |
diff --git a/drivers/media/dvb/dvb-usb/digitv.c b/drivers/media/dvb/dvb-usb/digitv.c index f7184111aa64..0a9a79820f26 100644 --- a/drivers/media/dvb/dvb-usb/digitv.c +++ b/drivers/media/dvb/dvb-usb/digitv.c | |||
@@ -346,26 +346,7 @@ static struct usb_driver digitv_driver = { | |||
346 | .id_table = digitv_table, | 346 | .id_table = digitv_table, |
347 | }; | 347 | }; |
348 | 348 | ||
349 | /* module stuff */ | 349 | module_usb_driver(digitv_driver); |
350 | static int __init digitv_module_init(void) | ||
351 | { | ||
352 | int result; | ||
353 | if ((result = usb_register(&digitv_driver))) { | ||
354 | err("usb_register failed. Error number %d",result); | ||
355 | return result; | ||
356 | } | ||
357 | |||
358 | return 0; | ||
359 | } | ||
360 | |||
361 | static void __exit digitv_module_exit(void) | ||
362 | { | ||
363 | /* deregister this driver from the USB subsystem */ | ||
364 | usb_deregister(&digitv_driver); | ||
365 | } | ||
366 | |||
367 | module_init (digitv_module_init); | ||
368 | module_exit (digitv_module_exit); | ||
369 | 350 | ||
370 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); | 351 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); |
371 | MODULE_DESCRIPTION("Driver for Nebula Electronics uDigiTV DVB-T USB2.0"); | 352 | MODULE_DESCRIPTION("Driver for Nebula Electronics uDigiTV DVB-T USB2.0"); |
diff --git a/drivers/media/dvb/dvb-usb/dtt200u.c b/drivers/media/dvb/dvb-usb/dtt200u.c index 106dfd55ff9c..66f205c112b2 100644 --- a/drivers/media/dvb/dvb-usb/dtt200u.c +++ b/drivers/media/dvb/dvb-usb/dtt200u.c | |||
@@ -360,26 +360,7 @@ static struct usb_driver dtt200u_usb_driver = { | |||
360 | .id_table = dtt200u_usb_table, | 360 | .id_table = dtt200u_usb_table, |
361 | }; | 361 | }; |
362 | 362 | ||
363 | /* module stuff */ | 363 | module_usb_driver(dtt200u_usb_driver); |
364 | static int __init dtt200u_usb_module_init(void) | ||
365 | { | ||
366 | int result; | ||
367 | if ((result = usb_register(&dtt200u_usb_driver))) { | ||
368 | err("usb_register failed. (%d)",result); | ||
369 | return result; | ||
370 | } | ||
371 | |||
372 | return 0; | ||
373 | } | ||
374 | |||
375 | static void __exit dtt200u_usb_module_exit(void) | ||
376 | { | ||
377 | /* deregister this driver from the USB subsystem */ | ||
378 | usb_deregister(&dtt200u_usb_driver); | ||
379 | } | ||
380 | |||
381 | module_init(dtt200u_usb_module_init); | ||
382 | module_exit(dtt200u_usb_module_exit); | ||
383 | 364 | ||
384 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); | 365 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); |
385 | MODULE_DESCRIPTION("Driver for the WideView/Yakumo/Hama/Typhoon/Club3D/Miglia DVB-T USB2.0 devices"); | 366 | MODULE_DESCRIPTION("Driver for the WideView/Yakumo/Hama/Typhoon/Club3D/Miglia DVB-T USB2.0 devices"); |
diff --git a/drivers/media/dvb/dvb-usb/dtv5100.c b/drivers/media/dvb/dvb-usb/dtv5100.c index 7373132163d2..3d11df41cac0 100644 --- a/drivers/media/dvb/dvb-usb/dtv5100.c +++ b/drivers/media/dvb/dvb-usb/dtv5100.c | |||
@@ -217,26 +217,7 @@ static struct usb_driver dtv5100_driver = { | |||
217 | .id_table = dtv5100_table, | 217 | .id_table = dtv5100_table, |
218 | }; | 218 | }; |
219 | 219 | ||
220 | /* module stuff */ | 220 | module_usb_driver(dtv5100_driver); |
221 | static int __init dtv5100_module_init(void) | ||
222 | { | ||
223 | int ret; | ||
224 | |||
225 | ret = usb_register(&dtv5100_driver); | ||
226 | if (ret) | ||
227 | err("usb_register failed. Error number %d", ret); | ||
228 | |||
229 | return ret; | ||
230 | } | ||
231 | |||
232 | static void __exit dtv5100_module_exit(void) | ||
233 | { | ||
234 | /* deregister this driver from the USB subsystem */ | ||
235 | usb_deregister(&dtv5100_driver); | ||
236 | } | ||
237 | |||
238 | module_init(dtv5100_module_init); | ||
239 | module_exit(dtv5100_module_exit); | ||
240 | 221 | ||
241 | MODULE_AUTHOR(DRIVER_AUTHOR); | 222 | MODULE_AUTHOR(DRIVER_AUTHOR); |
242 | MODULE_DESCRIPTION(DRIVER_DESC); | 223 | MODULE_DESCRIPTION(DRIVER_DESC); |
diff --git a/drivers/media/dvb/dvb-usb/dw2102.c b/drivers/media/dvb/dvb-usb/dw2102.c index f103ec1fe82e..ff941d20e6b7 100644 --- a/drivers/media/dvb/dvb-usb/dw2102.c +++ b/drivers/media/dvb/dvb-usb/dw2102.c | |||
@@ -1928,22 +1928,7 @@ static struct usb_driver dw2102_driver = { | |||
1928 | .id_table = dw2102_table, | 1928 | .id_table = dw2102_table, |
1929 | }; | 1929 | }; |
1930 | 1930 | ||
1931 | static int __init dw2102_module_init(void) | 1931 | module_usb_driver(dw2102_driver); |
1932 | { | ||
1933 | int ret = usb_register(&dw2102_driver); | ||
1934 | if (ret) | ||
1935 | err("usb_register failed. Error number %d", ret); | ||
1936 | |||
1937 | return ret; | ||
1938 | } | ||
1939 | |||
1940 | static void __exit dw2102_module_exit(void) | ||
1941 | { | ||
1942 | usb_deregister(&dw2102_driver); | ||
1943 | } | ||
1944 | |||
1945 | module_init(dw2102_module_init); | ||
1946 | module_exit(dw2102_module_exit); | ||
1947 | 1932 | ||
1948 | MODULE_AUTHOR("Igor M. Liplianin (c) liplianin@me.by"); | 1933 | MODULE_AUTHOR("Igor M. Liplianin (c) liplianin@me.by"); |
1949 | MODULE_DESCRIPTION("Driver for DVBWorld DVB-S 2101, 2102, DVB-S2 2104," | 1934 | MODULE_DESCRIPTION("Driver for DVBWorld DVB-S 2101, 2102, DVB-S2 2104," |
diff --git a/drivers/media/dvb/dvb-usb/ec168.c b/drivers/media/dvb/dvb-usb/ec168.c index 78442fe4aa5e..b4989ba8897d 100644 --- a/drivers/media/dvb/dvb-usb/ec168.c +++ b/drivers/media/dvb/dvb-usb/ec168.c | |||
@@ -428,27 +428,7 @@ static struct usb_driver ec168_driver = { | |||
428 | .id_table = ec168_id, | 428 | .id_table = ec168_id, |
429 | }; | 429 | }; |
430 | 430 | ||
431 | /* module stuff */ | 431 | module_usb_driver(ec168_driver); |
432 | static int __init ec168_module_init(void) | ||
433 | { | ||
434 | int ret; | ||
435 | deb_info("%s:\n", __func__); | ||
436 | ret = usb_register(&ec168_driver); | ||
437 | if (ret) | ||
438 | err("module init failed:%d", ret); | ||
439 | |||
440 | return ret; | ||
441 | } | ||
442 | |||
443 | static void __exit ec168_module_exit(void) | ||
444 | { | ||
445 | deb_info("%s:\n", __func__); | ||
446 | /* deregister this driver from the USB subsystem */ | ||
447 | usb_deregister(&ec168_driver); | ||
448 | } | ||
449 | |||
450 | module_init(ec168_module_init); | ||
451 | module_exit(ec168_module_exit); | ||
452 | 432 | ||
453 | MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>"); | 433 | MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>"); |
454 | MODULE_DESCRIPTION("E3C EC168 DVB-T USB2.0 driver"); | 434 | MODULE_DESCRIPTION("E3C EC168 DVB-T USB2.0 driver"); |
diff --git a/drivers/media/dvb/dvb-usb/friio.c b/drivers/media/dvb/dvb-usb/friio.c index b092dc2137cd..474a17e4db0c 100644 --- a/drivers/media/dvb/dvb-usb/friio.c +++ b/drivers/media/dvb/dvb-usb/friio.c | |||
@@ -514,28 +514,7 @@ static struct usb_driver friio_driver = { | |||
514 | .id_table = friio_table, | 514 | .id_table = friio_table, |
515 | }; | 515 | }; |
516 | 516 | ||
517 | 517 | module_usb_driver(friio_driver); | |
518 | /* module stuff */ | ||
519 | static int __init friio_module_init(void) | ||
520 | { | ||
521 | int ret; | ||
522 | |||
523 | ret = usb_register(&friio_driver); | ||
524 | if (ret) | ||
525 | err("usb_register failed. Error number %d", ret); | ||
526 | |||
527 | return ret; | ||
528 | } | ||
529 | |||
530 | |||
531 | static void __exit friio_module_exit(void) | ||
532 | { | ||
533 | /* deregister this driver from the USB subsystem */ | ||
534 | usb_deregister(&friio_driver); | ||
535 | } | ||
536 | |||
537 | module_init(friio_module_init); | ||
538 | module_exit(friio_module_exit); | ||
539 | 518 | ||
540 | MODULE_AUTHOR("Akihiro Tsukada <tskd2@yahoo.co.jp>"); | 519 | MODULE_AUTHOR("Akihiro Tsukada <tskd2@yahoo.co.jp>"); |
541 | MODULE_DESCRIPTION("Driver for Friio ISDB-T USB2.0 Receiver"); | 520 | MODULE_DESCRIPTION("Driver for Friio ISDB-T USB2.0 Receiver"); |
diff --git a/drivers/media/dvb/dvb-usb/gl861.c b/drivers/media/dvb/dvb-usb/gl861.c index 63681df244c4..c1f5582e1cdf 100644 --- a/drivers/media/dvb/dvb-usb/gl861.c +++ b/drivers/media/dvb/dvb-usb/gl861.c | |||
@@ -209,26 +209,7 @@ static struct usb_driver gl861_driver = { | |||
209 | .id_table = gl861_table, | 209 | .id_table = gl861_table, |
210 | }; | 210 | }; |
211 | 211 | ||
212 | /* module stuff */ | 212 | module_usb_driver(gl861_driver); |
213 | static int __init gl861_module_init(void) | ||
214 | { | ||
215 | int ret; | ||
216 | |||
217 | ret = usb_register(&gl861_driver); | ||
218 | if (ret) | ||
219 | err("usb_register failed. Error number %d", ret); | ||
220 | |||
221 | return ret; | ||
222 | } | ||
223 | |||
224 | static void __exit gl861_module_exit(void) | ||
225 | { | ||
226 | /* deregister this driver from the USB subsystem */ | ||
227 | usb_deregister(&gl861_driver); | ||
228 | } | ||
229 | |||
230 | module_init(gl861_module_init); | ||
231 | module_exit(gl861_module_exit); | ||
232 | 213 | ||
233 | MODULE_AUTHOR("Carl Lundqvist <comabug@gmail.com>"); | 214 | MODULE_AUTHOR("Carl Lundqvist <comabug@gmail.com>"); |
234 | MODULE_DESCRIPTION("Driver MSI Mega Sky 580 DVB-T USB2.0 / GL861"); | 215 | MODULE_DESCRIPTION("Driver MSI Mega Sky 580 DVB-T USB2.0 / GL861"); |
diff --git a/drivers/media/dvb/dvb-usb/gp8psk.c b/drivers/media/dvb/dvb-usb/gp8psk.c index 5f71284703d0..5d0384dd45b5 100644 --- a/drivers/media/dvb/dvb-usb/gp8psk.c +++ b/drivers/media/dvb/dvb-usb/gp8psk.c | |||
@@ -320,26 +320,7 @@ static struct usb_driver gp8psk_usb_driver = { | |||
320 | .id_table = gp8psk_usb_table, | 320 | .id_table = gp8psk_usb_table, |
321 | }; | 321 | }; |
322 | 322 | ||
323 | /* module stuff */ | 323 | module_usb_driver(gp8psk_usb_driver); |
324 | static int __init gp8psk_usb_module_init(void) | ||
325 | { | ||
326 | int result; | ||
327 | if ((result = usb_register(&gp8psk_usb_driver))) { | ||
328 | err("usb_register failed. (%d)",result); | ||
329 | return result; | ||
330 | } | ||
331 | |||
332 | return 0; | ||
333 | } | ||
334 | |||
335 | static void __exit gp8psk_usb_module_exit(void) | ||
336 | { | ||
337 | /* deregister this driver from the USB subsystem */ | ||
338 | usb_deregister(&gp8psk_usb_driver); | ||
339 | } | ||
340 | |||
341 | module_init(gp8psk_usb_module_init); | ||
342 | module_exit(gp8psk_usb_module_exit); | ||
343 | 324 | ||
344 | MODULE_AUTHOR("Alan Nisota <alannisota@gamil.com>"); | 325 | MODULE_AUTHOR("Alan Nisota <alannisota@gamil.com>"); |
345 | MODULE_DESCRIPTION("Driver for Genpix DVB-S"); | 326 | MODULE_DESCRIPTION("Driver for Genpix DVB-S"); |
diff --git a/drivers/media/dvb/dvb-usb/it913x.c b/drivers/media/dvb/dvb-usb/it913x.c index c46226187143..67094b879bb4 100644 --- a/drivers/media/dvb/dvb-usb/it913x.c +++ b/drivers/media/dvb/dvb-usb/it913x.c | |||
@@ -675,26 +675,7 @@ static struct usb_driver it913x_driver = { | |||
675 | .id_table = it913x_table, | 675 | .id_table = it913x_table, |
676 | }; | 676 | }; |
677 | 677 | ||
678 | /* module stuff */ | 678 | module_usb_driver(it913x_driver); |
679 | static int __init it913x_module_init(void) | ||
680 | { | ||
681 | int result = usb_register(&it913x_driver); | ||
682 | if (result) { | ||
683 | err("usb_register failed. Error number %d", result); | ||
684 | return result; | ||
685 | } | ||
686 | |||
687 | return 0; | ||
688 | } | ||
689 | |||
690 | static void __exit it913x_module_exit(void) | ||
691 | { | ||
692 | /* deregister this driver from the USB subsystem */ | ||
693 | usb_deregister(&it913x_driver); | ||
694 | } | ||
695 | |||
696 | module_init(it913x_module_init); | ||
697 | module_exit(it913x_module_exit); | ||
698 | 679 | ||
699 | MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>"); | 680 | MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>"); |
700 | MODULE_DESCRIPTION("it913x USB 2 Driver"); | 681 | MODULE_DESCRIPTION("it913x USB 2 Driver"); |
diff --git a/drivers/media/dvb/dvb-usb/lmedm04.c b/drivers/media/dvb/dvb-usb/lmedm04.c index b9228240f5ce..1a876a65ed56 100644 --- a/drivers/media/dvb/dvb-usb/lmedm04.c +++ b/drivers/media/dvb/dvb-usb/lmedm04.c | |||
@@ -1289,26 +1289,7 @@ static struct usb_driver lme2510_driver = { | |||
1289 | .id_table = lme2510_table, | 1289 | .id_table = lme2510_table, |
1290 | }; | 1290 | }; |
1291 | 1291 | ||
1292 | /* module stuff */ | 1292 | module_usb_driver(lme2510_driver); |
1293 | static int __init lme2510_module_init(void) | ||
1294 | { | ||
1295 | int result = usb_register(&lme2510_driver); | ||
1296 | if (result) { | ||
1297 | err("usb_register failed. Error number %d", result); | ||
1298 | return result; | ||
1299 | } | ||
1300 | |||
1301 | return 0; | ||
1302 | } | ||
1303 | |||
1304 | static void __exit lme2510_module_exit(void) | ||
1305 | { | ||
1306 | /* deregister this driver from the USB subsystem */ | ||
1307 | usb_deregister(&lme2510_driver); | ||
1308 | } | ||
1309 | |||
1310 | module_init(lme2510_module_init); | ||
1311 | module_exit(lme2510_module_exit); | ||
1312 | 1293 | ||
1313 | MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>"); | 1294 | MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>"); |
1314 | MODULE_DESCRIPTION("LME2510(C) DVB-S USB2.0"); | 1295 | MODULE_DESCRIPTION("LME2510(C) DVB-S USB2.0"); |
diff --git a/drivers/media/dvb/dvb-usb/m920x.c b/drivers/media/dvb/dvb-usb/m920x.c index a1e1287c949e..288af29a8bb7 100644 --- a/drivers/media/dvb/dvb-usb/m920x.c +++ b/drivers/media/dvb/dvb-usb/m920x.c | |||
@@ -1086,27 +1086,7 @@ static struct usb_driver m920x_driver = { | |||
1086 | .id_table = m920x_table, | 1086 | .id_table = m920x_table, |
1087 | }; | 1087 | }; |
1088 | 1088 | ||
1089 | /* module stuff */ | 1089 | module_usb_driver(m920x_driver); |
1090 | static int __init m920x_module_init(void) | ||
1091 | { | ||
1092 | int ret; | ||
1093 | |||
1094 | if ((ret = usb_register(&m920x_driver))) { | ||
1095 | err("usb_register failed. Error number %d", ret); | ||
1096 | return ret; | ||
1097 | } | ||
1098 | |||
1099 | return 0; | ||
1100 | } | ||
1101 | |||
1102 | static void __exit m920x_module_exit(void) | ||
1103 | { | ||
1104 | /* deregister this driver from the USB subsystem */ | ||
1105 | usb_deregister(&m920x_driver); | ||
1106 | } | ||
1107 | |||
1108 | module_init (m920x_module_init); | ||
1109 | module_exit (m920x_module_exit); | ||
1110 | 1090 | ||
1111 | MODULE_AUTHOR("Aapo Tahkola <aet@rasterburn.org>"); | 1091 | MODULE_AUTHOR("Aapo Tahkola <aet@rasterburn.org>"); |
1112 | MODULE_DESCRIPTION("DVB Driver for ULI M920x"); | 1092 | MODULE_DESCRIPTION("DVB Driver for ULI M920x"); |
diff --git a/drivers/media/dvb/dvb-usb/mxl111sf.c b/drivers/media/dvb/dvb-usb/mxl111sf.c index b5c98da5d9e2..825a8b242e09 100644 --- a/drivers/media/dvb/dvb-usb/mxl111sf.c +++ b/drivers/media/dvb/dvb-usb/mxl111sf.c | |||
@@ -1055,24 +1055,7 @@ static struct usb_driver mxl111sf_driver = { | |||
1055 | .id_table = mxl111sf_table, | 1055 | .id_table = mxl111sf_table, |
1056 | }; | 1056 | }; |
1057 | 1057 | ||
1058 | static int __init mxl111sf_module_init(void) | 1058 | module_usb_driver(mxl111sf_driver); |
1059 | { | ||
1060 | int result = usb_register(&mxl111sf_driver); | ||
1061 | if (result) { | ||
1062 | err("usb_register failed. Error number %d", result); | ||
1063 | return result; | ||
1064 | } | ||
1065 | |||
1066 | return 0; | ||
1067 | } | ||
1068 | |||
1069 | static void __exit mxl111sf_module_exit(void) | ||
1070 | { | ||
1071 | usb_deregister(&mxl111sf_driver); | ||
1072 | } | ||
1073 | |||
1074 | module_init(mxl111sf_module_init); | ||
1075 | module_exit(mxl111sf_module_exit); | ||
1076 | 1059 | ||
1077 | MODULE_AUTHOR("Michael Krufky <mkrufky@kernellabs.com>"); | 1060 | MODULE_AUTHOR("Michael Krufky <mkrufky@kernellabs.com>"); |
1078 | MODULE_DESCRIPTION("Driver for MaxLinear MxL111SF"); | 1061 | MODULE_DESCRIPTION("Driver for MaxLinear MxL111SF"); |
diff --git a/drivers/media/dvb/dvb-usb/nova-t-usb2.c b/drivers/media/dvb/dvb-usb/nova-t-usb2.c index 21384da6570e..6c55384e2fca 100644 --- a/drivers/media/dvb/dvb-usb/nova-t-usb2.c +++ b/drivers/media/dvb/dvb-usb/nova-t-usb2.c | |||
@@ -225,26 +225,7 @@ static struct usb_driver nova_t_driver = { | |||
225 | .id_table = nova_t_table, | 225 | .id_table = nova_t_table, |
226 | }; | 226 | }; |
227 | 227 | ||
228 | /* module stuff */ | 228 | module_usb_driver(nova_t_driver); |
229 | static int __init nova_t_module_init(void) | ||
230 | { | ||
231 | int result; | ||
232 | if ((result = usb_register(&nova_t_driver))) { | ||
233 | err("usb_register failed. Error number %d",result); | ||
234 | return result; | ||
235 | } | ||
236 | |||
237 | return 0; | ||
238 | } | ||
239 | |||
240 | static void __exit nova_t_module_exit(void) | ||
241 | { | ||
242 | /* deregister this driver from the USB subsystem */ | ||
243 | usb_deregister(&nova_t_driver); | ||
244 | } | ||
245 | |||
246 | module_init (nova_t_module_init); | ||
247 | module_exit (nova_t_module_exit); | ||
248 | 229 | ||
249 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); | 230 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); |
250 | MODULE_DESCRIPTION("Hauppauge WinTV-NOVA-T usb2"); | 231 | MODULE_DESCRIPTION("Hauppauge WinTV-NOVA-T usb2"); |
diff --git a/drivers/media/dvb/dvb-usb/opera1.c b/drivers/media/dvb/dvb-usb/opera1.c index 98fd9a6092b7..c8a95042dfbc 100644 --- a/drivers/media/dvb/dvb-usb/opera1.c +++ b/drivers/media/dvb/dvb-usb/opera1.c | |||
@@ -574,22 +574,7 @@ static struct usb_driver opera1_driver = { | |||
574 | .id_table = opera1_table, | 574 | .id_table = opera1_table, |
575 | }; | 575 | }; |
576 | 576 | ||
577 | static int __init opera1_module_init(void) | 577 | module_usb_driver(opera1_driver); |
578 | { | ||
579 | int result = 0; | ||
580 | if ((result = usb_register(&opera1_driver))) { | ||
581 | err("usb_register failed. Error number %d", result); | ||
582 | } | ||
583 | return result; | ||
584 | } | ||
585 | |||
586 | static void __exit opera1_module_exit(void) | ||
587 | { | ||
588 | usb_deregister(&opera1_driver); | ||
589 | } | ||
590 | |||
591 | module_init(opera1_module_init); | ||
592 | module_exit(opera1_module_exit); | ||
593 | 578 | ||
594 | MODULE_AUTHOR("Mario Hlawitschka (c) dh1pa@amsat.org"); | 579 | MODULE_AUTHOR("Mario Hlawitschka (c) dh1pa@amsat.org"); |
595 | MODULE_AUTHOR("Marco Gittler (c) g.marco@freenet.de"); | 580 | MODULE_AUTHOR("Marco Gittler (c) g.marco@freenet.de"); |
diff --git a/drivers/media/dvb/dvb-usb/pctv452e.c b/drivers/media/dvb/dvb-usb/pctv452e.c index f9aec5cb6e77..f526eb05cc7a 100644 --- a/drivers/media/dvb/dvb-usb/pctv452e.c +++ b/drivers/media/dvb/dvb-usb/pctv452e.c | |||
@@ -1055,22 +1055,7 @@ static struct usb_driver pctv452e_usb_driver = { | |||
1055 | .id_table = pctv452e_usb_table, | 1055 | .id_table = pctv452e_usb_table, |
1056 | }; | 1056 | }; |
1057 | 1057 | ||
1058 | static int __init pctv452e_usb_init(void) | 1058 | module_usb_driver(pctv452e_usb_driver); |
1059 | { | ||
1060 | int ret = usb_register(&pctv452e_usb_driver); | ||
1061 | if (ret) | ||
1062 | err("%s: usb_register failed! Error %d", __FILE__, ret); | ||
1063 | |||
1064 | return ret; | ||
1065 | } | ||
1066 | |||
1067 | static void __exit pctv452e_usb_exit(void) | ||
1068 | { | ||
1069 | usb_deregister(&pctv452e_usb_driver); | ||
1070 | } | ||
1071 | |||
1072 | module_init(pctv452e_usb_init); | ||
1073 | module_exit(pctv452e_usb_exit); | ||
1074 | 1059 | ||
1075 | MODULE_AUTHOR("Dominik Kuhlen <dkuhlen@gmx.net>"); | 1060 | MODULE_AUTHOR("Dominik Kuhlen <dkuhlen@gmx.net>"); |
1076 | MODULE_AUTHOR("Andre Weidemann <Andre.Weidemann@web.de>"); | 1061 | MODULE_AUTHOR("Andre Weidemann <Andre.Weidemann@web.de>"); |
diff --git a/drivers/media/dvb/dvb-usb/technisat-usb2.c b/drivers/media/dvb/dvb-usb/technisat-usb2.c index 0998fe961950..acefaa89cc53 100644 --- a/drivers/media/dvb/dvb-usb/technisat-usb2.c +++ b/drivers/media/dvb/dvb-usb/technisat-usb2.c | |||
@@ -781,25 +781,7 @@ static struct usb_driver technisat_usb2_driver = { | |||
781 | .id_table = technisat_usb2_id_table, | 781 | .id_table = technisat_usb2_id_table, |
782 | }; | 782 | }; |
783 | 783 | ||
784 | /* module stuff */ | 784 | module_usb_driver(technisat_usb2_driver); |
785 | static int __init technisat_usb2_module_init(void) | ||
786 | { | ||
787 | int result = usb_register(&technisat_usb2_driver); | ||
788 | if (result) { | ||
789 | err("usb_register failed. Code %d", result); | ||
790 | return result; | ||
791 | } | ||
792 | |||
793 | return 0; | ||
794 | } | ||
795 | |||
796 | static void __exit technisat_usb2_module_exit(void) | ||
797 | { | ||
798 | usb_deregister(&technisat_usb2_driver); | ||
799 | } | ||
800 | |||
801 | module_init(technisat_usb2_module_init); | ||
802 | module_exit(technisat_usb2_module_exit); | ||
803 | 785 | ||
804 | MODULE_AUTHOR("Patrick Boettcher <pboettcher@kernellabs.com>"); | 786 | MODULE_AUTHOR("Patrick Boettcher <pboettcher@kernellabs.com>"); |
805 | MODULE_DESCRIPTION("Driver for Technisat DVB-S/S2 USB 2.0 device"); | 787 | MODULE_DESCRIPTION("Driver for Technisat DVB-S/S2 USB 2.0 device"); |
diff --git a/drivers/media/dvb/dvb-usb/ttusb2.c b/drivers/media/dvb/dvb-usb/ttusb2.c index ea4eab8b3965..56acf8e55d50 100644 --- a/drivers/media/dvb/dvb-usb/ttusb2.c +++ b/drivers/media/dvb/dvb-usb/ttusb2.c | |||
@@ -799,26 +799,7 @@ static struct usb_driver ttusb2_driver = { | |||
799 | .id_table = ttusb2_table, | 799 | .id_table = ttusb2_table, |
800 | }; | 800 | }; |
801 | 801 | ||
802 | /* module stuff */ | 802 | module_usb_driver(ttusb2_driver); |
803 | static int __init ttusb2_module_init(void) | ||
804 | { | ||
805 | int result; | ||
806 | if ((result = usb_register(&ttusb2_driver))) { | ||
807 | err("usb_register failed. Error number %d",result); | ||
808 | return result; | ||
809 | } | ||
810 | |||
811 | return 0; | ||
812 | } | ||
813 | |||
814 | static void __exit ttusb2_module_exit(void) | ||
815 | { | ||
816 | /* deregister this driver from the USB subsystem */ | ||
817 | usb_deregister(&ttusb2_driver); | ||
818 | } | ||
819 | |||
820 | module_init (ttusb2_module_init); | ||
821 | module_exit (ttusb2_module_exit); | ||
822 | 803 | ||
823 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); | 804 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); |
824 | MODULE_DESCRIPTION("Driver for Pinnacle PCTV 400e DVB-S USB2.0"); | 805 | MODULE_DESCRIPTION("Driver for Pinnacle PCTV 400e DVB-S USB2.0"); |
diff --git a/drivers/media/dvb/dvb-usb/umt-010.c b/drivers/media/dvb/dvb-usb/umt-010.c index 463673a5c2b2..9b042292e788 100644 --- a/drivers/media/dvb/dvb-usb/umt-010.c +++ b/drivers/media/dvb/dvb-usb/umt-010.c | |||
@@ -143,26 +143,7 @@ static struct usb_driver umt_driver = { | |||
143 | .id_table = umt_table, | 143 | .id_table = umt_table, |
144 | }; | 144 | }; |
145 | 145 | ||
146 | /* module stuff */ | 146 | module_usb_driver(umt_driver); |
147 | static int __init umt_module_init(void) | ||
148 | { | ||
149 | int result; | ||
150 | if ((result = usb_register(&umt_driver))) { | ||
151 | err("usb_register failed. Error number %d",result); | ||
152 | return result; | ||
153 | } | ||
154 | |||
155 | return 0; | ||
156 | } | ||
157 | |||
158 | static void __exit umt_module_exit(void) | ||
159 | { | ||
160 | /* deregister this driver from the USB subsystem */ | ||
161 | usb_deregister(&umt_driver); | ||
162 | } | ||
163 | |||
164 | module_init (umt_module_init); | ||
165 | module_exit (umt_module_exit); | ||
166 | 147 | ||
167 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); | 148 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); |
168 | MODULE_DESCRIPTION("Driver for HanfTek UMT 010 USB2.0 DVB-T device"); | 149 | MODULE_DESCRIPTION("Driver for HanfTek UMT 010 USB2.0 DVB-T device"); |
diff --git a/drivers/media/dvb/dvb-usb/vp702x.c b/drivers/media/dvb/dvb-usb/vp702x.c index 45e31f224814..07c673a6e764 100644 --- a/drivers/media/dvb/dvb-usb/vp702x.c +++ b/drivers/media/dvb/dvb-usb/vp702x.c | |||
@@ -436,26 +436,7 @@ static struct usb_driver vp702x_usb_driver = { | |||
436 | .id_table = vp702x_usb_table, | 436 | .id_table = vp702x_usb_table, |
437 | }; | 437 | }; |
438 | 438 | ||
439 | /* module stuff */ | 439 | module_usb_driver(vp702x_usb_driver); |
440 | static int __init vp702x_usb_module_init(void) | ||
441 | { | ||
442 | int result; | ||
443 | if ((result = usb_register(&vp702x_usb_driver))) { | ||
444 | err("usb_register failed. (%d)",result); | ||
445 | return result; | ||
446 | } | ||
447 | |||
448 | return 0; | ||
449 | } | ||
450 | |||
451 | static void __exit vp702x_usb_module_exit(void) | ||
452 | { | ||
453 | /* deregister this driver from the USB subsystem */ | ||
454 | usb_deregister(&vp702x_usb_driver); | ||
455 | } | ||
456 | |||
457 | module_init(vp702x_usb_module_init); | ||
458 | module_exit(vp702x_usb_module_exit); | ||
459 | 440 | ||
460 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); | 441 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); |
461 | MODULE_DESCRIPTION("Driver for Twinhan StarBox DVB-S USB2.0 and clones"); | 442 | MODULE_DESCRIPTION("Driver for Twinhan StarBox DVB-S USB2.0 and clones"); |
diff --git a/drivers/media/dvb/dvb-usb/vp7045.c b/drivers/media/dvb/dvb-usb/vp7045.c index 90873af5682e..d750724132ee 100644 --- a/drivers/media/dvb/dvb-usb/vp7045.c +++ b/drivers/media/dvb/dvb-usb/vp7045.c | |||
@@ -294,26 +294,7 @@ static struct usb_driver vp7045_usb_driver = { | |||
294 | .id_table = vp7045_usb_table, | 294 | .id_table = vp7045_usb_table, |
295 | }; | 295 | }; |
296 | 296 | ||
297 | /* module stuff */ | 297 | module_usb_driver(vp7045_usb_driver); |
298 | static int __init vp7045_usb_module_init(void) | ||
299 | { | ||
300 | int result; | ||
301 | if ((result = usb_register(&vp7045_usb_driver))) { | ||
302 | err("usb_register failed. (%d)",result); | ||
303 | return result; | ||
304 | } | ||
305 | |||
306 | return 0; | ||
307 | } | ||
308 | |||
309 | static void __exit vp7045_usb_module_exit(void) | ||
310 | { | ||
311 | /* deregister this driver from the USB subsystem */ | ||
312 | usb_deregister(&vp7045_usb_driver); | ||
313 | } | ||
314 | |||
315 | module_init(vp7045_usb_module_init); | ||
316 | module_exit(vp7045_usb_module_exit); | ||
317 | 298 | ||
318 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); | 299 | MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>"); |
319 | MODULE_DESCRIPTION("Driver for Twinhan MagicBox/Alpha and DNTV tinyUSB2 DVB-T USB2.0"); | 300 | MODULE_DESCRIPTION("Driver for Twinhan MagicBox/Alpha and DNTV tinyUSB2 DVB-T USB2.0"); |
diff --git a/drivers/media/dvb/siano/smsusb.c b/drivers/media/dvb/siano/smsusb.c index 51c7121b321a..b1fe5137df09 100644 --- a/drivers/media/dvb/siano/smsusb.c +++ b/drivers/media/dvb/siano/smsusb.c | |||
@@ -557,26 +557,7 @@ static struct usb_driver smsusb_driver = { | |||
557 | .resume = smsusb_resume, | 557 | .resume = smsusb_resume, |
558 | }; | 558 | }; |
559 | 559 | ||
560 | static int __init smsusb_module_init(void) | 560 | module_usb_driver(smsusb_driver); |
561 | { | ||
562 | int rc = usb_register(&smsusb_driver); | ||
563 | if (rc) | ||
564 | sms_err("usb_register failed. Error number %d", rc); | ||
565 | |||
566 | sms_debug(""); | ||
567 | |||
568 | return rc; | ||
569 | } | ||
570 | |||
571 | static void __exit smsusb_module_exit(void) | ||
572 | { | ||
573 | /* Regular USB Cleanup */ | ||
574 | usb_deregister(&smsusb_driver); | ||
575 | sms_info("end"); | ||
576 | } | ||
577 | |||
578 | module_init(smsusb_module_init); | ||
579 | module_exit(smsusb_module_exit); | ||
580 | 561 | ||
581 | MODULE_DESCRIPTION("Driver for the Siano SMS1xxx USB dongle"); | 562 | MODULE_DESCRIPTION("Driver for the Siano SMS1xxx USB dongle"); |
582 | MODULE_AUTHOR("Siano Mobile Silicon, INC. (uris@siano-ms.com)"); | 563 | MODULE_AUTHOR("Siano Mobile Silicon, INC. (uris@siano-ms.com)"); |
diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c index 420bb42d5233..e90192fdde11 100644 --- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c +++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | |||
@@ -1794,26 +1794,7 @@ static struct usb_driver ttusb_driver = { | |||
1794 | .id_table = ttusb_table, | 1794 | .id_table = ttusb_table, |
1795 | }; | 1795 | }; |
1796 | 1796 | ||
1797 | static int __init ttusb_init(void) | 1797 | module_usb_driver(ttusb_driver); |
1798 | { | ||
1799 | int err; | ||
1800 | |||
1801 | if ((err = usb_register(&ttusb_driver)) < 0) { | ||
1802 | printk("%s: usb_register failed! Error number %d", | ||
1803 | __FILE__, err); | ||
1804 | return err; | ||
1805 | } | ||
1806 | |||
1807 | return 0; | ||
1808 | } | ||
1809 | |||
1810 | static void __exit ttusb_exit(void) | ||
1811 | { | ||
1812 | usb_deregister(&ttusb_driver); | ||
1813 | } | ||
1814 | |||
1815 | module_init(ttusb_init); | ||
1816 | module_exit(ttusb_exit); | ||
1817 | 1798 | ||
1818 | MODULE_AUTHOR("Holger Waechtler <holger@convergence.de>"); | 1799 | MODULE_AUTHOR("Holger Waechtler <holger@convergence.de>"); |
1819 | MODULE_DESCRIPTION("TTUSB DVB Driver"); | 1800 | MODULE_DESCRIPTION("TTUSB DVB Driver"); |
diff --git a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c index f893bffa08a3..504c81230339 100644 --- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c +++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c | |||
@@ -1756,26 +1756,7 @@ static struct usb_driver ttusb_dec_driver = { | |||
1756 | .id_table = ttusb_dec_table, | 1756 | .id_table = ttusb_dec_table, |
1757 | }; | 1757 | }; |
1758 | 1758 | ||
1759 | static int __init ttusb_dec_init(void) | 1759 | module_usb_driver(ttusb_dec_driver); |
1760 | { | ||
1761 | int result; | ||
1762 | |||
1763 | if ((result = usb_register(&ttusb_dec_driver)) < 0) { | ||
1764 | printk("%s: initialisation failed: error %d.\n", __func__, | ||
1765 | result); | ||
1766 | return result; | ||
1767 | } | ||
1768 | |||
1769 | return 0; | ||
1770 | } | ||
1771 | |||
1772 | static void __exit ttusb_dec_exit(void) | ||
1773 | { | ||
1774 | usb_deregister(&ttusb_dec_driver); | ||
1775 | } | ||
1776 | |||
1777 | module_init(ttusb_dec_init); | ||
1778 | module_exit(ttusb_dec_exit); | ||
1779 | 1760 | ||
1780 | MODULE_AUTHOR("Alex Woods <linux-dvb@giblets.org>"); | 1761 | MODULE_AUTHOR("Alex Woods <linux-dvb@giblets.org>"); |
1781 | MODULE_DESCRIPTION(DRIVER_NAME); | 1762 | MODULE_DESCRIPTION(DRIVER_NAME); |
diff --git a/drivers/media/radio/dsbr100.c b/drivers/media/radio/dsbr100.c index 25e58cbf35f0..f36905b63645 100644 --- a/drivers/media/radio/dsbr100.c +++ b/drivers/media/radio/dsbr100.c | |||
@@ -624,21 +624,7 @@ static int usb_dsbr100_probe(struct usb_interface *intf, | |||
624 | return 0; | 624 | return 0; |
625 | } | 625 | } |
626 | 626 | ||
627 | static int __init dsbr100_init(void) | 627 | module_usb_driver(usb_dsbr100_driver); |
628 | { | ||
629 | int retval = usb_register(&usb_dsbr100_driver); | ||
630 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
631 | DRIVER_DESC "\n"); | ||
632 | return retval; | ||
633 | } | ||
634 | |||
635 | static void __exit dsbr100_exit(void) | ||
636 | { | ||
637 | usb_deregister(&usb_dsbr100_driver); | ||
638 | } | ||
639 | |||
640 | module_init (dsbr100_init); | ||
641 | module_exit (dsbr100_exit); | ||
642 | 628 | ||
643 | MODULE_AUTHOR( DRIVER_AUTHOR ); | 629 | MODULE_AUTHOR( DRIVER_AUTHOR ); |
644 | MODULE_DESCRIPTION( DRIVER_DESC ); | 630 | MODULE_DESCRIPTION( DRIVER_DESC ); |
diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c index 1742bd8110bd..a860a72a58ec 100644 --- a/drivers/media/radio/radio-mr800.c +++ b/drivers/media/radio/radio-mr800.c | |||
@@ -659,25 +659,4 @@ err: | |||
659 | return retval; | 659 | return retval; |
660 | } | 660 | } |
661 | 661 | ||
662 | static int __init amradio_init(void) | 662 | module_usb_driver(usb_amradio_driver); |
663 | { | ||
664 | int retval = usb_register(&usb_amradio_driver); | ||
665 | |||
666 | pr_info(KBUILD_MODNAME | ||
667 | ": version " DRIVER_VERSION " " DRIVER_DESC "\n"); | ||
668 | |||
669 | if (retval) | ||
670 | pr_err(KBUILD_MODNAME | ||
671 | ": usb_register failed. Error number %d\n", retval); | ||
672 | |||
673 | return retval; | ||
674 | } | ||
675 | |||
676 | static void __exit amradio_exit(void) | ||
677 | { | ||
678 | usb_deregister(&usb_amradio_driver); | ||
679 | } | ||
680 | |||
681 | module_init(amradio_init); | ||
682 | module_exit(amradio_exit); | ||
683 | |||
diff --git a/drivers/media/radio/si470x/radio-si470x-usb.c b/drivers/media/radio/si470x/radio-si470x-usb.c index a6ad707fae96..b7debb67932a 100644 --- a/drivers/media/radio/si470x/radio-si470x-usb.c +++ b/drivers/media/radio/si470x/radio-si470x-usb.c | |||
@@ -861,33 +861,7 @@ static struct usb_driver si470x_usb_driver = { | |||
861 | .supports_autosuspend = 1, | 861 | .supports_autosuspend = 1, |
862 | }; | 862 | }; |
863 | 863 | ||
864 | 864 | module_usb_driver(si470x_usb_driver); | |
865 | |||
866 | /************************************************************************** | ||
867 | * Module Interface | ||
868 | **************************************************************************/ | ||
869 | |||
870 | /* | ||
871 | * si470x_module_init - module init | ||
872 | */ | ||
873 | static int __init si470x_module_init(void) | ||
874 | { | ||
875 | printk(KERN_INFO DRIVER_DESC ", Version " DRIVER_VERSION "\n"); | ||
876 | return usb_register(&si470x_usb_driver); | ||
877 | } | ||
878 | |||
879 | |||
880 | /* | ||
881 | * si470x_module_exit - module exit | ||
882 | */ | ||
883 | static void __exit si470x_module_exit(void) | ||
884 | { | ||
885 | usb_deregister(&si470x_usb_driver); | ||
886 | } | ||
887 | |||
888 | |||
889 | module_init(si470x_module_init); | ||
890 | module_exit(si470x_module_exit); | ||
891 | 865 | ||
892 | MODULE_LICENSE("GPL"); | 866 | MODULE_LICENSE("GPL"); |
893 | MODULE_AUTHOR(DRIVER_AUTHOR); | 867 | MODULE_AUTHOR(DRIVER_AUTHOR); |
diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c index 01bb8daf4b09..baf907b3ce76 100644 --- a/drivers/media/rc/ati_remote.c +++ b/drivers/media/rc/ati_remote.c | |||
@@ -899,38 +899,7 @@ static void ati_remote_disconnect(struct usb_interface *interface) | |||
899 | kfree(ati_remote); | 899 | kfree(ati_remote); |
900 | } | 900 | } |
901 | 901 | ||
902 | /* | 902 | module_usb_driver(ati_remote_driver); |
903 | * ati_remote_init | ||
904 | */ | ||
905 | static int __init ati_remote_init(void) | ||
906 | { | ||
907 | int result; | ||
908 | |||
909 | result = usb_register(&ati_remote_driver); | ||
910 | if (result) | ||
911 | printk(KERN_ERR KBUILD_MODNAME | ||
912 | ": usb_register error #%d\n", result); | ||
913 | else | ||
914 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
915 | DRIVER_DESC "\n"); | ||
916 | |||
917 | return result; | ||
918 | } | ||
919 | |||
920 | /* | ||
921 | * ati_remote_exit | ||
922 | */ | ||
923 | static void __exit ati_remote_exit(void) | ||
924 | { | ||
925 | usb_deregister(&ati_remote_driver); | ||
926 | } | ||
927 | |||
928 | /* | ||
929 | * module specification | ||
930 | */ | ||
931 | |||
932 | module_init(ati_remote_init); | ||
933 | module_exit(ati_remote_exit); | ||
934 | 903 | ||
935 | MODULE_AUTHOR(DRIVER_AUTHOR); | 904 | MODULE_AUTHOR(DRIVER_AUTHOR); |
936 | MODULE_DESCRIPTION(DRIVER_DESC); | 905 | MODULE_DESCRIPTION(DRIVER_DESC); |
diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index 6ed96465137a..3aeb29a7ce11 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c | |||
@@ -2458,23 +2458,4 @@ static int imon_resume(struct usb_interface *intf) | |||
2458 | return rc; | 2458 | return rc; |
2459 | } | 2459 | } |
2460 | 2460 | ||
2461 | static int __init imon_init(void) | 2461 | module_usb_driver(imon_driver); |
2462 | { | ||
2463 | int rc; | ||
2464 | |||
2465 | rc = usb_register(&imon_driver); | ||
2466 | if (rc) { | ||
2467 | pr_err("usb register failed(%d)\n", rc); | ||
2468 | rc = -ENODEV; | ||
2469 | } | ||
2470 | |||
2471 | return rc; | ||
2472 | } | ||
2473 | |||
2474 | static void __exit imon_exit(void) | ||
2475 | { | ||
2476 | usb_deregister(&imon_driver); | ||
2477 | } | ||
2478 | |||
2479 | module_init(imon_init); | ||
2480 | module_exit(imon_exit); | ||
diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index 60d3c1e09712..20bb12d6fbbe 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c | |||
@@ -1448,25 +1448,7 @@ static struct usb_driver mceusb_dev_driver = { | |||
1448 | .id_table = mceusb_dev_table | 1448 | .id_table = mceusb_dev_table |
1449 | }; | 1449 | }; |
1450 | 1450 | ||
1451 | static int __init mceusb_dev_init(void) | 1451 | module_usb_driver(mceusb_dev_driver); |
1452 | { | ||
1453 | int ret; | ||
1454 | |||
1455 | ret = usb_register(&mceusb_dev_driver); | ||
1456 | if (ret < 0) | ||
1457 | printk(KERN_ERR DRIVER_NAME | ||
1458 | ": usb register failed, result = %d\n", ret); | ||
1459 | |||
1460 | return ret; | ||
1461 | } | ||
1462 | |||
1463 | static void __exit mceusb_dev_exit(void) | ||
1464 | { | ||
1465 | usb_deregister(&mceusb_dev_driver); | ||
1466 | } | ||
1467 | |||
1468 | module_init(mceusb_dev_init); | ||
1469 | module_exit(mceusb_dev_exit); | ||
1470 | 1452 | ||
1471 | MODULE_DESCRIPTION(DRIVER_DESC); | 1453 | MODULE_DESCRIPTION(DRIVER_DESC); |
1472 | MODULE_AUTHOR(DRIVER_AUTHOR); | 1454 | MODULE_AUTHOR(DRIVER_AUTHOR); |
diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c index 61287fcca61a..07322fb75eff 100644 --- a/drivers/media/rc/redrat3.c +++ b/drivers/media/rc/redrat3.c | |||
@@ -1300,25 +1300,7 @@ static struct usb_driver redrat3_dev_driver = { | |||
1300 | .id_table = redrat3_dev_table | 1300 | .id_table = redrat3_dev_table |
1301 | }; | 1301 | }; |
1302 | 1302 | ||
1303 | static int __init redrat3_dev_init(void) | 1303 | module_usb_driver(redrat3_dev_driver); |
1304 | { | ||
1305 | int ret; | ||
1306 | |||
1307 | ret = usb_register(&redrat3_dev_driver); | ||
1308 | if (ret < 0) | ||
1309 | pr_err(DRIVER_NAME | ||
1310 | ": usb register failed, result = %d\n", ret); | ||
1311 | |||
1312 | return ret; | ||
1313 | } | ||
1314 | |||
1315 | static void __exit redrat3_dev_exit(void) | ||
1316 | { | ||
1317 | usb_deregister(&redrat3_dev_driver); | ||
1318 | } | ||
1319 | |||
1320 | module_init(redrat3_dev_init); | ||
1321 | module_exit(redrat3_dev_exit); | ||
1322 | 1304 | ||
1323 | MODULE_DESCRIPTION(DRIVER_DESC); | 1305 | MODULE_DESCRIPTION(DRIVER_DESC); |
1324 | MODULE_AUTHOR(DRIVER_AUTHOR); | 1306 | MODULE_AUTHOR(DRIVER_AUTHOR); |
diff --git a/drivers/media/rc/streamzap.c b/drivers/media/rc/streamzap.c index e435d94c0776..b1d29d09eeae 100644 --- a/drivers/media/rc/streamzap.c +++ b/drivers/media/rc/streamzap.c | |||
@@ -523,33 +523,7 @@ static int streamzap_resume(struct usb_interface *intf) | |||
523 | return 0; | 523 | return 0; |
524 | } | 524 | } |
525 | 525 | ||
526 | /** | 526 | module_usb_driver(streamzap_driver); |
527 | * streamzap_init | ||
528 | */ | ||
529 | static int __init streamzap_init(void) | ||
530 | { | ||
531 | int ret; | ||
532 | |||
533 | /* register this driver with the USB subsystem */ | ||
534 | ret = usb_register(&streamzap_driver); | ||
535 | if (ret < 0) | ||
536 | printk(KERN_ERR DRIVER_NAME ": usb register failed, " | ||
537 | "result = %d\n", ret); | ||
538 | |||
539 | return ret; | ||
540 | } | ||
541 | |||
542 | /** | ||
543 | * streamzap_exit | ||
544 | */ | ||
545 | static void __exit streamzap_exit(void) | ||
546 | { | ||
547 | usb_deregister(&streamzap_driver); | ||
548 | } | ||
549 | |||
550 | |||
551 | module_init(streamzap_init); | ||
552 | module_exit(streamzap_exit); | ||
553 | 527 | ||
554 | MODULE_AUTHOR("Jarod Wilson <jarod@wilsonet.com>"); | 528 | MODULE_AUTHOR("Jarod Wilson <jarod@wilsonet.com>"); |
555 | MODULE_DESCRIPTION(DRIVER_DESC); | 529 | MODULE_DESCRIPTION(DRIVER_DESC); |
diff --git a/drivers/media/video/cx231xx/cx231xx-cards.c b/drivers/media/video/cx231xx/cx231xx-cards.c index 53dae2a8272d..60b021e79864 100644 --- a/drivers/media/video/cx231xx/cx231xx-cards.c +++ b/drivers/media/video/cx231xx/cx231xx-cards.c | |||
@@ -1385,26 +1385,4 @@ static struct usb_driver cx231xx_usb_driver = { | |||
1385 | .id_table = cx231xx_id_table, | 1385 | .id_table = cx231xx_id_table, |
1386 | }; | 1386 | }; |
1387 | 1387 | ||
1388 | static int __init cx231xx_module_init(void) | 1388 | module_usb_driver(cx231xx_usb_driver); |
1389 | { | ||
1390 | int result; | ||
1391 | |||
1392 | printk(KERN_INFO DRIVER_NAME " v4l2 driver loaded.\n"); | ||
1393 | |||
1394 | /* register this driver with the USB subsystem */ | ||
1395 | result = usb_register(&cx231xx_usb_driver); | ||
1396 | if (result) | ||
1397 | cx231xx_err(DRIVER_NAME | ||
1398 | " usb_register failed. Error number %d.\n", result); | ||
1399 | |||
1400 | return result; | ||
1401 | } | ||
1402 | |||
1403 | static void __exit cx231xx_module_exit(void) | ||
1404 | { | ||
1405 | /* deregister this driver with the USB subsystem */ | ||
1406 | usb_deregister(&cx231xx_usb_driver); | ||
1407 | } | ||
1408 | |||
1409 | module_init(cx231xx_module_init); | ||
1410 | module_exit(cx231xx_module_exit); | ||
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index 9b747c266afa..93807dcf944e 100644 --- a/drivers/media/video/em28xx/em28xx-cards.c +++ b/drivers/media/video/em28xx/em28xx-cards.c | |||
@@ -3325,26 +3325,4 @@ static struct usb_driver em28xx_usb_driver = { | |||
3325 | .id_table = em28xx_id_table, | 3325 | .id_table = em28xx_id_table, |
3326 | }; | 3326 | }; |
3327 | 3327 | ||
3328 | static int __init em28xx_module_init(void) | 3328 | module_usb_driver(em28xx_usb_driver); |
3329 | { | ||
3330 | int result; | ||
3331 | |||
3332 | /* register this driver with the USB subsystem */ | ||
3333 | result = usb_register(&em28xx_usb_driver); | ||
3334 | if (result) | ||
3335 | em28xx_err(DRIVER_NAME | ||
3336 | " usb_register failed. Error number %d.\n", result); | ||
3337 | |||
3338 | printk(KERN_INFO DRIVER_NAME " driver loaded\n"); | ||
3339 | |||
3340 | return result; | ||
3341 | } | ||
3342 | |||
3343 | static void __exit em28xx_module_exit(void) | ||
3344 | { | ||
3345 | /* deregister this driver with the USB subsystem */ | ||
3346 | usb_deregister(&em28xx_usb_driver); | ||
3347 | } | ||
3348 | |||
3349 | module_init(em28xx_module_init); | ||
3350 | module_exit(em28xx_module_exit); | ||
diff --git a/drivers/media/video/et61x251/et61x251_core.c b/drivers/media/video/et61x251/et61x251_core.c index d3777c86e1de..40f214ab924f 100644 --- a/drivers/media/video/et61x251/et61x251_core.c +++ b/drivers/media/video/et61x251/et61x251_core.c | |||
@@ -2680,27 +2680,4 @@ static struct usb_driver et61x251_usb_driver = { | |||
2680 | .disconnect = et61x251_usb_disconnect, | 2680 | .disconnect = et61x251_usb_disconnect, |
2681 | }; | 2681 | }; |
2682 | 2682 | ||
2683 | /*****************************************************************************/ | 2683 | module_usb_driver(et61x251_usb_driver); |
2684 | |||
2685 | static int __init et61x251_module_init(void) | ||
2686 | { | ||
2687 | int err = 0; | ||
2688 | |||
2689 | KDBG(2, ET61X251_MODULE_NAME " v" ET61X251_MODULE_VERSION); | ||
2690 | KDBG(3, ET61X251_MODULE_AUTHOR); | ||
2691 | |||
2692 | if ((err = usb_register(&et61x251_usb_driver))) | ||
2693 | KDBG(1, "usb_register() failed"); | ||
2694 | |||
2695 | return err; | ||
2696 | } | ||
2697 | |||
2698 | |||
2699 | static void __exit et61x251_module_exit(void) | ||
2700 | { | ||
2701 | usb_deregister(&et61x251_usb_driver); | ||
2702 | } | ||
2703 | |||
2704 | |||
2705 | module_init(et61x251_module_init); | ||
2706 | module_exit(et61x251_module_exit); | ||
diff --git a/drivers/media/video/gspca/benq.c b/drivers/media/video/gspca/benq.c index 6ae26160b81f..636627b57dc9 100644 --- a/drivers/media/video/gspca/benq.c +++ b/drivers/media/video/gspca/benq.c | |||
@@ -288,15 +288,4 @@ static struct usb_driver sd_driver = { | |||
288 | #endif | 288 | #endif |
289 | }; | 289 | }; |
290 | 290 | ||
291 | /* -- module insert / remove -- */ | 291 | module_usb_driver(sd_driver); |
292 | static int __init sd_mod_init(void) | ||
293 | { | ||
294 | return usb_register(&sd_driver); | ||
295 | } | ||
296 | static void __exit sd_mod_exit(void) | ||
297 | { | ||
298 | usb_deregister(&sd_driver); | ||
299 | } | ||
300 | |||
301 | module_init(sd_mod_init); | ||
302 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/conex.c b/drivers/media/video/gspca/conex.c index 4c56dbef6d92..ea17b5d94ea4 100644 --- a/drivers/media/video/gspca/conex.c +++ b/drivers/media/video/gspca/conex.c | |||
@@ -1067,15 +1067,4 @@ static struct usb_driver sd_driver = { | |||
1067 | #endif | 1067 | #endif |
1068 | }; | 1068 | }; |
1069 | 1069 | ||
1070 | /* -- module insert / remove -- */ | 1070 | module_usb_driver(sd_driver); |
1071 | static int __init sd_mod_init(void) | ||
1072 | { | ||
1073 | return usb_register(&sd_driver); | ||
1074 | } | ||
1075 | static void __exit sd_mod_exit(void) | ||
1076 | { | ||
1077 | usb_deregister(&sd_driver); | ||
1078 | } | ||
1079 | |||
1080 | module_init(sd_mod_init); | ||
1081 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/cpia1.c b/drivers/media/video/gspca/cpia1.c index f9b86b2484b0..8f33bbd091ad 100644 --- a/drivers/media/video/gspca/cpia1.c +++ b/drivers/media/video/gspca/cpia1.c | |||
@@ -2132,15 +2132,4 @@ static struct usb_driver sd_driver = { | |||
2132 | #endif | 2132 | #endif |
2133 | }; | 2133 | }; |
2134 | 2134 | ||
2135 | /* -- module insert / remove -- */ | 2135 | module_usb_driver(sd_driver); |
2136 | static int __init sd_mod_init(void) | ||
2137 | { | ||
2138 | return usb_register(&sd_driver); | ||
2139 | } | ||
2140 | static void __exit sd_mod_exit(void) | ||
2141 | { | ||
2142 | usb_deregister(&sd_driver); | ||
2143 | } | ||
2144 | |||
2145 | module_init(sd_mod_init); | ||
2146 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/etoms.c b/drivers/media/video/gspca/etoms.c index 0357d6d461d1..81a4adbd9f7c 100644 --- a/drivers/media/video/gspca/etoms.c +++ b/drivers/media/video/gspca/etoms.c | |||
@@ -895,16 +895,4 @@ static struct usb_driver sd_driver = { | |||
895 | #endif | 895 | #endif |
896 | }; | 896 | }; |
897 | 897 | ||
898 | /* -- module insert / remove -- */ | 898 | module_usb_driver(sd_driver); |
899 | static int __init sd_mod_init(void) | ||
900 | { | ||
901 | return usb_register(&sd_driver); | ||
902 | } | ||
903 | |||
904 | static void __exit sd_mod_exit(void) | ||
905 | { | ||
906 | usb_deregister(&sd_driver); | ||
907 | } | ||
908 | |||
909 | module_init(sd_mod_init); | ||
910 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/finepix.c b/drivers/media/video/gspca/finepix.c index ea48200fd3a0..0107513cd728 100644 --- a/drivers/media/video/gspca/finepix.c +++ b/drivers/media/video/gspca/finepix.c | |||
@@ -290,16 +290,4 @@ static struct usb_driver sd_driver = { | |||
290 | #endif | 290 | #endif |
291 | }; | 291 | }; |
292 | 292 | ||
293 | /* -- module insert / remove -- */ | 293 | module_usb_driver(sd_driver); |
294 | static int __init sd_mod_init(void) | ||
295 | { | ||
296 | return usb_register(&sd_driver); | ||
297 | } | ||
298 | |||
299 | static void __exit sd_mod_exit(void) | ||
300 | { | ||
301 | usb_deregister(&sd_driver); | ||
302 | } | ||
303 | |||
304 | module_init(sd_mod_init); | ||
305 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/gl860/gl860.c b/drivers/media/video/gspca/gl860/gl860.c index 2ced3b73994f..a8f54c20e585 100644 --- a/drivers/media/video/gspca/gl860/gl860.c +++ b/drivers/media/video/gspca/gl860/gl860.c | |||
@@ -524,22 +524,7 @@ static struct usb_driver sd_driver = { | |||
524 | 524 | ||
525 | /*====================== Init and Exit module functions ====================*/ | 525 | /*====================== Init and Exit module functions ====================*/ |
526 | 526 | ||
527 | static int __init sd_mod_init(void) | 527 | module_usb_driver(sd_driver); |
528 | { | ||
529 | PDEBUG(D_PROBE, "driver startup - version %s", DRIVER_VERSION); | ||
530 | |||
531 | if (usb_register(&sd_driver) < 0) | ||
532 | return -1; | ||
533 | return 0; | ||
534 | } | ||
535 | |||
536 | static void __exit sd_mod_exit(void) | ||
537 | { | ||
538 | usb_deregister(&sd_driver); | ||
539 | } | ||
540 | |||
541 | module_init(sd_mod_init); | ||
542 | module_exit(sd_mod_exit); | ||
543 | 528 | ||
544 | /*==========================================================================*/ | 529 | /*==========================================================================*/ |
545 | 530 | ||
diff --git a/drivers/media/video/gspca/jeilinj.c b/drivers/media/video/gspca/jeilinj.c index 8e3dabe30077..5ab3f7e12760 100644 --- a/drivers/media/video/gspca/jeilinj.c +++ b/drivers/media/video/gspca/jeilinj.c | |||
@@ -582,16 +582,4 @@ static struct usb_driver sd_driver = { | |||
582 | #endif | 582 | #endif |
583 | }; | 583 | }; |
584 | 584 | ||
585 | /* -- module insert / remove -- */ | 585 | module_usb_driver(sd_driver); |
586 | static int __init sd_mod_init(void) | ||
587 | { | ||
588 | return usb_register(&sd_driver); | ||
589 | } | ||
590 | |||
591 | static void __exit sd_mod_exit(void) | ||
592 | { | ||
593 | usb_deregister(&sd_driver); | ||
594 | } | ||
595 | |||
596 | module_init(sd_mod_init); | ||
597 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/kinect.c b/drivers/media/video/gspca/kinect.c index 4fe51fda80f3..e8e8f2fe9166 100644 --- a/drivers/media/video/gspca/kinect.c +++ b/drivers/media/video/gspca/kinect.c | |||
@@ -413,16 +413,4 @@ static struct usb_driver sd_driver = { | |||
413 | #endif | 413 | #endif |
414 | }; | 414 | }; |
415 | 415 | ||
416 | /* -- module insert / remove -- */ | 416 | module_usb_driver(sd_driver); |
417 | static int __init sd_mod_init(void) | ||
418 | { | ||
419 | return usb_register(&sd_driver); | ||
420 | } | ||
421 | |||
422 | static void __exit sd_mod_exit(void) | ||
423 | { | ||
424 | usb_deregister(&sd_driver); | ||
425 | } | ||
426 | |||
427 | module_init(sd_mod_init); | ||
428 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/konica.c b/drivers/media/video/gspca/konica.c index f3f7fe0ec4b7..b1da7f4096c8 100644 --- a/drivers/media/video/gspca/konica.c +++ b/drivers/media/video/gspca/konica.c | |||
@@ -634,15 +634,4 @@ static struct usb_driver sd_driver = { | |||
634 | #endif | 634 | #endif |
635 | }; | 635 | }; |
636 | 636 | ||
637 | /* -- module insert / remove -- */ | 637 | module_usb_driver(sd_driver); |
638 | static int __init sd_mod_init(void) | ||
639 | { | ||
640 | return usb_register(&sd_driver); | ||
641 | } | ||
642 | static void __exit sd_mod_exit(void) | ||
643 | { | ||
644 | usb_deregister(&sd_driver); | ||
645 | } | ||
646 | |||
647 | module_init(sd_mod_init); | ||
648 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/m5602/m5602_core.c b/drivers/media/video/gspca/m5602/m5602_core.c index 67533e5582a6..9fe3816b2aa0 100644 --- a/drivers/media/video/gspca/m5602/m5602_core.c +++ b/drivers/media/video/gspca/m5602/m5602_core.c | |||
@@ -404,19 +404,7 @@ static struct usb_driver sd_driver = { | |||
404 | .disconnect = m5602_disconnect | 404 | .disconnect = m5602_disconnect |
405 | }; | 405 | }; |
406 | 406 | ||
407 | /* -- module insert / remove -- */ | 407 | module_usb_driver(sd_driver); |
408 | static int __init mod_m5602_init(void) | ||
409 | { | ||
410 | return usb_register(&sd_driver); | ||
411 | } | ||
412 | |||
413 | static void __exit mod_m5602_exit(void) | ||
414 | { | ||
415 | usb_deregister(&sd_driver); | ||
416 | } | ||
417 | |||
418 | module_init(mod_m5602_init); | ||
419 | module_exit(mod_m5602_exit); | ||
420 | 408 | ||
421 | MODULE_AUTHOR(DRIVER_AUTHOR); | 409 | MODULE_AUTHOR(DRIVER_AUTHOR); |
422 | MODULE_DESCRIPTION(DRIVER_DESC); | 410 | MODULE_DESCRIPTION(DRIVER_DESC); |
diff --git a/drivers/media/video/gspca/mars.c b/drivers/media/video/gspca/mars.c index ef45fa575752..5c2ea05c46b4 100644 --- a/drivers/media/video/gspca/mars.c +++ b/drivers/media/video/gspca/mars.c | |||
@@ -517,15 +517,4 @@ static struct usb_driver sd_driver = { | |||
517 | #endif | 517 | #endif |
518 | }; | 518 | }; |
519 | 519 | ||
520 | /* -- module insert / remove -- */ | 520 | module_usb_driver(sd_driver); |
521 | static int __init sd_mod_init(void) | ||
522 | { | ||
523 | return usb_register(&sd_driver); | ||
524 | } | ||
525 | static void __exit sd_mod_exit(void) | ||
526 | { | ||
527 | usb_deregister(&sd_driver); | ||
528 | } | ||
529 | |||
530 | module_init(sd_mod_init); | ||
531 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/mr97310a.c b/drivers/media/video/gspca/mr97310a.c index 473e813b680e..d73e5bd3dbf7 100644 --- a/drivers/media/video/gspca/mr97310a.c +++ b/drivers/media/video/gspca/mr97310a.c | |||
@@ -1259,15 +1259,4 @@ static struct usb_driver sd_driver = { | |||
1259 | #endif | 1259 | #endif |
1260 | }; | 1260 | }; |
1261 | 1261 | ||
1262 | /* -- module insert / remove -- */ | 1262 | module_usb_driver(sd_driver); |
1263 | static int __init sd_mod_init(void) | ||
1264 | { | ||
1265 | return usb_register(&sd_driver); | ||
1266 | } | ||
1267 | static void __exit sd_mod_exit(void) | ||
1268 | { | ||
1269 | usb_deregister(&sd_driver); | ||
1270 | } | ||
1271 | |||
1272 | module_init(sd_mod_init); | ||
1273 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/nw80x.c b/drivers/media/video/gspca/nw80x.c index 7681814e594f..d4bec9321771 100644 --- a/drivers/media/video/gspca/nw80x.c +++ b/drivers/media/video/gspca/nw80x.c | |||
@@ -2118,18 +2118,7 @@ static struct usb_driver sd_driver = { | |||
2118 | #endif | 2118 | #endif |
2119 | }; | 2119 | }; |
2120 | 2120 | ||
2121 | /* -- module insert / remove -- */ | 2121 | module_usb_driver(sd_driver); |
2122 | static int __init sd_mod_init(void) | ||
2123 | { | ||
2124 | return usb_register(&sd_driver); | ||
2125 | } | ||
2126 | static void __exit sd_mod_exit(void) | ||
2127 | { | ||
2128 | usb_deregister(&sd_driver); | ||
2129 | } | ||
2130 | |||
2131 | module_init(sd_mod_init); | ||
2132 | module_exit(sd_mod_exit); | ||
2133 | 2122 | ||
2134 | module_param(webcam, int, 0644); | 2123 | module_param(webcam, int, 0644); |
2135 | MODULE_PARM_DESC(webcam, | 2124 | MODULE_PARM_DESC(webcam, |
diff --git a/drivers/media/video/gspca/ov519.c b/drivers/media/video/gspca/ov519.c index 6a01b35a9478..08b8ce1dee18 100644 --- a/drivers/media/video/gspca/ov519.c +++ b/drivers/media/video/gspca/ov519.c | |||
@@ -5056,18 +5056,7 @@ static struct usb_driver sd_driver = { | |||
5056 | #endif | 5056 | #endif |
5057 | }; | 5057 | }; |
5058 | 5058 | ||
5059 | /* -- module insert / remove -- */ | 5059 | module_usb_driver(sd_driver); |
5060 | static int __init sd_mod_init(void) | ||
5061 | { | ||
5062 | return usb_register(&sd_driver); | ||
5063 | } | ||
5064 | static void __exit sd_mod_exit(void) | ||
5065 | { | ||
5066 | usb_deregister(&sd_driver); | ||
5067 | } | ||
5068 | |||
5069 | module_init(sd_mod_init); | ||
5070 | module_exit(sd_mod_exit); | ||
5071 | 5060 | ||
5072 | module_param(frame_rate, int, 0644); | 5061 | module_param(frame_rate, int, 0644); |
5073 | MODULE_PARM_DESC(frame_rate, "Frame rate (5, 10, 15, 20 or 30 fps)"); | 5062 | MODULE_PARM_DESC(frame_rate, "Frame rate (5, 10, 15, 20 or 30 fps)"); |
diff --git a/drivers/media/video/gspca/ov534.c b/drivers/media/video/gspca/ov534.c index 76907eced4a1..04753391de3e 100644 --- a/drivers/media/video/gspca/ov534.c +++ b/drivers/media/video/gspca/ov534.c | |||
@@ -1533,16 +1533,4 @@ static struct usb_driver sd_driver = { | |||
1533 | #endif | 1533 | #endif |
1534 | }; | 1534 | }; |
1535 | 1535 | ||
1536 | /* -- module insert / remove -- */ | 1536 | module_usb_driver(sd_driver); |
1537 | static int __init sd_mod_init(void) | ||
1538 | { | ||
1539 | return usb_register(&sd_driver); | ||
1540 | } | ||
1541 | |||
1542 | static void __exit sd_mod_exit(void) | ||
1543 | { | ||
1544 | usb_deregister(&sd_driver); | ||
1545 | } | ||
1546 | |||
1547 | module_init(sd_mod_init); | ||
1548 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/ov534_9.c b/drivers/media/video/gspca/ov534_9.c index b3b1ea60a841..f30060d50633 100644 --- a/drivers/media/video/gspca/ov534_9.c +++ b/drivers/media/video/gspca/ov534_9.c | |||
@@ -1432,16 +1432,4 @@ static struct usb_driver sd_driver = { | |||
1432 | #endif | 1432 | #endif |
1433 | }; | 1433 | }; |
1434 | 1434 | ||
1435 | /* -- module insert / remove -- */ | 1435 | module_usb_driver(sd_driver); |
1436 | static int __init sd_mod_init(void) | ||
1437 | { | ||
1438 | return usb_register(&sd_driver); | ||
1439 | } | ||
1440 | |||
1441 | static void __exit sd_mod_exit(void) | ||
1442 | { | ||
1443 | usb_deregister(&sd_driver); | ||
1444 | } | ||
1445 | |||
1446 | module_init(sd_mod_init); | ||
1447 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/pac207.c b/drivers/media/video/gspca/pac207.c index 1600df152fd6..ece8b1e82a13 100644 --- a/drivers/media/video/gspca/pac207.c +++ b/drivers/media/video/gspca/pac207.c | |||
@@ -569,15 +569,4 @@ static struct usb_driver sd_driver = { | |||
569 | #endif | 569 | #endif |
570 | }; | 570 | }; |
571 | 571 | ||
572 | /* -- module insert / remove -- */ | 572 | module_usb_driver(sd_driver); |
573 | static int __init sd_mod_init(void) | ||
574 | { | ||
575 | return usb_register(&sd_driver); | ||
576 | } | ||
577 | static void __exit sd_mod_exit(void) | ||
578 | { | ||
579 | usb_deregister(&sd_driver); | ||
580 | } | ||
581 | |||
582 | module_init(sd_mod_init); | ||
583 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/pac7302.c b/drivers/media/video/gspca/pac7302.c index 1c44f78ff9e2..2811195258c4 100644 --- a/drivers/media/video/gspca/pac7302.c +++ b/drivers/media/video/gspca/pac7302.c | |||
@@ -1220,15 +1220,4 @@ static struct usb_driver sd_driver = { | |||
1220 | #endif | 1220 | #endif |
1221 | }; | 1221 | }; |
1222 | 1222 | ||
1223 | /* -- module insert / remove -- */ | 1223 | module_usb_driver(sd_driver); |
1224 | static int __init sd_mod_init(void) | ||
1225 | { | ||
1226 | return usb_register(&sd_driver); | ||
1227 | } | ||
1228 | static void __exit sd_mod_exit(void) | ||
1229 | { | ||
1230 | usb_deregister(&sd_driver); | ||
1231 | } | ||
1232 | |||
1233 | module_init(sd_mod_init); | ||
1234 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/pac7311.c b/drivers/media/video/gspca/pac7311.c index 7509d05dc065..1ac111176ffa 100644 --- a/drivers/media/video/gspca/pac7311.c +++ b/drivers/media/video/gspca/pac7311.c | |||
@@ -868,15 +868,4 @@ static struct usb_driver sd_driver = { | |||
868 | #endif | 868 | #endif |
869 | }; | 869 | }; |
870 | 870 | ||
871 | /* -- module insert / remove -- */ | 871 | module_usb_driver(sd_driver); |
872 | static int __init sd_mod_init(void) | ||
873 | { | ||
874 | return usb_register(&sd_driver); | ||
875 | } | ||
876 | static void __exit sd_mod_exit(void) | ||
877 | { | ||
878 | usb_deregister(&sd_driver); | ||
879 | } | ||
880 | |||
881 | module_init(sd_mod_init); | ||
882 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/se401.c b/drivers/media/video/gspca/se401.c index 3b71bbcd977a..1494e1829d36 100644 --- a/drivers/media/video/gspca/se401.c +++ b/drivers/media/video/gspca/se401.c | |||
@@ -766,15 +766,4 @@ static struct usb_driver sd_driver = { | |||
766 | .post_reset = sd_post_reset, | 766 | .post_reset = sd_post_reset, |
767 | }; | 767 | }; |
768 | 768 | ||
769 | /* -- module insert / remove -- */ | 769 | module_usb_driver(sd_driver); |
770 | static int __init sd_mod_init(void) | ||
771 | { | ||
772 | return usb_register(&sd_driver); | ||
773 | } | ||
774 | static void __exit sd_mod_exit(void) | ||
775 | { | ||
776 | usb_deregister(&sd_driver); | ||
777 | } | ||
778 | |||
779 | module_init(sd_mod_init); | ||
780 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/sn9c2028.c b/drivers/media/video/gspca/sn9c2028.c index 48aae3926a33..478533cb1152 100644 --- a/drivers/media/video/gspca/sn9c2028.c +++ b/drivers/media/video/gspca/sn9c2028.c | |||
@@ -737,16 +737,4 @@ static struct usb_driver sd_driver = { | |||
737 | #endif | 737 | #endif |
738 | }; | 738 | }; |
739 | 739 | ||
740 | /* -- module insert / remove -- */ | 740 | module_usb_driver(sd_driver); |
741 | static int __init sd_mod_init(void) | ||
742 | { | ||
743 | return usb_register(&sd_driver); | ||
744 | } | ||
745 | |||
746 | static void __exit sd_mod_exit(void) | ||
747 | { | ||
748 | usb_deregister(&sd_driver); | ||
749 | } | ||
750 | |||
751 | module_init(sd_mod_init); | ||
752 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/sn9c20x.c b/drivers/media/video/gspca/sn9c20x.c index 86e07a139a16..33cabc342dcf 100644 --- a/drivers/media/video/gspca/sn9c20x.c +++ b/drivers/media/video/gspca/sn9c20x.c | |||
@@ -2554,15 +2554,4 @@ static struct usb_driver sd_driver = { | |||
2554 | #endif | 2554 | #endif |
2555 | }; | 2555 | }; |
2556 | 2556 | ||
2557 | /* -- module insert / remove -- */ | 2557 | module_usb_driver(sd_driver); |
2558 | static int __init sd_mod_init(void) | ||
2559 | { | ||
2560 | return usb_register(&sd_driver); | ||
2561 | } | ||
2562 | static void __exit sd_mod_exit(void) | ||
2563 | { | ||
2564 | usb_deregister(&sd_driver); | ||
2565 | } | ||
2566 | |||
2567 | module_init(sd_mod_init); | ||
2568 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/sonixb.c b/drivers/media/video/gspca/sonixb.c index 146b459b08d5..ddb392dc4f2d 100644 --- a/drivers/media/video/gspca/sonixb.c +++ b/drivers/media/video/gspca/sonixb.c | |||
@@ -1527,15 +1527,4 @@ static struct usb_driver sd_driver = { | |||
1527 | #endif | 1527 | #endif |
1528 | }; | 1528 | }; |
1529 | 1529 | ||
1530 | /* -- module insert / remove -- */ | 1530 | module_usb_driver(sd_driver); |
1531 | static int __init sd_mod_init(void) | ||
1532 | { | ||
1533 | return usb_register(&sd_driver); | ||
1534 | } | ||
1535 | static void __exit sd_mod_exit(void) | ||
1536 | { | ||
1537 | usb_deregister(&sd_driver); | ||
1538 | } | ||
1539 | |||
1540 | module_init(sd_mod_init); | ||
1541 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c index c746bf19ca14..afa3186b8038 100644 --- a/drivers/media/video/gspca/sonixj.c +++ b/drivers/media/video/gspca/sonixj.c | |||
@@ -3104,15 +3104,4 @@ static struct usb_driver sd_driver = { | |||
3104 | #endif | 3104 | #endif |
3105 | }; | 3105 | }; |
3106 | 3106 | ||
3107 | /* -- module insert / remove -- */ | 3107 | module_usb_driver(sd_driver); |
3108 | static int __init sd_mod_init(void) | ||
3109 | { | ||
3110 | return usb_register(&sd_driver); | ||
3111 | } | ||
3112 | static void __exit sd_mod_exit(void) | ||
3113 | { | ||
3114 | usb_deregister(&sd_driver); | ||
3115 | } | ||
3116 | |||
3117 | module_init(sd_mod_init); | ||
3118 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/spca1528.c b/drivers/media/video/gspca/spca1528.c index 695673106e76..070b9c33b517 100644 --- a/drivers/media/video/gspca/spca1528.c +++ b/drivers/media/video/gspca/spca1528.c | |||
@@ -590,15 +590,4 @@ static struct usb_driver sd_driver = { | |||
590 | #endif | 590 | #endif |
591 | }; | 591 | }; |
592 | 592 | ||
593 | /* -- module insert / remove -- */ | 593 | module_usb_driver(sd_driver); |
594 | static int __init sd_mod_init(void) | ||
595 | { | ||
596 | return usb_register(&sd_driver); | ||
597 | } | ||
598 | static void __exit sd_mod_exit(void) | ||
599 | { | ||
600 | usb_deregister(&sd_driver); | ||
601 | } | ||
602 | |||
603 | module_init(sd_mod_init); | ||
604 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/spca500.c b/drivers/media/video/gspca/spca500.c index bb82c94ece14..103984708c77 100644 --- a/drivers/media/video/gspca/spca500.c +++ b/drivers/media/video/gspca/spca500.c | |||
@@ -1092,15 +1092,4 @@ static struct usb_driver sd_driver = { | |||
1092 | #endif | 1092 | #endif |
1093 | }; | 1093 | }; |
1094 | 1094 | ||
1095 | /* -- module insert / remove -- */ | 1095 | module_usb_driver(sd_driver); |
1096 | static int __init sd_mod_init(void) | ||
1097 | { | ||
1098 | return usb_register(&sd_driver); | ||
1099 | } | ||
1100 | static void __exit sd_mod_exit(void) | ||
1101 | { | ||
1102 | usb_deregister(&sd_driver); | ||
1103 | } | ||
1104 | |||
1105 | module_init(sd_mod_init); | ||
1106 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/spca501.c b/drivers/media/video/gspca/spca501.c index 7aaac72aee91..9c16821addd4 100644 --- a/drivers/media/video/gspca/spca501.c +++ b/drivers/media/video/gspca/spca501.c | |||
@@ -2188,15 +2188,4 @@ static struct usb_driver sd_driver = { | |||
2188 | #endif | 2188 | #endif |
2189 | }; | 2189 | }; |
2190 | 2190 | ||
2191 | /* -- module insert / remove -- */ | 2191 | module_usb_driver(sd_driver); |
2192 | static int __init sd_mod_init(void) | ||
2193 | { | ||
2194 | return usb_register(&sd_driver); | ||
2195 | } | ||
2196 | static void __exit sd_mod_exit(void) | ||
2197 | { | ||
2198 | usb_deregister(&sd_driver); | ||
2199 | } | ||
2200 | |||
2201 | module_init(sd_mod_init); | ||
2202 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/spca505.c b/drivers/media/video/gspca/spca505.c index 16722dc60394..1320f35e39f2 100644 --- a/drivers/media/video/gspca/spca505.c +++ b/drivers/media/video/gspca/spca505.c | |||
@@ -815,15 +815,4 @@ static struct usb_driver sd_driver = { | |||
815 | #endif | 815 | #endif |
816 | }; | 816 | }; |
817 | 817 | ||
818 | /* -- module insert / remove -- */ | 818 | module_usb_driver(sd_driver); |
819 | static int __init sd_mod_init(void) | ||
820 | { | ||
821 | return usb_register(&sd_driver); | ||
822 | } | ||
823 | static void __exit sd_mod_exit(void) | ||
824 | { | ||
825 | usb_deregister(&sd_driver); | ||
826 | } | ||
827 | |||
828 | module_init(sd_mod_init); | ||
829 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/spca506.c b/drivers/media/video/gspca/spca506.c index 89fec4c500af..54eed87672d2 100644 --- a/drivers/media/video/gspca/spca506.c +++ b/drivers/media/video/gspca/spca506.c | |||
@@ -714,21 +714,4 @@ static struct usb_driver sd_driver = { | |||
714 | #endif | 714 | #endif |
715 | }; | 715 | }; |
716 | 716 | ||
717 | /* -- module insert / remove -- */ | 717 | module_usb_driver(sd_driver); |
718 | static int __init sd_mod_init(void) | ||
719 | { | ||
720 | int ret; | ||
721 | ret = usb_register(&sd_driver); | ||
722 | if (ret < 0) | ||
723 | return ret; | ||
724 | PDEBUG(D_PROBE, "registered"); | ||
725 | return 0; | ||
726 | } | ||
727 | static void __exit sd_mod_exit(void) | ||
728 | { | ||
729 | usb_deregister(&sd_driver); | ||
730 | PDEBUG(D_PROBE, "deregistered"); | ||
731 | } | ||
732 | |||
733 | module_init(sd_mod_init); | ||
734 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/spca508.c b/drivers/media/video/gspca/spca508.c index a44fe3d25965..df4e16996461 100644 --- a/drivers/media/video/gspca/spca508.c +++ b/drivers/media/video/gspca/spca508.c | |||
@@ -1544,15 +1544,4 @@ static struct usb_driver sd_driver = { | |||
1544 | #endif | 1544 | #endif |
1545 | }; | 1545 | }; |
1546 | 1546 | ||
1547 | /* -- module insert / remove -- */ | 1547 | module_usb_driver(sd_driver); |
1548 | static int __init sd_mod_init(void) | ||
1549 | { | ||
1550 | return usb_register(&sd_driver); | ||
1551 | } | ||
1552 | static void __exit sd_mod_exit(void) | ||
1553 | { | ||
1554 | usb_deregister(&sd_driver); | ||
1555 | } | ||
1556 | |||
1557 | module_init(sd_mod_init); | ||
1558 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/spca561.c b/drivers/media/video/gspca/spca561.c index c82fd53cef95..259a0c73c664 100644 --- a/drivers/media/video/gspca/spca561.c +++ b/drivers/media/video/gspca/spca561.c | |||
@@ -1106,15 +1106,4 @@ static struct usb_driver sd_driver = { | |||
1106 | #endif | 1106 | #endif |
1107 | }; | 1107 | }; |
1108 | 1108 | ||
1109 | /* -- module insert / remove -- */ | 1109 | module_usb_driver(sd_driver); |
1110 | static int __init sd_mod_init(void) | ||
1111 | { | ||
1112 | return usb_register(&sd_driver); | ||
1113 | } | ||
1114 | static void __exit sd_mod_exit(void) | ||
1115 | { | ||
1116 | usb_deregister(&sd_driver); | ||
1117 | } | ||
1118 | |||
1119 | module_init(sd_mod_init); | ||
1120 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/sq905.c b/drivers/media/video/gspca/sq905.c index df805f798282..2fe3c29bd6b7 100644 --- a/drivers/media/video/gspca/sq905.c +++ b/drivers/media/video/gspca/sq905.c | |||
@@ -432,16 +432,4 @@ static struct usb_driver sd_driver = { | |||
432 | #endif | 432 | #endif |
433 | }; | 433 | }; |
434 | 434 | ||
435 | /* -- module insert / remove -- */ | 435 | module_usb_driver(sd_driver); |
436 | static int __init sd_mod_init(void) | ||
437 | { | ||
438 | return usb_register(&sd_driver); | ||
439 | } | ||
440 | |||
441 | static void __exit sd_mod_exit(void) | ||
442 | { | ||
443 | usb_deregister(&sd_driver); | ||
444 | } | ||
445 | |||
446 | module_init(sd_mod_init); | ||
447 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/sq905c.c b/drivers/media/video/gspca/sq905c.c index c2c056056e08..ae783634712f 100644 --- a/drivers/media/video/gspca/sq905c.c +++ b/drivers/media/video/gspca/sq905c.c | |||
@@ -339,16 +339,4 @@ static struct usb_driver sd_driver = { | |||
339 | #endif | 339 | #endif |
340 | }; | 340 | }; |
341 | 341 | ||
342 | /* -- module insert / remove -- */ | 342 | module_usb_driver(sd_driver); |
343 | static int __init sd_mod_init(void) | ||
344 | { | ||
345 | return usb_register(&sd_driver); | ||
346 | } | ||
347 | |||
348 | static void __exit sd_mod_exit(void) | ||
349 | { | ||
350 | usb_deregister(&sd_driver); | ||
351 | } | ||
352 | |||
353 | module_init(sd_mod_init); | ||
354 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/sq930x.c b/drivers/media/video/gspca/sq930x.c index e4255b4905e7..1a8ba9b3550a 100644 --- a/drivers/media/video/gspca/sq930x.c +++ b/drivers/media/video/gspca/sq930x.c | |||
@@ -1197,15 +1197,4 @@ static struct usb_driver sd_driver = { | |||
1197 | #endif | 1197 | #endif |
1198 | }; | 1198 | }; |
1199 | 1199 | ||
1200 | /* -- module insert / remove -- */ | 1200 | module_usb_driver(sd_driver); |
1201 | static int __init sd_mod_init(void) | ||
1202 | { | ||
1203 | return usb_register(&sd_driver); | ||
1204 | } | ||
1205 | static void __exit sd_mod_exit(void) | ||
1206 | { | ||
1207 | usb_deregister(&sd_driver); | ||
1208 | } | ||
1209 | |||
1210 | module_init(sd_mod_init); | ||
1211 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/stk014.c b/drivers/media/video/gspca/stk014.c index 42a7a28a6c8b..4ae7cc8f463a 100644 --- a/drivers/media/video/gspca/stk014.c +++ b/drivers/media/video/gspca/stk014.c | |||
@@ -519,15 +519,4 @@ static struct usb_driver sd_driver = { | |||
519 | #endif | 519 | #endif |
520 | }; | 520 | }; |
521 | 521 | ||
522 | /* -- module insert / remove -- */ | 522 | module_usb_driver(sd_driver); |
523 | static int __init sd_mod_init(void) | ||
524 | { | ||
525 | return usb_register(&sd_driver); | ||
526 | } | ||
527 | static void __exit sd_mod_exit(void) | ||
528 | { | ||
529 | usb_deregister(&sd_driver); | ||
530 | } | ||
531 | |||
532 | module_init(sd_mod_init); | ||
533 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/stv0680.c b/drivers/media/video/gspca/stv0680.c index 4dcc7e37f9fd..461ed645f309 100644 --- a/drivers/media/video/gspca/stv0680.c +++ b/drivers/media/video/gspca/stv0680.c | |||
@@ -355,15 +355,4 @@ static struct usb_driver sd_driver = { | |||
355 | #endif | 355 | #endif |
356 | }; | 356 | }; |
357 | 357 | ||
358 | /* -- module insert / remove -- */ | 358 | module_usb_driver(sd_driver); |
359 | static int __init sd_mod_init(void) | ||
360 | { | ||
361 | return usb_register(&sd_driver); | ||
362 | } | ||
363 | static void __exit sd_mod_exit(void) | ||
364 | { | ||
365 | usb_deregister(&sd_driver); | ||
366 | } | ||
367 | |||
368 | module_init(sd_mod_init); | ||
369 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/stv06xx/stv06xx.c b/drivers/media/video/gspca/stv06xx/stv06xx.c index b1fca7db1015..0ab425fbea9a 100644 --- a/drivers/media/video/gspca/stv06xx/stv06xx.c +++ b/drivers/media/video/gspca/stv06xx/stv06xx.c | |||
@@ -612,18 +612,7 @@ static struct usb_driver sd_driver = { | |||
612 | #endif | 612 | #endif |
613 | }; | 613 | }; |
614 | 614 | ||
615 | /* -- module insert / remove -- */ | 615 | module_usb_driver(sd_driver); |
616 | static int __init sd_mod_init(void) | ||
617 | { | ||
618 | return usb_register(&sd_driver); | ||
619 | } | ||
620 | static void __exit sd_mod_exit(void) | ||
621 | { | ||
622 | usb_deregister(&sd_driver); | ||
623 | } | ||
624 | |||
625 | module_init(sd_mod_init); | ||
626 | module_exit(sd_mod_exit); | ||
627 | 616 | ||
628 | module_param(dump_bridge, bool, S_IRUGO | S_IWUSR); | 617 | module_param(dump_bridge, bool, S_IRUGO | S_IWUSR); |
629 | MODULE_PARM_DESC(dump_bridge, "Dumps all usb bridge registers at startup"); | 618 | MODULE_PARM_DESC(dump_bridge, "Dumps all usb bridge registers at startup"); |
diff --git a/drivers/media/video/gspca/sunplus.c b/drivers/media/video/gspca/sunplus.c index c8909772435a..c80f0c0c75b6 100644 --- a/drivers/media/video/gspca/sunplus.c +++ b/drivers/media/video/gspca/sunplus.c | |||
@@ -1211,15 +1211,4 @@ static struct usb_driver sd_driver = { | |||
1211 | #endif | 1211 | #endif |
1212 | }; | 1212 | }; |
1213 | 1213 | ||
1214 | /* -- module insert / remove -- */ | 1214 | module_usb_driver(sd_driver); |
1215 | static int __init sd_mod_init(void) | ||
1216 | { | ||
1217 | return usb_register(&sd_driver); | ||
1218 | } | ||
1219 | static void __exit sd_mod_exit(void) | ||
1220 | { | ||
1221 | usb_deregister(&sd_driver); | ||
1222 | } | ||
1223 | |||
1224 | module_init(sd_mod_init); | ||
1225 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/t613.c b/drivers/media/video/gspca/t613.c index 90f0877eb599..ea44deb66af4 100644 --- a/drivers/media/video/gspca/t613.c +++ b/drivers/media/video/gspca/t613.c | |||
@@ -1438,15 +1438,4 @@ static struct usb_driver sd_driver = { | |||
1438 | #endif | 1438 | #endif |
1439 | }; | 1439 | }; |
1440 | 1440 | ||
1441 | /* -- module insert / remove -- */ | 1441 | module_usb_driver(sd_driver); |
1442 | static int __init sd_mod_init(void) | ||
1443 | { | ||
1444 | return usb_register(&sd_driver); | ||
1445 | } | ||
1446 | static void __exit sd_mod_exit(void) | ||
1447 | { | ||
1448 | usb_deregister(&sd_driver); | ||
1449 | } | ||
1450 | |||
1451 | module_init(sd_mod_init); | ||
1452 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/topro.c b/drivers/media/video/gspca/topro.c index 29596c59837f..b2695b1dc603 100644 --- a/drivers/media/video/gspca/topro.c +++ b/drivers/media/video/gspca/topro.c | |||
@@ -4971,18 +4971,7 @@ static struct usb_driver sd_driver = { | |||
4971 | #endif | 4971 | #endif |
4972 | }; | 4972 | }; |
4973 | 4973 | ||
4974 | /* -- module insert / remove -- */ | 4974 | module_usb_driver(sd_driver); |
4975 | static int __init sd_mod_init(void) | ||
4976 | { | ||
4977 | return usb_register(&sd_driver); | ||
4978 | } | ||
4979 | static void __exit sd_mod_exit(void) | ||
4980 | { | ||
4981 | usb_deregister(&sd_driver); | ||
4982 | } | ||
4983 | |||
4984 | module_init(sd_mod_init); | ||
4985 | module_exit(sd_mod_exit); | ||
4986 | 4975 | ||
4987 | module_param(force_sensor, int, 0644); | 4976 | module_param(force_sensor, int, 0644); |
4988 | MODULE_PARM_DESC(force_sensor, | 4977 | MODULE_PARM_DESC(force_sensor, |
diff --git a/drivers/media/video/gspca/tv8532.c b/drivers/media/video/gspca/tv8532.c index 933ef2ca658c..c8922c5ffbf5 100644 --- a/drivers/media/video/gspca/tv8532.c +++ b/drivers/media/video/gspca/tv8532.c | |||
@@ -418,16 +418,4 @@ static struct usb_driver sd_driver = { | |||
418 | #endif | 418 | #endif |
419 | }; | 419 | }; |
420 | 420 | ||
421 | /* -- module insert / remove -- */ | 421 | module_usb_driver(sd_driver); |
422 | static int __init sd_mod_init(void) | ||
423 | { | ||
424 | return usb_register(&sd_driver); | ||
425 | } | ||
426 | |||
427 | static void __exit sd_mod_exit(void) | ||
428 | { | ||
429 | usb_deregister(&sd_driver); | ||
430 | } | ||
431 | |||
432 | module_init(sd_mod_init); | ||
433 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/vc032x.c b/drivers/media/video/gspca/vc032x.c index 7ee2c8271dcc..208f6b2d512a 100644 --- a/drivers/media/video/gspca/vc032x.c +++ b/drivers/media/video/gspca/vc032x.c | |||
@@ -4230,15 +4230,4 @@ static struct usb_driver sd_driver = { | |||
4230 | #endif | 4230 | #endif |
4231 | }; | 4231 | }; |
4232 | 4232 | ||
4233 | /* -- module insert / remove -- */ | 4233 | module_usb_driver(sd_driver); |
4234 | static int __init sd_mod_init(void) | ||
4235 | { | ||
4236 | return usb_register(&sd_driver); | ||
4237 | } | ||
4238 | static void __exit sd_mod_exit(void) | ||
4239 | { | ||
4240 | usb_deregister(&sd_driver); | ||
4241 | } | ||
4242 | |||
4243 | module_init(sd_mod_init); | ||
4244 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/vicam.c b/drivers/media/video/gspca/vicam.c index 81dd4c99d025..d12ea1518ace 100644 --- a/drivers/media/video/gspca/vicam.c +++ b/drivers/media/video/gspca/vicam.c | |||
@@ -368,16 +368,4 @@ static struct usb_driver sd_driver = { | |||
368 | #endif | 368 | #endif |
369 | }; | 369 | }; |
370 | 370 | ||
371 | /* -- module insert / remove -- */ | 371 | module_usb_driver(sd_driver); |
372 | static int __init sd_mod_init(void) | ||
373 | { | ||
374 | return usb_register(&sd_driver); | ||
375 | } | ||
376 | |||
377 | static void __exit sd_mod_exit(void) | ||
378 | { | ||
379 | usb_deregister(&sd_driver); | ||
380 | } | ||
381 | |||
382 | module_init(sd_mod_init); | ||
383 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/xirlink_cit.c b/drivers/media/video/gspca/xirlink_cit.c index 3aed42acdb5a..fbb6ed25ec31 100644 --- a/drivers/media/video/gspca/xirlink_cit.c +++ b/drivers/media/video/gspca/xirlink_cit.c | |||
@@ -3325,15 +3325,4 @@ static struct usb_driver sd_driver = { | |||
3325 | #endif | 3325 | #endif |
3326 | }; | 3326 | }; |
3327 | 3327 | ||
3328 | /* -- module insert / remove -- */ | 3328 | module_usb_driver(sd_driver); |
3329 | static int __init sd_mod_init(void) | ||
3330 | { | ||
3331 | return usb_register(&sd_driver); | ||
3332 | } | ||
3333 | static void __exit sd_mod_exit(void) | ||
3334 | { | ||
3335 | usb_deregister(&sd_driver); | ||
3336 | } | ||
3337 | |||
3338 | module_init(sd_mod_init); | ||
3339 | module_exit(sd_mod_exit); | ||
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c index 30ea1e479492..0202fead6b97 100644 --- a/drivers/media/video/gspca/zc3xx.c +++ b/drivers/media/video/gspca/zc3xx.c | |||
@@ -7050,18 +7050,7 @@ static struct usb_driver sd_driver = { | |||
7050 | #endif | 7050 | #endif |
7051 | }; | 7051 | }; |
7052 | 7052 | ||
7053 | static int __init sd_mod_init(void) | 7053 | module_usb_driver(sd_driver); |
7054 | { | ||
7055 | return usb_register(&sd_driver); | ||
7056 | } | ||
7057 | |||
7058 | static void __exit sd_mod_exit(void) | ||
7059 | { | ||
7060 | usb_deregister(&sd_driver); | ||
7061 | } | ||
7062 | |||
7063 | module_init(sd_mod_init); | ||
7064 | module_exit(sd_mod_exit); | ||
7065 | 7054 | ||
7066 | module_param(force_sensor, int, 0644); | 7055 | module_param(force_sensor, int, 0644); |
7067 | MODULE_PARM_DESC(force_sensor, | 7056 | MODULE_PARM_DESC(force_sensor, |
diff --git a/drivers/media/video/hdpvr/hdpvr-core.c b/drivers/media/video/hdpvr/hdpvr-core.c index 441dacf642bb..3f1a5b1beeba 100644 --- a/drivers/media/video/hdpvr/hdpvr-core.c +++ b/drivers/media/video/hdpvr/hdpvr-core.c | |||
@@ -452,26 +452,7 @@ static struct usb_driver hdpvr_usb_driver = { | |||
452 | .id_table = hdpvr_table, | 452 | .id_table = hdpvr_table, |
453 | }; | 453 | }; |
454 | 454 | ||
455 | static int __init hdpvr_init(void) | 455 | module_usb_driver(hdpvr_usb_driver); |
456 | { | ||
457 | int result; | ||
458 | |||
459 | /* register this driver with the USB subsystem */ | ||
460 | result = usb_register(&hdpvr_usb_driver); | ||
461 | if (result) | ||
462 | err("usb_register failed. Error number %d", result); | ||
463 | |||
464 | return result; | ||
465 | } | ||
466 | |||
467 | static void __exit hdpvr_exit(void) | ||
468 | { | ||
469 | /* deregister this driver with the USB subsystem */ | ||
470 | usb_deregister(&hdpvr_usb_driver); | ||
471 | } | ||
472 | |||
473 | module_init(hdpvr_init); | ||
474 | module_exit(hdpvr_exit); | ||
475 | 456 | ||
476 | MODULE_LICENSE("GPL"); | 457 | MODULE_LICENSE("GPL"); |
477 | MODULE_VERSION("0.2.1"); | 458 | MODULE_VERSION("0.2.1"); |
diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c index 803c9c82e496..c1bef6187661 100644 --- a/drivers/media/video/s2255drv.c +++ b/drivers/media/video/s2255drv.c | |||
@@ -2682,25 +2682,7 @@ static struct usb_driver s2255_driver = { | |||
2682 | .id_table = s2255_table, | 2682 | .id_table = s2255_table, |
2683 | }; | 2683 | }; |
2684 | 2684 | ||
2685 | static int __init usb_s2255_init(void) | 2685 | module_usb_driver(s2255_driver); |
2686 | { | ||
2687 | int result; | ||
2688 | /* register this driver with the USB subsystem */ | ||
2689 | result = usb_register(&s2255_driver); | ||
2690 | if (result) | ||
2691 | pr_err(KBUILD_MODNAME | ||
2692 | ": usb_register failed. Error number %d\n", result); | ||
2693 | dprintk(2, "%s\n", __func__); | ||
2694 | return result; | ||
2695 | } | ||
2696 | |||
2697 | static void __exit usb_s2255_exit(void) | ||
2698 | { | ||
2699 | usb_deregister(&s2255_driver); | ||
2700 | } | ||
2701 | |||
2702 | module_init(usb_s2255_init); | ||
2703 | module_exit(usb_s2255_exit); | ||
2704 | 2686 | ||
2705 | MODULE_DESCRIPTION("Sensoray 2255 Video for Linux driver"); | 2687 | MODULE_DESCRIPTION("Sensoray 2255 Video for Linux driver"); |
2706 | MODULE_AUTHOR("Dean Anderson (Sensoray Company Inc.)"); | 2688 | MODULE_AUTHOR("Dean Anderson (Sensoray Company Inc.)"); |
diff --git a/drivers/media/video/sn9c102/sn9c102_core.c b/drivers/media/video/sn9c102/sn9c102_core.c index 16cb07c5c27b..7025be129286 100644 --- a/drivers/media/video/sn9c102/sn9c102_core.c +++ b/drivers/media/video/sn9c102/sn9c102_core.c | |||
@@ -3420,27 +3420,4 @@ static struct usb_driver sn9c102_usb_driver = { | |||
3420 | .disconnect = sn9c102_usb_disconnect, | 3420 | .disconnect = sn9c102_usb_disconnect, |
3421 | }; | 3421 | }; |
3422 | 3422 | ||
3423 | /*****************************************************************************/ | 3423 | module_usb_driver(sn9c102_usb_driver); |
3424 | |||
3425 | static int __init sn9c102_module_init(void) | ||
3426 | { | ||
3427 | int err = 0; | ||
3428 | |||
3429 | KDBG(2, SN9C102_MODULE_NAME " v" SN9C102_MODULE_VERSION); | ||
3430 | KDBG(3, SN9C102_MODULE_AUTHOR); | ||
3431 | |||
3432 | if ((err = usb_register(&sn9c102_usb_driver))) | ||
3433 | KDBG(1, "usb_register() failed"); | ||
3434 | |||
3435 | return err; | ||
3436 | } | ||
3437 | |||
3438 | |||
3439 | static void __exit sn9c102_module_exit(void) | ||
3440 | { | ||
3441 | usb_deregister(&sn9c102_usb_driver); | ||
3442 | } | ||
3443 | |||
3444 | |||
3445 | module_init(sn9c102_module_init); | ||
3446 | module_exit(sn9c102_module_exit); | ||
diff --git a/drivers/media/video/stk-webcam.c b/drivers/media/video/stk-webcam.c index cbc105f975de..b7fb5a5cad7e 100644 --- a/drivers/media/video/stk-webcam.c +++ b/drivers/media/video/stk-webcam.c | |||
@@ -1377,25 +1377,4 @@ static struct usb_driver stk_camera_driver = { | |||
1377 | #endif | 1377 | #endif |
1378 | }; | 1378 | }; |
1379 | 1379 | ||
1380 | 1380 | module_usb_driver(stk_camera_driver); | |
1381 | static int __init stk_camera_init(void) | ||
1382 | { | ||
1383 | int result; | ||
1384 | |||
1385 | result = usb_register(&stk_camera_driver); | ||
1386 | if (result) | ||
1387 | STK_ERROR("usb_register failed ! Error number %d\n", result); | ||
1388 | |||
1389 | |||
1390 | return result; | ||
1391 | } | ||
1392 | |||
1393 | static void __exit stk_camera_exit(void) | ||
1394 | { | ||
1395 | usb_deregister(&stk_camera_driver); | ||
1396 | } | ||
1397 | |||
1398 | module_init(stk_camera_init); | ||
1399 | module_exit(stk_camera_exit); | ||
1400 | |||
1401 | |||
diff --git a/drivers/media/video/tm6000/tm6000-cards.c b/drivers/media/video/tm6000/tm6000-cards.c index ec2578a0fdf7..ff939bc0e0b9 100644 --- a/drivers/media/video/tm6000/tm6000-cards.c +++ b/drivers/media/video/tm6000/tm6000-cards.c | |||
@@ -1371,31 +1371,7 @@ static struct usb_driver tm6000_usb_driver = { | |||
1371 | .id_table = tm6000_id_table, | 1371 | .id_table = tm6000_id_table, |
1372 | }; | 1372 | }; |
1373 | 1373 | ||
1374 | static int __init tm6000_module_init(void) | 1374 | module_usb_driver(tm6000_usb_driver); |
1375 | { | ||
1376 | int result; | ||
1377 | |||
1378 | printk(KERN_INFO "tm6000" " v4l2 driver version %d.%d.%d loaded\n", | ||
1379 | (TM6000_VERSION >> 16) & 0xff, | ||
1380 | (TM6000_VERSION >> 8) & 0xff, TM6000_VERSION & 0xff); | ||
1381 | |||
1382 | /* register this driver with the USB subsystem */ | ||
1383 | result = usb_register(&tm6000_usb_driver); | ||
1384 | if (result) | ||
1385 | printk(KERN_ERR "tm6000" | ||
1386 | " usb_register failed. Error number %d.\n", result); | ||
1387 | |||
1388 | return result; | ||
1389 | } | ||
1390 | |||
1391 | static void __exit tm6000_module_exit(void) | ||
1392 | { | ||
1393 | /* deregister at USB subsystem */ | ||
1394 | usb_deregister(&tm6000_usb_driver); | ||
1395 | } | ||
1396 | |||
1397 | module_init(tm6000_module_init); | ||
1398 | module_exit(tm6000_module_exit); | ||
1399 | 1375 | ||
1400 | MODULE_DESCRIPTION("Trident TVMaster TM5600/TM6000/TM6010 USB2 adapter"); | 1376 | MODULE_DESCRIPTION("Trident TVMaster TM5600/TM6000/TM6010 USB2 adapter"); |
1401 | MODULE_AUTHOR("Mauro Carvalho Chehab"); | 1377 | MODULE_AUTHOR("Mauro Carvalho Chehab"); |
diff --git a/drivers/media/video/zr364xx.c b/drivers/media/video/zr364xx.c index e78cf94f491e..cd2e39fc4bf0 100644 --- a/drivers/media/video/zr364xx.c +++ b/drivers/media/video/zr364xx.c | |||
@@ -1695,28 +1695,7 @@ static struct usb_driver zr364xx_driver = { | |||
1695 | .id_table = device_table | 1695 | .id_table = device_table |
1696 | }; | 1696 | }; |
1697 | 1697 | ||
1698 | 1698 | module_usb_driver(zr364xx_driver); | |
1699 | static int __init zr364xx_init(void) | ||
1700 | { | ||
1701 | int retval; | ||
1702 | retval = usb_register(&zr364xx_driver); | ||
1703 | if (retval) | ||
1704 | printk(KERN_ERR KBUILD_MODNAME ": usb_register failed!\n"); | ||
1705 | else | ||
1706 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC "\n"); | ||
1707 | return retval; | ||
1708 | } | ||
1709 | |||
1710 | |||
1711 | static void __exit zr364xx_exit(void) | ||
1712 | { | ||
1713 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC " module unloaded\n"); | ||
1714 | usb_deregister(&zr364xx_driver); | ||
1715 | } | ||
1716 | |||
1717 | |||
1718 | module_init(zr364xx_init); | ||
1719 | module_exit(zr364xx_exit); | ||
1720 | 1699 | ||
1721 | MODULE_AUTHOR(DRIVER_AUTHOR); | 1700 | MODULE_AUTHOR(DRIVER_AUTHOR); |
1722 | MODULE_DESCRIPTION(DRIVER_DESC); | 1701 | MODULE_DESCRIPTION(DRIVER_DESC); |
diff --git a/drivers/mmc/host/ushc.c b/drivers/mmc/host/ushc.c index f08f944ac53c..c0105a2e269a 100644 --- a/drivers/mmc/host/ushc.c +++ b/drivers/mmc/host/ushc.c | |||
@@ -562,17 +562,7 @@ static struct usb_driver ushc_driver = { | |||
562 | .disconnect = ushc_disconnect, | 562 | .disconnect = ushc_disconnect, |
563 | }; | 563 | }; |
564 | 564 | ||
565 | static int __init ushc_init(void) | 565 | module_usb_driver(ushc_driver); |
566 | { | ||
567 | return usb_register(&ushc_driver); | ||
568 | } | ||
569 | module_init(ushc_init); | ||
570 | |||
571 | static void __exit ushc_exit(void) | ||
572 | { | ||
573 | usb_deregister(&ushc_driver); | ||
574 | } | ||
575 | module_exit(ushc_exit); | ||
576 | 566 | ||
577 | MODULE_DESCRIPTION("USB SD Host Controller driver"); | 567 | MODULE_DESCRIPTION("USB SD Host Controller driver"); |
578 | MODULE_AUTHOR("David Vrabel <david.vrabel@csr.com>"); | 568 | MODULE_AUTHOR("David Vrabel <david.vrabel@csr.com>"); |
diff --git a/drivers/mtd/nand/alauda.c b/drivers/mtd/nand/alauda.c index eb40ea829ab2..6a5ff64a139e 100644 --- a/drivers/mtd/nand/alauda.c +++ b/drivers/mtd/nand/alauda.c | |||
@@ -717,17 +717,6 @@ static struct usb_driver alauda_driver = { | |||
717 | .id_table = alauda_table, | 717 | .id_table = alauda_table, |
718 | }; | 718 | }; |
719 | 719 | ||
720 | static int __init alauda_init(void) | 720 | module_usb_driver(alauda_driver); |
721 | { | ||
722 | return usb_register(&alauda_driver); | ||
723 | } | ||
724 | |||
725 | static void __exit alauda_exit(void) | ||
726 | { | ||
727 | usb_deregister(&alauda_driver); | ||
728 | } | ||
729 | |||
730 | module_init(alauda_init); | ||
731 | module_exit(alauda_exit); | ||
732 | 721 | ||
733 | MODULE_LICENSE("GPL"); | 722 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index 4ef7e2fd9fe6..aef42f045320 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
27 | #include <linux/device.h> | 27 | #include <linux/device.h> |
28 | #include <linux/sched.h> | 28 | #include <linux/sched.h> |
29 | #include <linux/sysdev.h> | ||
30 | #include <linux/fs.h> | 29 | #include <linux/fs.h> |
31 | #include <linux/types.h> | 30 | #include <linux/types.h> |
32 | #include <linux/string.h> | 31 | #include <linux/string.h> |
diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c index a72c7bfb4090..9697c14b8dc6 100644 --- a/drivers/net/can/usb/ems_usb.c +++ b/drivers/net/can/usb/ems_usb.c | |||
@@ -1115,28 +1115,4 @@ static struct usb_driver ems_usb_driver = { | |||
1115 | .id_table = ems_usb_table, | 1115 | .id_table = ems_usb_table, |
1116 | }; | 1116 | }; |
1117 | 1117 | ||
1118 | static int __init ems_usb_init(void) | 1118 | module_usb_driver(ems_usb_driver); |
1119 | { | ||
1120 | int err; | ||
1121 | |||
1122 | printk(KERN_INFO "CPC-USB kernel driver loaded\n"); | ||
1123 | |||
1124 | /* register this driver with the USB subsystem */ | ||
1125 | err = usb_register(&ems_usb_driver); | ||
1126 | |||
1127 | if (err) { | ||
1128 | err("usb_register failed. Error number %d\n", err); | ||
1129 | return err; | ||
1130 | } | ||
1131 | |||
1132 | return 0; | ||
1133 | } | ||
1134 | |||
1135 | static void __exit ems_usb_exit(void) | ||
1136 | { | ||
1137 | /* deregister this driver with the USB subsystem */ | ||
1138 | usb_deregister(&ems_usb_driver); | ||
1139 | } | ||
1140 | |||
1141 | module_init(ems_usb_init); | ||
1142 | module_exit(ems_usb_exit); | ||
diff --git a/drivers/net/can/usb/esd_usb2.c b/drivers/net/can/usb/esd_usb2.c index eb8b0e600282..92774637aad8 100644 --- a/drivers/net/can/usb/esd_usb2.c +++ b/drivers/net/can/usb/esd_usb2.c | |||
@@ -1108,25 +1108,4 @@ static struct usb_driver esd_usb2_driver = { | |||
1108 | .id_table = esd_usb2_table, | 1108 | .id_table = esd_usb2_table, |
1109 | }; | 1109 | }; |
1110 | 1110 | ||
1111 | static int __init esd_usb2_init(void) | 1111 | module_usb_driver(esd_usb2_driver); |
1112 | { | ||
1113 | int err; | ||
1114 | |||
1115 | /* register this driver with the USB subsystem */ | ||
1116 | err = usb_register(&esd_usb2_driver); | ||
1117 | |||
1118 | if (err) { | ||
1119 | err("usb_register failed. Error number %d\n", err); | ||
1120 | return err; | ||
1121 | } | ||
1122 | |||
1123 | return 0; | ||
1124 | } | ||
1125 | module_init(esd_usb2_init); | ||
1126 | |||
1127 | static void __exit esd_usb2_exit(void) | ||
1128 | { | ||
1129 | /* deregister this driver with the USB subsystem */ | ||
1130 | usb_deregister(&esd_usb2_driver); | ||
1131 | } | ||
1132 | module_exit(esd_usb2_exit); | ||
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c index d9267cb98a23..72f687b40d66 100644 --- a/drivers/net/irda/irda-usb.c +++ b/drivers/net/irda/irda-usb.c | |||
@@ -1914,41 +1914,8 @@ static struct usb_driver irda_driver = { | |||
1914 | #endif | 1914 | #endif |
1915 | }; | 1915 | }; |
1916 | 1916 | ||
1917 | /************************* MODULE CALLBACKS *************************/ | 1917 | module_usb_driver(irda_driver); |
1918 | /* | ||
1919 | * Deal with module insertion/removal | ||
1920 | * Mostly tell USB about our existence | ||
1921 | */ | ||
1922 | |||
1923 | /*------------------------------------------------------------------*/ | ||
1924 | /* | ||
1925 | * Module insertion | ||
1926 | */ | ||
1927 | static int __init usb_irda_init(void) | ||
1928 | { | ||
1929 | int ret; | ||
1930 | |||
1931 | ret = usb_register(&irda_driver); | ||
1932 | if (ret < 0) | ||
1933 | return ret; | ||
1934 | |||
1935 | IRDA_MESSAGE("USB IrDA support registered\n"); | ||
1936 | return 0; | ||
1937 | } | ||
1938 | module_init(usb_irda_init); | ||
1939 | 1918 | ||
1940 | /*------------------------------------------------------------------*/ | ||
1941 | /* | ||
1942 | * Module removal | ||
1943 | */ | ||
1944 | static void __exit usb_irda_cleanup(void) | ||
1945 | { | ||
1946 | /* Deregister the driver and remove all pending instances */ | ||
1947 | usb_deregister(&irda_driver); | ||
1948 | } | ||
1949 | module_exit(usb_irda_cleanup); | ||
1950 | |||
1951 | /*------------------------------------------------------------------*/ | ||
1952 | /* | 1919 | /* |
1953 | * Module parameters | 1920 | * Module parameters |
1954 | */ | 1921 | */ |
diff --git a/drivers/net/irda/kingsun-sir.c b/drivers/net/irda/kingsun-sir.c index cb90d640007a..79aebeee928c 100644 --- a/drivers/net/irda/kingsun-sir.c +++ b/drivers/net/irda/kingsun-sir.c | |||
@@ -621,24 +621,7 @@ static struct usb_driver irda_driver = { | |||
621 | #endif | 621 | #endif |
622 | }; | 622 | }; |
623 | 623 | ||
624 | /* | 624 | module_usb_driver(irda_driver); |
625 | * Module insertion | ||
626 | */ | ||
627 | static int __init kingsun_init(void) | ||
628 | { | ||
629 | return usb_register(&irda_driver); | ||
630 | } | ||
631 | module_init(kingsun_init); | ||
632 | |||
633 | /* | ||
634 | * Module removal | ||
635 | */ | ||
636 | static void __exit kingsun_cleanup(void) | ||
637 | { | ||
638 | /* Deregister the driver and remove all pending instances */ | ||
639 | usb_deregister(&irda_driver); | ||
640 | } | ||
641 | module_exit(kingsun_cleanup); | ||
642 | 625 | ||
643 | MODULE_AUTHOR("Alex VillacÃs Lasso <a_villacis@palosanto.com>"); | 626 | MODULE_AUTHOR("Alex VillacÃs Lasso <a_villacis@palosanto.com>"); |
644 | MODULE_DESCRIPTION("IrDA-USB Dongle Driver for KingSun/DonShine"); | 627 | MODULE_DESCRIPTION("IrDA-USB Dongle Driver for KingSun/DonShine"); |
diff --git a/drivers/net/irda/ks959-sir.c b/drivers/net/irda/ks959-sir.c index 1046014dd6c2..abe689dffc72 100644 --- a/drivers/net/irda/ks959-sir.c +++ b/drivers/net/irda/ks959-sir.c | |||
@@ -901,26 +901,7 @@ static struct usb_driver irda_driver = { | |||
901 | #endif | 901 | #endif |
902 | }; | 902 | }; |
903 | 903 | ||
904 | /* | 904 | module_usb_driver(irda_driver); |
905 | * Module insertion | ||
906 | */ | ||
907 | static int __init ks959_init(void) | ||
908 | { | ||
909 | return usb_register(&irda_driver); | ||
910 | } | ||
911 | |||
912 | module_init(ks959_init); | ||
913 | |||
914 | /* | ||
915 | * Module removal | ||
916 | */ | ||
917 | static void __exit ks959_cleanup(void) | ||
918 | { | ||
919 | /* Deregister the driver and remove all pending instances */ | ||
920 | usb_deregister(&irda_driver); | ||
921 | } | ||
922 | |||
923 | module_exit(ks959_cleanup); | ||
924 | 905 | ||
925 | MODULE_AUTHOR("Alex VillacÃs Lasso <a_villacis@palosanto.com>"); | 906 | MODULE_AUTHOR("Alex VillacÃs Lasso <a_villacis@palosanto.com>"); |
926 | MODULE_DESCRIPTION("IrDA-USB Dongle Driver for KingSun KS-959"); | 907 | MODULE_DESCRIPTION("IrDA-USB Dongle Driver for KingSun KS-959"); |
diff --git a/drivers/net/irda/ksdazzle-sir.c b/drivers/net/irda/ksdazzle-sir.c index 9cc142fcc712..f8c01088eeb7 100644 --- a/drivers/net/irda/ksdazzle-sir.c +++ b/drivers/net/irda/ksdazzle-sir.c | |||
@@ -796,26 +796,7 @@ static struct usb_driver irda_driver = { | |||
796 | #endif | 796 | #endif |
797 | }; | 797 | }; |
798 | 798 | ||
799 | /* | 799 | module_usb_driver(irda_driver); |
800 | * Module insertion | ||
801 | */ | ||
802 | static int __init ksdazzle_init(void) | ||
803 | { | ||
804 | return usb_register(&irda_driver); | ||
805 | } | ||
806 | |||
807 | module_init(ksdazzle_init); | ||
808 | |||
809 | /* | ||
810 | * Module removal | ||
811 | */ | ||
812 | static void __exit ksdazzle_cleanup(void) | ||
813 | { | ||
814 | /* Deregister the driver and remove all pending instances */ | ||
815 | usb_deregister(&irda_driver); | ||
816 | } | ||
817 | |||
818 | module_exit(ksdazzle_cleanup); | ||
819 | 800 | ||
820 | MODULE_AUTHOR("Alex VillacÃs Lasso <a_villacis@palosanto.com>"); | 801 | MODULE_AUTHOR("Alex VillacÃs Lasso <a_villacis@palosanto.com>"); |
821 | MODULE_DESCRIPTION("IrDA-USB Dongle Driver for KingSun Dazzle"); | 802 | MODULE_DESCRIPTION("IrDA-USB Dongle Driver for KingSun Dazzle"); |
diff --git a/drivers/net/irda/mcs7780.c b/drivers/net/irda/mcs7780.c index be52bfed66a9..1a00b5990cb8 100644 --- a/drivers/net/irda/mcs7780.c +++ b/drivers/net/irda/mcs7780.c | |||
@@ -968,25 +968,4 @@ static void mcs_disconnect(struct usb_interface *intf) | |||
968 | IRDA_DEBUG(0, "MCS7780 now disconnected.\n"); | 968 | IRDA_DEBUG(0, "MCS7780 now disconnected.\n"); |
969 | } | 969 | } |
970 | 970 | ||
971 | /* Module insertion */ | 971 | module_usb_driver(mcs_driver); |
972 | static int __init mcs_init(void) | ||
973 | { | ||
974 | int result; | ||
975 | |||
976 | /* register this driver with the USB subsystem */ | ||
977 | result = usb_register(&mcs_driver); | ||
978 | if (result) | ||
979 | IRDA_ERROR("usb_register failed. Error number %d\n", result); | ||
980 | |||
981 | return result; | ||
982 | } | ||
983 | module_init(mcs_init); | ||
984 | |||
985 | /* Module removal */ | ||
986 | static void __exit mcs_exit(void) | ||
987 | { | ||
988 | /* deregister this driver with the USB subsystem */ | ||
989 | usb_deregister(&mcs_driver); | ||
990 | } | ||
991 | module_exit(mcs_exit); | ||
992 | |||
diff --git a/drivers/net/irda/stir4200.c b/drivers/net/irda/stir4200.c index 41c96b3d8152..212868eb6f5f 100644 --- a/drivers/net/irda/stir4200.c +++ b/drivers/net/irda/stir4200.c | |||
@@ -1133,21 +1133,4 @@ static struct usb_driver irda_driver = { | |||
1133 | #endif | 1133 | #endif |
1134 | }; | 1134 | }; |
1135 | 1135 | ||
1136 | /* | 1136 | module_usb_driver(irda_driver); |
1137 | * Module insertion | ||
1138 | */ | ||
1139 | static int __init stir_init(void) | ||
1140 | { | ||
1141 | return usb_register(&irda_driver); | ||
1142 | } | ||
1143 | module_init(stir_init); | ||
1144 | |||
1145 | /* | ||
1146 | * Module removal | ||
1147 | */ | ||
1148 | static void __exit stir_cleanup(void) | ||
1149 | { | ||
1150 | /* Deregister the driver and remove all pending instances */ | ||
1151 | usb_deregister(&irda_driver); | ||
1152 | } | ||
1153 | module_exit(stir_cleanup); | ||
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c index dbdca225b846..1ff7163bc348 100644 --- a/drivers/net/usb/asix.c +++ b/drivers/net/usb/asix.c | |||
@@ -1678,17 +1678,7 @@ static struct usb_driver asix_driver = { | |||
1678 | .supports_autosuspend = 1, | 1678 | .supports_autosuspend = 1, |
1679 | }; | 1679 | }; |
1680 | 1680 | ||
1681 | static int __init asix_init(void) | 1681 | module_usb_driver(asix_driver); |
1682 | { | ||
1683 | return usb_register(&asix_driver); | ||
1684 | } | ||
1685 | module_init(asix_init); | ||
1686 | |||
1687 | static void __exit asix_exit(void) | ||
1688 | { | ||
1689 | usb_deregister(&asix_driver); | ||
1690 | } | ||
1691 | module_exit(asix_exit); | ||
1692 | 1682 | ||
1693 | MODULE_AUTHOR("David Hollis"); | 1683 | MODULE_AUTHOR("David Hollis"); |
1694 | MODULE_VERSION(DRIVER_VERSION); | 1684 | MODULE_VERSION(DRIVER_VERSION); |
diff --git a/drivers/net/usb/catc.c b/drivers/net/usb/catc.c index a68272c93381..182cfb4aeb1d 100644 --- a/drivers/net/usb/catc.c +++ b/drivers/net/usb/catc.c | |||
@@ -949,19 +949,4 @@ static struct usb_driver catc_driver = { | |||
949 | .id_table = catc_id_table, | 949 | .id_table = catc_id_table, |
950 | }; | 950 | }; |
951 | 951 | ||
952 | static int __init catc_init(void) | 952 | module_usb_driver(catc_driver); |
953 | { | ||
954 | int result = usb_register(&catc_driver); | ||
955 | if (result == 0) | ||
956 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
957 | DRIVER_DESC "\n"); | ||
958 | return result; | ||
959 | } | ||
960 | |||
961 | static void __exit catc_exit(void) | ||
962 | { | ||
963 | usb_deregister(&catc_driver); | ||
964 | } | ||
965 | |||
966 | module_init(catc_init); | ||
967 | module_exit(catc_exit); | ||
diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c index 331e44056f5a..790cbdea7392 100644 --- a/drivers/net/usb/cdc-phonet.c +++ b/drivers/net/usb/cdc-phonet.c | |||
@@ -457,18 +457,7 @@ static struct usb_driver usbpn_driver = { | |||
457 | .id_table = usbpn_ids, | 457 | .id_table = usbpn_ids, |
458 | }; | 458 | }; |
459 | 459 | ||
460 | static int __init usbpn_init(void) | 460 | module_usb_driver(usbpn_driver); |
461 | { | ||
462 | return usb_register(&usbpn_driver); | ||
463 | } | ||
464 | |||
465 | static void __exit usbpn_exit(void) | ||
466 | { | ||
467 | usb_deregister(&usbpn_driver); | ||
468 | } | ||
469 | |||
470 | module_init(usbpn_init); | ||
471 | module_exit(usbpn_exit); | ||
472 | 461 | ||
473 | MODULE_AUTHOR("Remi Denis-Courmont"); | 462 | MODULE_AUTHOR("Remi Denis-Courmont"); |
474 | MODULE_DESCRIPTION("USB CDC Phonet host interface"); | 463 | MODULE_DESCRIPTION("USB CDC Phonet host interface"); |
diff --git a/drivers/net/usb/cdc_eem.c b/drivers/net/usb/cdc_eem.c index 882f53f708df..439690be519f 100644 --- a/drivers/net/usb/cdc_eem.c +++ b/drivers/net/usb/cdc_eem.c | |||
@@ -369,18 +369,7 @@ static struct usb_driver eem_driver = { | |||
369 | .resume = usbnet_resume, | 369 | .resume = usbnet_resume, |
370 | }; | 370 | }; |
371 | 371 | ||
372 | 372 | module_usb_driver(eem_driver); | |
373 | static int __init eem_init(void) | ||
374 | { | ||
375 | return usb_register(&eem_driver); | ||
376 | } | ||
377 | module_init(eem_init); | ||
378 | |||
379 | static void __exit eem_exit(void) | ||
380 | { | ||
381 | usb_deregister(&eem_driver); | ||
382 | } | ||
383 | module_exit(eem_exit); | ||
384 | 373 | ||
385 | MODULE_AUTHOR("Omar Laazimani <omar.oberthur@gmail.com>"); | 374 | MODULE_AUTHOR("Omar Laazimani <omar.oberthur@gmail.com>"); |
386 | MODULE_DESCRIPTION("USB CDC EEM"); | 375 | MODULE_DESCRIPTION("USB CDC EEM"); |
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c index 99ed6eb4dfaf..41a61efc331e 100644 --- a/drivers/net/usb/cdc_ether.c +++ b/drivers/net/usb/cdc_ether.c | |||
@@ -425,6 +425,9 @@ int usbnet_cdc_bind(struct usbnet *dev, struct usb_interface *intf) | |||
425 | int status; | 425 | int status; |
426 | struct cdc_state *info = (void *) &dev->data; | 426 | struct cdc_state *info = (void *) &dev->data; |
427 | 427 | ||
428 | BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data) | ||
429 | < sizeof(struct cdc_state))); | ||
430 | |||
428 | status = usbnet_generic_cdc_bind(dev, intf); | 431 | status = usbnet_generic_cdc_bind(dev, intf); |
429 | if (status < 0) | 432 | if (status < 0) |
430 | return status; | 433 | return status; |
@@ -615,21 +618,7 @@ static struct usb_driver cdc_driver = { | |||
615 | .supports_autosuspend = 1, | 618 | .supports_autosuspend = 1, |
616 | }; | 619 | }; |
617 | 620 | ||
618 | 621 | module_usb_driver(cdc_driver); | |
619 | static int __init cdc_init(void) | ||
620 | { | ||
621 | BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data) | ||
622 | < sizeof(struct cdc_state))); | ||
623 | |||
624 | return usb_register(&cdc_driver); | ||
625 | } | ||
626 | module_init(cdc_init); | ||
627 | |||
628 | static void __exit cdc_exit(void) | ||
629 | { | ||
630 | usb_deregister(&cdc_driver); | ||
631 | } | ||
632 | module_exit(cdc_exit); | ||
633 | 622 | ||
634 | MODULE_AUTHOR("David Brownell"); | 623 | MODULE_AUTHOR("David Brownell"); |
635 | MODULE_DESCRIPTION("USB CDC Ethernet devices"); | 624 | MODULE_DESCRIPTION("USB CDC Ethernet devices"); |
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 009dd0f18535..cb8e595c5021 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c | |||
@@ -1230,20 +1230,7 @@ static struct ethtool_ops cdc_ncm_ethtool_ops = { | |||
1230 | .nway_reset = usbnet_nway_reset, | 1230 | .nway_reset = usbnet_nway_reset, |
1231 | }; | 1231 | }; |
1232 | 1232 | ||
1233 | static int __init cdc_ncm_init(void) | 1233 | module_usb_driver(cdc_ncm_driver); |
1234 | { | ||
1235 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION "\n"); | ||
1236 | return usb_register(&cdc_ncm_driver); | ||
1237 | } | ||
1238 | |||
1239 | module_init(cdc_ncm_init); | ||
1240 | |||
1241 | static void __exit cdc_ncm_exit(void) | ||
1242 | { | ||
1243 | usb_deregister(&cdc_ncm_driver); | ||
1244 | } | ||
1245 | |||
1246 | module_exit(cdc_ncm_exit); | ||
1247 | 1234 | ||
1248 | MODULE_AUTHOR("Hans Petter Selasky"); | 1235 | MODULE_AUTHOR("Hans Petter Selasky"); |
1249 | MODULE_DESCRIPTION("USB CDC NCM host driver"); | 1236 | MODULE_DESCRIPTION("USB CDC NCM host driver"); |
diff --git a/drivers/net/usb/cdc_subset.c b/drivers/net/usb/cdc_subset.c index fc5f13d47ad9..b403d934e4e3 100644 --- a/drivers/net/usb/cdc_subset.c +++ b/drivers/net/usb/cdc_subset.c | |||
@@ -338,17 +338,7 @@ static struct usb_driver cdc_subset_driver = { | |||
338 | .id_table = products, | 338 | .id_table = products, |
339 | }; | 339 | }; |
340 | 340 | ||
341 | static int __init cdc_subset_init(void) | 341 | module_usb_driver(cdc_subset_driver); |
342 | { | ||
343 | return usb_register(&cdc_subset_driver); | ||
344 | } | ||
345 | module_init(cdc_subset_init); | ||
346 | |||
347 | static void __exit cdc_subset_exit(void) | ||
348 | { | ||
349 | usb_deregister(&cdc_subset_driver); | ||
350 | } | ||
351 | module_exit(cdc_subset_exit); | ||
352 | 342 | ||
353 | MODULE_AUTHOR("David Brownell"); | 343 | MODULE_AUTHOR("David Brownell"); |
354 | MODULE_DESCRIPTION("Simple 'CDC Subset' USB networking links"); | 344 | MODULE_DESCRIPTION("Simple 'CDC Subset' USB networking links"); |
diff --git a/drivers/net/usb/cx82310_eth.c b/drivers/net/usb/cx82310_eth.c index 8969f124c18c..0e0531356e62 100644 --- a/drivers/net/usb/cx82310_eth.c +++ b/drivers/net/usb/cx82310_eth.c | |||
@@ -329,17 +329,7 @@ static struct usb_driver cx82310_driver = { | |||
329 | .resume = usbnet_resume, | 329 | .resume = usbnet_resume, |
330 | }; | 330 | }; |
331 | 331 | ||
332 | static int __init cx82310_init(void) | 332 | module_usb_driver(cx82310_driver); |
333 | { | ||
334 | return usb_register(&cx82310_driver); | ||
335 | } | ||
336 | module_init(cx82310_init); | ||
337 | |||
338 | static void __exit cx82310_exit(void) | ||
339 | { | ||
340 | usb_deregister(&cx82310_driver); | ||
341 | } | ||
342 | module_exit(cx82310_exit); | ||
343 | 333 | ||
344 | MODULE_AUTHOR("Ondrej Zary"); | 334 | MODULE_AUTHOR("Ondrej Zary"); |
345 | MODULE_DESCRIPTION("Conexant CX82310-based ADSL router USB ethernet driver"); | 335 | MODULE_DESCRIPTION("Conexant CX82310-based ADSL router USB ethernet driver"); |
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c index fbc0e4def767..b97226318ea5 100644 --- a/drivers/net/usb/dm9601.c +++ b/drivers/net/usb/dm9601.c | |||
@@ -672,18 +672,7 @@ static struct usb_driver dm9601_driver = { | |||
672 | .resume = usbnet_resume, | 672 | .resume = usbnet_resume, |
673 | }; | 673 | }; |
674 | 674 | ||
675 | static int __init dm9601_init(void) | 675 | module_usb_driver(dm9601_driver); |
676 | { | ||
677 | return usb_register(&dm9601_driver); | ||
678 | } | ||
679 | |||
680 | static void __exit dm9601_exit(void) | ||
681 | { | ||
682 | usb_deregister(&dm9601_driver); | ||
683 | } | ||
684 | |||
685 | module_init(dm9601_init); | ||
686 | module_exit(dm9601_exit); | ||
687 | 676 | ||
688 | MODULE_AUTHOR("Peter Korsgaard <jacmet@sunsite.dk>"); | 677 | MODULE_AUTHOR("Peter Korsgaard <jacmet@sunsite.dk>"); |
689 | MODULE_DESCRIPTION("Davicom DM9601 USB 1.1 ethernet devices"); | 678 | MODULE_DESCRIPTION("Davicom DM9601 USB 1.1 ethernet devices"); |
diff --git a/drivers/net/usb/gl620a.c b/drivers/net/usb/gl620a.c index c4cfd1dea881..38266bdae26b 100644 --- a/drivers/net/usb/gl620a.c +++ b/drivers/net/usb/gl620a.c | |||
@@ -227,17 +227,7 @@ static struct usb_driver gl620a_driver = { | |||
227 | .resume = usbnet_resume, | 227 | .resume = usbnet_resume, |
228 | }; | 228 | }; |
229 | 229 | ||
230 | static int __init usbnet_init(void) | 230 | module_usb_driver(gl620a_driver); |
231 | { | ||
232 | return usb_register(&gl620a_driver); | ||
233 | } | ||
234 | module_init(usbnet_init); | ||
235 | |||
236 | static void __exit usbnet_exit(void) | ||
237 | { | ||
238 | usb_deregister(&gl620a_driver); | ||
239 | } | ||
240 | module_exit(usbnet_exit); | ||
241 | 231 | ||
242 | MODULE_AUTHOR("Jiun-Jie Huang"); | 232 | MODULE_AUTHOR("Jiun-Jie Huang"); |
243 | MODULE_DESCRIPTION("GL620-USB-A Host-to-Host Link cables"); | 233 | MODULE_DESCRIPTION("GL620-USB-A Host-to-Host Link cables"); |
diff --git a/drivers/net/usb/int51x1.c b/drivers/net/usb/int51x1.c index 131ac6c172f6..12a22a453ff1 100644 --- a/drivers/net/usb/int51x1.c +++ b/drivers/net/usb/int51x1.c | |||
@@ -238,17 +238,7 @@ static struct usb_driver int51x1_driver = { | |||
238 | .resume = usbnet_resume, | 238 | .resume = usbnet_resume, |
239 | }; | 239 | }; |
240 | 240 | ||
241 | static int __init int51x1_init(void) | 241 | module_usb_driver(int51x1_driver); |
242 | { | ||
243 | return usb_register(&int51x1_driver); | ||
244 | } | ||
245 | module_init(int51x1_init); | ||
246 | |||
247 | static void __exit int51x1_exit(void) | ||
248 | { | ||
249 | usb_deregister(&int51x1_driver); | ||
250 | } | ||
251 | module_exit(int51x1_exit); | ||
252 | 242 | ||
253 | MODULE_AUTHOR("Peter Holik"); | 243 | MODULE_AUTHOR("Peter Holik"); |
254 | MODULE_DESCRIPTION("Intellon usb powerline adapter"); | 244 | MODULE_DESCRIPTION("Intellon usb powerline adapter"); |
diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c index 13c1f044b40d..08a4df238796 100644 --- a/drivers/net/usb/ipheth.c +++ b/drivers/net/usb/ipheth.c | |||
@@ -543,25 +543,7 @@ static struct usb_driver ipheth_driver = { | |||
543 | .id_table = ipheth_table, | 543 | .id_table = ipheth_table, |
544 | }; | 544 | }; |
545 | 545 | ||
546 | static int __init ipheth_init(void) | 546 | module_usb_driver(ipheth_driver); |
547 | { | ||
548 | int retval; | ||
549 | |||
550 | retval = usb_register(&ipheth_driver); | ||
551 | if (retval) { | ||
552 | err("usb_register failed: %d", retval); | ||
553 | return retval; | ||
554 | } | ||
555 | return 0; | ||
556 | } | ||
557 | |||
558 | static void __exit ipheth_exit(void) | ||
559 | { | ||
560 | usb_deregister(&ipheth_driver); | ||
561 | } | ||
562 | |||
563 | module_init(ipheth_init); | ||
564 | module_exit(ipheth_exit); | ||
565 | 547 | ||
566 | MODULE_AUTHOR("Diego Giagio <diego@giagio.com>"); | 548 | MODULE_AUTHOR("Diego Giagio <diego@giagio.com>"); |
567 | MODULE_DESCRIPTION("Apple iPhone USB Ethernet driver"); | 549 | MODULE_DESCRIPTION("Apple iPhone USB Ethernet driver"); |
diff --git a/drivers/net/usb/kalmia.c b/drivers/net/usb/kalmia.c index 5a6d0f88f43b..7562649b3d6b 100644 --- a/drivers/net/usb/kalmia.c +++ b/drivers/net/usb/kalmia.c | |||
@@ -375,17 +375,7 @@ static struct usb_driver kalmia_driver = { | |||
375 | .resume = usbnet_resume | 375 | .resume = usbnet_resume |
376 | }; | 376 | }; |
377 | 377 | ||
378 | static int __init kalmia_init(void) | 378 | module_usb_driver(kalmia_driver); |
379 | { | ||
380 | return usb_register(&kalmia_driver); | ||
381 | } | ||
382 | module_init( kalmia_init); | ||
383 | |||
384 | static void __exit kalmia_exit(void) | ||
385 | { | ||
386 | usb_deregister(&kalmia_driver); | ||
387 | } | ||
388 | module_exit( kalmia_exit); | ||
389 | 379 | ||
390 | MODULE_AUTHOR("Marius Bjoernstad Kotsbak <marius@kotsbak.com>"); | 380 | MODULE_AUTHOR("Marius Bjoernstad Kotsbak <marius@kotsbak.com>"); |
391 | MODULE_DESCRIPTION("Samsung Kalmia USB network driver"); | 381 | MODULE_DESCRIPTION("Samsung Kalmia USB network driver"); |
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c index 582ca2dfa5f9..d034d9c42548 100644 --- a/drivers/net/usb/kaweth.c +++ b/drivers/net/usb/kaweth.c | |||
@@ -1324,32 +1324,4 @@ static int kaweth_internal_control_msg(struct usb_device *usb_dev, | |||
1324 | } | 1324 | } |
1325 | } | 1325 | } |
1326 | 1326 | ||
1327 | 1327 | module_usb_driver(kaweth_driver); | |
1328 | /**************************************************************** | ||
1329 | * kaweth_init | ||
1330 | ****************************************************************/ | ||
1331 | static int __init kaweth_init(void) | ||
1332 | { | ||
1333 | dbg("Driver loading"); | ||
1334 | return usb_register(&kaweth_driver); | ||
1335 | } | ||
1336 | |||
1337 | /**************************************************************** | ||
1338 | * kaweth_exit | ||
1339 | ****************************************************************/ | ||
1340 | static void __exit kaweth_exit(void) | ||
1341 | { | ||
1342 | usb_deregister(&kaweth_driver); | ||
1343 | } | ||
1344 | |||
1345 | module_init(kaweth_init); | ||
1346 | module_exit(kaweth_exit); | ||
1347 | |||
1348 | |||
1349 | |||
1350 | |||
1351 | |||
1352 | |||
1353 | |||
1354 | |||
1355 | |||
diff --git a/drivers/net/usb/lg-vl600.c b/drivers/net/usb/lg-vl600.c index 9c26c6390d69..45a981fde43f 100644 --- a/drivers/net/usb/lg-vl600.c +++ b/drivers/net/usb/lg-vl600.c | |||
@@ -346,17 +346,7 @@ static struct usb_driver lg_vl600_driver = { | |||
346 | .resume = usbnet_resume, | 346 | .resume = usbnet_resume, |
347 | }; | 347 | }; |
348 | 348 | ||
349 | static int __init vl600_init(void) | 349 | module_usb_driver(lg_vl600_driver); |
350 | { | ||
351 | return usb_register(&lg_vl600_driver); | ||
352 | } | ||
353 | module_init(vl600_init); | ||
354 | |||
355 | static void __exit vl600_exit(void) | ||
356 | { | ||
357 | usb_deregister(&lg_vl600_driver); | ||
358 | } | ||
359 | module_exit(vl600_exit); | ||
360 | 350 | ||
361 | MODULE_AUTHOR("Anrzej Zaborowski"); | 351 | MODULE_AUTHOR("Anrzej Zaborowski"); |
362 | MODULE_DESCRIPTION("LG-VL600 modem's ethernet link"); | 352 | MODULE_DESCRIPTION("LG-VL600 modem's ethernet link"); |
diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c index db2cb74bf854..a29aa9cf9f6e 100644 --- a/drivers/net/usb/mcs7830.c +++ b/drivers/net/usb/mcs7830.c | |||
@@ -692,17 +692,7 @@ static struct usb_driver mcs7830_driver = { | |||
692 | .reset_resume = mcs7830_reset_resume, | 692 | .reset_resume = mcs7830_reset_resume, |
693 | }; | 693 | }; |
694 | 694 | ||
695 | static int __init mcs7830_init(void) | 695 | module_usb_driver(mcs7830_driver); |
696 | { | ||
697 | return usb_register(&mcs7830_driver); | ||
698 | } | ||
699 | module_init(mcs7830_init); | ||
700 | |||
701 | static void __exit mcs7830_exit(void) | ||
702 | { | ||
703 | usb_deregister(&mcs7830_driver); | ||
704 | } | ||
705 | module_exit(mcs7830_exit); | ||
706 | 696 | ||
707 | MODULE_DESCRIPTION("USB to network adapter MCS7830)"); | 697 | MODULE_DESCRIPTION("USB to network adapter MCS7830)"); |
708 | MODULE_LICENSE("GPL"); | 698 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/net/usb/net1080.c b/drivers/net/usb/net1080.c index 01db4602a39e..83f965cb69e7 100644 --- a/drivers/net/usb/net1080.c +++ b/drivers/net/usb/net1080.c | |||
@@ -589,17 +589,7 @@ static struct usb_driver net1080_driver = { | |||
589 | .resume = usbnet_resume, | 589 | .resume = usbnet_resume, |
590 | }; | 590 | }; |
591 | 591 | ||
592 | static int __init net1080_init(void) | 592 | module_usb_driver(net1080_driver); |
593 | { | ||
594 | return usb_register(&net1080_driver); | ||
595 | } | ||
596 | module_init(net1080_init); | ||
597 | |||
598 | static void __exit net1080_exit(void) | ||
599 | { | ||
600 | usb_deregister(&net1080_driver); | ||
601 | } | ||
602 | module_exit(net1080_exit); | ||
603 | 593 | ||
604 | MODULE_AUTHOR("David Brownell"); | 594 | MODULE_AUTHOR("David Brownell"); |
605 | MODULE_DESCRIPTION("NetChip 1080 based USB Host-to-Host Links"); | 595 | MODULE_DESCRIPTION("NetChip 1080 based USB Host-to-Host Links"); |
diff --git a/drivers/net/usb/plusb.c b/drivers/net/usb/plusb.c index 217aec8a768f..b2b035e29978 100644 --- a/drivers/net/usb/plusb.c +++ b/drivers/net/usb/plusb.c | |||
@@ -154,17 +154,7 @@ static struct usb_driver plusb_driver = { | |||
154 | .resume = usbnet_resume, | 154 | .resume = usbnet_resume, |
155 | }; | 155 | }; |
156 | 156 | ||
157 | static int __init plusb_init(void) | 157 | module_usb_driver(plusb_driver); |
158 | { | ||
159 | return usb_register(&plusb_driver); | ||
160 | } | ||
161 | module_init(plusb_init); | ||
162 | |||
163 | static void __exit plusb_exit(void) | ||
164 | { | ||
165 | usb_deregister(&plusb_driver); | ||
166 | } | ||
167 | module_exit(plusb_exit); | ||
168 | 158 | ||
169 | MODULE_AUTHOR("David Brownell"); | 159 | MODULE_AUTHOR("David Brownell"); |
170 | MODULE_DESCRIPTION("Prolific PL-2301/2302/25A1 USB Host to Host Link Driver"); | 160 | MODULE_DESCRIPTION("Prolific PL-2301/2302/25A1 USB Host to Host Link Driver"); |
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c index 255d6a424a6b..c8f1b5b3aff3 100644 --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c | |||
@@ -635,17 +635,7 @@ static struct usb_driver rndis_driver = { | |||
635 | .resume = usbnet_resume, | 635 | .resume = usbnet_resume, |
636 | }; | 636 | }; |
637 | 637 | ||
638 | static int __init rndis_init(void) | 638 | module_usb_driver(rndis_driver); |
639 | { | ||
640 | return usb_register(&rndis_driver); | ||
641 | } | ||
642 | module_init(rndis_init); | ||
643 | |||
644 | static void __exit rndis_exit(void) | ||
645 | { | ||
646 | usb_deregister(&rndis_driver); | ||
647 | } | ||
648 | module_exit(rndis_exit); | ||
649 | 639 | ||
650 | MODULE_AUTHOR("David Brownell"); | 640 | MODULE_AUTHOR("David Brownell"); |
651 | MODULE_DESCRIPTION("USB Host side RNDIS driver"); | 641 | MODULE_DESCRIPTION("USB Host side RNDIS driver"); |
diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c index bf8c84d0adf2..0710b4ca9252 100644 --- a/drivers/net/usb/rtl8150.c +++ b/drivers/net/usb/rtl8150.c | |||
@@ -978,20 +978,7 @@ static struct usb_driver rtl8150_driver = { | |||
978 | .resume = rtl8150_resume | 978 | .resume = rtl8150_resume |
979 | }; | 979 | }; |
980 | 980 | ||
981 | static int __init usb_rtl8150_init(void) | 981 | module_usb_driver(rtl8150_driver); |
982 | { | ||
983 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
984 | DRIVER_DESC "\n"); | ||
985 | return usb_register(&rtl8150_driver); | ||
986 | } | ||
987 | |||
988 | static void __exit usb_rtl8150_exit(void) | ||
989 | { | ||
990 | usb_deregister(&rtl8150_driver); | ||
991 | } | ||
992 | |||
993 | module_init(usb_rtl8150_init); | ||
994 | module_exit(usb_rtl8150_exit); | ||
995 | 982 | ||
996 | MODULE_AUTHOR(DRIVER_AUTHOR); | 983 | MODULE_AUTHOR(DRIVER_AUTHOR); |
997 | MODULE_DESCRIPTION(DRIVER_DESC); | 984 | MODULE_DESCRIPTION(DRIVER_DESC); |
diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c index ed1b43210584..e45dfdcb8718 100644 --- a/drivers/net/usb/sierra_net.c +++ b/drivers/net/usb/sierra_net.c | |||
@@ -900,6 +900,9 @@ struct sk_buff *sierra_net_tx_fixup(struct usbnet *dev, struct sk_buff *skb, | |||
900 | u16 len; | 900 | u16 len; |
901 | bool need_tail; | 901 | bool need_tail; |
902 | 902 | ||
903 | BUILD_BUG_ON(FIELD_SIZEOF(struct usbnet, data) | ||
904 | < sizeof(struct cdc_state)); | ||
905 | |||
903 | dev_dbg(&dev->udev->dev, "%s", __func__); | 906 | dev_dbg(&dev->udev->dev, "%s", __func__); |
904 | if (priv->link_up && check_ethip_packet(skb, dev) && is_ip(skb)) { | 907 | if (priv->link_up && check_ethip_packet(skb, dev) && is_ip(skb)) { |
905 | /* enough head room as is? */ | 908 | /* enough head room as is? */ |
@@ -981,21 +984,7 @@ static struct usb_driver sierra_net_driver = { | |||
981 | .no_dynamic_id = 1, | 984 | .no_dynamic_id = 1, |
982 | }; | 985 | }; |
983 | 986 | ||
984 | static int __init sierra_net_init(void) | 987 | module_usb_driver(sierra_net_driver); |
985 | { | ||
986 | BUILD_BUG_ON(FIELD_SIZEOF(struct usbnet, data) | ||
987 | < sizeof(struct cdc_state)); | ||
988 | |||
989 | return usb_register(&sierra_net_driver); | ||
990 | } | ||
991 | |||
992 | static void __exit sierra_net_exit(void) | ||
993 | { | ||
994 | usb_deregister(&sierra_net_driver); | ||
995 | } | ||
996 | |||
997 | module_exit(sierra_net_exit); | ||
998 | module_init(sierra_net_init); | ||
999 | 988 | ||
1000 | MODULE_AUTHOR(DRIVER_AUTHOR); | 989 | MODULE_AUTHOR(DRIVER_AUTHOR); |
1001 | MODULE_DESCRIPTION(DRIVER_DESC); | 990 | MODULE_DESCRIPTION(DRIVER_DESC); |
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c index 0d5da82f0ff7..3b017bbd2a22 100644 --- a/drivers/net/usb/smsc75xx.c +++ b/drivers/net/usb/smsc75xx.c | |||
@@ -1238,17 +1238,7 @@ static struct usb_driver smsc75xx_driver = { | |||
1238 | .disconnect = usbnet_disconnect, | 1238 | .disconnect = usbnet_disconnect, |
1239 | }; | 1239 | }; |
1240 | 1240 | ||
1241 | static int __init smsc75xx_init(void) | 1241 | module_usb_driver(smsc75xx_driver); |
1242 | { | ||
1243 | return usb_register(&smsc75xx_driver); | ||
1244 | } | ||
1245 | module_init(smsc75xx_init); | ||
1246 | |||
1247 | static void __exit smsc75xx_exit(void) | ||
1248 | { | ||
1249 | usb_deregister(&smsc75xx_driver); | ||
1250 | } | ||
1251 | module_exit(smsc75xx_exit); | ||
1252 | 1242 | ||
1253 | MODULE_AUTHOR("Nancy Lin"); | 1243 | MODULE_AUTHOR("Nancy Lin"); |
1254 | MODULE_AUTHOR("Steve Glendinning <steve.glendinning@smsc.com>"); | 1244 | MODULE_AUTHOR("Steve Glendinning <steve.glendinning@smsc.com>"); |
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index db217ad66f26..d45520e6dd48 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c | |||
@@ -1298,17 +1298,7 @@ static struct usb_driver smsc95xx_driver = { | |||
1298 | .disconnect = usbnet_disconnect, | 1298 | .disconnect = usbnet_disconnect, |
1299 | }; | 1299 | }; |
1300 | 1300 | ||
1301 | static int __init smsc95xx_init(void) | 1301 | module_usb_driver(smsc95xx_driver); |
1302 | { | ||
1303 | return usb_register(&smsc95xx_driver); | ||
1304 | } | ||
1305 | module_init(smsc95xx_init); | ||
1306 | |||
1307 | static void __exit smsc95xx_exit(void) | ||
1308 | { | ||
1309 | usb_deregister(&smsc95xx_driver); | ||
1310 | } | ||
1311 | module_exit(smsc95xx_exit); | ||
1312 | 1302 | ||
1313 | MODULE_AUTHOR("Nancy Lin"); | 1303 | MODULE_AUTHOR("Nancy Lin"); |
1314 | MODULE_AUTHOR("Steve Glendinning <steve.glendinning@smsc.com>"); | 1304 | MODULE_AUTHOR("Steve Glendinning <steve.glendinning@smsc.com>"); |
diff --git a/drivers/net/usb/zaurus.c b/drivers/net/usb/zaurus.c index 1a2234c20514..f701d4127087 100644 --- a/drivers/net/usb/zaurus.c +++ b/drivers/net/usb/zaurus.c | |||
@@ -362,17 +362,7 @@ static struct usb_driver zaurus_driver = { | |||
362 | .resume = usbnet_resume, | 362 | .resume = usbnet_resume, |
363 | }; | 363 | }; |
364 | 364 | ||
365 | static int __init zaurus_init(void) | 365 | module_usb_driver(zaurus_driver); |
366 | { | ||
367 | return usb_register(&zaurus_driver); | ||
368 | } | ||
369 | module_init(zaurus_init); | ||
370 | |||
371 | static void __exit zaurus_exit(void) | ||
372 | { | ||
373 | usb_deregister(&zaurus_driver); | ||
374 | } | ||
375 | module_exit(zaurus_exit); | ||
376 | 366 | ||
377 | MODULE_AUTHOR("Pavel Machek, David Brownell"); | 367 | MODULE_AUTHOR("Pavel Machek, David Brownell"); |
378 | MODULE_DESCRIPTION("Sharp Zaurus PDA, and compatible products"); | 368 | MODULE_DESCRIPTION("Sharp Zaurus PDA, and compatible products"); |
diff --git a/drivers/net/wireless/ath/carl9170/usb.c b/drivers/net/wireless/ath/carl9170/usb.c index 333b69ef2ae2..89821e4835c7 100644 --- a/drivers/net/wireless/ath/carl9170/usb.c +++ b/drivers/net/wireless/ath/carl9170/usb.c | |||
@@ -1161,15 +1161,4 @@ static struct usb_driver carl9170_driver = { | |||
1161 | #endif /* CONFIG_PM */ | 1161 | #endif /* CONFIG_PM */ |
1162 | }; | 1162 | }; |
1163 | 1163 | ||
1164 | static int __init carl9170_usb_init(void) | 1164 | module_usb_driver(carl9170_driver); |
1165 | { | ||
1166 | return usb_register(&carl9170_driver); | ||
1167 | } | ||
1168 | |||
1169 | static void __exit carl9170_usb_exit(void) | ||
1170 | { | ||
1171 | usb_deregister(&carl9170_driver); | ||
1172 | } | ||
1173 | |||
1174 | module_init(carl9170_usb_init); | ||
1175 | module_exit(carl9170_usb_exit); | ||
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c index db879c364ebf..b5fbbc7947df 100644 --- a/drivers/net/wireless/libertas/if_usb.c +++ b/drivers/net/wireless/libertas/if_usb.c | |||
@@ -1184,29 +1184,7 @@ static struct usb_driver if_usb_driver = { | |||
1184 | .reset_resume = if_usb_resume, | 1184 | .reset_resume = if_usb_resume, |
1185 | }; | 1185 | }; |
1186 | 1186 | ||
1187 | static int __init if_usb_init_module(void) | 1187 | module_usb_driver(if_usb_driver); |
1188 | { | ||
1189 | int ret = 0; | ||
1190 | |||
1191 | lbs_deb_enter(LBS_DEB_MAIN); | ||
1192 | |||
1193 | ret = usb_register(&if_usb_driver); | ||
1194 | |||
1195 | lbs_deb_leave_args(LBS_DEB_MAIN, "ret %d", ret); | ||
1196 | return ret; | ||
1197 | } | ||
1198 | |||
1199 | static void __exit if_usb_exit_module(void) | ||
1200 | { | ||
1201 | lbs_deb_enter(LBS_DEB_MAIN); | ||
1202 | |||
1203 | usb_deregister(&if_usb_driver); | ||
1204 | |||
1205 | lbs_deb_leave(LBS_DEB_MAIN); | ||
1206 | } | ||
1207 | |||
1208 | module_init(if_usb_init_module); | ||
1209 | module_exit(if_usb_exit_module); | ||
1210 | 1188 | ||
1211 | MODULE_DESCRIPTION("8388 USB WLAN Driver"); | 1189 | MODULE_DESCRIPTION("8388 USB WLAN Driver"); |
1212 | MODULE_AUTHOR("Marvell International Ltd. and Red Hat, Inc."); | 1190 | MODULE_AUTHOR("Marvell International Ltd. and Red Hat, Inc."); |
diff --git a/drivers/net/wireless/libertas_tf/if_usb.c b/drivers/net/wireless/libertas_tf/if_usb.c index 68202e63873a..aff8b5743af0 100644 --- a/drivers/net/wireless/libertas_tf/if_usb.c +++ b/drivers/net/wireless/libertas_tf/if_usb.c | |||
@@ -924,27 +924,7 @@ static struct usb_driver if_usb_driver = { | |||
924 | .resume = if_usb_resume, | 924 | .resume = if_usb_resume, |
925 | }; | 925 | }; |
926 | 926 | ||
927 | static int __init if_usb_init_module(void) | 927 | module_usb_driver(if_usb_driver); |
928 | { | ||
929 | int ret = 0; | ||
930 | |||
931 | lbtf_deb_enter(LBTF_DEB_MAIN); | ||
932 | |||
933 | ret = usb_register(&if_usb_driver); | ||
934 | |||
935 | lbtf_deb_leave_args(LBTF_DEB_MAIN, "ret %d", ret); | ||
936 | return ret; | ||
937 | } | ||
938 | |||
939 | static void __exit if_usb_exit_module(void) | ||
940 | { | ||
941 | lbtf_deb_enter(LBTF_DEB_MAIN); | ||
942 | usb_deregister(&if_usb_driver); | ||
943 | lbtf_deb_leave(LBTF_DEB_MAIN); | ||
944 | } | ||
945 | |||
946 | module_init(if_usb_init_module); | ||
947 | module_exit(if_usb_exit_module); | ||
948 | 928 | ||
949 | MODULE_DESCRIPTION("8388 USB WLAN Thinfirm Driver"); | 929 | MODULE_DESCRIPTION("8388 USB WLAN Thinfirm Driver"); |
950 | MODULE_AUTHOR("Cozybit Inc."); | 930 | MODULE_AUTHOR("Cozybit Inc."); |
diff --git a/drivers/net/wireless/orinoco/orinoco_usb.c b/drivers/net/wireless/orinoco/orinoco_usb.c index 0793e4265b43..ae8ce56670b6 100644 --- a/drivers/net/wireless/orinoco/orinoco_usb.c +++ b/drivers/net/wireless/orinoco/orinoco_usb.c | |||
@@ -1759,32 +1759,7 @@ static struct usb_driver orinoco_driver = { | |||
1759 | static char version[] __initdata = DRIVER_NAME " " DRIVER_VERSION | 1759 | static char version[] __initdata = DRIVER_NAME " " DRIVER_VERSION |
1760 | " (Manuel Estrada Sainz)"; | 1760 | " (Manuel Estrada Sainz)"; |
1761 | 1761 | ||
1762 | static int __init ezusb_module_init(void) | 1762 | module_usb_driver(orinoco_driver); |
1763 | { | ||
1764 | int err; | ||
1765 | |||
1766 | printk(KERN_DEBUG "%s\n", version); | ||
1767 | |||
1768 | /* register this driver with the USB subsystem */ | ||
1769 | err = usb_register(&orinoco_driver); | ||
1770 | if (err < 0) { | ||
1771 | printk(KERN_ERR PFX "usb_register failed, error %d\n", | ||
1772 | err); | ||
1773 | return err; | ||
1774 | } | ||
1775 | |||
1776 | return 0; | ||
1777 | } | ||
1778 | |||
1779 | static void __exit ezusb_module_exit(void) | ||
1780 | { | ||
1781 | /* deregister this driver with the USB subsystem */ | ||
1782 | usb_deregister(&orinoco_driver); | ||
1783 | } | ||
1784 | |||
1785 | |||
1786 | module_init(ezusb_module_init); | ||
1787 | module_exit(ezusb_module_exit); | ||
1788 | 1763 | ||
1789 | MODULE_AUTHOR("Manuel Estrada Sainz"); | 1764 | MODULE_AUTHOR("Manuel Estrada Sainz"); |
1790 | MODULE_DESCRIPTION("Driver for Orinoco wireless LAN cards using EZUSB bridge"); | 1765 | MODULE_DESCRIPTION("Driver for Orinoco wireless LAN cards using EZUSB bridge"); |
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c index 9b6096866427..f4d28c39aac7 100644 --- a/drivers/net/wireless/p54/p54usb.c +++ b/drivers/net/wireless/p54/p54usb.c | |||
@@ -1083,15 +1083,4 @@ static struct usb_driver p54u_driver = { | |||
1083 | .soft_unbind = 1, | 1083 | .soft_unbind = 1, |
1084 | }; | 1084 | }; |
1085 | 1085 | ||
1086 | static int __init p54u_init(void) | 1086 | module_usb_driver(p54u_driver); |
1087 | { | ||
1088 | return usb_register(&p54u_driver); | ||
1089 | } | ||
1090 | |||
1091 | static void __exit p54u_exit(void) | ||
1092 | { | ||
1093 | usb_deregister(&p54u_driver); | ||
1094 | } | ||
1095 | |||
1096 | module_init(p54u_init); | ||
1097 | module_exit(p54u_exit); | ||
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index 3802c31fefcd..a330c69583d6 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c | |||
@@ -3771,17 +3771,7 @@ static struct usb_driver rndis_wlan_driver = { | |||
3771 | .resume = usbnet_resume, | 3771 | .resume = usbnet_resume, |
3772 | }; | 3772 | }; |
3773 | 3773 | ||
3774 | static int __init rndis_wlan_init(void) | 3774 | module_usb_driver(rndis_wlan_driver); |
3775 | { | ||
3776 | return usb_register(&rndis_wlan_driver); | ||
3777 | } | ||
3778 | module_init(rndis_wlan_init); | ||
3779 | |||
3780 | static void __exit rndis_wlan_exit(void) | ||
3781 | { | ||
3782 | usb_deregister(&rndis_wlan_driver); | ||
3783 | } | ||
3784 | module_exit(rndis_wlan_exit); | ||
3785 | 3775 | ||
3786 | MODULE_AUTHOR("Bjorge Dijkstra"); | 3776 | MODULE_AUTHOR("Bjorge Dijkstra"); |
3787 | MODULE_AUTHOR("Jussi Kivilinna"); | 3777 | MODULE_AUTHOR("Jussi Kivilinna"); |
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index de7d41f21a69..1de9c752c88b 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -1982,15 +1982,4 @@ static struct usb_driver rt2500usb_driver = { | |||
1982 | .resume = rt2x00usb_resume, | 1982 | .resume = rt2x00usb_resume, |
1983 | }; | 1983 | }; |
1984 | 1984 | ||
1985 | static int __init rt2500usb_init(void) | 1985 | module_usb_driver(rt2500usb_driver); |
1986 | { | ||
1987 | return usb_register(&rt2500usb_driver); | ||
1988 | } | ||
1989 | |||
1990 | static void __exit rt2500usb_exit(void) | ||
1991 | { | ||
1992 | usb_deregister(&rt2500usb_driver); | ||
1993 | } | ||
1994 | |||
1995 | module_init(rt2500usb_init); | ||
1996 | module_exit(rt2500usb_exit); | ||
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c index f8eb49f5ac29..262ee9eefb6f 100644 --- a/drivers/net/wireless/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/rt2x00/rt2800usb.c | |||
@@ -1217,15 +1217,4 @@ static struct usb_driver rt2800usb_driver = { | |||
1217 | .resume = rt2x00usb_resume, | 1217 | .resume = rt2x00usb_resume, |
1218 | }; | 1218 | }; |
1219 | 1219 | ||
1220 | static int __init rt2800usb_init(void) | 1220 | module_usb_driver(rt2800usb_driver); |
1221 | { | ||
1222 | return usb_register(&rt2800usb_driver); | ||
1223 | } | ||
1224 | |||
1225 | static void __exit rt2800usb_exit(void) | ||
1226 | { | ||
1227 | usb_deregister(&rt2800usb_driver); | ||
1228 | } | ||
1229 | |||
1230 | module_init(rt2800usb_init); | ||
1231 | module_exit(rt2800usb_exit); | ||
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index 1c69c737086d..e477a964081d 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -2528,15 +2528,4 @@ static struct usb_driver rt73usb_driver = { | |||
2528 | .resume = rt2x00usb_resume, | 2528 | .resume = rt2x00usb_resume, |
2529 | }; | 2529 | }; |
2530 | 2530 | ||
2531 | static int __init rt73usb_init(void) | 2531 | module_usb_driver(rt73usb_driver); |
2532 | { | ||
2533 | return usb_register(&rt73usb_driver); | ||
2534 | } | ||
2535 | |||
2536 | static void __exit rt73usb_exit(void) | ||
2537 | { | ||
2538 | usb_deregister(&rt73usb_driver); | ||
2539 | } | ||
2540 | |||
2541 | module_init(rt73usb_init); | ||
2542 | module_exit(rt73usb_exit); | ||
diff --git a/drivers/net/wireless/rtl818x/rtl8187/dev.c b/drivers/net/wireless/rtl818x/rtl8187/dev.c index 4a78f9e39dfa..638fbef693e6 100644 --- a/drivers/net/wireless/rtl818x/rtl8187/dev.c +++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c | |||
@@ -1592,15 +1592,4 @@ static struct usb_driver rtl8187_driver = { | |||
1592 | .disconnect = __devexit_p(rtl8187_disconnect), | 1592 | .disconnect = __devexit_p(rtl8187_disconnect), |
1593 | }; | 1593 | }; |
1594 | 1594 | ||
1595 | static int __init rtl8187_init(void) | 1595 | module_usb_driver(rtl8187_driver); |
1596 | { | ||
1597 | return usb_register(&rtl8187_driver); | ||
1598 | } | ||
1599 | |||
1600 | static void __exit rtl8187_exit(void) | ||
1601 | { | ||
1602 | usb_deregister(&rtl8187_driver); | ||
1603 | } | ||
1604 | |||
1605 | module_init(rtl8187_init); | ||
1606 | module_exit(rtl8187_exit); | ||
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c index 3527c7957b45..6d2ca773bbc7 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | |||
@@ -384,15 +384,4 @@ static struct usb_driver rtl8192cu_driver = { | |||
384 | #endif | 384 | #endif |
385 | }; | 385 | }; |
386 | 386 | ||
387 | static int __init rtl8192cu_init(void) | 387 | module_usb_driver(rtl8192cu_driver); |
388 | { | ||
389 | return usb_register(&rtl8192cu_driver); | ||
390 | } | ||
391 | |||
392 | static void __exit rtl8192cu_exit(void) | ||
393 | { | ||
394 | usb_deregister(&rtl8192cu_driver); | ||
395 | } | ||
396 | |||
397 | module_init(rtl8192cu_init); | ||
398 | module_exit(rtl8192cu_exit); | ||
diff --git a/drivers/net/wireless/zd1201.c b/drivers/net/wireless/zd1201.c index 8efa2f2d9579..a66b93b7ff9a 100644 --- a/drivers/net/wireless/zd1201.c +++ b/drivers/net/wireless/zd1201.c | |||
@@ -1907,15 +1907,4 @@ static struct usb_driver zd1201_usb = { | |||
1907 | .resume = zd1201_resume, | 1907 | .resume = zd1201_resume, |
1908 | }; | 1908 | }; |
1909 | 1909 | ||
1910 | static int __init zd1201_init(void) | 1910 | module_usb_driver(zd1201_usb); |
1911 | { | ||
1912 | return usb_register(&zd1201_usb); | ||
1913 | } | ||
1914 | |||
1915 | static void __exit zd1201_cleanup(void) | ||
1916 | { | ||
1917 | usb_deregister(&zd1201_usb); | ||
1918 | } | ||
1919 | |||
1920 | module_init(zd1201_init); | ||
1921 | module_exit(zd1201_cleanup); | ||
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c index b8b6c2abbd4a..1a1500bc8452 100644 --- a/drivers/nfc/pn533.c +++ b/drivers/nfc/pn533.c | |||
@@ -1761,24 +1761,7 @@ static struct usb_driver pn533_driver = { | |||
1761 | .id_table = pn533_table, | 1761 | .id_table = pn533_table, |
1762 | }; | 1762 | }; |
1763 | 1763 | ||
1764 | static int __init pn533_init(void) | 1764 | module_usb_driver(pn533_driver); |
1765 | { | ||
1766 | int rc; | ||
1767 | |||
1768 | rc = usb_register(&pn533_driver); | ||
1769 | if (rc) | ||
1770 | err("usb_register failed. Error number %d", rc); | ||
1771 | |||
1772 | return rc; | ||
1773 | } | ||
1774 | |||
1775 | static void __exit pn533_exit(void) | ||
1776 | { | ||
1777 | usb_deregister(&pn533_driver); | ||
1778 | } | ||
1779 | |||
1780 | module_init(pn533_init); | ||
1781 | module_exit(pn533_exit); | ||
1782 | 1765 | ||
1783 | MODULE_AUTHOR("Lauro Ramos Venancio <lauro.venancio@openbossa.org>," | 1766 | MODULE_AUTHOR("Lauro Ramos Venancio <lauro.venancio@openbossa.org>," |
1784 | " Aloisio Almeida Jr <aloisio.almeida@openbossa.org>"); | 1767 | " Aloisio Almeida Jr <aloisio.almeida@openbossa.org>"); |
diff --git a/drivers/platform/x86/ibm_rtl.c b/drivers/platform/x86/ibm_rtl.c index 811d436cd677..42a7d603c870 100644 --- a/drivers/platform/x86/ibm_rtl.c +++ b/drivers/platform/x86/ibm_rtl.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #include <linux/delay.h> | 28 | #include <linux/delay.h> |
29 | #include <linux/module.h> | 29 | #include <linux/module.h> |
30 | #include <linux/io.h> | 30 | #include <linux/io.h> |
31 | #include <linux/sysdev.h> | ||
32 | #include <linux/dmi.h> | 31 | #include <linux/dmi.h> |
33 | #include <linux/efi.h> | 32 | #include <linux/efi.h> |
34 | #include <linux/mutex.h> | 33 | #include <linux/mutex.h> |
@@ -165,22 +164,22 @@ static int ibm_rtl_write(u8 value) | |||
165 | return ret; | 164 | return ret; |
166 | } | 165 | } |
167 | 166 | ||
168 | static ssize_t rtl_show_version(struct sysdev_class * dev, | 167 | static ssize_t rtl_show_version(struct device *dev, |
169 | struct sysdev_class_attribute *attr, | 168 | struct device_attribute *attr, |
170 | char *buf) | 169 | char *buf) |
171 | { | 170 | { |
172 | return sprintf(buf, "%d\n", (int)ioread8(&rtl_table->version)); | 171 | return sprintf(buf, "%d\n", (int)ioread8(&rtl_table->version)); |
173 | } | 172 | } |
174 | 173 | ||
175 | static ssize_t rtl_show_state(struct sysdev_class *dev, | 174 | static ssize_t rtl_show_state(struct device *dev, |
176 | struct sysdev_class_attribute *attr, | 175 | struct device_attribute *attr, |
177 | char *buf) | 176 | char *buf) |
178 | { | 177 | { |
179 | return sprintf(buf, "%d\n", ioread8(&rtl_table->rt_status)); | 178 | return sprintf(buf, "%d\n", ioread8(&rtl_table->rt_status)); |
180 | } | 179 | } |
181 | 180 | ||
182 | static ssize_t rtl_set_state(struct sysdev_class *dev, | 181 | static ssize_t rtl_set_state(struct device *dev, |
183 | struct sysdev_class_attribute *attr, | 182 | struct device_attribute *attr, |
184 | const char *buf, | 183 | const char *buf, |
185 | size_t count) | 184 | size_t count) |
186 | { | 185 | { |
@@ -205,27 +204,28 @@ static ssize_t rtl_set_state(struct sysdev_class *dev, | |||
205 | return ret; | 204 | return ret; |
206 | } | 205 | } |
207 | 206 | ||
208 | static struct sysdev_class class_rtl = { | 207 | static struct bus_type rtl_subsys = { |
209 | .name = "ibm_rtl", | 208 | .name = "ibm_rtl", |
209 | .dev_name = "ibm_rtl", | ||
210 | }; | 210 | }; |
211 | 211 | ||
212 | static SYSDEV_CLASS_ATTR(version, S_IRUGO, rtl_show_version, NULL); | 212 | static DEVICE_ATTR(version, S_IRUGO, rtl_show_version, NULL); |
213 | static SYSDEV_CLASS_ATTR(state, 0600, rtl_show_state, rtl_set_state); | 213 | static DEVICE_ATTR(state, 0600, rtl_show_state, rtl_set_state); |
214 | 214 | ||
215 | static struct sysdev_class_attribute *rtl_attributes[] = { | 215 | static struct device_attribute *rtl_attributes[] = { |
216 | &attr_version, | 216 | &dev_attr_version, |
217 | &attr_state, | 217 | &dev_attr_state, |
218 | NULL | 218 | NULL |
219 | }; | 219 | }; |
220 | 220 | ||
221 | 221 | ||
222 | static int rtl_setup_sysfs(void) { | 222 | static int rtl_setup_sysfs(void) { |
223 | int ret, i; | 223 | int ret, i; |
224 | ret = sysdev_class_register(&class_rtl); | ||
225 | 224 | ||
225 | ret = subsys_system_register(&rtl_subsys, NULL); | ||
226 | if (!ret) { | 226 | if (!ret) { |
227 | for (i = 0; rtl_attributes[i]; i ++) | 227 | for (i = 0; rtl_attributes[i]; i ++) |
228 | sysdev_class_create_file(&class_rtl, rtl_attributes[i]); | 228 | device_create_file(rtl_subsys.dev_root, rtl_attributes[i]); |
229 | } | 229 | } |
230 | return ret; | 230 | return ret; |
231 | } | 231 | } |
@@ -233,8 +233,8 @@ static int rtl_setup_sysfs(void) { | |||
233 | static void rtl_teardown_sysfs(void) { | 233 | static void rtl_teardown_sysfs(void) { |
234 | int i; | 234 | int i; |
235 | for (i = 0; rtl_attributes[i]; i ++) | 235 | for (i = 0; rtl_attributes[i]; i ++) |
236 | sysdev_class_remove_file(&class_rtl, rtl_attributes[i]); | 236 | device_remove_file(rtl_subsys.dev_root, rtl_attributes[i]); |
237 | sysdev_class_unregister(&class_rtl); | 237 | bus_unregister(&rtl_subsys); |
238 | } | 238 | } |
239 | 239 | ||
240 | 240 | ||
diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c index 48870e504231..f00d0d1e0653 100644 --- a/drivers/platform/x86/intel_scu_ipc.c +++ b/drivers/platform/x86/intel_scu_ipc.c | |||
@@ -19,7 +19,7 @@ | |||
19 | #include <linux/delay.h> | 19 | #include <linux/delay.h> |
20 | #include <linux/errno.h> | 20 | #include <linux/errno.h> |
21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
22 | #include <linux/sysdev.h> | 22 | #include <linux/device.h> |
23 | #include <linux/pm.h> | 23 | #include <linux/pm.h> |
24 | #include <linux/pci.h> | 24 | #include <linux/pci.h> |
25 | #include <linux/interrupt.h> | 25 | #include <linux/interrupt.h> |
diff --git a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c index 98f3e4ade924..690c3338a8ae 100644 --- a/drivers/s390/block/xpram.c +++ b/drivers/s390/block/xpram.c | |||
@@ -36,7 +36,7 @@ | |||
36 | #include <linux/blkdev.h> | 36 | #include <linux/blkdev.h> |
37 | #include <linux/blkpg.h> | 37 | #include <linux/blkpg.h> |
38 | #include <linux/hdreg.h> /* HDIO_GETGEO */ | 38 | #include <linux/hdreg.h> /* HDIO_GETGEO */ |
39 | #include <linux/sysdev.h> | 39 | #include <linux/device.h> |
40 | #include <linux/bio.h> | 40 | #include <linux/bio.h> |
41 | #include <linux/suspend.h> | 41 | #include <linux/suspend.h> |
42 | #include <linux/platform_device.h> | 42 | #include <linux/platform_device.h> |
diff --git a/drivers/s390/char/sclp_config.c b/drivers/s390/char/sclp_config.c index 95b909ac2b73..3c03c1060be6 100644 --- a/drivers/s390/char/sclp_config.c +++ b/drivers/s390/char/sclp_config.c | |||
@@ -11,7 +11,7 @@ | |||
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
13 | #include <linux/cpu.h> | 13 | #include <linux/cpu.h> |
14 | #include <linux/sysdev.h> | 14 | #include <linux/device.h> |
15 | #include <linux/workqueue.h> | 15 | #include <linux/workqueue.h> |
16 | #include <asm/smp.h> | 16 | #include <asm/smp.h> |
17 | 17 | ||
@@ -31,14 +31,14 @@ static struct work_struct sclp_cpu_change_work; | |||
31 | static void sclp_cpu_capability_notify(struct work_struct *work) | 31 | static void sclp_cpu_capability_notify(struct work_struct *work) |
32 | { | 32 | { |
33 | int cpu; | 33 | int cpu; |
34 | struct sys_device *sysdev; | 34 | struct device *dev; |
35 | 35 | ||
36 | s390_adjust_jiffies(); | 36 | s390_adjust_jiffies(); |
37 | pr_warning("cpu capability changed.\n"); | 37 | pr_warning("cpu capability changed.\n"); |
38 | get_online_cpus(); | 38 | get_online_cpus(); |
39 | for_each_online_cpu(cpu) { | 39 | for_each_online_cpu(cpu) { |
40 | sysdev = get_cpu_sysdev(cpu); | 40 | dev = get_cpu_device(cpu); |
41 | kobject_uevent(&sysdev->kobj, KOBJ_CHANGE); | 41 | kobject_uevent(&dev->kobj, KOBJ_CHANGE); |
42 | } | 42 | } |
43 | put_online_cpus(); | 43 | put_online_cpus(); |
44 | } | 44 | } |
diff --git a/drivers/sh/intc/core.c b/drivers/sh/intc/core.c index 8b7a141ff35e..e85512dd9c72 100644 --- a/drivers/sh/intc/core.c +++ b/drivers/sh/intc/core.c | |||
@@ -25,7 +25,7 @@ | |||
25 | #include <linux/stat.h> | 25 | #include <linux/stat.h> |
26 | #include <linux/interrupt.h> | 26 | #include <linux/interrupt.h> |
27 | #include <linux/sh_intc.h> | 27 | #include <linux/sh_intc.h> |
28 | #include <linux/sysdev.h> | 28 | #include <linux/device.h> |
29 | #include <linux/syscore_ops.h> | 29 | #include <linux/syscore_ops.h> |
30 | #include <linux/list.h> | 30 | #include <linux/list.h> |
31 | #include <linux/spinlock.h> | 31 | #include <linux/spinlock.h> |
@@ -434,46 +434,47 @@ struct syscore_ops intc_syscore_ops = { | |||
434 | .resume = intc_resume, | 434 | .resume = intc_resume, |
435 | }; | 435 | }; |
436 | 436 | ||
437 | struct sysdev_class intc_sysdev_class = { | 437 | struct bus_type intc_subsys = { |
438 | .name = "intc", | 438 | .name = "intc", |
439 | .dev_name = "intc", | ||
439 | }; | 440 | }; |
440 | 441 | ||
441 | static ssize_t | 442 | static ssize_t |
442 | show_intc_name(struct sys_device *dev, struct sysdev_attribute *attr, char *buf) | 443 | show_intc_name(struct device *dev, struct device_attribute *attr, char *buf) |
443 | { | 444 | { |
444 | struct intc_desc_int *d; | 445 | struct intc_desc_int *d; |
445 | 446 | ||
446 | d = container_of(dev, struct intc_desc_int, sysdev); | 447 | d = container_of(dev, struct intc_desc_int, dev); |
447 | 448 | ||
448 | return sprintf(buf, "%s\n", d->chip.name); | 449 | return sprintf(buf, "%s\n", d->chip.name); |
449 | } | 450 | } |
450 | 451 | ||
451 | static SYSDEV_ATTR(name, S_IRUGO, show_intc_name, NULL); | 452 | static DEVICE_ATTR(name, S_IRUGO, show_intc_name, NULL); |
452 | 453 | ||
453 | static int __init register_intc_sysdevs(void) | 454 | static int __init register_intc_devs(void) |
454 | { | 455 | { |
455 | struct intc_desc_int *d; | 456 | struct intc_desc_int *d; |
456 | int error; | 457 | int error; |
457 | 458 | ||
458 | register_syscore_ops(&intc_syscore_ops); | 459 | register_syscore_ops(&intc_syscore_ops); |
459 | 460 | ||
460 | error = sysdev_class_register(&intc_sysdev_class); | 461 | error = subsys_system_register(&intc_subsys, NULL); |
461 | if (!error) { | 462 | if (!error) { |
462 | list_for_each_entry(d, &intc_list, list) { | 463 | list_for_each_entry(d, &intc_list, list) { |
463 | d->sysdev.id = d->index; | 464 | d->dev.id = d->index; |
464 | d->sysdev.cls = &intc_sysdev_class; | 465 | d->dev.bus = &intc_subsys; |
465 | error = sysdev_register(&d->sysdev); | 466 | error = device_register(&d->dev); |
466 | if (error == 0) | 467 | if (error == 0) |
467 | error = sysdev_create_file(&d->sysdev, | 468 | error = device_create_file(&d->dev, |
468 | &attr_name); | 469 | &dev_attr_name); |
469 | if (error) | 470 | if (error) |
470 | break; | 471 | break; |
471 | } | 472 | } |
472 | } | 473 | } |
473 | 474 | ||
474 | if (error) | 475 | if (error) |
475 | pr_err("sysdev registration error\n"); | 476 | pr_err("device registration error\n"); |
476 | 477 | ||
477 | return error; | 478 | return error; |
478 | } | 479 | } |
479 | device_initcall(register_intc_sysdevs); | 480 | device_initcall(register_intc_devs); |
diff --git a/drivers/sh/intc/internals.h b/drivers/sh/intc/internals.h index 5b934851efa8..1c2722e5af3f 100644 --- a/drivers/sh/intc/internals.h +++ b/drivers/sh/intc/internals.h | |||
@@ -4,7 +4,7 @@ | |||
4 | #include <linux/kernel.h> | 4 | #include <linux/kernel.h> |
5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
6 | #include <linux/radix-tree.h> | 6 | #include <linux/radix-tree.h> |
7 | #include <linux/sysdev.h> | 7 | #include <linux/device.h> |
8 | 8 | ||
9 | #define _INTC_MK(fn, mode, addr_e, addr_d, width, shift) \ | 9 | #define _INTC_MK(fn, mode, addr_e, addr_d, width, shift) \ |
10 | ((shift) | ((width) << 5) | ((fn) << 9) | ((mode) << 13) | \ | 10 | ((shift) | ((width) << 5) | ((fn) << 9) | ((mode) << 13) | \ |
@@ -51,7 +51,7 @@ struct intc_subgroup_entry { | |||
51 | 51 | ||
52 | struct intc_desc_int { | 52 | struct intc_desc_int { |
53 | struct list_head list; | 53 | struct list_head list; |
54 | struct sys_device sysdev; | 54 | struct device dev; |
55 | struct radix_tree_root tree; | 55 | struct radix_tree_root tree; |
56 | raw_spinlock_t lock; | 56 | raw_spinlock_t lock; |
57 | unsigned int index; | 57 | unsigned int index; |
@@ -157,7 +157,7 @@ void _intc_enable(struct irq_data *data, unsigned long handle); | |||
157 | extern struct list_head intc_list; | 157 | extern struct list_head intc_list; |
158 | extern raw_spinlock_t intc_big_lock; | 158 | extern raw_spinlock_t intc_big_lock; |
159 | extern unsigned int nr_intc_controllers; | 159 | extern unsigned int nr_intc_controllers; |
160 | extern struct sysdev_class intc_sysdev_class; | 160 | extern struct bus_type intc_subsys; |
161 | 161 | ||
162 | unsigned int intc_get_dfl_prio_level(void); | 162 | unsigned int intc_get_dfl_prio_level(void); |
163 | unsigned int intc_get_prio_level(unsigned int irq); | 163 | unsigned int intc_get_prio_level(unsigned int irq); |
diff --git a/drivers/sh/intc/userimask.c b/drivers/sh/intc/userimask.c index 56bf9336b92b..e649ceaaa410 100644 --- a/drivers/sh/intc/userimask.c +++ b/drivers/sh/intc/userimask.c | |||
@@ -10,7 +10,7 @@ | |||
10 | #define pr_fmt(fmt) "intc: " fmt | 10 | #define pr_fmt(fmt) "intc: " fmt |
11 | 11 | ||
12 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
13 | #include <linux/sysdev.h> | 13 | #include <linux/device.h> |
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | #include <linux/stat.h> | 16 | #include <linux/stat.h> |
@@ -20,15 +20,15 @@ | |||
20 | static void __iomem *uimask; | 20 | static void __iomem *uimask; |
21 | 21 | ||
22 | static ssize_t | 22 | static ssize_t |
23 | show_intc_userimask(struct sysdev_class *cls, | 23 | show_intc_userimask(struct device *dev, |
24 | struct sysdev_class_attribute *attr, char *buf) | 24 | struct device_attribute *attr, char *buf) |
25 | { | 25 | { |
26 | return sprintf(buf, "%d\n", (__raw_readl(uimask) >> 4) & 0xf); | 26 | return sprintf(buf, "%d\n", (__raw_readl(uimask) >> 4) & 0xf); |
27 | } | 27 | } |
28 | 28 | ||
29 | static ssize_t | 29 | static ssize_t |
30 | store_intc_userimask(struct sysdev_class *cls, | 30 | store_intc_userimask(struct device *dev, |
31 | struct sysdev_class_attribute *attr, | 31 | struct device_attribute *attr, |
32 | const char *buf, size_t count) | 32 | const char *buf, size_t count) |
33 | { | 33 | { |
34 | unsigned long level; | 34 | unsigned long level; |
@@ -55,8 +55,8 @@ store_intc_userimask(struct sysdev_class *cls, | |||
55 | return count; | 55 | return count; |
56 | } | 56 | } |
57 | 57 | ||
58 | static SYSDEV_CLASS_ATTR(userimask, S_IRUSR | S_IWUSR, | 58 | static DEVICE_ATTR(userimask, S_IRUSR | S_IWUSR, |
59 | show_intc_userimask, store_intc_userimask); | 59 | show_intc_userimask, store_intc_userimask); |
60 | 60 | ||
61 | 61 | ||
62 | static int __init userimask_sysdev_init(void) | 62 | static int __init userimask_sysdev_init(void) |
@@ -64,7 +64,7 @@ static int __init userimask_sysdev_init(void) | |||
64 | if (unlikely(!uimask)) | 64 | if (unlikely(!uimask)) |
65 | return -ENXIO; | 65 | return -ENXIO; |
66 | 66 | ||
67 | return sysdev_class_create_file(&intc_sysdev_class, &attr_userimask); | 67 | return device_create_file(intc_subsys.dev_root, &dev_attr_userimask); |
68 | } | 68 | } |
69 | late_initcall(userimask_sysdev_init); | 69 | late_initcall(userimask_sysdev_init); |
70 | 70 | ||
diff --git a/drivers/staging/frontier/alphatrack.c b/drivers/staging/frontier/alphatrack.c index 2babb034a254..d8efed657440 100644 --- a/drivers/staging/frontier/alphatrack.c +++ b/drivers/staging/frontier/alphatrack.c | |||
@@ -867,30 +867,4 @@ static struct usb_driver usb_alphatrack_driver = { | |||
867 | .id_table = usb_alphatrack_table, | 867 | .id_table = usb_alphatrack_table, |
868 | }; | 868 | }; |
869 | 869 | ||
870 | /** | 870 | module_usb_driver(usb_alphatrack_driver); |
871 | * usb_alphatrack_init | ||
872 | */ | ||
873 | static int __init usb_alphatrack_init(void) | ||
874 | { | ||
875 | int retval; | ||
876 | |||
877 | /* register this driver with the USB subsystem */ | ||
878 | retval = usb_register(&usb_alphatrack_driver); | ||
879 | if (retval) | ||
880 | err("usb_register failed for the " __FILE__ | ||
881 | " driver. Error number %d\n", retval); | ||
882 | |||
883 | return retval; | ||
884 | } | ||
885 | |||
886 | /** | ||
887 | * usb_alphatrack_exit | ||
888 | */ | ||
889 | static void __exit usb_alphatrack_exit(void) | ||
890 | { | ||
891 | /* deregister this driver with the USB subsystem */ | ||
892 | usb_deregister(&usb_alphatrack_driver); | ||
893 | } | ||
894 | |||
895 | module_init(usb_alphatrack_init); | ||
896 | module_exit(usb_alphatrack_exit); | ||
diff --git a/drivers/staging/frontier/tranzport.c b/drivers/staging/frontier/tranzport.c index 8894ab14f167..c263284ddc0e 100644 --- a/drivers/staging/frontier/tranzport.c +++ b/drivers/staging/frontier/tranzport.c | |||
@@ -971,29 +971,4 @@ static struct usb_driver usb_tranzport_driver = { | |||
971 | .id_table = usb_tranzport_table, | 971 | .id_table = usb_tranzport_table, |
972 | }; | 972 | }; |
973 | 973 | ||
974 | /** | 974 | module_usb_driver(usb_tranzport_driver); |
975 | * usb_tranzport_init | ||
976 | */ | ||
977 | static int __init usb_tranzport_init(void) | ||
978 | { | ||
979 | int retval; | ||
980 | |||
981 | /* register this driver with the USB subsystem */ | ||
982 | retval = usb_register(&usb_tranzport_driver); | ||
983 | if (retval) | ||
984 | err("usb_register failed for the " __FILE__ | ||
985 | " driver. Error number %d\n", retval); | ||
986 | return retval; | ||
987 | } | ||
988 | /** | ||
989 | * usb_tranzport_exit | ||
990 | */ | ||
991 | |||
992 | static void __exit usb_tranzport_exit(void) | ||
993 | { | ||
994 | /* deregister this driver with the USB subsystem */ | ||
995 | usb_deregister(&usb_tranzport_driver); | ||
996 | } | ||
997 | |||
998 | module_init(usb_tranzport_init); | ||
999 | module_exit(usb_tranzport_exit); | ||
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c index 79482ac1c489..84c38d5c9397 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c | |||
@@ -263,24 +263,4 @@ static struct usb_driver ft1000_usb_driver = { | |||
263 | .id_table = id_table, | 263 | .id_table = id_table, |
264 | }; | 264 | }; |
265 | 265 | ||
266 | static int __init usb_ft1000_init(void) | 266 | module_usb_driver(ft1000_usb_driver); |
267 | { | ||
268 | int ret = 0; | ||
269 | |||
270 | DEBUG("Initialize and register the driver\n"); | ||
271 | |||
272 | ret = usb_register(&ft1000_usb_driver); | ||
273 | if (ret) | ||
274 | err("usb_register failed. Error number %d", ret); | ||
275 | |||
276 | return ret; | ||
277 | } | ||
278 | |||
279 | static void __exit usb_ft1000_exit(void) | ||
280 | { | ||
281 | DEBUG("Deregister the driver\n"); | ||
282 | usb_deregister(&ft1000_usb_driver); | ||
283 | } | ||
284 | |||
285 | module_init(usb_ft1000_init); | ||
286 | module_exit(usb_ft1000_exit); | ||
diff --git a/drivers/staging/iio/accel/adis16201_core.c b/drivers/staging/iio/accel/adis16201_core.c index 1c5dad537844..97f747eac647 100644 --- a/drivers/staging/iio/accel/adis16201_core.c +++ b/drivers/staging/iio/accel/adis16201_core.c | |||
@@ -549,18 +549,7 @@ static struct spi_driver adis16201_driver = { | |||
549 | .probe = adis16201_probe, | 549 | .probe = adis16201_probe, |
550 | .remove = __devexit_p(adis16201_remove), | 550 | .remove = __devexit_p(adis16201_remove), |
551 | }; | 551 | }; |
552 | 552 | module_spi_driver(adis16201_driver); | |
553 | static __init int adis16201_init(void) | ||
554 | { | ||
555 | return spi_register_driver(&adis16201_driver); | ||
556 | } | ||
557 | module_init(adis16201_init); | ||
558 | |||
559 | static __exit void adis16201_exit(void) | ||
560 | { | ||
561 | spi_unregister_driver(&adis16201_driver); | ||
562 | } | ||
563 | module_exit(adis16201_exit); | ||
564 | 553 | ||
565 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); | 554 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); |
566 | MODULE_DESCRIPTION("Analog Devices ADIS16201 Programmable Digital Vibration Sensor driver"); | 555 | MODULE_DESCRIPTION("Analog Devices ADIS16201 Programmable Digital Vibration Sensor driver"); |
diff --git a/drivers/staging/iio/accel/adis16203_core.c b/drivers/staging/iio/accel/adis16203_core.c index 8a3337442afd..a6d6d27f3c97 100644 --- a/drivers/staging/iio/accel/adis16203_core.c +++ b/drivers/staging/iio/accel/adis16203_core.c | |||
@@ -504,18 +504,7 @@ static struct spi_driver adis16203_driver = { | |||
504 | .probe = adis16203_probe, | 504 | .probe = adis16203_probe, |
505 | .remove = __devexit_p(adis16203_remove), | 505 | .remove = __devexit_p(adis16203_remove), |
506 | }; | 506 | }; |
507 | 507 | module_spi_driver(adis16203_driver); | |
508 | static __init int adis16203_init(void) | ||
509 | { | ||
510 | return spi_register_driver(&adis16203_driver); | ||
511 | } | ||
512 | module_init(adis16203_init); | ||
513 | |||
514 | static __exit void adis16203_exit(void) | ||
515 | { | ||
516 | spi_unregister_driver(&adis16203_driver); | ||
517 | } | ||
518 | module_exit(adis16203_exit); | ||
519 | 508 | ||
520 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); | 509 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); |
521 | MODULE_DESCRIPTION("Analog Devices ADIS16203 Programmable Digital Vibration Sensor driver"); | 510 | MODULE_DESCRIPTION("Analog Devices ADIS16203 Programmable Digital Vibration Sensor driver"); |
diff --git a/drivers/staging/iio/accel/adis16204_core.c b/drivers/staging/iio/accel/adis16204_core.c index 644ac8e4d2aa..7ac5b4c533d8 100644 --- a/drivers/staging/iio/accel/adis16204_core.c +++ b/drivers/staging/iio/accel/adis16204_core.c | |||
@@ -577,18 +577,7 @@ static struct spi_driver adis16204_driver = { | |||
577 | .probe = adis16204_probe, | 577 | .probe = adis16204_probe, |
578 | .remove = __devexit_p(adis16204_remove), | 578 | .remove = __devexit_p(adis16204_remove), |
579 | }; | 579 | }; |
580 | 580 | module_spi_driver(adis16204_driver); | |
581 | static __init int adis16204_init(void) | ||
582 | { | ||
583 | return spi_register_driver(&adis16204_driver); | ||
584 | } | ||
585 | module_init(adis16204_init); | ||
586 | |||
587 | static __exit void adis16204_exit(void) | ||
588 | { | ||
589 | spi_unregister_driver(&adis16204_driver); | ||
590 | } | ||
591 | module_exit(adis16204_exit); | ||
592 | 581 | ||
593 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); | 582 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); |
594 | MODULE_DESCRIPTION("ADIS16204 High-g Digital Impact Sensor and Recorder"); | 583 | MODULE_DESCRIPTION("ADIS16204 High-g Digital Impact Sensor and Recorder"); |
diff --git a/drivers/staging/iio/accel/adis16209_core.c b/drivers/staging/iio/accel/adis16209_core.c index 0a8571b18b39..c03afbf5bbdc 100644 --- a/drivers/staging/iio/accel/adis16209_core.c +++ b/drivers/staging/iio/accel/adis16209_core.c | |||
@@ -553,18 +553,7 @@ static struct spi_driver adis16209_driver = { | |||
553 | .probe = adis16209_probe, | 553 | .probe = adis16209_probe, |
554 | .remove = __devexit_p(adis16209_remove), | 554 | .remove = __devexit_p(adis16209_remove), |
555 | }; | 555 | }; |
556 | 556 | module_spi_driver(adis16209_driver); | |
557 | static __init int adis16209_init(void) | ||
558 | { | ||
559 | return spi_register_driver(&adis16209_driver); | ||
560 | } | ||
561 | module_init(adis16209_init); | ||
562 | |||
563 | static __exit void adis16209_exit(void) | ||
564 | { | ||
565 | spi_unregister_driver(&adis16209_driver); | ||
566 | } | ||
567 | module_exit(adis16209_exit); | ||
568 | 557 | ||
569 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); | 558 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); |
570 | MODULE_DESCRIPTION("Analog Devices ADIS16209 Digital Vibration Sensor driver"); | 559 | MODULE_DESCRIPTION("Analog Devices ADIS16209 Digital Vibration Sensor driver"); |
diff --git a/drivers/staging/iio/accel/adis16220_core.c b/drivers/staging/iio/accel/adis16220_core.c index 6d4503de192d..73298e7849e6 100644 --- a/drivers/staging/iio/accel/adis16220_core.c +++ b/drivers/staging/iio/accel/adis16220_core.c | |||
@@ -708,18 +708,7 @@ static struct spi_driver adis16220_driver = { | |||
708 | .probe = adis16220_probe, | 708 | .probe = adis16220_probe, |
709 | .remove = __devexit_p(adis16220_remove), | 709 | .remove = __devexit_p(adis16220_remove), |
710 | }; | 710 | }; |
711 | 711 | module_spi_driver(adis16220_driver); | |
712 | static __init int adis16220_init(void) | ||
713 | { | ||
714 | return spi_register_driver(&adis16220_driver); | ||
715 | } | ||
716 | module_init(adis16220_init); | ||
717 | |||
718 | static __exit void adis16220_exit(void) | ||
719 | { | ||
720 | spi_unregister_driver(&adis16220_driver); | ||
721 | } | ||
722 | module_exit(adis16220_exit); | ||
723 | 712 | ||
724 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); | 713 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); |
725 | MODULE_DESCRIPTION("Analog Devices ADIS16220 Digital Vibration Sensor"); | 714 | MODULE_DESCRIPTION("Analog Devices ADIS16220 Digital Vibration Sensor"); |
diff --git a/drivers/staging/iio/accel/adis16240_core.c b/drivers/staging/iio/accel/adis16240_core.c index b8be2925d61c..88881b9919ef 100644 --- a/drivers/staging/iio/accel/adis16240_core.c +++ b/drivers/staging/iio/accel/adis16240_core.c | |||
@@ -606,18 +606,7 @@ static struct spi_driver adis16240_driver = { | |||
606 | .probe = adis16240_probe, | 606 | .probe = adis16240_probe, |
607 | .remove = __devexit_p(adis16240_remove), | 607 | .remove = __devexit_p(adis16240_remove), |
608 | }; | 608 | }; |
609 | 609 | module_spi_driver(adis16240_driver); | |
610 | static __init int adis16240_init(void) | ||
611 | { | ||
612 | return spi_register_driver(&adis16240_driver); | ||
613 | } | ||
614 | module_init(adis16240_init); | ||
615 | |||
616 | static __exit void adis16240_exit(void) | ||
617 | { | ||
618 | spi_unregister_driver(&adis16240_driver); | ||
619 | } | ||
620 | module_exit(adis16240_exit); | ||
621 | 610 | ||
622 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); | 611 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); |
623 | MODULE_DESCRIPTION("Analog Devices Programmable Impact Sensor and Recorder"); | 612 | MODULE_DESCRIPTION("Analog Devices Programmable Impact Sensor and Recorder"); |
diff --git a/drivers/staging/iio/accel/kxsd9.c b/drivers/staging/iio/accel/kxsd9.c index 5238503f6805..cfce21c2eddc 100644 --- a/drivers/staging/iio/accel/kxsd9.c +++ b/drivers/staging/iio/accel/kxsd9.c | |||
@@ -280,18 +280,7 @@ static struct spi_driver kxsd9_driver = { | |||
280 | .remove = __devexit_p(kxsd9_remove), | 280 | .remove = __devexit_p(kxsd9_remove), |
281 | .id_table = kxsd9_id, | 281 | .id_table = kxsd9_id, |
282 | }; | 282 | }; |
283 | 283 | module_spi_driver(kxsd9_driver); | |
284 | static __init int kxsd9_spi_init(void) | ||
285 | { | ||
286 | return spi_register_driver(&kxsd9_driver); | ||
287 | } | ||
288 | module_init(kxsd9_spi_init); | ||
289 | |||
290 | static __exit void kxsd9_spi_exit(void) | ||
291 | { | ||
292 | spi_unregister_driver(&kxsd9_driver); | ||
293 | } | ||
294 | module_exit(kxsd9_spi_exit); | ||
295 | 284 | ||
296 | MODULE_AUTHOR("Jonathan Cameron <jic23@cam.ac.uk>"); | 285 | MODULE_AUTHOR("Jonathan Cameron <jic23@cam.ac.uk>"); |
297 | MODULE_DESCRIPTION("Kionix KXSD9 SPI driver"); | 286 | MODULE_DESCRIPTION("Kionix KXSD9 SPI driver"); |
diff --git a/drivers/staging/iio/accel/lis3l02dq_core.c b/drivers/staging/iio/accel/lis3l02dq_core.c index 559545a42333..6877521ec173 100644 --- a/drivers/staging/iio/accel/lis3l02dq_core.c +++ b/drivers/staging/iio/accel/lis3l02dq_core.c | |||
@@ -804,18 +804,7 @@ static struct spi_driver lis3l02dq_driver = { | |||
804 | .probe = lis3l02dq_probe, | 804 | .probe = lis3l02dq_probe, |
805 | .remove = __devexit_p(lis3l02dq_remove), | 805 | .remove = __devexit_p(lis3l02dq_remove), |
806 | }; | 806 | }; |
807 | 807 | module_spi_driver(lis3l02dq_driver); | |
808 | static __init int lis3l02dq_init(void) | ||
809 | { | ||
810 | return spi_register_driver(&lis3l02dq_driver); | ||
811 | } | ||
812 | module_init(lis3l02dq_init); | ||
813 | |||
814 | static __exit void lis3l02dq_exit(void) | ||
815 | { | ||
816 | spi_unregister_driver(&lis3l02dq_driver); | ||
817 | } | ||
818 | module_exit(lis3l02dq_exit); | ||
819 | 808 | ||
820 | MODULE_AUTHOR("Jonathan Cameron <jic23@cam.ac.uk>"); | 809 | MODULE_AUTHOR("Jonathan Cameron <jic23@cam.ac.uk>"); |
821 | MODULE_DESCRIPTION("ST LIS3L02DQ Accelerometer SPI driver"); | 810 | MODULE_DESCRIPTION("ST LIS3L02DQ Accelerometer SPI driver"); |
diff --git a/drivers/staging/iio/accel/sca3000_core.c b/drivers/staging/iio/accel/sca3000_core.c index a44a70589db9..6c359074a06d 100644 --- a/drivers/staging/iio/accel/sca3000_core.c +++ b/drivers/staging/iio/accel/sca3000_core.c | |||
@@ -1250,18 +1250,7 @@ static struct spi_driver sca3000_driver = { | |||
1250 | .remove = __devexit_p(sca3000_remove), | 1250 | .remove = __devexit_p(sca3000_remove), |
1251 | .id_table = sca3000_id, | 1251 | .id_table = sca3000_id, |
1252 | }; | 1252 | }; |
1253 | 1253 | module_spi_driver(sca3000_driver); | |
1254 | static __init int sca3000_init(void) | ||
1255 | { | ||
1256 | return spi_register_driver(&sca3000_driver); | ||
1257 | } | ||
1258 | module_init(sca3000_init); | ||
1259 | |||
1260 | static __exit void sca3000_exit(void) | ||
1261 | { | ||
1262 | spi_unregister_driver(&sca3000_driver); | ||
1263 | } | ||
1264 | module_exit(sca3000_exit); | ||
1265 | 1254 | ||
1266 | MODULE_AUTHOR("Jonathan Cameron <jic23@cam.ac.uk>"); | 1255 | MODULE_AUTHOR("Jonathan Cameron <jic23@cam.ac.uk>"); |
1267 | MODULE_DESCRIPTION("VTI SCA3000 Series Accelerometers SPI driver"); | 1256 | MODULE_DESCRIPTION("VTI SCA3000 Series Accelerometers SPI driver"); |
diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c index 31c376b9d5eb..a6a4a4e1f183 100644 --- a/drivers/staging/iio/adc/ad7192.c +++ b/drivers/staging/iio/adc/ad7192.c | |||
@@ -1161,18 +1161,7 @@ static struct spi_driver ad7192_driver = { | |||
1161 | .remove = __devexit_p(ad7192_remove), | 1161 | .remove = __devexit_p(ad7192_remove), |
1162 | .id_table = ad7192_id, | 1162 | .id_table = ad7192_id, |
1163 | }; | 1163 | }; |
1164 | 1164 | module_spi_driver(ad7192_driver); | |
1165 | static int __init ad7192_init(void) | ||
1166 | { | ||
1167 | return spi_register_driver(&ad7192_driver); | ||
1168 | } | ||
1169 | module_init(ad7192_init); | ||
1170 | |||
1171 | static void __exit ad7192_exit(void) | ||
1172 | { | ||
1173 | spi_unregister_driver(&ad7192_driver); | ||
1174 | } | ||
1175 | module_exit(ad7192_exit); | ||
1176 | 1165 | ||
1177 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); | 1166 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); |
1178 | MODULE_DESCRIPTION("Analog Devices AD7190, AD7192, AD7195 ADC"); | 1167 | MODULE_DESCRIPTION("Analog Devices AD7190, AD7192, AD7195 ADC"); |
diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c index 372d059042f9..dbaeae81e873 100644 --- a/drivers/staging/iio/adc/ad7280a.c +++ b/drivers/staging/iio/adc/ad7280a.c | |||
@@ -979,18 +979,7 @@ static struct spi_driver ad7280_driver = { | |||
979 | .remove = __devexit_p(ad7280_remove), | 979 | .remove = __devexit_p(ad7280_remove), |
980 | .id_table = ad7280_id, | 980 | .id_table = ad7280_id, |
981 | }; | 981 | }; |
982 | 982 | module_spi_driver(ad7280_driver); | |
983 | static int __init ad7280_init(void) | ||
984 | { | ||
985 | return spi_register_driver(&ad7280_driver); | ||
986 | } | ||
987 | module_init(ad7280_init); | ||
988 | |||
989 | static void __exit ad7280_exit(void) | ||
990 | { | ||
991 | spi_unregister_driver(&ad7280_driver); | ||
992 | } | ||
993 | module_exit(ad7280_exit); | ||
994 | 983 | ||
995 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); | 984 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); |
996 | MODULE_DESCRIPTION("Analog Devices AD7280A"); | 985 | MODULE_DESCRIPTION("Analog Devices AD7280A"); |
diff --git a/drivers/staging/iio/adc/ad7291.c b/drivers/staging/iio/adc/ad7291.c index 10e79e8ee64d..aa44a52a7adb 100644 --- a/drivers/staging/iio/adc/ad7291.c +++ b/drivers/staging/iio/adc/ad7291.c | |||
@@ -700,20 +700,8 @@ static struct i2c_driver ad7291_driver = { | |||
700 | .remove = __devexit_p(ad7291_remove), | 700 | .remove = __devexit_p(ad7291_remove), |
701 | .id_table = ad7291_id, | 701 | .id_table = ad7291_id, |
702 | }; | 702 | }; |
703 | 703 | module_i2c_driver(ad7291_driver); | |
704 | static __init int ad7291_init(void) | ||
705 | { | ||
706 | return i2c_add_driver(&ad7291_driver); | ||
707 | } | ||
708 | |||
709 | static __exit void ad7291_exit(void) | ||
710 | { | ||
711 | i2c_del_driver(&ad7291_driver); | ||
712 | } | ||
713 | 704 | ||
714 | MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>"); | 705 | MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>"); |
715 | MODULE_DESCRIPTION("Analog Devices AD7291 ADC driver"); | 706 | MODULE_DESCRIPTION("Analog Devices AD7291 ADC driver"); |
716 | MODULE_LICENSE("GPL v2"); | 707 | MODULE_LICENSE("GPL v2"); |
717 | |||
718 | module_init(ad7291_init); | ||
719 | module_exit(ad7291_exit); | ||
diff --git a/drivers/staging/iio/adc/ad7298_core.c b/drivers/staging/iio/adc/ad7298_core.c index c1de73a1ca91..a799bd1922dc 100644 --- a/drivers/staging/iio/adc/ad7298_core.c +++ b/drivers/staging/iio/adc/ad7298_core.c | |||
@@ -276,18 +276,7 @@ static struct spi_driver ad7298_driver = { | |||
276 | .remove = __devexit_p(ad7298_remove), | 276 | .remove = __devexit_p(ad7298_remove), |
277 | .id_table = ad7298_id, | 277 | .id_table = ad7298_id, |
278 | }; | 278 | }; |
279 | 279 | module_spi_driver(ad7298_driver); | |
280 | static int __init ad7298_init(void) | ||
281 | { | ||
282 | return spi_register_driver(&ad7298_driver); | ||
283 | } | ||
284 | module_init(ad7298_init); | ||
285 | |||
286 | static void __exit ad7298_exit(void) | ||
287 | { | ||
288 | spi_unregister_driver(&ad7298_driver); | ||
289 | } | ||
290 | module_exit(ad7298_exit); | ||
291 | 280 | ||
292 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); | 281 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); |
293 | MODULE_DESCRIPTION("Analog Devices AD7298 ADC"); | 282 | MODULE_DESCRIPTION("Analog Devices AD7298 ADC"); |
diff --git a/drivers/staging/iio/adc/ad7476_core.c b/drivers/staging/iio/adc/ad7476_core.c index fd79facc6cae..0b5852030ab6 100644 --- a/drivers/staging/iio/adc/ad7476_core.c +++ b/drivers/staging/iio/adc/ad7476_core.c | |||
@@ -248,18 +248,7 @@ static struct spi_driver ad7476_driver = { | |||
248 | .remove = __devexit_p(ad7476_remove), | 248 | .remove = __devexit_p(ad7476_remove), |
249 | .id_table = ad7476_id, | 249 | .id_table = ad7476_id, |
250 | }; | 250 | }; |
251 | 251 | module_spi_driver(ad7476_driver); | |
252 | static int __init ad7476_init(void) | ||
253 | { | ||
254 | return spi_register_driver(&ad7476_driver); | ||
255 | } | ||
256 | module_init(ad7476_init); | ||
257 | |||
258 | static void __exit ad7476_exit(void) | ||
259 | { | ||
260 | spi_unregister_driver(&ad7476_driver); | ||
261 | } | ||
262 | module_exit(ad7476_exit); | ||
263 | 252 | ||
264 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); | 253 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); |
265 | MODULE_DESCRIPTION("Analog Devices AD7475/6/7/8(A) AD7466/7/8 ADC"); | 254 | MODULE_DESCRIPTION("Analog Devices AD7475/6/7/8(A) AD7466/7/8 ADC"); |
diff --git a/drivers/staging/iio/adc/ad7606_spi.c b/drivers/staging/iio/adc/ad7606_spi.c index aede1ba5e041..b984bd2048b6 100644 --- a/drivers/staging/iio/adc/ad7606_spi.c +++ b/drivers/staging/iio/adc/ad7606_spi.c | |||
@@ -109,18 +109,7 @@ static struct spi_driver ad7606_driver = { | |||
109 | .remove = __devexit_p(ad7606_spi_remove), | 109 | .remove = __devexit_p(ad7606_spi_remove), |
110 | .id_table = ad7606_id, | 110 | .id_table = ad7606_id, |
111 | }; | 111 | }; |
112 | 112 | module_spi_driver(ad7606_driver); | |
113 | static int __init ad7606_spi_init(void) | ||
114 | { | ||
115 | return spi_register_driver(&ad7606_driver); | ||
116 | } | ||
117 | module_init(ad7606_spi_init); | ||
118 | |||
119 | static void __exit ad7606_spi_exit(void) | ||
120 | { | ||
121 | spi_unregister_driver(&ad7606_driver); | ||
122 | } | ||
123 | module_exit(ad7606_spi_exit); | ||
124 | 113 | ||
125 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); | 114 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); |
126 | MODULE_DESCRIPTION("Analog Devices AD7606 ADC"); | 115 | MODULE_DESCRIPTION("Analog Devices AD7606 ADC"); |
diff --git a/drivers/staging/iio/adc/ad7780.c b/drivers/staging/iio/adc/ad7780.c index 7a579a1fd696..ec90261cbc3c 100644 --- a/drivers/staging/iio/adc/ad7780.c +++ b/drivers/staging/iio/adc/ad7780.c | |||
@@ -283,18 +283,7 @@ static struct spi_driver ad7780_driver = { | |||
283 | .remove = __devexit_p(ad7780_remove), | 283 | .remove = __devexit_p(ad7780_remove), |
284 | .id_table = ad7780_id, | 284 | .id_table = ad7780_id, |
285 | }; | 285 | }; |
286 | 286 | module_spi_driver(ad7780_driver); | |
287 | static int __init ad7780_init(void) | ||
288 | { | ||
289 | return spi_register_driver(&ad7780_driver); | ||
290 | } | ||
291 | module_init(ad7780_init); | ||
292 | |||
293 | static void __exit ad7780_exit(void) | ||
294 | { | ||
295 | spi_unregister_driver(&ad7780_driver); | ||
296 | } | ||
297 | module_exit(ad7780_exit); | ||
298 | 287 | ||
299 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); | 288 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); |
300 | MODULE_DESCRIPTION("Analog Devices AD7780/1 ADC"); | 289 | MODULE_DESCRIPTION("Analog Devices AD7780/1 ADC"); |
diff --git a/drivers/staging/iio/adc/ad7793.c b/drivers/staging/iio/adc/ad7793.c index 999f8f746cff..1c5588e88cdf 100644 --- a/drivers/staging/iio/adc/ad7793.c +++ b/drivers/staging/iio/adc/ad7793.c | |||
@@ -1045,18 +1045,7 @@ static struct spi_driver ad7793_driver = { | |||
1045 | .remove = __devexit_p(ad7793_remove), | 1045 | .remove = __devexit_p(ad7793_remove), |
1046 | .id_table = ad7793_id, | 1046 | .id_table = ad7793_id, |
1047 | }; | 1047 | }; |
1048 | 1048 | module_spi_driver(ad7793_driver); | |
1049 | static int __init ad7793_init(void) | ||
1050 | { | ||
1051 | return spi_register_driver(&ad7793_driver); | ||
1052 | } | ||
1053 | module_init(ad7793_init); | ||
1054 | |||
1055 | static void __exit ad7793_exit(void) | ||
1056 | { | ||
1057 | spi_unregister_driver(&ad7793_driver); | ||
1058 | } | ||
1059 | module_exit(ad7793_exit); | ||
1060 | 1049 | ||
1061 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); | 1050 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); |
1062 | MODULE_DESCRIPTION("Analog Devices AD7792/3 ADC"); | 1051 | MODULE_DESCRIPTION("Analog Devices AD7792/3 ADC"); |
diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c index bdb90492b8a5..acbf9363132b 100644 --- a/drivers/staging/iio/adc/ad7816.c +++ b/drivers/staging/iio/adc/ad7816.c | |||
@@ -466,21 +466,9 @@ static struct spi_driver ad7816_driver = { | |||
466 | .remove = __devexit_p(ad7816_remove), | 466 | .remove = __devexit_p(ad7816_remove), |
467 | .id_table = ad7816_id, | 467 | .id_table = ad7816_id, |
468 | }; | 468 | }; |
469 | 469 | module_spi_driver(ad7816_driver); | |
470 | static __init int ad7816_init(void) | ||
471 | { | ||
472 | return spi_register_driver(&ad7816_driver); | ||
473 | } | ||
474 | |||
475 | static __exit void ad7816_exit(void) | ||
476 | { | ||
477 | spi_unregister_driver(&ad7816_driver); | ||
478 | } | ||
479 | 470 | ||
480 | MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>"); | 471 | MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>"); |
481 | MODULE_DESCRIPTION("Analog Devices AD7816/7/8 digital" | 472 | MODULE_DESCRIPTION("Analog Devices AD7816/7/8 digital" |
482 | " temperature sensor driver"); | 473 | " temperature sensor driver"); |
483 | MODULE_LICENSE("GPL v2"); | 474 | MODULE_LICENSE("GPL v2"); |
484 | |||
485 | module_init(ad7816_init); | ||
486 | module_exit(ad7816_exit); | ||
diff --git a/drivers/staging/iio/adc/ad7887_core.c b/drivers/staging/iio/adc/ad7887_core.c index 609dcd5f2ddc..91b8fb09d92b 100644 --- a/drivers/staging/iio/adc/ad7887_core.c +++ b/drivers/staging/iio/adc/ad7887_core.c | |||
@@ -257,18 +257,7 @@ static struct spi_driver ad7887_driver = { | |||
257 | .remove = __devexit_p(ad7887_remove), | 257 | .remove = __devexit_p(ad7887_remove), |
258 | .id_table = ad7887_id, | 258 | .id_table = ad7887_id, |
259 | }; | 259 | }; |
260 | 260 | module_spi_driver(ad7887_driver); | |
261 | static int __init ad7887_init(void) | ||
262 | { | ||
263 | return spi_register_driver(&ad7887_driver); | ||
264 | } | ||
265 | module_init(ad7887_init); | ||
266 | |||
267 | static void __exit ad7887_exit(void) | ||
268 | { | ||
269 | spi_unregister_driver(&ad7887_driver); | ||
270 | } | ||
271 | module_exit(ad7887_exit); | ||
272 | 261 | ||
273 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); | 262 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); |
274 | MODULE_DESCRIPTION("Analog Devices AD7887 ADC"); | 263 | MODULE_DESCRIPTION("Analog Devices AD7887 ADC"); |
diff --git a/drivers/staging/iio/adc/ad799x_core.c b/drivers/staging/iio/adc/ad799x_core.c index ee6cd792bec8..c0d2f886ea2c 100644 --- a/drivers/staging/iio/adc/ad799x_core.c +++ b/drivers/staging/iio/adc/ad799x_core.c | |||
@@ -929,21 +929,9 @@ static struct i2c_driver ad799x_driver = { | |||
929 | .remove = __devexit_p(ad799x_remove), | 929 | .remove = __devexit_p(ad799x_remove), |
930 | .id_table = ad799x_id, | 930 | .id_table = ad799x_id, |
931 | }; | 931 | }; |
932 | 932 | module_i2c_driver(ad799x_driver); | |
933 | static __init int ad799x_init(void) | ||
934 | { | ||
935 | return i2c_add_driver(&ad799x_driver); | ||
936 | } | ||
937 | |||
938 | static __exit void ad799x_exit(void) | ||
939 | { | ||
940 | i2c_del_driver(&ad799x_driver); | ||
941 | } | ||
942 | 933 | ||
943 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); | 934 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); |
944 | MODULE_DESCRIPTION("Analog Devices AD799x ADC"); | 935 | MODULE_DESCRIPTION("Analog Devices AD799x ADC"); |
945 | MODULE_LICENSE("GPL v2"); | 936 | MODULE_LICENSE("GPL v2"); |
946 | MODULE_ALIAS("i2c:ad799x"); | 937 | MODULE_ALIAS("i2c:ad799x"); |
947 | |||
948 | module_init(ad799x_init); | ||
949 | module_exit(ad799x_exit); | ||
diff --git a/drivers/staging/iio/adc/adt7310.c b/drivers/staging/iio/adc/adt7310.c index c9e0be3b1cf3..bc307f3b024e 100644 --- a/drivers/staging/iio/adc/adt7310.c +++ b/drivers/staging/iio/adc/adt7310.c | |||
@@ -884,21 +884,9 @@ static struct spi_driver adt7310_driver = { | |||
884 | .remove = __devexit_p(adt7310_remove), | 884 | .remove = __devexit_p(adt7310_remove), |
885 | .id_table = adt7310_id, | 885 | .id_table = adt7310_id, |
886 | }; | 886 | }; |
887 | 887 | module_spi_driver(adt7310_driver); | |
888 | static __init int adt7310_init(void) | ||
889 | { | ||
890 | return spi_register_driver(&adt7310_driver); | ||
891 | } | ||
892 | |||
893 | static __exit void adt7310_exit(void) | ||
894 | { | ||
895 | spi_unregister_driver(&adt7310_driver); | ||
896 | } | ||
897 | 888 | ||
898 | MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>"); | 889 | MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>"); |
899 | MODULE_DESCRIPTION("Analog Devices ADT7310 digital" | 890 | MODULE_DESCRIPTION("Analog Devices ADT7310 digital" |
900 | " temperature sensor driver"); | 891 | " temperature sensor driver"); |
901 | MODULE_LICENSE("GPL v2"); | 892 | MODULE_LICENSE("GPL v2"); |
902 | |||
903 | module_init(adt7310_init); | ||
904 | module_exit(adt7310_exit); | ||
diff --git a/drivers/staging/iio/adc/adt7410.c b/drivers/staging/iio/adc/adt7410.c index a289e429dc41..3481cf6f7574 100644 --- a/drivers/staging/iio/adc/adt7410.c +++ b/drivers/staging/iio/adc/adt7410.c | |||
@@ -844,21 +844,9 @@ static struct i2c_driver adt7410_driver = { | |||
844 | .remove = __devexit_p(adt7410_remove), | 844 | .remove = __devexit_p(adt7410_remove), |
845 | .id_table = adt7410_id, | 845 | .id_table = adt7410_id, |
846 | }; | 846 | }; |
847 | 847 | module_i2c_driver(adt7410_driver); | |
848 | static __init int adt7410_init(void) | ||
849 | { | ||
850 | return i2c_add_driver(&adt7410_driver); | ||
851 | } | ||
852 | |||
853 | static __exit void adt7410_exit(void) | ||
854 | { | ||
855 | i2c_del_driver(&adt7410_driver); | ||
856 | } | ||
857 | 848 | ||
858 | MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>"); | 849 | MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>"); |
859 | MODULE_DESCRIPTION("Analog Devices ADT7410 digital" | 850 | MODULE_DESCRIPTION("Analog Devices ADT7410 digital" |
860 | " temperature sensor driver"); | 851 | " temperature sensor driver"); |
861 | MODULE_LICENSE("GPL v2"); | 852 | MODULE_LICENSE("GPL v2"); |
862 | |||
863 | module_init(adt7410_init); | ||
864 | module_exit(adt7410_exit); | ||
diff --git a/drivers/staging/iio/adc/max1363_core.c b/drivers/staging/iio/adc/max1363_core.c index eb699ade34b0..3f28f1ab52a2 100644 --- a/drivers/staging/iio/adc/max1363_core.c +++ b/drivers/staging/iio/adc/max1363_core.c | |||
@@ -1410,20 +1410,8 @@ static struct i2c_driver max1363_driver = { | |||
1410 | .remove = max1363_remove, | 1410 | .remove = max1363_remove, |
1411 | .id_table = max1363_id, | 1411 | .id_table = max1363_id, |
1412 | }; | 1412 | }; |
1413 | 1413 | module_i2c_driver(max1363_driver); | |
1414 | static __init int max1363_init(void) | ||
1415 | { | ||
1416 | return i2c_add_driver(&max1363_driver); | ||
1417 | } | ||
1418 | |||
1419 | static __exit void max1363_exit(void) | ||
1420 | { | ||
1421 | i2c_del_driver(&max1363_driver); | ||
1422 | } | ||
1423 | 1414 | ||
1424 | MODULE_AUTHOR("Jonathan Cameron <jic23@cam.ac.uk>"); | 1415 | MODULE_AUTHOR("Jonathan Cameron <jic23@cam.ac.uk>"); |
1425 | MODULE_DESCRIPTION("Maxim 1363 ADC"); | 1416 | MODULE_DESCRIPTION("Maxim 1363 ADC"); |
1426 | MODULE_LICENSE("GPL v2"); | 1417 | MODULE_LICENSE("GPL v2"); |
1427 | |||
1428 | module_init(max1363_init); | ||
1429 | module_exit(max1363_exit); | ||
diff --git a/drivers/staging/iio/addac/adt7316-i2c.c b/drivers/staging/iio/addac/adt7316-i2c.c index 07d718e8fb4d..2c03a39220e8 100644 --- a/drivers/staging/iio/addac/adt7316-i2c.c +++ b/drivers/staging/iio/addac/adt7316-i2c.c | |||
@@ -151,21 +151,9 @@ static struct i2c_driver adt7316_driver = { | |||
151 | .resume = adt7316_i2c_resume, | 151 | .resume = adt7316_i2c_resume, |
152 | .id_table = adt7316_i2c_id, | 152 | .id_table = adt7316_i2c_id, |
153 | }; | 153 | }; |
154 | 154 | module_i2c_driver(adt7316_driver); | |
155 | static __init int adt7316_i2c_init(void) | ||
156 | { | ||
157 | return i2c_add_driver(&adt7316_driver); | ||
158 | } | ||
159 | |||
160 | static __exit void adt7316_i2c_exit(void) | ||
161 | { | ||
162 | i2c_del_driver(&adt7316_driver); | ||
163 | } | ||
164 | 155 | ||
165 | MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>"); | 156 | MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>"); |
166 | MODULE_DESCRIPTION("I2C bus driver for Analog Devices ADT7316/7/9 and" | 157 | MODULE_DESCRIPTION("I2C bus driver for Analog Devices ADT7316/7/9 and" |
167 | "ADT7516/7/8 digital temperature sensor, ADC and DAC"); | 158 | "ADT7516/7/8 digital temperature sensor, ADC and DAC"); |
168 | MODULE_LICENSE("GPL v2"); | 159 | MODULE_LICENSE("GPL v2"); |
169 | |||
170 | module_init(adt7316_i2c_init); | ||
171 | module_exit(adt7316_i2c_exit); | ||
diff --git a/drivers/staging/iio/addac/adt7316-spi.c b/drivers/staging/iio/addac/adt7316-spi.c index 369d4d01ed97..1e93c7b7aed9 100644 --- a/drivers/staging/iio/addac/adt7316-spi.c +++ b/drivers/staging/iio/addac/adt7316-spi.c | |||
@@ -160,21 +160,9 @@ static struct spi_driver adt7316_driver = { | |||
160 | .resume = adt7316_spi_resume, | 160 | .resume = adt7316_spi_resume, |
161 | .id_table = adt7316_spi_id, | 161 | .id_table = adt7316_spi_id, |
162 | }; | 162 | }; |
163 | 163 | module_spi_driver(adt7316_driver); | |
164 | static __init int adt7316_spi_init(void) | ||
165 | { | ||
166 | return spi_register_driver(&adt7316_driver); | ||
167 | } | ||
168 | |||
169 | static __exit void adt7316_spi_exit(void) | ||
170 | { | ||
171 | spi_unregister_driver(&adt7316_driver); | ||
172 | } | ||
173 | 164 | ||
174 | MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>"); | 165 | MODULE_AUTHOR("Sonic Zhang <sonic.zhang@analog.com>"); |
175 | MODULE_DESCRIPTION("SPI bus driver for Analog Devices ADT7316/7/8 and" | 166 | MODULE_DESCRIPTION("SPI bus driver for Analog Devices ADT7316/7/8 and" |
176 | "ADT7516/7/9 digital temperature sensor, ADC and DAC"); | 167 | "ADT7516/7/9 digital temperature sensor, ADC and DAC"); |
177 | MODULE_LICENSE("GPL v2"); | 168 | MODULE_LICENSE("GPL v2"); |
178 | |||
179 | module_init(adt7316_spi_init); | ||
180 | module_exit(adt7316_spi_exit); | ||
diff --git a/drivers/staging/iio/cdc/ad7150.c b/drivers/staging/iio/cdc/ad7150.c index a761ca94a17e..47181875e113 100644 --- a/drivers/staging/iio/cdc/ad7150.c +++ b/drivers/staging/iio/cdc/ad7150.c | |||
@@ -657,20 +657,8 @@ static struct i2c_driver ad7150_driver = { | |||
657 | .remove = __devexit_p(ad7150_remove), | 657 | .remove = __devexit_p(ad7150_remove), |
658 | .id_table = ad7150_id, | 658 | .id_table = ad7150_id, |
659 | }; | 659 | }; |
660 | 660 | module_i2c_driver(ad7150_driver); | |
661 | static __init int ad7150_init(void) | ||
662 | { | ||
663 | return i2c_add_driver(&ad7150_driver); | ||
664 | } | ||
665 | |||
666 | static __exit void ad7150_exit(void) | ||
667 | { | ||
668 | i2c_del_driver(&ad7150_driver); | ||
669 | } | ||
670 | 661 | ||
671 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); | 662 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); |
672 | MODULE_DESCRIPTION("Analog Devices AD7150/1/6 capacitive sensor driver"); | 663 | MODULE_DESCRIPTION("Analog Devices AD7150/1/6 capacitive sensor driver"); |
673 | MODULE_LICENSE("GPL v2"); | 664 | MODULE_LICENSE("GPL v2"); |
674 | |||
675 | module_init(ad7150_init); | ||
676 | module_exit(ad7150_exit); | ||
diff --git a/drivers/staging/iio/cdc/ad7152.c b/drivers/staging/iio/cdc/ad7152.c index 662584d72a74..152d3be6d97d 100644 --- a/drivers/staging/iio/cdc/ad7152.c +++ b/drivers/staging/iio/cdc/ad7152.c | |||
@@ -540,20 +540,8 @@ static struct i2c_driver ad7152_driver = { | |||
540 | .remove = __devexit_p(ad7152_remove), | 540 | .remove = __devexit_p(ad7152_remove), |
541 | .id_table = ad7152_id, | 541 | .id_table = ad7152_id, |
542 | }; | 542 | }; |
543 | 543 | module_i2c_driver(ad7152_driver); | |
544 | static __init int ad7152_init(void) | ||
545 | { | ||
546 | return i2c_add_driver(&ad7152_driver); | ||
547 | } | ||
548 | |||
549 | static __exit void ad7152_exit(void) | ||
550 | { | ||
551 | i2c_del_driver(&ad7152_driver); | ||
552 | } | ||
553 | 544 | ||
554 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); | 545 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); |
555 | MODULE_DESCRIPTION("Analog Devices AD7152/3 capacitive sensor driver"); | 546 | MODULE_DESCRIPTION("Analog Devices AD7152/3 capacitive sensor driver"); |
556 | MODULE_LICENSE("GPL v2"); | 547 | MODULE_LICENSE("GPL v2"); |
557 | |||
558 | module_init(ad7152_init); | ||
559 | module_exit(ad7152_exit); | ||
diff --git a/drivers/staging/iio/cdc/ad7746.c b/drivers/staging/iio/cdc/ad7746.c index 2867943309cc..9df590891a69 100644 --- a/drivers/staging/iio/cdc/ad7746.c +++ b/drivers/staging/iio/cdc/ad7746.c | |||
@@ -788,20 +788,8 @@ static struct i2c_driver ad7746_driver = { | |||
788 | .remove = __devexit_p(ad7746_remove), | 788 | .remove = __devexit_p(ad7746_remove), |
789 | .id_table = ad7746_id, | 789 | .id_table = ad7746_id, |
790 | }; | 790 | }; |
791 | 791 | module_i2c_driver(ad7746_driver); | |
792 | static __init int ad7746_init(void) | ||
793 | { | ||
794 | return i2c_add_driver(&ad7746_driver); | ||
795 | } | ||
796 | |||
797 | static __exit void ad7746_exit(void) | ||
798 | { | ||
799 | i2c_del_driver(&ad7746_driver); | ||
800 | } | ||
801 | 792 | ||
802 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); | 793 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); |
803 | MODULE_DESCRIPTION("Analog Devices AD7746/5/7 capacitive sensor driver"); | 794 | MODULE_DESCRIPTION("Analog Devices AD7746/5/7 capacitive sensor driver"); |
804 | MODULE_LICENSE("GPL v2"); | 795 | MODULE_LICENSE("GPL v2"); |
805 | |||
806 | module_init(ad7746_init); | ||
807 | module_exit(ad7746_exit); | ||
diff --git a/drivers/staging/iio/dac/ad5064.c b/drivers/staging/iio/dac/ad5064.c index 24279f2ae41f..39cfe6cb02a2 100644 --- a/drivers/staging/iio/dac/ad5064.c +++ b/drivers/staging/iio/dac/ad5064.c | |||
@@ -445,18 +445,7 @@ static struct spi_driver ad5064_driver = { | |||
445 | .remove = __devexit_p(ad5064_remove), | 445 | .remove = __devexit_p(ad5064_remove), |
446 | .id_table = ad5064_id, | 446 | .id_table = ad5064_id, |
447 | }; | 447 | }; |
448 | 448 | module_spi_driver(ad5064_driver); | |
449 | static __init int ad5064_spi_init(void) | ||
450 | { | ||
451 | return spi_register_driver(&ad5064_driver); | ||
452 | } | ||
453 | module_init(ad5064_spi_init); | ||
454 | |||
455 | static __exit void ad5064_spi_exit(void) | ||
456 | { | ||
457 | spi_unregister_driver(&ad5064_driver); | ||
458 | } | ||
459 | module_exit(ad5064_spi_exit); | ||
460 | 449 | ||
461 | MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>"); | 450 | MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>"); |
462 | MODULE_DESCRIPTION("Analog Devices AD5064/64-1/44/24 DAC"); | 451 | MODULE_DESCRIPTION("Analog Devices AD5064/64-1/44/24 DAC"); |
diff --git a/drivers/staging/iio/dac/ad5360.c b/drivers/staging/iio/dac/ad5360.c index 72d0f3f0d6ae..bc0459e32d04 100644 --- a/drivers/staging/iio/dac/ad5360.c +++ b/drivers/staging/iio/dac/ad5360.c | |||
@@ -563,18 +563,7 @@ static struct spi_driver ad5360_driver = { | |||
563 | .remove = __devexit_p(ad5360_remove), | 563 | .remove = __devexit_p(ad5360_remove), |
564 | .id_table = ad5360_ids, | 564 | .id_table = ad5360_ids, |
565 | }; | 565 | }; |
566 | 566 | module_spi_driver(ad5360_driver); | |
567 | static __init int ad5360_spi_init(void) | ||
568 | { | ||
569 | return spi_register_driver(&ad5360_driver); | ||
570 | } | ||
571 | module_init(ad5360_spi_init); | ||
572 | |||
573 | static __exit void ad5360_spi_exit(void) | ||
574 | { | ||
575 | spi_unregister_driver(&ad5360_driver); | ||
576 | } | ||
577 | module_exit(ad5360_spi_exit); | ||
578 | 567 | ||
579 | MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>"); | 568 | MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>"); |
580 | MODULE_DESCRIPTION("Analog Devices AD5360/61/62/63/70/71/72/73 DAC"); | 569 | MODULE_DESCRIPTION("Analog Devices AD5360/61/62/63/70/71/72/73 DAC"); |
diff --git a/drivers/staging/iio/dac/ad5446.c b/drivers/staging/iio/dac/ad5446.c index e1c204d51d8c..ac3bc5f52dcc 100644 --- a/drivers/staging/iio/dac/ad5446.c +++ b/drivers/staging/iio/dac/ad5446.c | |||
@@ -465,18 +465,7 @@ static struct spi_driver ad5446_driver = { | |||
465 | .remove = __devexit_p(ad5446_remove), | 465 | .remove = __devexit_p(ad5446_remove), |
466 | .id_table = ad5446_id, | 466 | .id_table = ad5446_id, |
467 | }; | 467 | }; |
468 | 468 | module_spi_driver(ad5446_driver); | |
469 | static int __init ad5446_init(void) | ||
470 | { | ||
471 | return spi_register_driver(&ad5446_driver); | ||
472 | } | ||
473 | module_init(ad5446_init); | ||
474 | |||
475 | static void __exit ad5446_exit(void) | ||
476 | { | ||
477 | spi_unregister_driver(&ad5446_driver); | ||
478 | } | ||
479 | module_exit(ad5446_exit); | ||
480 | 469 | ||
481 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); | 470 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); |
482 | MODULE_DESCRIPTION("Analog Devices AD5444/AD5446 DAC"); | 471 | MODULE_DESCRIPTION("Analog Devices AD5444/AD5446 DAC"); |
diff --git a/drivers/staging/iio/dac/ad5504.c b/drivers/staging/iio/dac/ad5504.c index 60dd6404d689..57539ce8e6cf 100644 --- a/drivers/staging/iio/dac/ad5504.c +++ b/drivers/staging/iio/dac/ad5504.c | |||
@@ -377,18 +377,7 @@ static struct spi_driver ad5504_driver = { | |||
377 | .remove = __devexit_p(ad5504_remove), | 377 | .remove = __devexit_p(ad5504_remove), |
378 | .id_table = ad5504_id, | 378 | .id_table = ad5504_id, |
379 | }; | 379 | }; |
380 | 380 | module_spi_driver(ad5504_driver); | |
381 | static __init int ad5504_spi_init(void) | ||
382 | { | ||
383 | return spi_register_driver(&ad5504_driver); | ||
384 | } | ||
385 | module_init(ad5504_spi_init); | ||
386 | |||
387 | static __exit void ad5504_spi_exit(void) | ||
388 | { | ||
389 | spi_unregister_driver(&ad5504_driver); | ||
390 | } | ||
391 | module_exit(ad5504_spi_exit); | ||
392 | 381 | ||
393 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); | 382 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); |
394 | MODULE_DESCRIPTION("Analog Devices AD5501/AD5501 DAC"); | 383 | MODULE_DESCRIPTION("Analog Devices AD5501/AD5501 DAC"); |
diff --git a/drivers/staging/iio/dac/ad5624r_spi.c b/drivers/staging/iio/dac/ad5624r_spi.c index 284d87900362..6e05f0dbae0b 100644 --- a/drivers/staging/iio/dac/ad5624r_spi.c +++ b/drivers/staging/iio/dac/ad5624r_spi.c | |||
@@ -317,18 +317,7 @@ static struct spi_driver ad5624r_driver = { | |||
317 | .remove = __devexit_p(ad5624r_remove), | 317 | .remove = __devexit_p(ad5624r_remove), |
318 | .id_table = ad5624r_id, | 318 | .id_table = ad5624r_id, |
319 | }; | 319 | }; |
320 | 320 | module_spi_driver(ad5624r_driver); | |
321 | static __init int ad5624r_spi_init(void) | ||
322 | { | ||
323 | return spi_register_driver(&ad5624r_driver); | ||
324 | } | ||
325 | module_init(ad5624r_spi_init); | ||
326 | |||
327 | static __exit void ad5624r_spi_exit(void) | ||
328 | { | ||
329 | spi_unregister_driver(&ad5624r_driver); | ||
330 | } | ||
331 | module_exit(ad5624r_spi_exit); | ||
332 | 321 | ||
333 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); | 322 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); |
334 | MODULE_DESCRIPTION("Analog Devices AD5624/44/64R DAC spi driver"); | 323 | MODULE_DESCRIPTION("Analog Devices AD5624/44/64R DAC spi driver"); |
diff --git a/drivers/staging/iio/dac/ad5686.c b/drivers/staging/iio/dac/ad5686.c index 974c6f5b60c4..e72db2fbfedf 100644 --- a/drivers/staging/iio/dac/ad5686.c +++ b/drivers/staging/iio/dac/ad5686.c | |||
@@ -447,18 +447,7 @@ static struct spi_driver ad5686_driver = { | |||
447 | .remove = __devexit_p(ad5686_remove), | 447 | .remove = __devexit_p(ad5686_remove), |
448 | .id_table = ad5686_id, | 448 | .id_table = ad5686_id, |
449 | }; | 449 | }; |
450 | 450 | module_spi_driver(ad5686_driver); | |
451 | static __init int ad5686_spi_init(void) | ||
452 | { | ||
453 | return spi_register_driver(&ad5686_driver); | ||
454 | } | ||
455 | module_init(ad5686_spi_init); | ||
456 | |||
457 | static __exit void ad5686_spi_exit(void) | ||
458 | { | ||
459 | spi_unregister_driver(&ad5686_driver); | ||
460 | } | ||
461 | module_exit(ad5686_spi_exit); | ||
462 | 451 | ||
463 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); | 452 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); |
464 | MODULE_DESCRIPTION("Analog Devices AD5686/85/84 DAC"); | 453 | MODULE_DESCRIPTION("Analog Devices AD5686/85/84 DAC"); |
diff --git a/drivers/staging/iio/dac/ad5791.c b/drivers/staging/iio/dac/ad5791.c index 6fbca8d96153..4a80fd822231 100644 --- a/drivers/staging/iio/dac/ad5791.c +++ b/drivers/staging/iio/dac/ad5791.c | |||
@@ -410,18 +410,7 @@ static struct spi_driver ad5791_driver = { | |||
410 | .remove = __devexit_p(ad5791_remove), | 410 | .remove = __devexit_p(ad5791_remove), |
411 | .id_table = ad5791_id, | 411 | .id_table = ad5791_id, |
412 | }; | 412 | }; |
413 | 413 | module_spi_driver(ad5791_driver); | |
414 | static __init int ad5791_spi_init(void) | ||
415 | { | ||
416 | return spi_register_driver(&ad5791_driver); | ||
417 | } | ||
418 | module_init(ad5791_spi_init); | ||
419 | |||
420 | static __exit void ad5791_spi_exit(void) | ||
421 | { | ||
422 | spi_unregister_driver(&ad5791_driver); | ||
423 | } | ||
424 | module_exit(ad5791_spi_exit); | ||
425 | 414 | ||
426 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); | 415 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); |
427 | MODULE_DESCRIPTION("Analog Devices AD5760/AD5780/AD5781/AD5791 DAC"); | 416 | MODULE_DESCRIPTION("Analog Devices AD5760/AD5780/AD5781/AD5791 DAC"); |
diff --git a/drivers/staging/iio/dac/max517.c b/drivers/staging/iio/dac/max517.c index adfbd20f8988..a4df6d7443c1 100644 --- a/drivers/staging/iio/dac/max517.c +++ b/drivers/staging/iio/dac/max517.c | |||
@@ -280,20 +280,8 @@ static struct i2c_driver max517_driver = { | |||
280 | .resume = max517_resume, | 280 | .resume = max517_resume, |
281 | .id_table = max517_id, | 281 | .id_table = max517_id, |
282 | }; | 282 | }; |
283 | 283 | module_i2c_driver(max517_driver); | |
284 | static int __init max517_init(void) | ||
285 | { | ||
286 | return i2c_add_driver(&max517_driver); | ||
287 | } | ||
288 | |||
289 | static void __exit max517_exit(void) | ||
290 | { | ||
291 | i2c_del_driver(&max517_driver); | ||
292 | } | ||
293 | 284 | ||
294 | MODULE_AUTHOR("Roland Stigge <stigge@antcom.de>"); | 285 | MODULE_AUTHOR("Roland Stigge <stigge@antcom.de>"); |
295 | MODULE_DESCRIPTION("MAX517/MAX518/MAX519 8-bit DAC"); | 286 | MODULE_DESCRIPTION("MAX517/MAX518/MAX519 8-bit DAC"); |
296 | MODULE_LICENSE("GPL"); | 287 | MODULE_LICENSE("GPL"); |
297 | |||
298 | module_init(max517_init); | ||
299 | module_exit(max517_exit); | ||
diff --git a/drivers/staging/iio/dds/ad5930.c b/drivers/staging/iio/dds/ad5930.c index f5e368b56650..4a360d044a36 100644 --- a/drivers/staging/iio/dds/ad5930.c +++ b/drivers/staging/iio/dds/ad5930.c | |||
@@ -143,18 +143,7 @@ static struct spi_driver ad5930_driver = { | |||
143 | .probe = ad5930_probe, | 143 | .probe = ad5930_probe, |
144 | .remove = __devexit_p(ad5930_remove), | 144 | .remove = __devexit_p(ad5930_remove), |
145 | }; | 145 | }; |
146 | 146 | module_spi_driver(ad5930_driver); | |
147 | static __init int ad5930_spi_init(void) | ||
148 | { | ||
149 | return spi_register_driver(&ad5930_driver); | ||
150 | } | ||
151 | module_init(ad5930_spi_init); | ||
152 | |||
153 | static __exit void ad5930_spi_exit(void) | ||
154 | { | ||
155 | spi_unregister_driver(&ad5930_driver); | ||
156 | } | ||
157 | module_exit(ad5930_spi_exit); | ||
158 | 147 | ||
159 | MODULE_AUTHOR("Cliff Cai"); | 148 | MODULE_AUTHOR("Cliff Cai"); |
160 | MODULE_DESCRIPTION("Analog Devices ad5930 driver"); | 149 | MODULE_DESCRIPTION("Analog Devices ad5930 driver"); |
diff --git a/drivers/staging/iio/dds/ad9832.c b/drivers/staging/iio/dds/ad9832.c index 9b4ff6065359..cc32fd65b8b3 100644 --- a/drivers/staging/iio/dds/ad9832.c +++ b/drivers/staging/iio/dds/ad9832.c | |||
@@ -355,18 +355,7 @@ static struct spi_driver ad9832_driver = { | |||
355 | .remove = __devexit_p(ad9832_remove), | 355 | .remove = __devexit_p(ad9832_remove), |
356 | .id_table = ad9832_id, | 356 | .id_table = ad9832_id, |
357 | }; | 357 | }; |
358 | 358 | module_spi_driver(ad9832_driver); | |
359 | static int __init ad9832_init(void) | ||
360 | { | ||
361 | return spi_register_driver(&ad9832_driver); | ||
362 | } | ||
363 | module_init(ad9832_init); | ||
364 | |||
365 | static void __exit ad9832_exit(void) | ||
366 | { | ||
367 | spi_unregister_driver(&ad9832_driver); | ||
368 | } | ||
369 | module_exit(ad9832_exit); | ||
370 | 359 | ||
371 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); | 360 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); |
372 | MODULE_DESCRIPTION("Analog Devices AD9832/AD9835 DDS"); | 361 | MODULE_DESCRIPTION("Analog Devices AD9832/AD9835 DDS"); |
diff --git a/drivers/staging/iio/dds/ad9834.c b/drivers/staging/iio/dds/ad9834.c index c468f696fe25..2b31e3524826 100644 --- a/drivers/staging/iio/dds/ad9834.c +++ b/drivers/staging/iio/dds/ad9834.c | |||
@@ -446,18 +446,7 @@ static struct spi_driver ad9834_driver = { | |||
446 | .remove = __devexit_p(ad9834_remove), | 446 | .remove = __devexit_p(ad9834_remove), |
447 | .id_table = ad9834_id, | 447 | .id_table = ad9834_id, |
448 | }; | 448 | }; |
449 | 449 | module_spi_driver(ad9834_driver); | |
450 | static int __init ad9834_init(void) | ||
451 | { | ||
452 | return spi_register_driver(&ad9834_driver); | ||
453 | } | ||
454 | module_init(ad9834_init); | ||
455 | |||
456 | static void __exit ad9834_exit(void) | ||
457 | { | ||
458 | spi_unregister_driver(&ad9834_driver); | ||
459 | } | ||
460 | module_exit(ad9834_exit); | ||
461 | 450 | ||
462 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); | 451 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); |
463 | MODULE_DESCRIPTION("Analog Devices AD9833/AD9834/AD9837/AD9838 DDS"); | 452 | MODULE_DESCRIPTION("Analog Devices AD9833/AD9834/AD9837/AD9838 DDS"); |
diff --git a/drivers/staging/iio/dds/ad9850.c b/drivers/staging/iio/dds/ad9850.c index a14771b24c50..f9c96afcb996 100644 --- a/drivers/staging/iio/dds/ad9850.c +++ b/drivers/staging/iio/dds/ad9850.c | |||
@@ -129,18 +129,7 @@ static struct spi_driver ad9850_driver = { | |||
129 | .probe = ad9850_probe, | 129 | .probe = ad9850_probe, |
130 | .remove = __devexit_p(ad9850_remove), | 130 | .remove = __devexit_p(ad9850_remove), |
131 | }; | 131 | }; |
132 | 132 | module_spi_driver(ad9850_driver); | |
133 | static __init int ad9850_spi_init(void) | ||
134 | { | ||
135 | return spi_register_driver(&ad9850_driver); | ||
136 | } | ||
137 | module_init(ad9850_spi_init); | ||
138 | |||
139 | static __exit void ad9850_spi_exit(void) | ||
140 | { | ||
141 | spi_unregister_driver(&ad9850_driver); | ||
142 | } | ||
143 | module_exit(ad9850_spi_exit); | ||
144 | 133 | ||
145 | MODULE_AUTHOR("Cliff Cai"); | 134 | MODULE_AUTHOR("Cliff Cai"); |
146 | MODULE_DESCRIPTION("Analog Devices ad9850 driver"); | 135 | MODULE_DESCRIPTION("Analog Devices ad9850 driver"); |
diff --git a/drivers/staging/iio/dds/ad9852.c b/drivers/staging/iio/dds/ad9852.c index cfceaa64a53a..9fc73fdc9c3b 100644 --- a/drivers/staging/iio/dds/ad9852.c +++ b/drivers/staging/iio/dds/ad9852.c | |||
@@ -280,18 +280,7 @@ static struct spi_driver ad9852_driver = { | |||
280 | .probe = ad9852_probe, | 280 | .probe = ad9852_probe, |
281 | .remove = __devexit_p(ad9852_remove), | 281 | .remove = __devexit_p(ad9852_remove), |
282 | }; | 282 | }; |
283 | 283 | module_spi_driver(ad9852_driver); | |
284 | static __init int ad9852_spi_init(void) | ||
285 | { | ||
286 | return spi_register_driver(&ad9852_driver); | ||
287 | } | ||
288 | module_init(ad9852_spi_init); | ||
289 | |||
290 | static __exit void ad9852_spi_exit(void) | ||
291 | { | ||
292 | spi_unregister_driver(&ad9852_driver); | ||
293 | } | ||
294 | module_exit(ad9852_spi_exit); | ||
295 | 284 | ||
296 | MODULE_AUTHOR("Cliff Cai"); | 285 | MODULE_AUTHOR("Cliff Cai"); |
297 | MODULE_DESCRIPTION("Analog Devices ad9852 driver"); | 286 | MODULE_DESCRIPTION("Analog Devices ad9852 driver"); |
diff --git a/drivers/staging/iio/dds/ad9910.c b/drivers/staging/iio/dds/ad9910.c index da83d2b88c4a..57046b03121f 100644 --- a/drivers/staging/iio/dds/ad9910.c +++ b/drivers/staging/iio/dds/ad9910.c | |||
@@ -413,18 +413,7 @@ static struct spi_driver ad9910_driver = { | |||
413 | .probe = ad9910_probe, | 413 | .probe = ad9910_probe, |
414 | .remove = __devexit_p(ad9910_remove), | 414 | .remove = __devexit_p(ad9910_remove), |
415 | }; | 415 | }; |
416 | 416 | module_spi_driver(ad9910_driver); | |
417 | static __init int ad9910_spi_init(void) | ||
418 | { | ||
419 | return spi_register_driver(&ad9910_driver); | ||
420 | } | ||
421 | module_init(ad9910_spi_init); | ||
422 | |||
423 | static __exit void ad9910_spi_exit(void) | ||
424 | { | ||
425 | spi_unregister_driver(&ad9910_driver); | ||
426 | } | ||
427 | module_exit(ad9910_spi_exit); | ||
428 | 417 | ||
429 | MODULE_AUTHOR("Cliff Cai"); | 418 | MODULE_AUTHOR("Cliff Cai"); |
430 | MODULE_DESCRIPTION("Analog Devices ad9910 driver"); | 419 | MODULE_DESCRIPTION("Analog Devices ad9910 driver"); |
diff --git a/drivers/staging/iio/dds/ad9951.c b/drivers/staging/iio/dds/ad9951.c index 20c182576def..d29130e9acdf 100644 --- a/drivers/staging/iio/dds/ad9951.c +++ b/drivers/staging/iio/dds/ad9951.c | |||
@@ -224,18 +224,7 @@ static struct spi_driver ad9951_driver = { | |||
224 | .probe = ad9951_probe, | 224 | .probe = ad9951_probe, |
225 | .remove = __devexit_p(ad9951_remove), | 225 | .remove = __devexit_p(ad9951_remove), |
226 | }; | 226 | }; |
227 | 227 | module_spi_driver(ad9951_driver); | |
228 | static __init int ad9951_spi_init(void) | ||
229 | { | ||
230 | return spi_register_driver(&ad9951_driver); | ||
231 | } | ||
232 | module_init(ad9951_spi_init); | ||
233 | |||
234 | static __exit void ad9951_spi_exit(void) | ||
235 | { | ||
236 | spi_unregister_driver(&ad9951_driver); | ||
237 | } | ||
238 | module_exit(ad9951_spi_exit); | ||
239 | 228 | ||
240 | MODULE_AUTHOR("Cliff Cai"); | 229 | MODULE_AUTHOR("Cliff Cai"); |
241 | MODULE_DESCRIPTION("Analog Devices ad9951 driver"); | 230 | MODULE_DESCRIPTION("Analog Devices ad9951 driver"); |
diff --git a/drivers/staging/iio/gyro/adis16080_core.c b/drivers/staging/iio/gyro/adis16080_core.c index 5d7a906fec78..9405f2d368ee 100644 --- a/drivers/staging/iio/gyro/adis16080_core.c +++ b/drivers/staging/iio/gyro/adis16080_core.c | |||
@@ -189,18 +189,7 @@ static struct spi_driver adis16080_driver = { | |||
189 | .probe = adis16080_probe, | 189 | .probe = adis16080_probe, |
190 | .remove = __devexit_p(adis16080_remove), | 190 | .remove = __devexit_p(adis16080_remove), |
191 | }; | 191 | }; |
192 | 192 | module_spi_driver(adis16080_driver); | |
193 | static __init int adis16080_init(void) | ||
194 | { | ||
195 | return spi_register_driver(&adis16080_driver); | ||
196 | } | ||
197 | module_init(adis16080_init); | ||
198 | |||
199 | static __exit void adis16080_exit(void) | ||
200 | { | ||
201 | spi_unregister_driver(&adis16080_driver); | ||
202 | } | ||
203 | module_exit(adis16080_exit); | ||
204 | 193 | ||
205 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); | 194 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); |
206 | MODULE_DESCRIPTION("Analog Devices ADIS16080/100 Yaw Rate Gyroscope Driver"); | 195 | MODULE_DESCRIPTION("Analog Devices ADIS16080/100 Yaw Rate Gyroscope Driver"); |
diff --git a/drivers/staging/iio/gyro/adis16130_core.c b/drivers/staging/iio/gyro/adis16130_core.c index 749240d0d8cb..c9aaca9631f4 100644 --- a/drivers/staging/iio/gyro/adis16130_core.c +++ b/drivers/staging/iio/gyro/adis16130_core.c | |||
@@ -168,18 +168,7 @@ static struct spi_driver adis16130_driver = { | |||
168 | .probe = adis16130_probe, | 168 | .probe = adis16130_probe, |
169 | .remove = __devexit_p(adis16130_remove), | 169 | .remove = __devexit_p(adis16130_remove), |
170 | }; | 170 | }; |
171 | 171 | module_spi_driver(adis16130_driver); | |
172 | static __init int adis16130_init(void) | ||
173 | { | ||
174 | return spi_register_driver(&adis16130_driver); | ||
175 | } | ||
176 | module_init(adis16130_init); | ||
177 | |||
178 | static __exit void adis16130_exit(void) | ||
179 | { | ||
180 | spi_unregister_driver(&adis16130_driver); | ||
181 | } | ||
182 | module_exit(adis16130_exit); | ||
183 | 172 | ||
184 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); | 173 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); |
185 | MODULE_DESCRIPTION("Analog Devices ADIS16130 High Precision Angular Rate"); | 174 | MODULE_DESCRIPTION("Analog Devices ADIS16130 High Precision Angular Rate"); |
diff --git a/drivers/staging/iio/gyro/adis16260_core.c b/drivers/staging/iio/gyro/adis16260_core.c index aaa3967f8c03..886dddf867ef 100644 --- a/drivers/staging/iio/gyro/adis16260_core.c +++ b/drivers/staging/iio/gyro/adis16260_core.c | |||
@@ -711,18 +711,7 @@ static struct spi_driver adis16260_driver = { | |||
711 | .remove = __devexit_p(adis16260_remove), | 711 | .remove = __devexit_p(adis16260_remove), |
712 | .id_table = adis16260_id, | 712 | .id_table = adis16260_id, |
713 | }; | 713 | }; |
714 | 714 | module_spi_driver(adis16260_driver); | |
715 | static __init int adis16260_init(void) | ||
716 | { | ||
717 | return spi_register_driver(&adis16260_driver); | ||
718 | } | ||
719 | module_init(adis16260_init); | ||
720 | |||
721 | static __exit void adis16260_exit(void) | ||
722 | { | ||
723 | spi_unregister_driver(&adis16260_driver); | ||
724 | } | ||
725 | module_exit(adis16260_exit); | ||
726 | 715 | ||
727 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); | 716 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); |
728 | MODULE_DESCRIPTION("Analog Devices ADIS16260/5 Digital Gyroscope Sensor"); | 717 | MODULE_DESCRIPTION("Analog Devices ADIS16260/5 Digital Gyroscope Sensor"); |
diff --git a/drivers/staging/iio/gyro/adxrs450_core.c b/drivers/staging/iio/gyro/adxrs450_core.c index 3c3ef796d48e..70fd468b6850 100644 --- a/drivers/staging/iio/gyro/adxrs450_core.c +++ b/drivers/staging/iio/gyro/adxrs450_core.c | |||
@@ -381,18 +381,7 @@ static struct spi_driver adxrs450_driver = { | |||
381 | .probe = adxrs450_probe, | 381 | .probe = adxrs450_probe, |
382 | .remove = __devexit_p(adxrs450_remove), | 382 | .remove = __devexit_p(adxrs450_remove), |
383 | }; | 383 | }; |
384 | 384 | module_spi_driver(adxrs450_driver); | |
385 | static __init int adxrs450_init(void) | ||
386 | { | ||
387 | return spi_register_driver(&adxrs450_driver); | ||
388 | } | ||
389 | module_init(adxrs450_init); | ||
390 | |||
391 | static __exit void adxrs450_exit(void) | ||
392 | { | ||
393 | spi_unregister_driver(&adxrs450_driver); | ||
394 | } | ||
395 | module_exit(adxrs450_exit); | ||
396 | 385 | ||
397 | MODULE_AUTHOR("Cliff Cai <cliff.cai@xxxxxxxxxx>"); | 386 | MODULE_AUTHOR("Cliff Cai <cliff.cai@xxxxxxxxxx>"); |
398 | MODULE_DESCRIPTION("Analog Devices ADXRS450 Gyroscope SPI driver"); | 387 | MODULE_DESCRIPTION("Analog Devices ADXRS450 Gyroscope SPI driver"); |
diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c index 1086e0befc28..454d131455de 100644 --- a/drivers/staging/iio/impedance-analyzer/ad5933.c +++ b/drivers/staging/iio/impedance-analyzer/ad5933.c | |||
@@ -796,18 +796,7 @@ static struct i2c_driver ad5933_driver = { | |||
796 | .remove = __devexit_p(ad5933_remove), | 796 | .remove = __devexit_p(ad5933_remove), |
797 | .id_table = ad5933_id, | 797 | .id_table = ad5933_id, |
798 | }; | 798 | }; |
799 | 799 | module_i2c_driver(ad5933_driver); | |
800 | static __init int ad5933_init(void) | ||
801 | { | ||
802 | return i2c_add_driver(&ad5933_driver); | ||
803 | } | ||
804 | module_init(ad5933_init); | ||
805 | |||
806 | static __exit void ad5933_exit(void) | ||
807 | { | ||
808 | i2c_del_driver(&ad5933_driver); | ||
809 | } | ||
810 | module_exit(ad5933_exit); | ||
811 | 800 | ||
812 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); | 801 | MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); |
813 | MODULE_DESCRIPTION("Analog Devices AD5933 Impedance Conv. Network Analyzer"); | 802 | MODULE_DESCRIPTION("Analog Devices AD5933 Impedance Conv. Network Analyzer"); |
diff --git a/drivers/staging/iio/imu/adis16400_core.c b/drivers/staging/iio/imu/adis16400_core.c index d082a37c4fb7..efc0f6529008 100644 --- a/drivers/staging/iio/imu/adis16400_core.c +++ b/drivers/staging/iio/imu/adis16400_core.c | |||
@@ -1128,18 +1128,7 @@ static struct spi_driver adis16400_driver = { | |||
1128 | .probe = adis16400_probe, | 1128 | .probe = adis16400_probe, |
1129 | .remove = __devexit_p(adis16400_remove), | 1129 | .remove = __devexit_p(adis16400_remove), |
1130 | }; | 1130 | }; |
1131 | 1131 | module_spi_driver(adis16400_driver); | |
1132 | static __init int adis16400_init(void) | ||
1133 | { | ||
1134 | return spi_register_driver(&adis16400_driver); | ||
1135 | } | ||
1136 | module_init(adis16400_init); | ||
1137 | |||
1138 | static __exit void adis16400_exit(void) | ||
1139 | { | ||
1140 | spi_unregister_driver(&adis16400_driver); | ||
1141 | } | ||
1142 | module_exit(adis16400_exit); | ||
1143 | 1132 | ||
1144 | MODULE_AUTHOR("Manuel Stahl <manuel.stahl@iis.fraunhofer.de>"); | 1133 | MODULE_AUTHOR("Manuel Stahl <manuel.stahl@iis.fraunhofer.de>"); |
1145 | MODULE_DESCRIPTION("Analog Devices ADIS16400/5 IMU SPI driver"); | 1134 | MODULE_DESCRIPTION("Analog Devices ADIS16400/5 IMU SPI driver"); |
diff --git a/drivers/staging/iio/light/isl29018.c b/drivers/staging/iio/light/isl29018.c index 9dc9e6358394..47638362224b 100644 --- a/drivers/staging/iio/light/isl29018.c +++ b/drivers/staging/iio/light/isl29018.c | |||
@@ -603,19 +603,7 @@ static struct i2c_driver isl29018_driver = { | |||
603 | .remove = __devexit_p(isl29018_remove), | 603 | .remove = __devexit_p(isl29018_remove), |
604 | .id_table = isl29018_id, | 604 | .id_table = isl29018_id, |
605 | }; | 605 | }; |
606 | 606 | module_i2c_driver(isl29018_driver); | |
607 | static int __init isl29018_init(void) | ||
608 | { | ||
609 | return i2c_add_driver(&isl29018_driver); | ||
610 | } | ||
611 | |||
612 | static void __exit isl29018_exit(void) | ||
613 | { | ||
614 | i2c_del_driver(&isl29018_driver); | ||
615 | } | ||
616 | |||
617 | module_init(isl29018_init); | ||
618 | module_exit(isl29018_exit); | ||
619 | 607 | ||
620 | MODULE_DESCRIPTION("ISL29018 Ambient Light Sensor driver"); | 608 | MODULE_DESCRIPTION("ISL29018 Ambient Light Sensor driver"); |
621 | MODULE_LICENSE("GPL"); | 609 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/staging/iio/light/tsl2563.c b/drivers/staging/iio/light/tsl2563.c index 7e984bcf8d7e..1942db13b03b 100644 --- a/drivers/staging/iio/light/tsl2563.c +++ b/drivers/staging/iio/light/tsl2563.c | |||
@@ -866,20 +866,8 @@ static struct i2c_driver tsl2563_i2c_driver = { | |||
866 | .remove = __devexit_p(tsl2563_remove), | 866 | .remove = __devexit_p(tsl2563_remove), |
867 | .id_table = tsl2563_id, | 867 | .id_table = tsl2563_id, |
868 | }; | 868 | }; |
869 | 869 | module_i2c_driver(tsl2563_i2c_driver); | |
870 | static int __init tsl2563_init(void) | ||
871 | { | ||
872 | return i2c_add_driver(&tsl2563_i2c_driver); | ||
873 | } | ||
874 | |||
875 | static void __exit tsl2563_exit(void) | ||
876 | { | ||
877 | i2c_del_driver(&tsl2563_i2c_driver); | ||
878 | } | ||
879 | 870 | ||
880 | MODULE_AUTHOR("Nokia Corporation"); | 871 | MODULE_AUTHOR("Nokia Corporation"); |
881 | MODULE_DESCRIPTION("tsl2563 light sensor driver"); | 872 | MODULE_DESCRIPTION("tsl2563 light sensor driver"); |
882 | MODULE_LICENSE("GPL"); | 873 | MODULE_LICENSE("GPL"); |
883 | |||
884 | module_init(tsl2563_init); | ||
885 | module_exit(tsl2563_exit); | ||
diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c index 80f77cf8e9c2..3836f73a5296 100644 --- a/drivers/staging/iio/light/tsl2583.c +++ b/drivers/staging/iio/light/tsl2583.c | |||
@@ -933,19 +933,7 @@ static struct i2c_driver taos_driver = { | |||
933 | .probe = taos_probe, | 933 | .probe = taos_probe, |
934 | .remove = __devexit_p(taos_remove), | 934 | .remove = __devexit_p(taos_remove), |
935 | }; | 935 | }; |
936 | 936 | module_i2c_driver(taos_driver); | |
937 | static int __init taos_init(void) | ||
938 | { | ||
939 | return i2c_add_driver(&taos_driver); | ||
940 | } | ||
941 | |||
942 | static void __exit taos_exit(void) | ||
943 | { | ||
944 | i2c_del_driver(&taos_driver); | ||
945 | } | ||
946 | |||
947 | module_init(taos_init); | ||
948 | module_exit(taos_exit); | ||
949 | 937 | ||
950 | MODULE_AUTHOR("J. August Brenner<jbrenner@taosinc.com>"); | 938 | MODULE_AUTHOR("J. August Brenner<jbrenner@taosinc.com>"); |
951 | MODULE_DESCRIPTION("TAOS tsl2583 ambient light sensor driver"); | 939 | MODULE_DESCRIPTION("TAOS tsl2583 ambient light sensor driver"); |
diff --git a/drivers/staging/iio/magnetometer/ak8975.c b/drivers/staging/iio/magnetometer/ak8975.c index 8b017127fd4d..db31d6d0e5b6 100644 --- a/drivers/staging/iio/magnetometer/ak8975.c +++ b/drivers/staging/iio/magnetometer/ak8975.c | |||
@@ -572,19 +572,7 @@ static struct i2c_driver ak8975_driver = { | |||
572 | .remove = __devexit_p(ak8975_remove), | 572 | .remove = __devexit_p(ak8975_remove), |
573 | .id_table = ak8975_id, | 573 | .id_table = ak8975_id, |
574 | }; | 574 | }; |
575 | 575 | module_i2c_driver(ak8975_driver); | |
576 | static int __init ak8975_init(void) | ||
577 | { | ||
578 | return i2c_add_driver(&ak8975_driver); | ||
579 | } | ||
580 | |||
581 | static void __exit ak8975_exit(void) | ||
582 | { | ||
583 | i2c_del_driver(&ak8975_driver); | ||
584 | } | ||
585 | |||
586 | module_init(ak8975_init); | ||
587 | module_exit(ak8975_exit); | ||
588 | 576 | ||
589 | MODULE_AUTHOR("Laxman Dewangan <ldewangan@nvidia.com>"); | 577 | MODULE_AUTHOR("Laxman Dewangan <ldewangan@nvidia.com>"); |
590 | MODULE_DESCRIPTION("AK8975 magnetometer driver"); | 578 | MODULE_DESCRIPTION("AK8975 magnetometer driver"); |
diff --git a/drivers/staging/iio/magnetometer/hmc5843.c b/drivers/staging/iio/magnetometer/hmc5843.c index fc9ee970888d..7bb1bc605136 100644 --- a/drivers/staging/iio/magnetometer/hmc5843.c +++ b/drivers/staging/iio/magnetometer/hmc5843.c | |||
@@ -618,20 +618,8 @@ static struct i2c_driver hmc5843_driver = { | |||
618 | .suspend = hmc5843_suspend, | 618 | .suspend = hmc5843_suspend, |
619 | .resume = hmc5843_resume, | 619 | .resume = hmc5843_resume, |
620 | }; | 620 | }; |
621 | 621 | module_i2c_driver(hmc5843_driver); | |
622 | static int __init hmc5843_init(void) | ||
623 | { | ||
624 | return i2c_add_driver(&hmc5843_driver); | ||
625 | } | ||
626 | |||
627 | static void __exit hmc5843_exit(void) | ||
628 | { | ||
629 | i2c_del_driver(&hmc5843_driver); | ||
630 | } | ||
631 | 622 | ||
632 | MODULE_AUTHOR("Shubhrajyoti Datta <shubhrajyoti@ti.com"); | 623 | MODULE_AUTHOR("Shubhrajyoti Datta <shubhrajyoti@ti.com"); |
633 | MODULE_DESCRIPTION("HMC5843 driver"); | 624 | MODULE_DESCRIPTION("HMC5843 driver"); |
634 | MODULE_LICENSE("GPL"); | 625 | MODULE_LICENSE("GPL"); |
635 | |||
636 | module_init(hmc5843_init); | ||
637 | module_exit(hmc5843_exit); | ||
diff --git a/drivers/staging/iio/meter/ade7753.c b/drivers/staging/iio/meter/ade7753.c index 940fef602b18..4c7b0cbf49fa 100644 --- a/drivers/staging/iio/meter/ade7753.c +++ b/drivers/staging/iio/meter/ade7753.c | |||
@@ -577,18 +577,7 @@ static struct spi_driver ade7753_driver = { | |||
577 | .probe = ade7753_probe, | 577 | .probe = ade7753_probe, |
578 | .remove = __devexit_p(ade7753_remove), | 578 | .remove = __devexit_p(ade7753_remove), |
579 | }; | 579 | }; |
580 | 580 | module_spi_driver(ade7753_driver); | |
581 | static __init int ade7753_init(void) | ||
582 | { | ||
583 | return spi_register_driver(&ade7753_driver); | ||
584 | } | ||
585 | module_init(ade7753_init); | ||
586 | |||
587 | static __exit void ade7753_exit(void) | ||
588 | { | ||
589 | spi_unregister_driver(&ade7753_driver); | ||
590 | } | ||
591 | module_exit(ade7753_exit); | ||
592 | 581 | ||
593 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); | 582 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); |
594 | MODULE_DESCRIPTION("Analog Devices ADE7753/6 Single-Phase Multifunction Meter"); | 583 | MODULE_DESCRIPTION("Analog Devices ADE7753/6 Single-Phase Multifunction Meter"); |
diff --git a/drivers/staging/iio/meter/ade7754.c b/drivers/staging/iio/meter/ade7754.c index 33f0d327c9fa..15c98cde76d1 100644 --- a/drivers/staging/iio/meter/ade7754.c +++ b/drivers/staging/iio/meter/ade7754.c | |||
@@ -600,18 +600,7 @@ static struct spi_driver ade7754_driver = { | |||
600 | .probe = ade7754_probe, | 600 | .probe = ade7754_probe, |
601 | .remove = __devexit_p(ade7754_remove), | 601 | .remove = __devexit_p(ade7754_remove), |
602 | }; | 602 | }; |
603 | 603 | module_spi_driver(ade7754_driver); | |
604 | static __init int ade7754_init(void) | ||
605 | { | ||
606 | return spi_register_driver(&ade7754_driver); | ||
607 | } | ||
608 | module_init(ade7754_init); | ||
609 | |||
610 | static __exit void ade7754_exit(void) | ||
611 | { | ||
612 | spi_unregister_driver(&ade7754_driver); | ||
613 | } | ||
614 | module_exit(ade7754_exit); | ||
615 | 604 | ||
616 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); | 605 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); |
617 | MODULE_DESCRIPTION("Analog Devices ADE7754 Polyphase Multifunction Energy Metering IC Driver"); | 606 | MODULE_DESCRIPTION("Analog Devices ADE7754 Polyphase Multifunction Energy Metering IC Driver"); |
diff --git a/drivers/staging/iio/meter/ade7758_core.c b/drivers/staging/iio/meter/ade7758_core.c index c5dafbdf3bda..39338bcb1872 100644 --- a/drivers/staging/iio/meter/ade7758_core.c +++ b/drivers/staging/iio/meter/ade7758_core.c | |||
@@ -853,18 +853,7 @@ static struct spi_driver ade7758_driver = { | |||
853 | .remove = __devexit_p(ade7758_remove), | 853 | .remove = __devexit_p(ade7758_remove), |
854 | .id_table = ade7758_id, | 854 | .id_table = ade7758_id, |
855 | }; | 855 | }; |
856 | 856 | module_spi_driver(ade7758_driver); | |
857 | static __init int ade7758_init(void) | ||
858 | { | ||
859 | return spi_register_driver(&ade7758_driver); | ||
860 | } | ||
861 | module_init(ade7758_init); | ||
862 | |||
863 | static __exit void ade7758_exit(void) | ||
864 | { | ||
865 | spi_unregister_driver(&ade7758_driver); | ||
866 | } | ||
867 | module_exit(ade7758_exit); | ||
868 | 857 | ||
869 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); | 858 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); |
870 | MODULE_DESCRIPTION("Analog Devices ADE7758 Polyphase Multifunction Energy Metering IC Driver"); | 859 | MODULE_DESCRIPTION("Analog Devices ADE7758 Polyphase Multifunction Energy Metering IC Driver"); |
diff --git a/drivers/staging/iio/meter/ade7759.c b/drivers/staging/iio/meter/ade7759.c index b691f10ce988..cfa2a5eff122 100644 --- a/drivers/staging/iio/meter/ade7759.c +++ b/drivers/staging/iio/meter/ade7759.c | |||
@@ -521,18 +521,7 @@ static struct spi_driver ade7759_driver = { | |||
521 | .probe = ade7759_probe, | 521 | .probe = ade7759_probe, |
522 | .remove = __devexit_p(ade7759_remove), | 522 | .remove = __devexit_p(ade7759_remove), |
523 | }; | 523 | }; |
524 | 524 | module_spi_driver(ade7759_driver); | |
525 | static __init int ade7759_init(void) | ||
526 | { | ||
527 | return spi_register_driver(&ade7759_driver); | ||
528 | } | ||
529 | module_init(ade7759_init); | ||
530 | |||
531 | static __exit void ade7759_exit(void) | ||
532 | { | ||
533 | spi_unregister_driver(&ade7759_driver); | ||
534 | } | ||
535 | module_exit(ade7759_exit); | ||
536 | 525 | ||
537 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); | 526 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); |
538 | MODULE_DESCRIPTION("Analog Devices ADE7759 Active Energy Metering IC Driver"); | 527 | MODULE_DESCRIPTION("Analog Devices ADE7759 Active Energy Metering IC Driver"); |
diff --git a/drivers/staging/iio/meter/ade7854-i2c.c b/drivers/staging/iio/meter/ade7854-i2c.c index cbca3fd8fcd6..1e1faa0479d3 100644 --- a/drivers/staging/iio/meter/ade7854-i2c.c +++ b/drivers/staging/iio/meter/ade7854-i2c.c | |||
@@ -253,19 +253,7 @@ static struct i2c_driver ade7854_i2c_driver = { | |||
253 | .remove = __devexit_p(ade7854_i2c_remove), | 253 | .remove = __devexit_p(ade7854_i2c_remove), |
254 | .id_table = ade7854_id, | 254 | .id_table = ade7854_id, |
255 | }; | 255 | }; |
256 | 256 | module_i2c_driver(ade7854_i2c_driver); | |
257 | static __init int ade7854_i2c_init(void) | ||
258 | { | ||
259 | return i2c_add_driver(&ade7854_i2c_driver); | ||
260 | } | ||
261 | module_init(ade7854_i2c_init); | ||
262 | |||
263 | static __exit void ade7854_i2c_exit(void) | ||
264 | { | ||
265 | i2c_del_driver(&ade7854_i2c_driver); | ||
266 | } | ||
267 | module_exit(ade7854_i2c_exit); | ||
268 | |||
269 | 257 | ||
270 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); | 258 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); |
271 | MODULE_DESCRIPTION("Analog Devices ADE7854/58/68/78 Polyphase Multifunction Energy Metering IC I2C Driver"); | 259 | MODULE_DESCRIPTION("Analog Devices ADE7854/58/68/78 Polyphase Multifunction Energy Metering IC I2C Driver"); |
diff --git a/drivers/staging/iio/meter/ade7854-spi.c b/drivers/staging/iio/meter/ade7854-spi.c index cfa23ba30efe..c485a79aeec3 100644 --- a/drivers/staging/iio/meter/ade7854-spi.c +++ b/drivers/staging/iio/meter/ade7854-spi.c | |||
@@ -353,18 +353,7 @@ static struct spi_driver ade7854_driver = { | |||
353 | .remove = __devexit_p(ade7854_spi_remove), | 353 | .remove = __devexit_p(ade7854_spi_remove), |
354 | .id_table = ade7854_id, | 354 | .id_table = ade7854_id, |
355 | }; | 355 | }; |
356 | 356 | module_spi_driver(ade7854_driver); | |
357 | static __init int ade7854_init(void) | ||
358 | { | ||
359 | return spi_register_driver(&ade7854_driver); | ||
360 | } | ||
361 | module_init(ade7854_init); | ||
362 | |||
363 | static __exit void ade7854_exit(void) | ||
364 | { | ||
365 | spi_unregister_driver(&ade7854_driver); | ||
366 | } | ||
367 | module_exit(ade7854_exit); | ||
368 | 357 | ||
369 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); | 358 | MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>"); |
370 | MODULE_DESCRIPTION("Analog Devices ADE7854/58/68/78 SPI Driver"); | 359 | MODULE_DESCRIPTION("Analog Devices ADE7854/58/68/78 SPI Driver"); |
diff --git a/drivers/staging/iio/resolver/ad2s1200.c b/drivers/staging/iio/resolver/ad2s1200.c index d7ad46aed0ff..1c6a02bfd45d 100644 --- a/drivers/staging/iio/resolver/ad2s1200.c +++ b/drivers/staging/iio/resolver/ad2s1200.c | |||
@@ -170,18 +170,7 @@ static struct spi_driver ad2s1200_driver = { | |||
170 | .remove = __devexit_p(ad2s1200_remove), | 170 | .remove = __devexit_p(ad2s1200_remove), |
171 | .id_table = ad2s1200_id, | 171 | .id_table = ad2s1200_id, |
172 | }; | 172 | }; |
173 | 173 | module_spi_driver(ad2s1200_driver); | |
174 | static __init int ad2s1200_spi_init(void) | ||
175 | { | ||
176 | return spi_register_driver(&ad2s1200_driver); | ||
177 | } | ||
178 | module_init(ad2s1200_spi_init); | ||
179 | |||
180 | static __exit void ad2s1200_spi_exit(void) | ||
181 | { | ||
182 | spi_unregister_driver(&ad2s1200_driver); | ||
183 | } | ||
184 | module_exit(ad2s1200_spi_exit); | ||
185 | 174 | ||
186 | MODULE_AUTHOR("Graff Yang <graff.yang@gmail.com>"); | 175 | MODULE_AUTHOR("Graff Yang <graff.yang@gmail.com>"); |
187 | MODULE_DESCRIPTION("Analog Devices AD2S1200/1205 Resolver to Digital SPI driver"); | 176 | MODULE_DESCRIPTION("Analog Devices AD2S1200/1205 Resolver to Digital SPI driver"); |
diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c index 6401a6273625..ff1b3316d016 100644 --- a/drivers/staging/iio/resolver/ad2s1210.c +++ b/drivers/staging/iio/resolver/ad2s1210.c | |||
@@ -759,18 +759,7 @@ static struct spi_driver ad2s1210_driver = { | |||
759 | .remove = __devexit_p(ad2s1210_remove), | 759 | .remove = __devexit_p(ad2s1210_remove), |
760 | .id_table = ad2s1210_id, | 760 | .id_table = ad2s1210_id, |
761 | }; | 761 | }; |
762 | 762 | module_spi_driver(ad2s1210_driver); | |
763 | static __init int ad2s1210_spi_init(void) | ||
764 | { | ||
765 | return spi_register_driver(&ad2s1210_driver); | ||
766 | } | ||
767 | module_init(ad2s1210_spi_init); | ||
768 | |||
769 | static __exit void ad2s1210_spi_exit(void) | ||
770 | { | ||
771 | spi_unregister_driver(&ad2s1210_driver); | ||
772 | } | ||
773 | module_exit(ad2s1210_spi_exit); | ||
774 | 763 | ||
775 | MODULE_AUTHOR("Graff Yang <graff.yang@gmail.com>"); | 764 | MODULE_AUTHOR("Graff Yang <graff.yang@gmail.com>"); |
776 | MODULE_DESCRIPTION("Analog Devices AD2S1210 Resolver to Digital SPI driver"); | 765 | MODULE_DESCRIPTION("Analog Devices AD2S1210 Resolver to Digital SPI driver"); |
diff --git a/drivers/staging/iio/resolver/ad2s90.c b/drivers/staging/iio/resolver/ad2s90.c index a9200d949dcd..6d0794389e74 100644 --- a/drivers/staging/iio/resolver/ad2s90.c +++ b/drivers/staging/iio/resolver/ad2s90.c | |||
@@ -119,18 +119,7 @@ static struct spi_driver ad2s90_driver = { | |||
119 | .remove = __devexit_p(ad2s90_remove), | 119 | .remove = __devexit_p(ad2s90_remove), |
120 | .id_table = ad2s90_id, | 120 | .id_table = ad2s90_id, |
121 | }; | 121 | }; |
122 | 122 | module_spi_driver(ad2s90_driver); | |
123 | static __init int ad2s90_spi_init(void) | ||
124 | { | ||
125 | return spi_register_driver(&ad2s90_driver); | ||
126 | } | ||
127 | module_init(ad2s90_spi_init); | ||
128 | |||
129 | static __exit void ad2s90_spi_exit(void) | ||
130 | { | ||
131 | spi_unregister_driver(&ad2s90_driver); | ||
132 | } | ||
133 | module_exit(ad2s90_spi_exit); | ||
134 | 123 | ||
135 | MODULE_AUTHOR("Graff Yang <graff.yang@gmail.com>"); | 124 | MODULE_AUTHOR("Graff Yang <graff.yang@gmail.com>"); |
136 | MODULE_DESCRIPTION("Analog Devices AD2S90 Resolver to Digital SPI driver"); | 125 | MODULE_DESCRIPTION("Analog Devices AD2S90 Resolver to Digital SPI driver"); |
diff --git a/drivers/staging/keucr/usb.c b/drivers/staging/keucr/usb.c index 66aad3a0d1fd..483303402735 100644 --- a/drivers/staging/keucr/usb.c +++ b/drivers/staging/keucr/usb.c | |||
@@ -701,26 +701,4 @@ static struct usb_driver usb_storage_driver = { | |||
701 | .soft_unbind = 1, | 701 | .soft_unbind = 1, |
702 | }; | 702 | }; |
703 | 703 | ||
704 | //----- usb_stor_init() --------------------- | 704 | module_usb_driver(usb_storage_driver); |
705 | static int __init usb_stor_init(void) | ||
706 | { | ||
707 | int retval; | ||
708 | pr_info("usb --- usb_stor_init start\n"); | ||
709 | |||
710 | retval = usb_register(&usb_storage_driver); | ||
711 | if (retval == 0) | ||
712 | pr_info("ENE USB Mass Storage support registered.\n"); | ||
713 | |||
714 | return retval; | ||
715 | } | ||
716 | |||
717 | //----- usb_stor_exit() --------------------- | ||
718 | static void __exit usb_stor_exit(void) | ||
719 | { | ||
720 | pr_info("usb --- usb_stor_exit\n"); | ||
721 | |||
722 | usb_deregister(&usb_storage_driver) ; | ||
723 | } | ||
724 | |||
725 | module_init(usb_stor_init); | ||
726 | module_exit(usb_stor_exit); | ||
diff --git a/drivers/staging/media/go7007/go7007-usb.c b/drivers/staging/media/go7007/go7007-usb.c index 3db3b0a91cc1..b7175fe1b15f 100644 --- a/drivers/staging/media/go7007/go7007-usb.c +++ b/drivers/staging/media/go7007/go7007-usb.c | |||
@@ -1272,17 +1272,4 @@ static struct usb_driver go7007_usb_driver = { | |||
1272 | .id_table = go7007_usb_id_table, | 1272 | .id_table = go7007_usb_id_table, |
1273 | }; | 1273 | }; |
1274 | 1274 | ||
1275 | static int __init go7007_usb_init(void) | 1275 | module_usb_driver(go7007_usb_driver); |
1276 | { | ||
1277 | return usb_register(&go7007_usb_driver); | ||
1278 | } | ||
1279 | |||
1280 | static void __exit go7007_usb_cleanup(void) | ||
1281 | { | ||
1282 | usb_deregister(&go7007_usb_driver); | ||
1283 | } | ||
1284 | |||
1285 | module_init(go7007_usb_init); | ||
1286 | module_exit(go7007_usb_cleanup); | ||
1287 | |||
1288 | MODULE_LICENSE("GPL v2"); | ||
diff --git a/drivers/staging/media/lirc/lirc_igorplugusb.c b/drivers/staging/media/lirc/lirc_igorplugusb.c index 0dc2c2b22c2b..6cd4cd67a1dd 100644 --- a/drivers/staging/media/lirc/lirc_igorplugusb.c +++ b/drivers/staging/media/lirc/lirc_igorplugusb.c | |||
@@ -541,26 +541,7 @@ static struct usb_driver igorplugusb_remote_driver = { | |||
541 | .id_table = igorplugusb_remote_id_table | 541 | .id_table = igorplugusb_remote_id_table |
542 | }; | 542 | }; |
543 | 543 | ||
544 | static int __init igorplugusb_remote_init(void) | 544 | module_usb_driver(igorplugusb_remote_driver); |
545 | { | ||
546 | int ret = 0; | ||
547 | |||
548 | dprintk(DRIVER_NAME ": loaded, debug mode enabled\n"); | ||
549 | |||
550 | ret = usb_register(&igorplugusb_remote_driver); | ||
551 | if (ret) | ||
552 | printk(KERN_ERR DRIVER_NAME ": usb register failed!\n"); | ||
553 | |||
554 | return ret; | ||
555 | } | ||
556 | |||
557 | static void __exit igorplugusb_remote_exit(void) | ||
558 | { | ||
559 | usb_deregister(&igorplugusb_remote_driver); | ||
560 | } | ||
561 | |||
562 | module_init(igorplugusb_remote_init); | ||
563 | module_exit(igorplugusb_remote_exit); | ||
564 | 545 | ||
565 | #include <linux/vermagic.h> | 546 | #include <linux/vermagic.h> |
566 | MODULE_INFO(vermagic, VERMAGIC_STRING); | 547 | MODULE_INFO(vermagic, VERMAGIC_STRING); |
diff --git a/drivers/staging/media/lirc/lirc_imon.c b/drivers/staging/media/lirc/lirc_imon.c index f5308d5929c6..f68218012f23 100644 --- a/drivers/staging/media/lirc/lirc_imon.c +++ b/drivers/staging/media/lirc/lirc_imon.c | |||
@@ -1025,26 +1025,4 @@ static int imon_resume(struct usb_interface *intf) | |||
1025 | return rc; | 1025 | return rc; |
1026 | } | 1026 | } |
1027 | 1027 | ||
1028 | static int __init imon_init(void) | 1028 | module_usb_driver(imon_driver); |
1029 | { | ||
1030 | int rc; | ||
1031 | |||
1032 | printk(KERN_INFO MOD_NAME ": " MOD_DESC ", v" MOD_VERSION "\n"); | ||
1033 | |||
1034 | rc = usb_register(&imon_driver); | ||
1035 | if (rc) { | ||
1036 | err("%s: usb register failed(%d)", __func__, rc); | ||
1037 | return -ENODEV; | ||
1038 | } | ||
1039 | |||
1040 | return 0; | ||
1041 | } | ||
1042 | |||
1043 | static void __exit imon_exit(void) | ||
1044 | { | ||
1045 | usb_deregister(&imon_driver); | ||
1046 | printk(KERN_INFO MOD_NAME ": module removed. Goodbye!\n"); | ||
1047 | } | ||
1048 | |||
1049 | module_init(imon_init); | ||
1050 | module_exit(imon_exit); | ||
diff --git a/drivers/staging/media/lirc/lirc_sasem.c b/drivers/staging/media/lirc/lirc_sasem.c index a2d18b0aa048..7855baa18e75 100644 --- a/drivers/staging/media/lirc/lirc_sasem.c +++ b/drivers/staging/media/lirc/lirc_sasem.c | |||
@@ -913,27 +913,4 @@ static void sasem_disconnect(struct usb_interface *interface) | |||
913 | mutex_unlock(&disconnect_lock); | 913 | mutex_unlock(&disconnect_lock); |
914 | } | 914 | } |
915 | 915 | ||
916 | static int __init sasem_init(void) | 916 | module_usb_driver(sasem_driver); |
917 | { | ||
918 | int rc; | ||
919 | |||
920 | printk(KERN_INFO MOD_DESC ", v" MOD_VERSION "\n"); | ||
921 | printk(KERN_INFO MOD_AUTHOR "\n"); | ||
922 | |||
923 | rc = usb_register(&sasem_driver); | ||
924 | if (rc < 0) { | ||
925 | err("%s: usb register failed (%d)", __func__, rc); | ||
926 | return -ENODEV; | ||
927 | } | ||
928 | return 0; | ||
929 | } | ||
930 | |||
931 | static void __exit sasem_exit(void) | ||
932 | { | ||
933 | usb_deregister(&sasem_driver); | ||
934 | printk(KERN_INFO "module removed. Goodbye!\n"); | ||
935 | } | ||
936 | |||
937 | |||
938 | module_init(sasem_init); | ||
939 | module_exit(sasem_exit); | ||
diff --git a/drivers/staging/media/lirc/lirc_ttusbir.c b/drivers/staging/media/lirc/lirc_ttusbir.c index e4b329b8cafd..7950887ff113 100644 --- a/drivers/staging/media/lirc/lirc_ttusbir.c +++ b/drivers/staging/media/lirc/lirc_ttusbir.c | |||
@@ -372,24 +372,4 @@ static void disconnect(struct usb_interface *intf) | |||
372 | kfree(ttusbir); | 372 | kfree(ttusbir); |
373 | } | 373 | } |
374 | 374 | ||
375 | static int ttusbir_init_module(void) | 375 | module_usb_driver(usb_driver); |
376 | { | ||
377 | int result; | ||
378 | |||
379 | DPRINTK(KERN_DEBUG "Module ttusbir init\n"); | ||
380 | |||
381 | /* register this driver with the USB subsystem */ | ||
382 | result = usb_register(&usb_driver); | ||
383 | if (result) | ||
384 | err("usb_register failed. Error number %d", result); | ||
385 | return result; | ||
386 | } | ||
387 | |||
388 | static void ttusbir_exit_module(void) | ||
389 | { | ||
390 | printk(KERN_DEBUG "Module ttusbir exit\n"); | ||
391 | usb_deregister(&usb_driver); | ||
392 | } | ||
393 | |||
394 | module_init(ttusbir_init_module); | ||
395 | module_exit(ttusbir_exit_module); | ||
diff --git a/drivers/staging/rts5139/rts51x.c b/drivers/staging/rts5139/rts51x.c index d9cee6d0b124..2b9f785954df 100644 --- a/drivers/staging/rts5139/rts51x.c +++ b/drivers/staging/rts5139/rts51x.c | |||
@@ -934,34 +934,4 @@ struct usb_driver rts51x_driver = { | |||
934 | .soft_unbind = 1, | 934 | .soft_unbind = 1, |
935 | }; | 935 | }; |
936 | 936 | ||
937 | static int __init rts51x_init(void) | 937 | module_usb_driver(rts51x_driver); |
938 | { | ||
939 | int retval; | ||
940 | |||
941 | printk(KERN_INFO "Initializing %s USB card reader driver...\n", | ||
942 | RTS51X_NAME); | ||
943 | |||
944 | /* register the driver, return usb_register return code if error */ | ||
945 | retval = usb_register(&rts51x_driver); | ||
946 | if (retval == 0) { | ||
947 | printk(KERN_INFO | ||
948 | "Realtek %s USB card reader support registered.\n", | ||
949 | RTS51X_NAME); | ||
950 | } | ||
951 | return retval; | ||
952 | } | ||
953 | |||
954 | static void __exit rts51x_exit(void) | ||
955 | { | ||
956 | RTS51X_DEBUGP("rts51x_exit() called\n"); | ||
957 | |||
958 | /* Deregister the driver | ||
959 | * This will cause disconnect() to be called for each | ||
960 | * attached unit | ||
961 | */ | ||
962 | RTS51X_DEBUGP("-- calling usb_deregister()\n"); | ||
963 | usb_deregister(&rts51x_driver); | ||
964 | } | ||
965 | |||
966 | module_init(rts51x_init); | ||
967 | module_exit(rts51x_exit); | ||
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c index 27521b69ce08..541f9aa8ef6d 100644 --- a/drivers/staging/vt6656/main_usb.c +++ b/drivers/staging/vt6656/main_usb.c | |||
@@ -2103,16 +2103,4 @@ static struct usb_driver vt6656_driver = { | |||
2103 | #endif /* CONFIG_PM */ | 2103 | #endif /* CONFIG_PM */ |
2104 | }; | 2104 | }; |
2105 | 2105 | ||
2106 | static int __init vt6656_init_module(void) | 2106 | module_usb_driver(vt6656_driver); |
2107 | { | ||
2108 | printk(KERN_NOTICE DEVICE_FULL_DRV_NAM " " DEVICE_VERSION); | ||
2109 | return usb_register(&vt6656_driver); | ||
2110 | } | ||
2111 | |||
2112 | static void __exit vt6656_cleanup_module(void) | ||
2113 | { | ||
2114 | usb_deregister(&vt6656_driver); | ||
2115 | } | ||
2116 | |||
2117 | module_init(vt6656_init_module); | ||
2118 | module_exit(vt6656_cleanup_module); | ||
diff --git a/drivers/staging/winbond/wbusb.c b/drivers/staging/winbond/wbusb.c index f958eb4f0d81..c3751a718384 100644 --- a/drivers/staging/winbond/wbusb.c +++ b/drivers/staging/winbond/wbusb.c | |||
@@ -865,15 +865,4 @@ static struct usb_driver wb35_driver = { | |||
865 | .disconnect = wb35_disconnect, | 865 | .disconnect = wb35_disconnect, |
866 | }; | 866 | }; |
867 | 867 | ||
868 | static int __init wb35_init(void) | 868 | module_usb_driver(wb35_driver); |
869 | { | ||
870 | return usb_register(&wb35_driver); | ||
871 | } | ||
872 | |||
873 | static void __exit wb35_exit(void) | ||
874 | { | ||
875 | usb_deregister(&wb35_driver); | ||
876 | } | ||
877 | |||
878 | module_init(wb35_init); | ||
879 | module_exit(wb35_exit); | ||
diff --git a/drivers/staging/wlan-ng/prism2usb.c b/drivers/staging/wlan-ng/prism2usb.c index 4efa027a81e4..b1aed1f1f749 100644 --- a/drivers/staging/wlan-ng/prism2usb.c +++ b/drivers/staging/wlan-ng/prism2usb.c | |||
@@ -358,16 +358,4 @@ static struct usb_driver prism2_usb_driver = { | |||
358 | /* fops, minor? */ | 358 | /* fops, minor? */ |
359 | }; | 359 | }; |
360 | 360 | ||
361 | static int __init prism2usb_init(void) | 361 | module_usb_driver(prism2_usb_driver); |
362 | { | ||
363 | /* This call will result in calls to prism2sta_probe_usb. */ | ||
364 | return usb_register(&prism2_usb_driver); | ||
365 | }; | ||
366 | |||
367 | static void __exit prism2usb_cleanup(void) | ||
368 | { | ||
369 | usb_deregister(&prism2_usb_driver); | ||
370 | }; | ||
371 | |||
372 | module_init(prism2usb_init); | ||
373 | module_exit(prism2usb_cleanup); | ||
diff --git a/drivers/uio/uio_pdrv.c b/drivers/uio/uio_pdrv.c index ff5059517351..72d3646c7365 100644 --- a/drivers/uio/uio_pdrv.c +++ b/drivers/uio/uio_pdrv.c | |||
@@ -104,17 +104,7 @@ static struct platform_driver uio_pdrv = { | |||
104 | }, | 104 | }, |
105 | }; | 105 | }; |
106 | 106 | ||
107 | static int __init uio_pdrv_init(void) | 107 | module_platform_driver(uio_pdrv); |
108 | { | ||
109 | return platform_driver_register(&uio_pdrv); | ||
110 | } | ||
111 | |||
112 | static void __exit uio_pdrv_exit(void) | ||
113 | { | ||
114 | platform_driver_unregister(&uio_pdrv); | ||
115 | } | ||
116 | module_init(uio_pdrv_init); | ||
117 | module_exit(uio_pdrv_exit); | ||
118 | 108 | ||
119 | MODULE_AUTHOR("Uwe Kleine-Koenig"); | 109 | MODULE_AUTHOR("Uwe Kleine-Koenig"); |
120 | MODULE_DESCRIPTION("Userspace I/O platform driver"); | 110 | MODULE_DESCRIPTION("Userspace I/O platform driver"); |
diff --git a/drivers/uio/uio_pdrv_genirq.c b/drivers/uio/uio_pdrv_genirq.c index 25de302009a1..b98371d93a92 100644 --- a/drivers/uio/uio_pdrv_genirq.c +++ b/drivers/uio/uio_pdrv_genirq.c | |||
@@ -273,18 +273,7 @@ static struct platform_driver uio_pdrv_genirq = { | |||
273 | }, | 273 | }, |
274 | }; | 274 | }; |
275 | 275 | ||
276 | static int __init uio_pdrv_genirq_init(void) | 276 | module_platform_driver(uio_pdrv_genirq); |
277 | { | ||
278 | return platform_driver_register(&uio_pdrv_genirq); | ||
279 | } | ||
280 | |||
281 | static void __exit uio_pdrv_genirq_exit(void) | ||
282 | { | ||
283 | platform_driver_unregister(&uio_pdrv_genirq); | ||
284 | } | ||
285 | |||
286 | module_init(uio_pdrv_genirq_init); | ||
287 | module_exit(uio_pdrv_genirq_exit); | ||
288 | 277 | ||
289 | MODULE_AUTHOR("Magnus Damm"); | 278 | MODULE_AUTHOR("Magnus Damm"); |
290 | MODULE_DESCRIPTION("Userspace I/O platform driver with generic IRQ handling"); | 279 | MODULE_DESCRIPTION("Userspace I/O platform driver with generic IRQ handling"); |
diff --git a/drivers/uio/uio_pruss.c b/drivers/uio/uio_pruss.c index e67b566e7aa3..33a7a273b453 100644 --- a/drivers/uio/uio_pruss.c +++ b/drivers/uio/uio_pruss.c | |||
@@ -227,19 +227,7 @@ static struct platform_driver pruss_driver = { | |||
227 | }, | 227 | }, |
228 | }; | 228 | }; |
229 | 229 | ||
230 | static int __init pruss_init_module(void) | 230 | module_platform_driver(pruss_driver); |
231 | { | ||
232 | return platform_driver_register(&pruss_driver); | ||
233 | } | ||
234 | |||
235 | module_init(pruss_init_module); | ||
236 | |||
237 | static void __exit pruss_exit_module(void) | ||
238 | { | ||
239 | platform_driver_unregister(&pruss_driver); | ||
240 | } | ||
241 | |||
242 | module_exit(pruss_exit_module); | ||
243 | 231 | ||
244 | MODULE_LICENSE("GPL v2"); | 232 | MODULE_LICENSE("GPL v2"); |
245 | MODULE_VERSION(DRV_VERSION); | 233 | MODULE_VERSION(DRV_VERSION); |
diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c index a845f8b8382f..98b89fe19867 100644 --- a/drivers/usb/atm/cxacru.c +++ b/drivers/usb/atm/cxacru.c | |||
@@ -1372,18 +1372,7 @@ static struct usb_driver cxacru_usb_driver = { | |||
1372 | .id_table = cxacru_usb_ids | 1372 | .id_table = cxacru_usb_ids |
1373 | }; | 1373 | }; |
1374 | 1374 | ||
1375 | static int __init cxacru_init(void) | 1375 | module_usb_driver(cxacru_usb_driver); |
1376 | { | ||
1377 | return usb_register(&cxacru_usb_driver); | ||
1378 | } | ||
1379 | |||
1380 | static void __exit cxacru_cleanup(void) | ||
1381 | { | ||
1382 | usb_deregister(&cxacru_usb_driver); | ||
1383 | } | ||
1384 | |||
1385 | module_init(cxacru_init); | ||
1386 | module_exit(cxacru_cleanup); | ||
1387 | 1376 | ||
1388 | MODULE_AUTHOR(DRIVER_AUTHOR); | 1377 | MODULE_AUTHOR(DRIVER_AUTHOR); |
1389 | MODULE_DESCRIPTION(DRIVER_DESC); | 1378 | MODULE_DESCRIPTION(DRIVER_DESC); |
diff --git a/drivers/usb/atm/speedtch.c b/drivers/usb/atm/speedtch.c index 0842cfbf60cf..b42092e1f164 100644 --- a/drivers/usb/atm/speedtch.c +++ b/drivers/usb/atm/speedtch.c | |||
@@ -953,22 +953,7 @@ static int speedtch_usb_probe(struct usb_interface *intf, const struct usb_devic | |||
953 | return usbatm_usb_probe(intf, id, &speedtch_usbatm_driver); | 953 | return usbatm_usb_probe(intf, id, &speedtch_usbatm_driver); |
954 | } | 954 | } |
955 | 955 | ||
956 | static int __init speedtch_usb_init(void) | 956 | module_usb_driver(speedtch_usb_driver); |
957 | { | ||
958 | dbg("%s: driver version %s", __func__, DRIVER_VERSION); | ||
959 | |||
960 | return usb_register(&speedtch_usb_driver); | ||
961 | } | ||
962 | |||
963 | static void __exit speedtch_usb_cleanup(void) | ||
964 | { | ||
965 | dbg("%s", __func__); | ||
966 | |||
967 | usb_deregister(&speedtch_usb_driver); | ||
968 | } | ||
969 | |||
970 | module_init(speedtch_usb_init); | ||
971 | module_exit(speedtch_usb_cleanup); | ||
972 | 957 | ||
973 | MODULE_AUTHOR(DRIVER_AUTHOR); | 958 | MODULE_AUTHOR(DRIVER_AUTHOR); |
974 | MODULE_DESCRIPTION(DRIVER_DESC); | 959 | MODULE_DESCRIPTION(DRIVER_DESC); |
diff --git a/drivers/usb/atm/ueagle-atm.c b/drivers/usb/atm/ueagle-atm.c index 428f36801e06..00f171a7a8a0 100644 --- a/drivers/usb/atm/ueagle-atm.c +++ b/drivers/usb/atm/ueagle-atm.c | |||
@@ -2753,36 +2753,7 @@ static struct usb_driver uea_driver = { | |||
2753 | 2753 | ||
2754 | MODULE_DEVICE_TABLE(usb, uea_ids); | 2754 | MODULE_DEVICE_TABLE(usb, uea_ids); |
2755 | 2755 | ||
2756 | /** | 2756 | module_usb_driver(uea_driver); |
2757 | * uea_init - Initialize the module. | ||
2758 | * Register to USB subsystem | ||
2759 | */ | ||
2760 | static int __init uea_init(void) | ||
2761 | { | ||
2762 | printk(KERN_INFO "[ueagle-atm] driver " EAGLEUSBVERSION " loaded\n"); | ||
2763 | |||
2764 | usb_register(&uea_driver); | ||
2765 | |||
2766 | return 0; | ||
2767 | } | ||
2768 | |||
2769 | module_init(uea_init); | ||
2770 | |||
2771 | /** | ||
2772 | * uea_exit - Destroy module | ||
2773 | * Deregister with USB subsystem | ||
2774 | */ | ||
2775 | static void __exit uea_exit(void) | ||
2776 | { | ||
2777 | /* | ||
2778 | * This calls automatically the uea_disconnect method if necessary: | ||
2779 | */ | ||
2780 | usb_deregister(&uea_driver); | ||
2781 | |||
2782 | printk(KERN_INFO "[ueagle-atm] driver unloaded\n"); | ||
2783 | } | ||
2784 | |||
2785 | module_exit(uea_exit); | ||
2786 | 2757 | ||
2787 | MODULE_AUTHOR("Damien Bergamini/Matthieu Castet/Stanislaw W. Gruszka"); | 2758 | MODULE_AUTHOR("Damien Bergamini/Matthieu Castet/Stanislaw W. Gruszka"); |
2788 | MODULE_DESCRIPTION("ADI 930/Eagle USB ADSL Modem driver"); | 2759 | MODULE_DESCRIPTION("ADI 930/Eagle USB ADSL Modem driver"); |
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index efe684908c1f..1c50baff7725 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c | |||
@@ -895,24 +895,7 @@ static struct usb_driver wdm_driver = { | |||
895 | .supports_autosuspend = 1, | 895 | .supports_autosuspend = 1, |
896 | }; | 896 | }; |
897 | 897 | ||
898 | /* --- low level module stuff --- */ | 898 | module_usb_driver(wdm_driver); |
899 | |||
900 | static int __init wdm_init(void) | ||
901 | { | ||
902 | int rv; | ||
903 | |||
904 | rv = usb_register(&wdm_driver); | ||
905 | |||
906 | return rv; | ||
907 | } | ||
908 | |||
909 | static void __exit wdm_exit(void) | ||
910 | { | ||
911 | usb_deregister(&wdm_driver); | ||
912 | } | ||
913 | |||
914 | module_init(wdm_init); | ||
915 | module_exit(wdm_exit); | ||
916 | 899 | ||
917 | MODULE_AUTHOR(DRIVER_AUTHOR); | 900 | MODULE_AUTHOR(DRIVER_AUTHOR); |
918 | MODULE_DESCRIPTION(DRIVER_DESC); | 901 | MODULE_DESCRIPTION(DRIVER_DESC); |
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c index cb3a93243a05..81ef2e207a8d 100644 --- a/drivers/usb/class/usblp.c +++ b/drivers/usb/class/usblp.c | |||
@@ -1412,18 +1412,7 @@ static struct usb_driver usblp_driver = { | |||
1412 | .supports_autosuspend = 1, | 1412 | .supports_autosuspend = 1, |
1413 | }; | 1413 | }; |
1414 | 1414 | ||
1415 | static int __init usblp_init(void) | 1415 | module_usb_driver(usblp_driver); |
1416 | { | ||
1417 | return usb_register(&usblp_driver); | ||
1418 | } | ||
1419 | |||
1420 | static void __exit usblp_exit(void) | ||
1421 | { | ||
1422 | usb_deregister(&usblp_driver); | ||
1423 | } | ||
1424 | |||
1425 | module_init(usblp_init); | ||
1426 | module_exit(usblp_exit); | ||
1427 | 1416 | ||
1428 | MODULE_AUTHOR(DRIVER_AUTHOR); | 1417 | MODULE_AUTHOR(DRIVER_AUTHOR); |
1429 | MODULE_DESCRIPTION(DRIVER_DESC); | 1418 | MODULE_DESCRIPTION(DRIVER_DESC); |
diff --git a/drivers/usb/class/usbtmc.c b/drivers/usb/class/usbtmc.c index 12cf5e7395a8..70d69d06054f 100644 --- a/drivers/usb/class/usbtmc.c +++ b/drivers/usb/class/usbtmc.c | |||
@@ -1116,21 +1116,6 @@ static struct usb_driver usbtmc_driver = { | |||
1116 | .resume = usbtmc_resume, | 1116 | .resume = usbtmc_resume, |
1117 | }; | 1117 | }; |
1118 | 1118 | ||
1119 | static int __init usbtmc_init(void) | 1119 | module_usb_driver(usbtmc_driver); |
1120 | { | ||
1121 | int retcode; | ||
1122 | |||
1123 | retcode = usb_register(&usbtmc_driver); | ||
1124 | if (retcode) | ||
1125 | printk(KERN_ERR KBUILD_MODNAME": Unable to register driver\n"); | ||
1126 | return retcode; | ||
1127 | } | ||
1128 | module_init(usbtmc_init); | ||
1129 | |||
1130 | static void __exit usbtmc_exit(void) | ||
1131 | { | ||
1132 | usb_deregister(&usbtmc_driver); | ||
1133 | } | ||
1134 | module_exit(usbtmc_exit); | ||
1135 | 1120 | ||
1136 | MODULE_LICENSE("GPL"); | 1121 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/usb/dwc3/debugfs.c b/drivers/usb/dwc3/debugfs.c index da1ad77d8d51..fcfa91517ea1 100644 --- a/drivers/usb/dwc3/debugfs.c +++ b/drivers/usb/dwc3/debugfs.c | |||
@@ -51,18 +51,13 @@ | |||
51 | #include "gadget.h" | 51 | #include "gadget.h" |
52 | #include "io.h" | 52 | #include "io.h" |
53 | 53 | ||
54 | struct dwc3_register { | ||
55 | const char *name; | ||
56 | u32 offset; | ||
57 | }; | ||
58 | |||
59 | #define dump_register(nm) \ | 54 | #define dump_register(nm) \ |
60 | { \ | 55 | { \ |
61 | .name = __stringify(nm), \ | 56 | .name = __stringify(nm), \ |
62 | .offset = DWC3_ ##nm, \ | 57 | .offset = DWC3_ ##nm, \ |
63 | } | 58 | } |
64 | 59 | ||
65 | static const struct dwc3_register dwc3_regs[] = { | 60 | static const struct debugfs_reg32 dwc3_regs[] = { |
66 | dump_register(GSBUSCFG0), | 61 | dump_register(GSBUSCFG0), |
67 | dump_register(GSBUSCFG1), | 62 | dump_register(GSBUSCFG1), |
68 | dump_register(GTXTHRCFG), | 63 | dump_register(GTXTHRCFG), |
@@ -382,15 +377,10 @@ static const struct dwc3_register dwc3_regs[] = { | |||
382 | static int dwc3_regdump_show(struct seq_file *s, void *unused) | 377 | static int dwc3_regdump_show(struct seq_file *s, void *unused) |
383 | { | 378 | { |
384 | struct dwc3 *dwc = s->private; | 379 | struct dwc3 *dwc = s->private; |
385 | int i; | ||
386 | 380 | ||
387 | seq_printf(s, "DesignWare USB3 Core Register Dump\n"); | 381 | seq_printf(s, "DesignWare USB3 Core Register Dump\n"); |
388 | 382 | debugfs_print_regs32(s, dwc3_regs, ARRAY_SIZE(dwc3_regs), | |
389 | for (i = 0; i < ARRAY_SIZE(dwc3_regs); i++) { | 383 | dwc->regs, ""); |
390 | seq_printf(s, "%-20s : %08x\n", dwc3_regs[i].name, | ||
391 | dwc3_readl(dwc->regs, dwc3_regs[i].offset)); | ||
392 | } | ||
393 | |||
394 | return 0; | 384 | return 0; |
395 | } | 385 | } |
396 | 386 | ||
diff --git a/drivers/usb/host/hwa-hc.c b/drivers/usb/host/hwa-hc.c index 9bfac657572e..056fb2d37c88 100644 --- a/drivers/usb/host/hwa-hc.c +++ b/drivers/usb/host/hwa-hc.c | |||
@@ -837,18 +837,7 @@ static struct usb_driver hwahc_driver = { | |||
837 | .id_table = hwahc_id_table, | 837 | .id_table = hwahc_id_table, |
838 | }; | 838 | }; |
839 | 839 | ||
840 | static int __init hwahc_driver_init(void) | 840 | module_usb_driver(hwahc_driver); |
841 | { | ||
842 | return usb_register(&hwahc_driver); | ||
843 | } | ||
844 | module_init(hwahc_driver_init); | ||
845 | |||
846 | static void __exit hwahc_driver_exit(void) | ||
847 | { | ||
848 | usb_deregister(&hwahc_driver); | ||
849 | } | ||
850 | module_exit(hwahc_driver_exit); | ||
851 | |||
852 | 841 | ||
853 | MODULE_AUTHOR("Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>"); | 842 | MODULE_AUTHOR("Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>"); |
854 | MODULE_DESCRIPTION("Host Wired Adapter USB Host Control Driver"); | 843 | MODULE_DESCRIPTION("Host Wired Adapter USB Host Control Driver"); |
diff --git a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c index 27e209a7222f..9c0f8caba3be 100644 --- a/drivers/usb/image/microtek.c +++ b/drivers/usb/image/microtek.c | |||
@@ -809,19 +809,7 @@ static void mts_usb_disconnect (struct usb_interface *intf) | |||
809 | kfree(desc); | 809 | kfree(desc); |
810 | } | 810 | } |
811 | 811 | ||
812 | 812 | module_usb_driver(mts_usb_driver); | |
813 | static int __init microtek_drv_init(void) | ||
814 | { | ||
815 | return usb_register(&mts_usb_driver); | ||
816 | } | ||
817 | |||
818 | static void __exit microtek_drv_exit(void) | ||
819 | { | ||
820 | usb_deregister(&mts_usb_driver); | ||
821 | } | ||
822 | |||
823 | module_init(microtek_drv_init); | ||
824 | module_exit(microtek_drv_exit); | ||
825 | 813 | ||
826 | MODULE_AUTHOR( DRIVER_AUTHOR ); | 814 | MODULE_AUTHOR( DRIVER_AUTHOR ); |
827 | MODULE_DESCRIPTION( DRIVER_DESC ); | 815 | MODULE_DESCRIPTION( DRIVER_DESC ); |
diff --git a/drivers/usb/misc/adutux.c b/drivers/usb/misc/adutux.c index fe858711651c..284b85461410 100644 --- a/drivers/usb/misc/adutux.c +++ b/drivers/usb/misc/adutux.c | |||
@@ -885,40 +885,7 @@ static struct usb_driver adu_driver = { | |||
885 | .id_table = device_table, | 885 | .id_table = device_table, |
886 | }; | 886 | }; |
887 | 887 | ||
888 | static int __init adu_init(void) | 888 | module_usb_driver(adu_driver); |
889 | { | ||
890 | int result; | ||
891 | |||
892 | dbg(2," %s : enter", __func__); | ||
893 | |||
894 | /* register this driver with the USB subsystem */ | ||
895 | result = usb_register(&adu_driver); | ||
896 | if (result < 0) { | ||
897 | printk(KERN_ERR "usb_register failed for the "__FILE__ | ||
898 | " driver. Error number %d\n", result); | ||
899 | goto exit; | ||
900 | } | ||
901 | |||
902 | printk(KERN_INFO "adutux " DRIVER_DESC " " DRIVER_VERSION "\n"); | ||
903 | printk(KERN_INFO "adutux is an experimental driver. " | ||
904 | "Use at your own risk\n"); | ||
905 | |||
906 | exit: | ||
907 | dbg(2," %s : leave, return value %d", __func__, result); | ||
908 | |||
909 | return result; | ||
910 | } | ||
911 | |||
912 | static void __exit adu_exit(void) | ||
913 | { | ||
914 | dbg(2," %s : enter", __func__); | ||
915 | /* deregister this driver with the USB subsystem */ | ||
916 | usb_deregister(&adu_driver); | ||
917 | dbg(2," %s : leave", __func__); | ||
918 | } | ||
919 | |||
920 | module_init(adu_init); | ||
921 | module_exit(adu_exit); | ||
922 | 889 | ||
923 | MODULE_AUTHOR(DRIVER_AUTHOR); | 890 | MODULE_AUTHOR(DRIVER_AUTHOR); |
924 | MODULE_DESCRIPTION(DRIVER_DESC); | 891 | MODULE_DESCRIPTION(DRIVER_DESC); |
diff --git a/drivers/usb/misc/cypress_cy7c63.c b/drivers/usb/misc/cypress_cy7c63.c index 9251773ecef4..3f7c1a92579f 100644 --- a/drivers/usb/misc/cypress_cy7c63.c +++ b/drivers/usb/misc/cypress_cy7c63.c | |||
@@ -271,27 +271,7 @@ static struct usb_driver cypress_driver = { | |||
271 | .id_table = cypress_table, | 271 | .id_table = cypress_table, |
272 | }; | 272 | }; |
273 | 273 | ||
274 | static int __init cypress_init(void) | 274 | module_usb_driver(cypress_driver); |
275 | { | ||
276 | int result; | ||
277 | |||
278 | /* register this driver with the USB subsystem */ | ||
279 | result = usb_register(&cypress_driver); | ||
280 | if (result) | ||
281 | printk(KERN_ERR KBUILD_MODNAME ": usb_register failed! " | ||
282 | "Error number: %d\n", result); | ||
283 | |||
284 | return result; | ||
285 | } | ||
286 | |||
287 | static void __exit cypress_exit(void) | ||
288 | { | ||
289 | /* deregister this driver with the USB subsystem */ | ||
290 | usb_deregister(&cypress_driver); | ||
291 | } | ||
292 | |||
293 | module_init(cypress_init); | ||
294 | module_exit(cypress_exit); | ||
295 | 275 | ||
296 | MODULE_AUTHOR(DRIVER_AUTHOR); | 276 | MODULE_AUTHOR(DRIVER_AUTHOR); |
297 | MODULE_DESCRIPTION(DRIVER_DESC); | 277 | MODULE_DESCRIPTION(DRIVER_DESC); |
diff --git a/drivers/usb/misc/cytherm.c b/drivers/usb/misc/cytherm.c index 1d7251bc1b5f..5b9831b95d97 100644 --- a/drivers/usb/misc/cytherm.c +++ b/drivers/usb/misc/cytherm.c | |||
@@ -417,31 +417,7 @@ static void cytherm_disconnect(struct usb_interface *interface) | |||
417 | dev_info(&interface->dev, "Cypress thermometer now disconnected\n"); | 417 | dev_info(&interface->dev, "Cypress thermometer now disconnected\n"); |
418 | } | 418 | } |
419 | 419 | ||
420 | 420 | module_usb_driver(cytherm_driver); | |
421 | static int __init usb_cytherm_init(void) | ||
422 | { | ||
423 | int result; | ||
424 | |||
425 | result = usb_register(&cytherm_driver); | ||
426 | if (result) { | ||
427 | printk(KERN_ERR KBUILD_MODNAME ": usb_register failed! " | ||
428 | "Error number: %d\n", result); | ||
429 | return result; | ||
430 | } | ||
431 | |||
432 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
433 | DRIVER_DESC "\n"); | ||
434 | return 0; | ||
435 | } | ||
436 | |||
437 | static void __exit usb_cytherm_exit(void) | ||
438 | { | ||
439 | usb_deregister(&cytherm_driver); | ||
440 | } | ||
441 | |||
442 | |||
443 | module_init (usb_cytherm_init); | ||
444 | module_exit (usb_cytherm_exit); | ||
445 | 421 | ||
446 | MODULE_AUTHOR(DRIVER_AUTHOR); | 422 | MODULE_AUTHOR(DRIVER_AUTHOR); |
447 | MODULE_DESCRIPTION(DRIVER_DESC); | 423 | MODULE_DESCRIPTION(DRIVER_DESC); |
diff --git a/drivers/usb/misc/emi26.c b/drivers/usb/misc/emi26.c index a6521c95f683..d9b6a0355443 100644 --- a/drivers/usb/misc/emi26.c +++ b/drivers/usb/misc/emi26.c | |||
@@ -276,18 +276,7 @@ static struct usb_driver emi26_driver = { | |||
276 | .id_table = id_table, | 276 | .id_table = id_table, |
277 | }; | 277 | }; |
278 | 278 | ||
279 | static int __init emi26_init (void) | 279 | module_usb_driver(emi26_driver); |
280 | { | ||
281 | return usb_register(&emi26_driver); | ||
282 | } | ||
283 | |||
284 | static void __exit emi26_exit (void) | ||
285 | { | ||
286 | usb_deregister (&emi26_driver); | ||
287 | } | ||
288 | |||
289 | module_init(emi26_init); | ||
290 | module_exit(emi26_exit); | ||
291 | 280 | ||
292 | MODULE_AUTHOR("Tapio Laxström"); | 281 | MODULE_AUTHOR("Tapio Laxström"); |
293 | MODULE_DESCRIPTION("Emagic EMI 2|6 firmware loader."); | 282 | MODULE_DESCRIPTION("Emagic EMI 2|6 firmware loader."); |
diff --git a/drivers/usb/misc/emi62.c b/drivers/usb/misc/emi62.c index fc15ad4c3139..9f39062ebb08 100644 --- a/drivers/usb/misc/emi62.c +++ b/drivers/usb/misc/emi62.c | |||
@@ -290,22 +290,7 @@ static struct usb_driver emi62_driver = { | |||
290 | .id_table = id_table, | 290 | .id_table = id_table, |
291 | }; | 291 | }; |
292 | 292 | ||
293 | static int __init emi62_init (void) | 293 | module_usb_driver(emi62_driver); |
294 | { | ||
295 | int retval; | ||
296 | retval = usb_register (&emi62_driver); | ||
297 | if (retval) | ||
298 | printk(KERN_ERR "adi-emi: registration failed\n"); | ||
299 | return retval; | ||
300 | } | ||
301 | |||
302 | static void __exit emi62_exit (void) | ||
303 | { | ||
304 | usb_deregister (&emi62_driver); | ||
305 | } | ||
306 | |||
307 | module_init(emi62_init); | ||
308 | module_exit(emi62_exit); | ||
309 | 294 | ||
310 | MODULE_AUTHOR("Tapio Laxström"); | 295 | MODULE_AUTHOR("Tapio Laxström"); |
311 | MODULE_DESCRIPTION("Emagic EMI 6|2m firmware loader."); | 296 | MODULE_DESCRIPTION("Emagic EMI 6|2m firmware loader."); |
diff --git a/drivers/usb/misc/idmouse.c b/drivers/usb/misc/idmouse.c index 515b67fffab1..0dee24698504 100644 --- a/drivers/usb/misc/idmouse.c +++ b/drivers/usb/misc/idmouse.c | |||
@@ -428,29 +428,7 @@ static void idmouse_disconnect(struct usb_interface *interface) | |||
428 | dev_info(&interface->dev, "disconnected\n"); | 428 | dev_info(&interface->dev, "disconnected\n"); |
429 | } | 429 | } |
430 | 430 | ||
431 | static int __init usb_idmouse_init(void) | 431 | module_usb_driver(idmouse_driver); |
432 | { | ||
433 | int result; | ||
434 | |||
435 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
436 | DRIVER_DESC "\n"); | ||
437 | |||
438 | /* register this driver with the USB subsystem */ | ||
439 | result = usb_register(&idmouse_driver); | ||
440 | if (result) | ||
441 | err("Unable to register device (error %d).", result); | ||
442 | |||
443 | return result; | ||
444 | } | ||
445 | |||
446 | static void __exit usb_idmouse_exit(void) | ||
447 | { | ||
448 | /* deregister this driver with the USB subsystem */ | ||
449 | usb_deregister(&idmouse_driver); | ||
450 | } | ||
451 | |||
452 | module_init(usb_idmouse_init); | ||
453 | module_exit(usb_idmouse_exit); | ||
454 | 432 | ||
455 | MODULE_AUTHOR(DRIVER_AUTHOR); | 433 | MODULE_AUTHOR(DRIVER_AUTHOR); |
456 | MODULE_DESCRIPTION(DRIVER_DESC); | 434 | MODULE_DESCRIPTION(DRIVER_DESC); |
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c index 81457904d6ba..7676b5b7e171 100644 --- a/drivers/usb/misc/iowarrior.c +++ b/drivers/usb/misc/iowarrior.c | |||
@@ -927,15 +927,4 @@ static struct usb_driver iowarrior_driver = { | |||
927 | .id_table = iowarrior_ids, | 927 | .id_table = iowarrior_ids, |
928 | }; | 928 | }; |
929 | 929 | ||
930 | static int __init iowarrior_init(void) | 930 | module_usb_driver(iowarrior_driver); |
931 | { | ||
932 | return usb_register(&iowarrior_driver); | ||
933 | } | ||
934 | |||
935 | static void __exit iowarrior_exit(void) | ||
936 | { | ||
937 | usb_deregister(&iowarrior_driver); | ||
938 | } | ||
939 | |||
940 | module_init(iowarrior_init); | ||
941 | module_exit(iowarrior_exit); | ||
diff --git a/drivers/usb/misc/isight_firmware.c b/drivers/usb/misc/isight_firmware.c index fe1d44319d0a..1dc7e9581cc6 100644 --- a/drivers/usb/misc/isight_firmware.c +++ b/drivers/usb/misc/isight_firmware.c | |||
@@ -126,18 +126,7 @@ static struct usb_driver isight_firmware_driver = { | |||
126 | .id_table = id_table, | 126 | .id_table = id_table, |
127 | }; | 127 | }; |
128 | 128 | ||
129 | static int __init isight_firmware_init(void) | 129 | module_usb_driver(isight_firmware_driver); |
130 | { | ||
131 | return usb_register(&isight_firmware_driver); | ||
132 | } | ||
133 | |||
134 | static void __exit isight_firmware_exit(void) | ||
135 | { | ||
136 | usb_deregister(&isight_firmware_driver); | ||
137 | } | ||
138 | |||
139 | module_init(isight_firmware_init); | ||
140 | module_exit(isight_firmware_exit); | ||
141 | 130 | ||
142 | MODULE_LICENSE("GPL"); | 131 | MODULE_LICENSE("GPL"); |
143 | MODULE_AUTHOR("Matthew Garrett <mjg@redhat.com>"); | 132 | MODULE_AUTHOR("Matthew Garrett <mjg@redhat.com>"); |
diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c index 48c166f0d764..5db4ab52061e 100644 --- a/drivers/usb/misc/ldusb.c +++ b/drivers/usb/misc/ldusb.c | |||
@@ -821,30 +821,5 @@ static struct usb_driver ld_usb_driver = { | |||
821 | .id_table = ld_usb_table, | 821 | .id_table = ld_usb_table, |
822 | }; | 822 | }; |
823 | 823 | ||
824 | /** | 824 | module_usb_driver(ld_usb_driver); |
825 | * ld_usb_init | ||
826 | */ | ||
827 | static int __init ld_usb_init(void) | ||
828 | { | ||
829 | int retval; | ||
830 | |||
831 | /* register this driver with the USB subsystem */ | ||
832 | retval = usb_register(&ld_usb_driver); | ||
833 | if (retval) | ||
834 | err("usb_register failed for the %s driver. Error number %d\n", __FILE__, retval); | ||
835 | |||
836 | return retval; | ||
837 | } | ||
838 | |||
839 | /** | ||
840 | * ld_usb_exit | ||
841 | */ | ||
842 | static void __exit ld_usb_exit(void) | ||
843 | { | ||
844 | /* deregister this driver with the USB subsystem */ | ||
845 | usb_deregister(&ld_usb_driver); | ||
846 | } | ||
847 | |||
848 | module_init(ld_usb_init); | ||
849 | module_exit(ld_usb_exit); | ||
850 | 825 | ||
diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c index a989356f693e..16937da31cd8 100644 --- a/drivers/usb/misc/legousbtower.c +++ b/drivers/usb/misc/legousbtower.c | |||
@@ -1043,51 +1043,7 @@ static void tower_disconnect (struct usb_interface *interface) | |||
1043 | dbg(2, "%s: leave", __func__); | 1043 | dbg(2, "%s: leave", __func__); |
1044 | } | 1044 | } |
1045 | 1045 | ||
1046 | 1046 | module_usb_driver(tower_driver); | |
1047 | |||
1048 | /** | ||
1049 | * lego_usb_tower_init | ||
1050 | */ | ||
1051 | static int __init lego_usb_tower_init(void) | ||
1052 | { | ||
1053 | int result; | ||
1054 | int retval = 0; | ||
1055 | |||
1056 | dbg(2, "%s: enter", __func__); | ||
1057 | |||
1058 | /* register this driver with the USB subsystem */ | ||
1059 | result = usb_register(&tower_driver); | ||
1060 | if (result < 0) { | ||
1061 | err("usb_register failed for the %s driver. Error number %d", __FILE__, result); | ||
1062 | retval = -1; | ||
1063 | goto exit; | ||
1064 | } | ||
1065 | |||
1066 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
1067 | DRIVER_DESC "\n"); | ||
1068 | |||
1069 | exit: | ||
1070 | dbg(2, "%s: leave, return value %d", __func__, retval); | ||
1071 | |||
1072 | return retval; | ||
1073 | } | ||
1074 | |||
1075 | |||
1076 | /** | ||
1077 | * lego_usb_tower_exit | ||
1078 | */ | ||
1079 | static void __exit lego_usb_tower_exit(void) | ||
1080 | { | ||
1081 | dbg(2, "%s: enter", __func__); | ||
1082 | |||
1083 | /* deregister this driver with the USB subsystem */ | ||
1084 | usb_deregister (&tower_driver); | ||
1085 | |||
1086 | dbg(2, "%s: leave", __func__); | ||
1087 | } | ||
1088 | |||
1089 | module_init (lego_usb_tower_init); | ||
1090 | module_exit (lego_usb_tower_exit); | ||
1091 | 1047 | ||
1092 | MODULE_AUTHOR(DRIVER_AUTHOR); | 1048 | MODULE_AUTHOR(DRIVER_AUTHOR); |
1093 | MODULE_DESCRIPTION(DRIVER_DESC); | 1049 | MODULE_DESCRIPTION(DRIVER_DESC); |
diff --git a/drivers/usb/misc/rio500.c b/drivers/usb/misc/rio500.c index 4e23d3841b43..487a8ce0775e 100644 --- a/drivers/usb/misc/rio500.c +++ b/drivers/usb/misc/rio500.c | |||
@@ -531,33 +531,7 @@ static struct usb_driver rio_driver = { | |||
531 | .id_table = rio_table, | 531 | .id_table = rio_table, |
532 | }; | 532 | }; |
533 | 533 | ||
534 | static int __init usb_rio_init(void) | 534 | module_usb_driver(rio_driver); |
535 | { | ||
536 | int retval; | ||
537 | retval = usb_register(&rio_driver); | ||
538 | if (retval) | ||
539 | goto out; | ||
540 | |||
541 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
542 | DRIVER_DESC "\n"); | ||
543 | |||
544 | out: | ||
545 | return retval; | ||
546 | } | ||
547 | |||
548 | |||
549 | static void __exit usb_rio_cleanup(void) | ||
550 | { | ||
551 | struct rio_usb_data *rio = &rio_instance; | ||
552 | |||
553 | rio->present = 0; | ||
554 | usb_deregister(&rio_driver); | ||
555 | |||
556 | |||
557 | } | ||
558 | |||
559 | module_init(usb_rio_init); | ||
560 | module_exit(usb_rio_cleanup); | ||
561 | 535 | ||
562 | MODULE_AUTHOR( DRIVER_AUTHOR ); | 536 | MODULE_AUTHOR( DRIVER_AUTHOR ); |
563 | MODULE_DESCRIPTION( DRIVER_DESC ); | 537 | MODULE_DESCRIPTION( DRIVER_DESC ); |
diff --git a/drivers/usb/misc/trancevibrator.c b/drivers/usb/misc/trancevibrator.c index f63776a48e2a..741efed4a236 100644 --- a/drivers/usb/misc/trancevibrator.c +++ b/drivers/usb/misc/trancevibrator.c | |||
@@ -137,26 +137,7 @@ static struct usb_driver tv_driver = { | |||
137 | .id_table = id_table, | 137 | .id_table = id_table, |
138 | }; | 138 | }; |
139 | 139 | ||
140 | static int __init tv_init(void) | 140 | module_usb_driver(tv_driver); |
141 | { | ||
142 | int retval = usb_register(&tv_driver); | ||
143 | if (retval) { | ||
144 | err("usb_register failed. Error number %d", retval); | ||
145 | return retval; | ||
146 | } | ||
147 | |||
148 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
149 | DRIVER_DESC "\n"); | ||
150 | return 0; | ||
151 | } | ||
152 | |||
153 | static void __exit tv_exit(void) | ||
154 | { | ||
155 | usb_deregister(&tv_driver); | ||
156 | } | ||
157 | |||
158 | module_init (tv_init); | ||
159 | module_exit (tv_exit); | ||
160 | 141 | ||
161 | MODULE_AUTHOR(DRIVER_AUTHOR); | 142 | MODULE_AUTHOR(DRIVER_AUTHOR); |
162 | MODULE_DESCRIPTION(DRIVER_DESC); | 143 | MODULE_DESCRIPTION(DRIVER_DESC); |
diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c index 1871cdf10da3..e2b4bd31c2b6 100644 --- a/drivers/usb/misc/usblcd.c +++ b/drivers/usb/misc/usblcd.c | |||
@@ -450,25 +450,7 @@ static struct usb_driver lcd_driver = { | |||
450 | .supports_autosuspend = 1, | 450 | .supports_autosuspend = 1, |
451 | }; | 451 | }; |
452 | 452 | ||
453 | static int __init usb_lcd_init(void) | 453 | module_usb_driver(lcd_driver); |
454 | { | ||
455 | int result; | ||
456 | |||
457 | result = usb_register(&lcd_driver); | ||
458 | if (result) | ||
459 | err("usb_register failed. Error number %d", result); | ||
460 | |||
461 | return result; | ||
462 | } | ||
463 | |||
464 | |||
465 | static void __exit usb_lcd_exit(void) | ||
466 | { | ||
467 | usb_deregister(&lcd_driver); | ||
468 | } | ||
469 | |||
470 | module_init(usb_lcd_init); | ||
471 | module_exit(usb_lcd_exit); | ||
472 | 454 | ||
473 | MODULE_AUTHOR("Georges Toth <g.toth@e-biz.lu>"); | 455 | MODULE_AUTHOR("Georges Toth <g.toth@e-biz.lu>"); |
474 | MODULE_DESCRIPTION(DRIVER_VERSION); | 456 | MODULE_DESCRIPTION(DRIVER_VERSION); |
diff --git a/drivers/usb/misc/usbled.c b/drivers/usb/misc/usbled.c index 43f84e50d514..4af56fbc3c06 100644 --- a/drivers/usb/misc/usbled.c +++ b/drivers/usb/misc/usbled.c | |||
@@ -231,23 +231,7 @@ static struct usb_driver led_driver = { | |||
231 | .id_table = id_table, | 231 | .id_table = id_table, |
232 | }; | 232 | }; |
233 | 233 | ||
234 | static int __init usb_led_init(void) | 234 | module_usb_driver(led_driver); |
235 | { | ||
236 | int retval = 0; | ||
237 | |||
238 | retval = usb_register(&led_driver); | ||
239 | if (retval) | ||
240 | err("usb_register failed. Error number %d", retval); | ||
241 | return retval; | ||
242 | } | ||
243 | |||
244 | static void __exit usb_led_exit(void) | ||
245 | { | ||
246 | usb_deregister(&led_driver); | ||
247 | } | ||
248 | |||
249 | module_init(usb_led_init); | ||
250 | module_exit(usb_led_exit); | ||
251 | 235 | ||
252 | MODULE_AUTHOR(DRIVER_AUTHOR); | 236 | MODULE_AUTHOR(DRIVER_AUTHOR); |
253 | MODULE_DESCRIPTION(DRIVER_DESC); | 237 | MODULE_DESCRIPTION(DRIVER_DESC); |
diff --git a/drivers/usb/misc/usbsevseg.c b/drivers/usb/misc/usbsevseg.c index 417b8f207e8b..107bf13b1cf1 100644 --- a/drivers/usb/misc/usbsevseg.c +++ b/drivers/usb/misc/usbsevseg.c | |||
@@ -437,23 +437,7 @@ static struct usb_driver sevseg_driver = { | |||
437 | .supports_autosuspend = 1, | 437 | .supports_autosuspend = 1, |
438 | }; | 438 | }; |
439 | 439 | ||
440 | static int __init usb_sevseg_init(void) | 440 | module_usb_driver(sevseg_driver); |
441 | { | ||
442 | int rc = 0; | ||
443 | |||
444 | rc = usb_register(&sevseg_driver); | ||
445 | if (rc) | ||
446 | err("usb_register failed. Error number %d", rc); | ||
447 | return rc; | ||
448 | } | ||
449 | |||
450 | static void __exit usb_sevseg_exit(void) | ||
451 | { | ||
452 | usb_deregister(&sevseg_driver); | ||
453 | } | ||
454 | |||
455 | module_init(usb_sevseg_init); | ||
456 | module_exit(usb_sevseg_exit); | ||
457 | 441 | ||
458 | MODULE_AUTHOR(DRIVER_AUTHOR); | 442 | MODULE_AUTHOR(DRIVER_AUTHOR); |
459 | MODULE_DESCRIPTION(DRIVER_DESC); | 443 | MODULE_DESCRIPTION(DRIVER_DESC); |
diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c index ac5bfd619e62..897edda42270 100644 --- a/drivers/usb/misc/yurex.c +++ b/drivers/usb/misc/yurex.c | |||
@@ -539,26 +539,6 @@ static const struct file_operations yurex_fops = { | |||
539 | .llseek = default_llseek, | 539 | .llseek = default_llseek, |
540 | }; | 540 | }; |
541 | 541 | ||
542 | 542 | module_usb_driver(yurex_driver); | |
543 | static int __init usb_yurex_init(void) | ||
544 | { | ||
545 | int result; | ||
546 | |||
547 | /* register this driver with the USB subsystem */ | ||
548 | result = usb_register(&yurex_driver); | ||
549 | if (result) | ||
550 | err("usb_register failed. Error number %d", result); | ||
551 | |||
552 | return result; | ||
553 | } | ||
554 | |||
555 | static void __exit usb_yurex_exit(void) | ||
556 | { | ||
557 | /* deregister this driver with the USB subsystem */ | ||
558 | usb_deregister(&yurex_driver); | ||
559 | } | ||
560 | |||
561 | module_init(usb_yurex_init); | ||
562 | module_exit(usb_yurex_exit); | ||
563 | 543 | ||
564 | MODULE_LICENSE("GPL"); | 544 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/usb/storage/alauda.c b/drivers/usb/storage/alauda.c index 42d0eaed4a01..3ca87a823342 100644 --- a/drivers/usb/storage/alauda.c +++ b/drivers/usb/storage/alauda.c | |||
@@ -1278,15 +1278,4 @@ static struct usb_driver alauda_driver = { | |||
1278 | .soft_unbind = 1, | 1278 | .soft_unbind = 1, |
1279 | }; | 1279 | }; |
1280 | 1280 | ||
1281 | static int __init alauda_init(void) | 1281 | module_usb_driver(alauda_driver); |
1282 | { | ||
1283 | return usb_register(&alauda_driver); | ||
1284 | } | ||
1285 | |||
1286 | static void __exit alauda_exit(void) | ||
1287 | { | ||
1288 | usb_deregister(&alauda_driver); | ||
1289 | } | ||
1290 | |||
1291 | module_init(alauda_init); | ||
1292 | module_exit(alauda_exit); | ||
diff --git a/drivers/usb/storage/cypress_atacb.c b/drivers/usb/storage/cypress_atacb.c index c84471821183..c7909dfa2434 100644 --- a/drivers/usb/storage/cypress_atacb.c +++ b/drivers/usb/storage/cypress_atacb.c | |||
@@ -274,15 +274,4 @@ static struct usb_driver cypress_driver = { | |||
274 | .soft_unbind = 1, | 274 | .soft_unbind = 1, |
275 | }; | 275 | }; |
276 | 276 | ||
277 | static int __init cypress_init(void) | 277 | module_usb_driver(cypress_driver); |
278 | { | ||
279 | return usb_register(&cypress_driver); | ||
280 | } | ||
281 | |||
282 | static void __exit cypress_exit(void) | ||
283 | { | ||
284 | usb_deregister(&cypress_driver); | ||
285 | } | ||
286 | |||
287 | module_init(cypress_init); | ||
288 | module_exit(cypress_exit); | ||
diff --git a/drivers/usb/storage/datafab.c b/drivers/usb/storage/datafab.c index ded836b02d7b..a99be857b794 100644 --- a/drivers/usb/storage/datafab.c +++ b/drivers/usb/storage/datafab.c | |||
@@ -753,15 +753,4 @@ static struct usb_driver datafab_driver = { | |||
753 | .soft_unbind = 1, | 753 | .soft_unbind = 1, |
754 | }; | 754 | }; |
755 | 755 | ||
756 | static int __init datafab_init(void) | 756 | module_usb_driver(datafab_driver); |
757 | { | ||
758 | return usb_register(&datafab_driver); | ||
759 | } | ||
760 | |||
761 | static void __exit datafab_exit(void) | ||
762 | { | ||
763 | usb_deregister(&datafab_driver); | ||
764 | } | ||
765 | |||
766 | module_init(datafab_init); | ||
767 | module_exit(datafab_exit); | ||
diff --git a/drivers/usb/storage/ene_ub6250.c b/drivers/usb/storage/ene_ub6250.c index 9fbe742343c6..b0a1687ca942 100644 --- a/drivers/usb/storage/ene_ub6250.c +++ b/drivers/usb/storage/ene_ub6250.c | |||
@@ -2409,15 +2409,4 @@ static struct usb_driver ene_ub6250_driver = { | |||
2409 | .soft_unbind = 1, | 2409 | .soft_unbind = 1, |
2410 | }; | 2410 | }; |
2411 | 2411 | ||
2412 | static int __init ene_ub6250_init(void) | 2412 | module_usb_driver(ene_ub6250_driver); |
2413 | { | ||
2414 | return usb_register(&ene_ub6250_driver); | ||
2415 | } | ||
2416 | |||
2417 | static void __exit ene_ub6250_exit(void) | ||
2418 | { | ||
2419 | usb_deregister(&ene_ub6250_driver); | ||
2420 | } | ||
2421 | |||
2422 | module_init(ene_ub6250_init); | ||
2423 | module_exit(ene_ub6250_exit); | ||
diff --git a/drivers/usb/storage/freecom.c b/drivers/usb/storage/freecom.c index 6542ca40d505..03d4a873748c 100644 --- a/drivers/usb/storage/freecom.c +++ b/drivers/usb/storage/freecom.c | |||
@@ -555,15 +555,4 @@ static struct usb_driver freecom_driver = { | |||
555 | .soft_unbind = 1, | 555 | .soft_unbind = 1, |
556 | }; | 556 | }; |
557 | 557 | ||
558 | static int __init freecom_init(void) | 558 | module_usb_driver(freecom_driver); |
559 | { | ||
560 | return usb_register(&freecom_driver); | ||
561 | } | ||
562 | |||
563 | static void __exit freecom_exit(void) | ||
564 | { | ||
565 | usb_deregister(&freecom_driver); | ||
566 | } | ||
567 | |||
568 | module_init(freecom_init); | ||
569 | module_exit(freecom_exit); | ||
diff --git a/drivers/usb/storage/isd200.c b/drivers/usb/storage/isd200.c index ffc4193e9505..6d6923317f10 100644 --- a/drivers/usb/storage/isd200.c +++ b/drivers/usb/storage/isd200.c | |||
@@ -1568,15 +1568,4 @@ static struct usb_driver isd200_driver = { | |||
1568 | .soft_unbind = 1, | 1568 | .soft_unbind = 1, |
1569 | }; | 1569 | }; |
1570 | 1570 | ||
1571 | static int __init isd200_init(void) | 1571 | module_usb_driver(isd200_driver); |
1572 | { | ||
1573 | return usb_register(&isd200_driver); | ||
1574 | } | ||
1575 | |||
1576 | static void __exit isd200_exit(void) | ||
1577 | { | ||
1578 | usb_deregister(&isd200_driver); | ||
1579 | } | ||
1580 | |||
1581 | module_init(isd200_init); | ||
1582 | module_exit(isd200_exit); | ||
diff --git a/drivers/usb/storage/jumpshot.c b/drivers/usb/storage/jumpshot.c index 6168596c5ac6..54b71650b69c 100644 --- a/drivers/usb/storage/jumpshot.c +++ b/drivers/usb/storage/jumpshot.c | |||
@@ -679,15 +679,4 @@ static struct usb_driver jumpshot_driver = { | |||
679 | .soft_unbind = 1, | 679 | .soft_unbind = 1, |
680 | }; | 680 | }; |
681 | 681 | ||
682 | static int __init jumpshot_init(void) | 682 | module_usb_driver(jumpshot_driver); |
683 | { | ||
684 | return usb_register(&jumpshot_driver); | ||
685 | } | ||
686 | |||
687 | static void __exit jumpshot_exit(void) | ||
688 | { | ||
689 | usb_deregister(&jumpshot_driver); | ||
690 | } | ||
691 | |||
692 | module_init(jumpshot_init); | ||
693 | module_exit(jumpshot_exit); | ||
diff --git a/drivers/usb/storage/karma.c b/drivers/usb/storage/karma.c index ba1b78906880..35181e29124d 100644 --- a/drivers/usb/storage/karma.c +++ b/drivers/usb/storage/karma.c | |||
@@ -232,15 +232,4 @@ static struct usb_driver karma_driver = { | |||
232 | .soft_unbind = 1, | 232 | .soft_unbind = 1, |
233 | }; | 233 | }; |
234 | 234 | ||
235 | static int __init karma_init(void) | 235 | module_usb_driver(karma_driver); |
236 | { | ||
237 | return usb_register(&karma_driver); | ||
238 | } | ||
239 | |||
240 | static void __exit karma_exit(void) | ||
241 | { | ||
242 | usb_deregister(&karma_driver); | ||
243 | } | ||
244 | |||
245 | module_init(karma_init); | ||
246 | module_exit(karma_exit); | ||
diff --git a/drivers/usb/storage/onetouch.c b/drivers/usb/storage/onetouch.c index 1943be5a2914..721c8c587305 100644 --- a/drivers/usb/storage/onetouch.c +++ b/drivers/usb/storage/onetouch.c | |||
@@ -314,15 +314,4 @@ static struct usb_driver onetouch_driver = { | |||
314 | .soft_unbind = 1, | 314 | .soft_unbind = 1, |
315 | }; | 315 | }; |
316 | 316 | ||
317 | static int __init onetouch_init(void) | 317 | module_usb_driver(onetouch_driver); |
318 | { | ||
319 | return usb_register(&onetouch_driver); | ||
320 | } | ||
321 | |||
322 | static void __exit onetouch_exit(void) | ||
323 | { | ||
324 | usb_deregister(&onetouch_driver); | ||
325 | } | ||
326 | |||
327 | module_init(onetouch_init); | ||
328 | module_exit(onetouch_exit); | ||
diff --git a/drivers/usb/storage/realtek_cr.c b/drivers/usb/storage/realtek_cr.c index 0ce5f79197e7..c41cd30d2c01 100644 --- a/drivers/usb/storage/realtek_cr.c +++ b/drivers/usb/storage/realtek_cr.c | |||
@@ -1104,15 +1104,4 @@ static struct usb_driver realtek_cr_driver = { | |||
1104 | .supports_autosuspend = 1, | 1104 | .supports_autosuspend = 1, |
1105 | }; | 1105 | }; |
1106 | 1106 | ||
1107 | static int __init realtek_cr_init(void) | 1107 | module_usb_driver(realtek_cr_driver); |
1108 | { | ||
1109 | return usb_register(&realtek_cr_driver); | ||
1110 | } | ||
1111 | |||
1112 | static void __exit realtek_cr_exit(void) | ||
1113 | { | ||
1114 | usb_deregister(&realtek_cr_driver); | ||
1115 | } | ||
1116 | |||
1117 | module_init(realtek_cr_init); | ||
1118 | module_exit(realtek_cr_exit); | ||
diff --git a/drivers/usb/storage/sddr09.c b/drivers/usb/storage/sddr09.c index bcb9a709d349..83ee49e737bd 100644 --- a/drivers/usb/storage/sddr09.c +++ b/drivers/usb/storage/sddr09.c | |||
@@ -1789,15 +1789,4 @@ static struct usb_driver sddr09_driver = { | |||
1789 | .soft_unbind = 1, | 1789 | .soft_unbind = 1, |
1790 | }; | 1790 | }; |
1791 | 1791 | ||
1792 | static int __init sddr09_init(void) | 1792 | module_usb_driver(sddr09_driver); |
1793 | { | ||
1794 | return usb_register(&sddr09_driver); | ||
1795 | } | ||
1796 | |||
1797 | static void __exit sddr09_exit(void) | ||
1798 | { | ||
1799 | usb_deregister(&sddr09_driver); | ||
1800 | } | ||
1801 | |||
1802 | module_init(sddr09_init); | ||
1803 | module_exit(sddr09_exit); | ||
diff --git a/drivers/usb/storage/sddr55.c b/drivers/usb/storage/sddr55.c index 44dfed7754ed..8983ec2ffb5a 100644 --- a/drivers/usb/storage/sddr55.c +++ b/drivers/usb/storage/sddr55.c | |||
@@ -1008,15 +1008,4 @@ static struct usb_driver sddr55_driver = { | |||
1008 | .soft_unbind = 1, | 1008 | .soft_unbind = 1, |
1009 | }; | 1009 | }; |
1010 | 1010 | ||
1011 | static int __init sddr55_init(void) | 1011 | module_usb_driver(sddr55_driver); |
1012 | { | ||
1013 | return usb_register(&sddr55_driver); | ||
1014 | } | ||
1015 | |||
1016 | static void __exit sddr55_exit(void) | ||
1017 | { | ||
1018 | usb_deregister(&sddr55_driver); | ||
1019 | } | ||
1020 | |||
1021 | module_init(sddr55_init); | ||
1022 | module_exit(sddr55_exit); | ||
diff --git a/drivers/usb/storage/shuttle_usbat.c b/drivers/usb/storage/shuttle_usbat.c index 0b00091d2ae9..a4c02751af4e 100644 --- a/drivers/usb/storage/shuttle_usbat.c +++ b/drivers/usb/storage/shuttle_usbat.c | |||
@@ -1865,15 +1865,4 @@ static struct usb_driver usbat_driver = { | |||
1865 | .soft_unbind = 1, | 1865 | .soft_unbind = 1, |
1866 | }; | 1866 | }; |
1867 | 1867 | ||
1868 | static int __init usbat_init(void) | 1868 | module_usb_driver(usbat_driver); |
1869 | { | ||
1870 | return usb_register(&usbat_driver); | ||
1871 | } | ||
1872 | |||
1873 | static void __exit usbat_exit(void) | ||
1874 | { | ||
1875 | usb_deregister(&usbat_driver); | ||
1876 | } | ||
1877 | |||
1878 | module_init(usbat_init); | ||
1879 | module_exit(usbat_exit); | ||
diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index 1d10d5b8204c..a33ead5dce20 100644 --- a/drivers/usb/storage/uas.c +++ b/drivers/usb/storage/uas.c | |||
@@ -760,18 +760,7 @@ static struct usb_driver uas_driver = { | |||
760 | .id_table = uas_usb_ids, | 760 | .id_table = uas_usb_ids, |
761 | }; | 761 | }; |
762 | 762 | ||
763 | static int uas_init(void) | 763 | module_usb_driver(uas_driver); |
764 | { | ||
765 | return usb_register(&uas_driver); | ||
766 | } | ||
767 | |||
768 | static void uas_exit(void) | ||
769 | { | ||
770 | usb_deregister(&uas_driver); | ||
771 | } | ||
772 | |||
773 | module_init(uas_init); | ||
774 | module_exit(uas_exit); | ||
775 | 764 | ||
776 | MODULE_LICENSE("GPL"); | 765 | MODULE_LICENSE("GPL"); |
777 | MODULE_AUTHOR("Matthew Wilcox and Sarah Sharp"); | 766 | MODULE_AUTHOR("Matthew Wilcox and Sarah Sharp"); |
diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c index 32d6fc953904..5c6c1bdbd455 100644 --- a/drivers/usb/usb-skeleton.c +++ b/drivers/usb/usb-skeleton.c | |||
@@ -688,25 +688,6 @@ static struct usb_driver skel_driver = { | |||
688 | .supports_autosuspend = 1, | 688 | .supports_autosuspend = 1, |
689 | }; | 689 | }; |
690 | 690 | ||
691 | static int __init usb_skel_init(void) | 691 | module_usb_driver(skel_driver); |
692 | { | ||
693 | int result; | ||
694 | |||
695 | /* register this driver with the USB subsystem */ | ||
696 | result = usb_register(&skel_driver); | ||
697 | if (result) | ||
698 | err("usb_register failed. Error number %d", result); | ||
699 | |||
700 | return result; | ||
701 | } | ||
702 | |||
703 | static void __exit usb_skel_exit(void) | ||
704 | { | ||
705 | /* deregister this driver with the USB subsystem */ | ||
706 | usb_deregister(&skel_driver); | ||
707 | } | ||
708 | |||
709 | module_init(usb_skel_init); | ||
710 | module_exit(usb_skel_exit); | ||
711 | 692 | ||
712 | MODULE_LICENSE("GPL"); | 693 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/usb/wusbcore/cbaf.c b/drivers/usb/wusbcore/cbaf.c index 200fd7c6c7d5..7f78f300f8fb 100644 --- a/drivers/usb/wusbcore/cbaf.c +++ b/drivers/usb/wusbcore/cbaf.c | |||
@@ -655,17 +655,7 @@ static struct usb_driver cbaf_driver = { | |||
655 | .disconnect = cbaf_disconnect, | 655 | .disconnect = cbaf_disconnect, |
656 | }; | 656 | }; |
657 | 657 | ||
658 | static int __init cbaf_driver_init(void) | 658 | module_usb_driver(cbaf_driver); |
659 | { | ||
660 | return usb_register(&cbaf_driver); | ||
661 | } | ||
662 | module_init(cbaf_driver_init); | ||
663 | |||
664 | static void __exit cbaf_driver_exit(void) | ||
665 | { | ||
666 | usb_deregister(&cbaf_driver); | ||
667 | } | ||
668 | module_exit(cbaf_driver_exit); | ||
669 | 659 | ||
670 | MODULE_AUTHOR("Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>"); | 660 | MODULE_AUTHOR("Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>"); |
671 | MODULE_DESCRIPTION("Wireless USB Cable Based Association"); | 661 | MODULE_DESCRIPTION("Wireless USB Cable Based Association"); |
diff --git a/drivers/uwb/hwa-rc.c b/drivers/uwb/hwa-rc.c index 2babcd4fbfc1..66797e9c5010 100644 --- a/drivers/uwb/hwa-rc.c +++ b/drivers/uwb/hwa-rc.c | |||
@@ -914,17 +914,7 @@ static struct usb_driver hwarc_driver = { | |||
914 | .post_reset = hwarc_post_reset, | 914 | .post_reset = hwarc_post_reset, |
915 | }; | 915 | }; |
916 | 916 | ||
917 | static int __init hwarc_driver_init(void) | 917 | module_usb_driver(hwarc_driver); |
918 | { | ||
919 | return usb_register(&hwarc_driver); | ||
920 | } | ||
921 | module_init(hwarc_driver_init); | ||
922 | |||
923 | static void __exit hwarc_driver_exit(void) | ||
924 | { | ||
925 | usb_deregister(&hwarc_driver); | ||
926 | } | ||
927 | module_exit(hwarc_driver_exit); | ||
928 | 918 | ||
929 | MODULE_AUTHOR("Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>"); | 919 | MODULE_AUTHOR("Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>"); |
930 | MODULE_DESCRIPTION("Host Wireless Adapter Radio Control Driver"); | 920 | MODULE_DESCRIPTION("Host Wireless Adapter Radio Control Driver"); |
diff --git a/drivers/uwb/i1480/dfu/usb.c b/drivers/uwb/i1480/dfu/usb.c index ba8664328afa..c8f684833d58 100644 --- a/drivers/uwb/i1480/dfu/usb.c +++ b/drivers/uwb/i1480/dfu/usb.c | |||
@@ -451,25 +451,7 @@ static struct usb_driver i1480_dfu_driver = { | |||
451 | .disconnect = NULL, | 451 | .disconnect = NULL, |
452 | }; | 452 | }; |
453 | 453 | ||
454 | 454 | module_usb_driver(i1480_dfu_driver); | |
455 | /* | ||
456 | * Initialize the i1480 DFU driver. | ||
457 | * | ||
458 | * We also need to register our function for guessing event sizes. | ||
459 | */ | ||
460 | static int __init i1480_dfu_driver_init(void) | ||
461 | { | ||
462 | return usb_register(&i1480_dfu_driver); | ||
463 | } | ||
464 | module_init(i1480_dfu_driver_init); | ||
465 | |||
466 | |||
467 | static void __exit i1480_dfu_driver_exit(void) | ||
468 | { | ||
469 | usb_deregister(&i1480_dfu_driver); | ||
470 | } | ||
471 | module_exit(i1480_dfu_driver_exit); | ||
472 | |||
473 | 455 | ||
474 | MODULE_AUTHOR("Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>"); | 456 | MODULE_AUTHOR("Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>"); |
475 | MODULE_DESCRIPTION("Intel Wireless UWB Link 1480 firmware uploader for USB"); | 457 | MODULE_DESCRIPTION("Intel Wireless UWB Link 1480 firmware uploader for USB"); |
diff --git a/drivers/video/smscufx.c b/drivers/video/smscufx.c index aaccffac67ab..3c22994ea31a 100644 --- a/drivers/video/smscufx.c +++ b/drivers/video/smscufx.c | |||
@@ -1792,24 +1792,7 @@ static struct usb_driver ufx_driver = { | |||
1792 | .id_table = id_table, | 1792 | .id_table = id_table, |
1793 | }; | 1793 | }; |
1794 | 1794 | ||
1795 | static int __init ufx_module_init(void) | 1795 | module_usb_driver(ufx_driver); |
1796 | { | ||
1797 | int res; | ||
1798 | |||
1799 | res = usb_register(&ufx_driver); | ||
1800 | if (res) | ||
1801 | err("usb_register failed. Error number %d", res); | ||
1802 | |||
1803 | return res; | ||
1804 | } | ||
1805 | |||
1806 | static void __exit ufx_module_exit(void) | ||
1807 | { | ||
1808 | usb_deregister(&ufx_driver); | ||
1809 | } | ||
1810 | |||
1811 | module_init(ufx_module_init); | ||
1812 | module_exit(ufx_module_exit); | ||
1813 | 1796 | ||
1814 | static void ufx_urb_completion(struct urb *urb) | 1797 | static void ufx_urb_completion(struct urb *urb) |
1815 | { | 1798 | { |
diff --git a/drivers/video/udlfb.c b/drivers/video/udlfb.c index 3473e75ce785..1f868d0187a2 100644 --- a/drivers/video/udlfb.c +++ b/drivers/video/udlfb.c | |||
@@ -1761,24 +1761,7 @@ static struct usb_driver dlfb_driver = { | |||
1761 | .id_table = id_table, | 1761 | .id_table = id_table, |
1762 | }; | 1762 | }; |
1763 | 1763 | ||
1764 | static int __init dlfb_module_init(void) | 1764 | module_usb_driver(dlfb_driver); |
1765 | { | ||
1766 | int res; | ||
1767 | |||
1768 | res = usb_register(&dlfb_driver); | ||
1769 | if (res) | ||
1770 | err("usb_register failed. Error number %d", res); | ||
1771 | |||
1772 | return res; | ||
1773 | } | ||
1774 | |||
1775 | static void __exit dlfb_module_exit(void) | ||
1776 | { | ||
1777 | usb_deregister(&dlfb_driver); | ||
1778 | } | ||
1779 | |||
1780 | module_init(dlfb_module_init); | ||
1781 | module_exit(dlfb_module_exit); | ||
1782 | 1765 | ||
1783 | static void dlfb_urb_completion(struct urb *urb) | 1766 | static void dlfb_urb_completion(struct urb *urb) |
1784 | { | 1767 | { |
diff --git a/drivers/w1/masters/ds2490.c b/drivers/w1/masters/ds2490.c index b5abaae38e97..4f7e1d770f81 100644 --- a/drivers/w1/masters/ds2490.c +++ b/drivers/w1/masters/ds2490.c | |||
@@ -1002,26 +1002,7 @@ static void ds_disconnect(struct usb_interface *intf) | |||
1002 | kfree(dev); | 1002 | kfree(dev); |
1003 | } | 1003 | } |
1004 | 1004 | ||
1005 | static int ds_init(void) | 1005 | module_usb_driver(ds_driver); |
1006 | { | ||
1007 | int err; | ||
1008 | |||
1009 | err = usb_register(&ds_driver); | ||
1010 | if (err) { | ||
1011 | printk(KERN_INFO "Failed to register DS9490R USB device: err=%d.\n", err); | ||
1012 | return err; | ||
1013 | } | ||
1014 | |||
1015 | return 0; | ||
1016 | } | ||
1017 | |||
1018 | static void ds_fini(void) | ||
1019 | { | ||
1020 | usb_deregister(&ds_driver); | ||
1021 | } | ||
1022 | |||
1023 | module_init(ds_init); | ||
1024 | module_exit(ds_fini); | ||
1025 | 1006 | ||
1026 | MODULE_LICENSE("GPL"); | 1007 | MODULE_LICENSE("GPL"); |
1027 | MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>"); | 1008 | MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>"); |
diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c index a1ef9b5b38cf..ff29ae747ee8 100644 --- a/drivers/w1/slaves/w1_therm.c +++ b/drivers/w1/slaves/w1_therm.c | |||
@@ -175,11 +175,13 @@ static ssize_t w1_therm_read(struct device *device, | |||
175 | { | 175 | { |
176 | struct w1_slave *sl = dev_to_w1_slave(device); | 176 | struct w1_slave *sl = dev_to_w1_slave(device); |
177 | struct w1_master *dev = sl->master; | 177 | struct w1_master *dev = sl->master; |
178 | u8 rom[9], crc, verdict; | 178 | u8 rom[9], crc, verdict, external_power; |
179 | int i, max_trying = 10; | 179 | int i, max_trying = 10; |
180 | ssize_t c = PAGE_SIZE; | 180 | ssize_t c = PAGE_SIZE; |
181 | 181 | ||
182 | mutex_lock(&dev->mutex); | 182 | i = mutex_lock_interruptible(&dev->mutex); |
183 | if (i != 0) | ||
184 | return i; | ||
183 | 185 | ||
184 | memset(rom, 0, sizeof(rom)); | 186 | memset(rom, 0, sizeof(rom)); |
185 | 187 | ||
@@ -190,13 +192,37 @@ static ssize_t w1_therm_read(struct device *device, | |||
190 | if (!w1_reset_select_slave(sl)) { | 192 | if (!w1_reset_select_slave(sl)) { |
191 | int count = 0; | 193 | int count = 0; |
192 | unsigned int tm = 750; | 194 | unsigned int tm = 750; |
195 | unsigned long sleep_rem; | ||
196 | |||
197 | w1_write_8(dev, W1_READ_PSUPPLY); | ||
198 | external_power = w1_read_8(dev); | ||
199 | |||
200 | if (w1_reset_select_slave(sl)) | ||
201 | continue; | ||
193 | 202 | ||
194 | /* 750ms strong pullup (or delay) after the convert */ | 203 | /* 750ms strong pullup (or delay) after the convert */ |
195 | if (w1_strong_pullup) | 204 | if (!external_power && w1_strong_pullup) |
196 | w1_next_pullup(dev, tm); | 205 | w1_next_pullup(dev, tm); |
206 | |||
197 | w1_write_8(dev, W1_CONVERT_TEMP); | 207 | w1_write_8(dev, W1_CONVERT_TEMP); |
198 | if (!w1_strong_pullup) | 208 | |
199 | msleep(tm); | 209 | if (external_power) { |
210 | mutex_unlock(&dev->mutex); | ||
211 | |||
212 | sleep_rem = msleep_interruptible(tm); | ||
213 | if (sleep_rem != 0) | ||
214 | return -EINTR; | ||
215 | |||
216 | i = mutex_lock_interruptible(&dev->mutex); | ||
217 | if (i != 0) | ||
218 | return i; | ||
219 | } else if (!w1_strong_pullup) { | ||
220 | sleep_rem = msleep_interruptible(tm); | ||
221 | if (sleep_rem != 0) { | ||
222 | mutex_unlock(&dev->mutex); | ||
223 | return -EINTR; | ||
224 | } | ||
225 | } | ||
200 | 226 | ||
201 | if (!w1_reset_select_slave(sl)) { | 227 | if (!w1_reset_select_slave(sl)) { |
202 | 228 | ||
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index c37497823851..9761950697b4 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c | |||
@@ -892,6 +892,16 @@ void w1_search(struct w1_master *dev, u8 search_type, w1_slave_found_callback cb | |||
892 | break; | 892 | break; |
893 | } | 893 | } |
894 | 894 | ||
895 | /* Do fast search on single slave bus */ | ||
896 | if (dev->max_slave_count == 1) { | ||
897 | w1_write_8(dev, W1_READ_ROM); | ||
898 | |||
899 | if (w1_read_block(dev, (u8 *)&rn, 8) == 8 && rn) | ||
900 | cb(dev, rn); | ||
901 | |||
902 | break; | ||
903 | } | ||
904 | |||
895 | /* Start the search */ | 905 | /* Start the search */ |
896 | w1_write_8(dev, search_type); | 906 | w1_write_8(dev, search_type); |
897 | for (i = 0; i < 64; ++i) { | 907 | for (i = 0; i < 64; ++i) { |
diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c index 748a74bd85e7..d8de1ddd176a 100644 --- a/drivers/watchdog/pcwd_usb.c +++ b/drivers/watchdog/pcwd_usb.c | |||
@@ -827,37 +827,4 @@ static void usb_pcwd_disconnect(struct usb_interface *interface) | |||
827 | printk(KERN_INFO PFX "USB PC Watchdog disconnected\n"); | 827 | printk(KERN_INFO PFX "USB PC Watchdog disconnected\n"); |
828 | } | 828 | } |
829 | 829 | ||
830 | 830 | module_usb_driver(usb_pcwd_driver); | |
831 | |||
832 | /** | ||
833 | * usb_pcwd_init | ||
834 | */ | ||
835 | static int __init usb_pcwd_init(void) | ||
836 | { | ||
837 | int result; | ||
838 | |||
839 | /* register this driver with the USB subsystem */ | ||
840 | result = usb_register(&usb_pcwd_driver); | ||
841 | if (result) { | ||
842 | printk(KERN_ERR PFX "usb_register failed. Error number %d\n", | ||
843 | result); | ||
844 | return result; | ||
845 | } | ||
846 | |||
847 | printk(KERN_INFO PFX DRIVER_DESC " v" DRIVER_VERSION "\n"); | ||
848 | return 0; | ||
849 | } | ||
850 | |||
851 | |||
852 | /** | ||
853 | * usb_pcwd_exit | ||
854 | */ | ||
855 | static void __exit usb_pcwd_exit(void) | ||
856 | { | ||
857 | /* deregister this driver with the USB subsystem */ | ||
858 | usb_deregister(&usb_pcwd_driver); | ||
859 | } | ||
860 | |||
861 | |||
862 | module_init(usb_pcwd_init); | ||
863 | module_exit(usb_pcwd_exit); | ||
diff --git a/drivers/xen/xen-balloon.c b/drivers/xen/xen-balloon.c index 9cc2259c9992..3832e303c33a 100644 --- a/drivers/xen/xen-balloon.c +++ b/drivers/xen/xen-balloon.c | |||
@@ -32,7 +32,6 @@ | |||
32 | 32 | ||
33 | #include <linux/kernel.h> | 33 | #include <linux/kernel.h> |
34 | #include <linux/module.h> | 34 | #include <linux/module.h> |
35 | #include <linux/sysdev.h> | ||
36 | #include <linux/capability.h> | 35 | #include <linux/capability.h> |
37 | 36 | ||
38 | #include <xen/xen.h> | 37 | #include <xen/xen.h> |
@@ -46,9 +45,9 @@ | |||
46 | 45 | ||
47 | #define BALLOON_CLASS_NAME "xen_memory" | 46 | #define BALLOON_CLASS_NAME "xen_memory" |
48 | 47 | ||
49 | static struct sys_device balloon_sysdev; | 48 | static struct device balloon_dev; |
50 | 49 | ||
51 | static int register_balloon(struct sys_device *sysdev); | 50 | static int register_balloon(struct device *dev); |
52 | 51 | ||
53 | /* React to a change in the target key */ | 52 | /* React to a change in the target key */ |
54 | static void watch_target(struct xenbus_watch *watch, | 53 | static void watch_target(struct xenbus_watch *watch, |
@@ -98,9 +97,9 @@ static int __init balloon_init(void) | |||
98 | 97 | ||
99 | pr_info("xen-balloon: Initialising balloon driver.\n"); | 98 | pr_info("xen-balloon: Initialising balloon driver.\n"); |
100 | 99 | ||
101 | register_balloon(&balloon_sysdev); | 100 | register_balloon(&balloon_dev); |
102 | 101 | ||
103 | register_xen_selfballooning(&balloon_sysdev); | 102 | register_xen_selfballooning(&balloon_dev); |
104 | 103 | ||
105 | register_xenstore_notifier(&xenstore_notifier); | 104 | register_xenstore_notifier(&xenstore_notifier); |
106 | 105 | ||
@@ -117,31 +116,31 @@ static void balloon_exit(void) | |||
117 | module_exit(balloon_exit); | 116 | module_exit(balloon_exit); |
118 | 117 | ||
119 | #define BALLOON_SHOW(name, format, args...) \ | 118 | #define BALLOON_SHOW(name, format, args...) \ |
120 | static ssize_t show_##name(struct sys_device *dev, \ | 119 | static ssize_t show_##name(struct device *dev, \ |
121 | struct sysdev_attribute *attr, \ | 120 | struct device_attribute *attr, \ |
122 | char *buf) \ | 121 | char *buf) \ |
123 | { \ | 122 | { \ |
124 | return sprintf(buf, format, ##args); \ | 123 | return sprintf(buf, format, ##args); \ |
125 | } \ | 124 | } \ |
126 | static SYSDEV_ATTR(name, S_IRUGO, show_##name, NULL) | 125 | static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL) |
127 | 126 | ||
128 | BALLOON_SHOW(current_kb, "%lu\n", PAGES2KB(balloon_stats.current_pages)); | 127 | BALLOON_SHOW(current_kb, "%lu\n", PAGES2KB(balloon_stats.current_pages)); |
129 | BALLOON_SHOW(low_kb, "%lu\n", PAGES2KB(balloon_stats.balloon_low)); | 128 | BALLOON_SHOW(low_kb, "%lu\n", PAGES2KB(balloon_stats.balloon_low)); |
130 | BALLOON_SHOW(high_kb, "%lu\n", PAGES2KB(balloon_stats.balloon_high)); | 129 | BALLOON_SHOW(high_kb, "%lu\n", PAGES2KB(balloon_stats.balloon_high)); |
131 | 130 | ||
132 | static SYSDEV_ULONG_ATTR(schedule_delay, 0444, balloon_stats.schedule_delay); | 131 | static DEVICE_ULONG_ATTR(schedule_delay, 0444, balloon_stats.schedule_delay); |
133 | static SYSDEV_ULONG_ATTR(max_schedule_delay, 0644, balloon_stats.max_schedule_delay); | 132 | static DEVICE_ULONG_ATTR(max_schedule_delay, 0644, balloon_stats.max_schedule_delay); |
134 | static SYSDEV_ULONG_ATTR(retry_count, 0444, balloon_stats.retry_count); | 133 | static DEVICE_ULONG_ATTR(retry_count, 0444, balloon_stats.retry_count); |
135 | static SYSDEV_ULONG_ATTR(max_retry_count, 0644, balloon_stats.max_retry_count); | 134 | static DEVICE_ULONG_ATTR(max_retry_count, 0644, balloon_stats.max_retry_count); |
136 | 135 | ||
137 | static ssize_t show_target_kb(struct sys_device *dev, struct sysdev_attribute *attr, | 136 | static ssize_t show_target_kb(struct device *dev, struct device_attribute *attr, |
138 | char *buf) | 137 | char *buf) |
139 | { | 138 | { |
140 | return sprintf(buf, "%lu\n", PAGES2KB(balloon_stats.target_pages)); | 139 | return sprintf(buf, "%lu\n", PAGES2KB(balloon_stats.target_pages)); |
141 | } | 140 | } |
142 | 141 | ||
143 | static ssize_t store_target_kb(struct sys_device *dev, | 142 | static ssize_t store_target_kb(struct device *dev, |
144 | struct sysdev_attribute *attr, | 143 | struct device_attribute *attr, |
145 | const char *buf, | 144 | const char *buf, |
146 | size_t count) | 145 | size_t count) |
147 | { | 146 | { |
@@ -158,11 +157,11 @@ static ssize_t store_target_kb(struct sys_device *dev, | |||
158 | return count; | 157 | return count; |
159 | } | 158 | } |
160 | 159 | ||
161 | static SYSDEV_ATTR(target_kb, S_IRUGO | S_IWUSR, | 160 | static DEVICE_ATTR(target_kb, S_IRUGO | S_IWUSR, |
162 | show_target_kb, store_target_kb); | 161 | show_target_kb, store_target_kb); |
163 | 162 | ||
164 | 163 | ||
165 | static ssize_t show_target(struct sys_device *dev, struct sysdev_attribute *attr, | 164 | static ssize_t show_target(struct device *dev, struct device_attribute *attr, |
166 | char *buf) | 165 | char *buf) |
167 | { | 166 | { |
168 | return sprintf(buf, "%llu\n", | 167 | return sprintf(buf, "%llu\n", |
@@ -170,8 +169,8 @@ static ssize_t show_target(struct sys_device *dev, struct sysdev_attribute *attr | |||
170 | << PAGE_SHIFT); | 169 | << PAGE_SHIFT); |
171 | } | 170 | } |
172 | 171 | ||
173 | static ssize_t store_target(struct sys_device *dev, | 172 | static ssize_t store_target(struct device *dev, |
174 | struct sysdev_attribute *attr, | 173 | struct device_attribute *attr, |
175 | const char *buf, | 174 | const char *buf, |
176 | size_t count) | 175 | size_t count) |
177 | { | 176 | { |
@@ -188,23 +187,23 @@ static ssize_t store_target(struct sys_device *dev, | |||
188 | return count; | 187 | return count; |
189 | } | 188 | } |
190 | 189 | ||
191 | static SYSDEV_ATTR(target, S_IRUGO | S_IWUSR, | 190 | static DEVICE_ATTR(target, S_IRUGO | S_IWUSR, |
192 | show_target, store_target); | 191 | show_target, store_target); |
193 | 192 | ||
194 | 193 | ||
195 | static struct sysdev_attribute *balloon_attrs[] = { | 194 | static struct device_attribute *balloon_attrs[] = { |
196 | &attr_target_kb, | 195 | &dev_attr_target_kb, |
197 | &attr_target, | 196 | &dev_attr_target, |
198 | &attr_schedule_delay.attr, | 197 | &dev_attr_schedule_delay.attr, |
199 | &attr_max_schedule_delay.attr, | 198 | &dev_attr_max_schedule_delay.attr, |
200 | &attr_retry_count.attr, | 199 | &dev_attr_retry_count.attr, |
201 | &attr_max_retry_count.attr | 200 | &dev_attr_max_retry_count.attr |
202 | }; | 201 | }; |
203 | 202 | ||
204 | static struct attribute *balloon_info_attrs[] = { | 203 | static struct attribute *balloon_info_attrs[] = { |
205 | &attr_current_kb.attr, | 204 | &dev_attr_current_kb.attr, |
206 | &attr_low_kb.attr, | 205 | &dev_attr_low_kb.attr, |
207 | &attr_high_kb.attr, | 206 | &dev_attr_high_kb.attr, |
208 | NULL | 207 | NULL |
209 | }; | 208 | }; |
210 | 209 | ||
@@ -213,34 +212,35 @@ static struct attribute_group balloon_info_group = { | |||
213 | .attrs = balloon_info_attrs | 212 | .attrs = balloon_info_attrs |
214 | }; | 213 | }; |
215 | 214 | ||
216 | static struct sysdev_class balloon_sysdev_class = { | 215 | static struct bus_type balloon_subsys = { |
217 | .name = BALLOON_CLASS_NAME | 216 | .name = BALLOON_CLASS_NAME, |
217 | .dev_name = BALLOON_CLASS_NAME, | ||
218 | }; | 218 | }; |
219 | 219 | ||
220 | static int register_balloon(struct sys_device *sysdev) | 220 | static int register_balloon(struct device *dev) |
221 | { | 221 | { |
222 | int i, error; | 222 | int i, error; |
223 | 223 | ||
224 | error = sysdev_class_register(&balloon_sysdev_class); | 224 | error = bus_register(&balloon_subsys); |
225 | if (error) | 225 | if (error) |
226 | return error; | 226 | return error; |
227 | 227 | ||
228 | sysdev->id = 0; | 228 | dev->id = 0; |
229 | sysdev->cls = &balloon_sysdev_class; | 229 | dev->bus = &balloon_subsys; |
230 | 230 | ||
231 | error = sysdev_register(sysdev); | 231 | error = device_register(dev); |
232 | if (error) { | 232 | if (error) { |
233 | sysdev_class_unregister(&balloon_sysdev_class); | 233 | bus_unregister(&balloon_subsys); |
234 | return error; | 234 | return error; |
235 | } | 235 | } |
236 | 236 | ||
237 | for (i = 0; i < ARRAY_SIZE(balloon_attrs); i++) { | 237 | for (i = 0; i < ARRAY_SIZE(balloon_attrs); i++) { |
238 | error = sysdev_create_file(sysdev, balloon_attrs[i]); | 238 | error = device_create_file(dev, balloon_attrs[i]); |
239 | if (error) | 239 | if (error) |
240 | goto fail; | 240 | goto fail; |
241 | } | 241 | } |
242 | 242 | ||
243 | error = sysfs_create_group(&sysdev->kobj, &balloon_info_group); | 243 | error = sysfs_create_group(&dev->kobj, &balloon_info_group); |
244 | if (error) | 244 | if (error) |
245 | goto fail; | 245 | goto fail; |
246 | 246 | ||
@@ -248,9 +248,9 @@ static int register_balloon(struct sys_device *sysdev) | |||
248 | 248 | ||
249 | fail: | 249 | fail: |
250 | while (--i >= 0) | 250 | while (--i >= 0) |
251 | sysdev_remove_file(sysdev, balloon_attrs[i]); | 251 | device_remove_file(dev, balloon_attrs[i]); |
252 | sysdev_unregister(sysdev); | 252 | device_unregister(dev); |
253 | sysdev_class_unregister(&balloon_sysdev_class); | 253 | bus_unregister(&balloon_subsys); |
254 | return error; | 254 | return error; |
255 | } | 255 | } |
256 | 256 | ||
diff --git a/drivers/xen/xen-selfballoon.c b/drivers/xen/xen-selfballoon.c index d93c70857e03..767ff656d5a7 100644 --- a/drivers/xen/xen-selfballoon.c +++ b/drivers/xen/xen-selfballoon.c | |||
@@ -74,6 +74,7 @@ | |||
74 | #include <linux/mman.h> | 74 | #include <linux/mman.h> |
75 | #include <linux/module.h> | 75 | #include <linux/module.h> |
76 | #include <linux/workqueue.h> | 76 | #include <linux/workqueue.h> |
77 | #include <linux/device.h> | ||
77 | #include <xen/balloon.h> | 78 | #include <xen/balloon.h> |
78 | #include <xen/tmem.h> | 79 | #include <xen/tmem.h> |
79 | #include <xen/xen.h> | 80 | #include <xen/xen.h> |
@@ -266,21 +267,20 @@ static void selfballoon_process(struct work_struct *work) | |||
266 | 267 | ||
267 | #ifdef CONFIG_SYSFS | 268 | #ifdef CONFIG_SYSFS |
268 | 269 | ||
269 | #include <linux/sysdev.h> | ||
270 | #include <linux/capability.h> | 270 | #include <linux/capability.h> |
271 | 271 | ||
272 | #define SELFBALLOON_SHOW(name, format, args...) \ | 272 | #define SELFBALLOON_SHOW(name, format, args...) \ |
273 | static ssize_t show_##name(struct sys_device *dev, \ | 273 | static ssize_t show_##name(struct device *dev, \ |
274 | struct sysdev_attribute *attr, \ | 274 | struct device_attribute *attr, \ |
275 | char *buf) \ | 275 | char *buf) \ |
276 | { \ | 276 | { \ |
277 | return sprintf(buf, format, ##args); \ | 277 | return sprintf(buf, format, ##args); \ |
278 | } | 278 | } |
279 | 279 | ||
280 | SELFBALLOON_SHOW(selfballooning, "%d\n", xen_selfballooning_enabled); | 280 | SELFBALLOON_SHOW(selfballooning, "%d\n", xen_selfballooning_enabled); |
281 | 281 | ||
282 | static ssize_t store_selfballooning(struct sys_device *dev, | 282 | static ssize_t store_selfballooning(struct device *dev, |
283 | struct sysdev_attribute *attr, | 283 | struct device_attribute *attr, |
284 | const char *buf, | 284 | const char *buf, |
285 | size_t count) | 285 | size_t count) |
286 | { | 286 | { |
@@ -303,13 +303,13 @@ static ssize_t store_selfballooning(struct sys_device *dev, | |||
303 | return count; | 303 | return count; |
304 | } | 304 | } |
305 | 305 | ||
306 | static SYSDEV_ATTR(selfballooning, S_IRUGO | S_IWUSR, | 306 | static DEVICE_ATTR(selfballooning, S_IRUGO | S_IWUSR, |
307 | show_selfballooning, store_selfballooning); | 307 | show_selfballooning, store_selfballooning); |
308 | 308 | ||
309 | SELFBALLOON_SHOW(selfballoon_interval, "%d\n", selfballoon_interval); | 309 | SELFBALLOON_SHOW(selfballoon_interval, "%d\n", selfballoon_interval); |
310 | 310 | ||
311 | static ssize_t store_selfballoon_interval(struct sys_device *dev, | 311 | static ssize_t store_selfballoon_interval(struct device *dev, |
312 | struct sysdev_attribute *attr, | 312 | struct device_attribute *attr, |
313 | const char *buf, | 313 | const char *buf, |
314 | size_t count) | 314 | size_t count) |
315 | { | 315 | { |
@@ -325,13 +325,13 @@ static ssize_t store_selfballoon_interval(struct sys_device *dev, | |||
325 | return count; | 325 | return count; |
326 | } | 326 | } |
327 | 327 | ||
328 | static SYSDEV_ATTR(selfballoon_interval, S_IRUGO | S_IWUSR, | 328 | static DEVICE_ATTR(selfballoon_interval, S_IRUGO | S_IWUSR, |
329 | show_selfballoon_interval, store_selfballoon_interval); | 329 | show_selfballoon_interval, store_selfballoon_interval); |
330 | 330 | ||
331 | SELFBALLOON_SHOW(selfballoon_downhys, "%d\n", selfballoon_downhysteresis); | 331 | SELFBALLOON_SHOW(selfballoon_downhys, "%d\n", selfballoon_downhysteresis); |
332 | 332 | ||
333 | static ssize_t store_selfballoon_downhys(struct sys_device *dev, | 333 | static ssize_t store_selfballoon_downhys(struct device *dev, |
334 | struct sysdev_attribute *attr, | 334 | struct device_attribute *attr, |
335 | const char *buf, | 335 | const char *buf, |
336 | size_t count) | 336 | size_t count) |
337 | { | 337 | { |
@@ -347,14 +347,14 @@ static ssize_t store_selfballoon_downhys(struct sys_device *dev, | |||
347 | return count; | 347 | return count; |
348 | } | 348 | } |
349 | 349 | ||
350 | static SYSDEV_ATTR(selfballoon_downhysteresis, S_IRUGO | S_IWUSR, | 350 | static DEVICE_ATTR(selfballoon_downhysteresis, S_IRUGO | S_IWUSR, |
351 | show_selfballoon_downhys, store_selfballoon_downhys); | 351 | show_selfballoon_downhys, store_selfballoon_downhys); |
352 | 352 | ||
353 | 353 | ||
354 | SELFBALLOON_SHOW(selfballoon_uphys, "%d\n", selfballoon_uphysteresis); | 354 | SELFBALLOON_SHOW(selfballoon_uphys, "%d\n", selfballoon_uphysteresis); |
355 | 355 | ||
356 | static ssize_t store_selfballoon_uphys(struct sys_device *dev, | 356 | static ssize_t store_selfballoon_uphys(struct device *dev, |
357 | struct sysdev_attribute *attr, | 357 | struct device_attribute *attr, |
358 | const char *buf, | 358 | const char *buf, |
359 | size_t count) | 359 | size_t count) |
360 | { | 360 | { |
@@ -370,14 +370,14 @@ static ssize_t store_selfballoon_uphys(struct sys_device *dev, | |||
370 | return count; | 370 | return count; |
371 | } | 371 | } |
372 | 372 | ||
373 | static SYSDEV_ATTR(selfballoon_uphysteresis, S_IRUGO | S_IWUSR, | 373 | static DEVICE_ATTR(selfballoon_uphysteresis, S_IRUGO | S_IWUSR, |
374 | show_selfballoon_uphys, store_selfballoon_uphys); | 374 | show_selfballoon_uphys, store_selfballoon_uphys); |
375 | 375 | ||
376 | SELFBALLOON_SHOW(selfballoon_min_usable_mb, "%d\n", | 376 | SELFBALLOON_SHOW(selfballoon_min_usable_mb, "%d\n", |
377 | selfballoon_min_usable_mb); | 377 | selfballoon_min_usable_mb); |
378 | 378 | ||
379 | static ssize_t store_selfballoon_min_usable_mb(struct sys_device *dev, | 379 | static ssize_t store_selfballoon_min_usable_mb(struct device *dev, |
380 | struct sysdev_attribute *attr, | 380 | struct device_attribute *attr, |
381 | const char *buf, | 381 | const char *buf, |
382 | size_t count) | 382 | size_t count) |
383 | { | 383 | { |
@@ -393,7 +393,7 @@ static ssize_t store_selfballoon_min_usable_mb(struct sys_device *dev, | |||
393 | return count; | 393 | return count; |
394 | } | 394 | } |
395 | 395 | ||
396 | static SYSDEV_ATTR(selfballoon_min_usable_mb, S_IRUGO | S_IWUSR, | 396 | static DEVICE_ATTR(selfballoon_min_usable_mb, S_IRUGO | S_IWUSR, |
397 | show_selfballoon_min_usable_mb, | 397 | show_selfballoon_min_usable_mb, |
398 | store_selfballoon_min_usable_mb); | 398 | store_selfballoon_min_usable_mb); |
399 | 399 | ||
@@ -401,8 +401,8 @@ static SYSDEV_ATTR(selfballoon_min_usable_mb, S_IRUGO | S_IWUSR, | |||
401 | #ifdef CONFIG_FRONTSWAP | 401 | #ifdef CONFIG_FRONTSWAP |
402 | SELFBALLOON_SHOW(frontswap_selfshrinking, "%d\n", frontswap_selfshrinking); | 402 | SELFBALLOON_SHOW(frontswap_selfshrinking, "%d\n", frontswap_selfshrinking); |
403 | 403 | ||
404 | static ssize_t store_frontswap_selfshrinking(struct sys_device *dev, | 404 | static ssize_t store_frontswap_selfshrinking(struct device *dev, |
405 | struct sysdev_attribute *attr, | 405 | struct device_attribute *attr, |
406 | const char *buf, | 406 | const char *buf, |
407 | size_t count) | 407 | size_t count) |
408 | { | 408 | { |
@@ -424,13 +424,13 @@ static ssize_t store_frontswap_selfshrinking(struct sys_device *dev, | |||
424 | return count; | 424 | return count; |
425 | } | 425 | } |
426 | 426 | ||
427 | static SYSDEV_ATTR(frontswap_selfshrinking, S_IRUGO | S_IWUSR, | 427 | static DEVICE_ATTR(frontswap_selfshrinking, S_IRUGO | S_IWUSR, |
428 | show_frontswap_selfshrinking, store_frontswap_selfshrinking); | 428 | show_frontswap_selfshrinking, store_frontswap_selfshrinking); |
429 | 429 | ||
430 | SELFBALLOON_SHOW(frontswap_inertia, "%d\n", frontswap_inertia); | 430 | SELFBALLOON_SHOW(frontswap_inertia, "%d\n", frontswap_inertia); |
431 | 431 | ||
432 | static ssize_t store_frontswap_inertia(struct sys_device *dev, | 432 | static ssize_t store_frontswap_inertia(struct device *dev, |
433 | struct sysdev_attribute *attr, | 433 | struct device_attribute *attr, |
434 | const char *buf, | 434 | const char *buf, |
435 | size_t count) | 435 | size_t count) |
436 | { | 436 | { |
@@ -447,13 +447,13 @@ static ssize_t store_frontswap_inertia(struct sys_device *dev, | |||
447 | return count; | 447 | return count; |
448 | } | 448 | } |
449 | 449 | ||
450 | static SYSDEV_ATTR(frontswap_inertia, S_IRUGO | S_IWUSR, | 450 | static DEVICE_ATTR(frontswap_inertia, S_IRUGO | S_IWUSR, |
451 | show_frontswap_inertia, store_frontswap_inertia); | 451 | show_frontswap_inertia, store_frontswap_inertia); |
452 | 452 | ||
453 | SELFBALLOON_SHOW(frontswap_hysteresis, "%d\n", frontswap_hysteresis); | 453 | SELFBALLOON_SHOW(frontswap_hysteresis, "%d\n", frontswap_hysteresis); |
454 | 454 | ||
455 | static ssize_t store_frontswap_hysteresis(struct sys_device *dev, | 455 | static ssize_t store_frontswap_hysteresis(struct device *dev, |
456 | struct sysdev_attribute *attr, | 456 | struct device_attribute *attr, |
457 | const char *buf, | 457 | const char *buf, |
458 | size_t count) | 458 | size_t count) |
459 | { | 459 | { |
@@ -469,21 +469,21 @@ static ssize_t store_frontswap_hysteresis(struct sys_device *dev, | |||
469 | return count; | 469 | return count; |
470 | } | 470 | } |
471 | 471 | ||
472 | static SYSDEV_ATTR(frontswap_hysteresis, S_IRUGO | S_IWUSR, | 472 | static DEVICE_ATTR(frontswap_hysteresis, S_IRUGO | S_IWUSR, |
473 | show_frontswap_hysteresis, store_frontswap_hysteresis); | 473 | show_frontswap_hysteresis, store_frontswap_hysteresis); |
474 | 474 | ||
475 | #endif /* CONFIG_FRONTSWAP */ | 475 | #endif /* CONFIG_FRONTSWAP */ |
476 | 476 | ||
477 | static struct attribute *selfballoon_attrs[] = { | 477 | static struct attribute *selfballoon_attrs[] = { |
478 | &attr_selfballooning.attr, | 478 | &dev_attr_selfballooning.attr, |
479 | &attr_selfballoon_interval.attr, | 479 | &dev_attr_selfballoon_interval.attr, |
480 | &attr_selfballoon_downhysteresis.attr, | 480 | &dev_attr_selfballoon_downhysteresis.attr, |
481 | &attr_selfballoon_uphysteresis.attr, | 481 | &dev_attr_selfballoon_uphysteresis.attr, |
482 | &attr_selfballoon_min_usable_mb.attr, | 482 | &dev_attr_selfballoon_min_usable_mb.attr, |
483 | #ifdef CONFIG_FRONTSWAP | 483 | #ifdef CONFIG_FRONTSWAP |
484 | &attr_frontswap_selfshrinking.attr, | 484 | &dev_attr_frontswap_selfshrinking.attr, |
485 | &attr_frontswap_hysteresis.attr, | 485 | &dev_attr_frontswap_hysteresis.attr, |
486 | &attr_frontswap_inertia.attr, | 486 | &dev_attr_frontswap_inertia.attr, |
487 | #endif | 487 | #endif |
488 | NULL | 488 | NULL |
489 | }; | 489 | }; |
@@ -494,12 +494,12 @@ static struct attribute_group selfballoon_group = { | |||
494 | }; | 494 | }; |
495 | #endif | 495 | #endif |
496 | 496 | ||
497 | int register_xen_selfballooning(struct sys_device *sysdev) | 497 | int register_xen_selfballooning(struct device *dev) |
498 | { | 498 | { |
499 | int error = -1; | 499 | int error = -1; |
500 | 500 | ||
501 | #ifdef CONFIG_SYSFS | 501 | #ifdef CONFIG_SYSFS |
502 | error = sysfs_create_group(&sysdev->kobj, &selfballoon_group); | 502 | error = sysfs_create_group(&dev->kobj, &selfballoon_group); |
503 | #endif | 503 | #endif |
504 | return error; | 504 | return error; |
505 | } | 505 | } |
diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c index 90f76575c056..ea62afa4fd57 100644 --- a/fs/debugfs/file.c +++ b/fs/debugfs/file.c | |||
@@ -15,9 +15,11 @@ | |||
15 | 15 | ||
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | #include <linux/fs.h> | 17 | #include <linux/fs.h> |
18 | #include <linux/seq_file.h> | ||
18 | #include <linux/pagemap.h> | 19 | #include <linux/pagemap.h> |
19 | #include <linux/namei.h> | 20 | #include <linux/namei.h> |
20 | #include <linux/debugfs.h> | 21 | #include <linux/debugfs.h> |
22 | #include <linux/io.h> | ||
21 | 23 | ||
22 | static ssize_t default_read_file(struct file *file, char __user *buf, | 24 | static ssize_t default_read_file(struct file *file, char __user *buf, |
23 | size_t count, loff_t *ppos) | 25 | size_t count, loff_t *ppos) |
@@ -525,3 +527,96 @@ struct dentry *debugfs_create_blob(const char *name, mode_t mode, | |||
525 | return debugfs_create_file(name, mode, parent, blob, &fops_blob); | 527 | return debugfs_create_file(name, mode, parent, blob, &fops_blob); |
526 | } | 528 | } |
527 | EXPORT_SYMBOL_GPL(debugfs_create_blob); | 529 | EXPORT_SYMBOL_GPL(debugfs_create_blob); |
530 | |||
531 | #ifdef CONFIG_HAS_IOMEM | ||
532 | |||
533 | /* | ||
534 | * The regset32 stuff is used to print 32-bit registers using the | ||
535 | * seq_file utilities. We offer printing a register set in an already-opened | ||
536 | * sequential file or create a debugfs file that only prints a regset32. | ||
537 | */ | ||
538 | |||
539 | /** | ||
540 | * debugfs_print_regs32 - use seq_print to describe a set of registers | ||
541 | * @s: the seq_file structure being used to generate output | ||
542 | * @regs: an array if struct debugfs_reg32 structures | ||
543 | * @mregs: the length of the above array | ||
544 | * @base: the base address to be used in reading the registers | ||
545 | * @prefix: a string to be prefixed to every output line | ||
546 | * | ||
547 | * This function outputs a text block describing the current values of | ||
548 | * some 32-bit hardware registers. It is meant to be used within debugfs | ||
549 | * files based on seq_file that need to show registers, intermixed with other | ||
550 | * information. The prefix argument may be used to specify a leading string, | ||
551 | * because some peripherals have several blocks of identical registers, | ||
552 | * for example configuration of dma channels | ||
553 | */ | ||
554 | int debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs, | ||
555 | int nregs, void __iomem *base, char *prefix) | ||
556 | { | ||
557 | int i, ret = 0; | ||
558 | |||
559 | for (i = 0; i < nregs; i++, regs++) { | ||
560 | if (prefix) | ||
561 | ret += seq_printf(s, "%s", prefix); | ||
562 | ret += seq_printf(s, "%s = 0x%08x\n", regs->name, | ||
563 | readl(base + regs->offset)); | ||
564 | } | ||
565 | return ret; | ||
566 | } | ||
567 | EXPORT_SYMBOL_GPL(debugfs_print_regs32); | ||
568 | |||
569 | static int debugfs_show_regset32(struct seq_file *s, void *data) | ||
570 | { | ||
571 | struct debugfs_regset32 *regset = s->private; | ||
572 | |||
573 | debugfs_print_regs32(s, regset->regs, regset->nregs, regset->base, ""); | ||
574 | return 0; | ||
575 | } | ||
576 | |||
577 | static int debugfs_open_regset32(struct inode *inode, struct file *file) | ||
578 | { | ||
579 | return single_open(file, debugfs_show_regset32, inode->i_private); | ||
580 | } | ||
581 | |||
582 | static const struct file_operations fops_regset32 = { | ||
583 | .open = debugfs_open_regset32, | ||
584 | .read = seq_read, | ||
585 | .llseek = seq_lseek, | ||
586 | .release = single_release, | ||
587 | }; | ||
588 | |||
589 | /** | ||
590 | * debugfs_create_regset32 - create a debugfs file that returns register values | ||
591 | * @name: a pointer to a string containing the name of the file to create. | ||
592 | * @mode: the permission that the file should have | ||
593 | * @parent: a pointer to the parent dentry for this file. This should be a | ||
594 | * directory dentry if set. If this parameter is %NULL, then the | ||
595 | * file will be created in the root of the debugfs filesystem. | ||
596 | * @regset: a pointer to a struct debugfs_regset32, which contains a pointer | ||
597 | * to an array of register definitions, the array size and the base | ||
598 | * address where the register bank is to be found. | ||
599 | * | ||
600 | * This function creates a file in debugfs with the given name that reports | ||
601 | * the names and values of a set of 32-bit registers. If the @mode variable | ||
602 | * is so set it can be read from. Writing is not supported. | ||
603 | * | ||
604 | * This function will return a pointer to a dentry if it succeeds. This | ||
605 | * pointer must be passed to the debugfs_remove() function when the file is | ||
606 | * to be removed (no automatic cleanup happens if your module is unloaded, | ||
607 | * you are responsible here.) If an error occurs, %NULL will be returned. | ||
608 | * | ||
609 | * If debugfs is not enabled in the kernel, the value -%ENODEV will be | ||
610 | * returned. It is not wise to check for this value, but rather, check for | ||
611 | * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling | ||
612 | * code. | ||
613 | */ | ||
614 | struct dentry *debugfs_create_regset32(const char *name, mode_t mode, | ||
615 | struct dentry *parent, | ||
616 | struct debugfs_regset32 *regset) | ||
617 | { | ||
618 | return debugfs_create_file(name, mode, parent, regset, &fops_regset32); | ||
619 | } | ||
620 | EXPORT_SYMBOL_GPL(debugfs_create_regset32); | ||
621 | |||
622 | #endif /* CONFIG_HAS_IOMEM */ | ||
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 305c263021e7..1f6587590a1a 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -14,7 +14,7 @@ | |||
14 | #ifndef _LINUX_CPU_H_ | 14 | #ifndef _LINUX_CPU_H_ |
15 | #define _LINUX_CPU_H_ | 15 | #define _LINUX_CPU_H_ |
16 | 16 | ||
17 | #include <linux/sysdev.h> | 17 | #include <linux/device.h> |
18 | #include <linux/node.h> | 18 | #include <linux/node.h> |
19 | #include <linux/compiler.h> | 19 | #include <linux/compiler.h> |
20 | #include <linux/cpumask.h> | 20 | #include <linux/cpumask.h> |
@@ -22,20 +22,20 @@ | |||
22 | struct cpu { | 22 | struct cpu { |
23 | int node_id; /* The node which contains the CPU */ | 23 | int node_id; /* The node which contains the CPU */ |
24 | int hotpluggable; /* creates sysfs control file if hotpluggable */ | 24 | int hotpluggable; /* creates sysfs control file if hotpluggable */ |
25 | struct sys_device sysdev; | 25 | struct device dev; |
26 | }; | 26 | }; |
27 | 27 | ||
28 | extern int register_cpu(struct cpu *cpu, int num); | 28 | extern int register_cpu(struct cpu *cpu, int num); |
29 | extern struct sys_device *get_cpu_sysdev(unsigned cpu); | 29 | extern struct device *get_cpu_device(unsigned cpu); |
30 | extern bool cpu_is_hotpluggable(unsigned cpu); | 30 | extern bool cpu_is_hotpluggable(unsigned cpu); |
31 | 31 | ||
32 | extern int cpu_add_sysdev_attr(struct sysdev_attribute *attr); | 32 | extern int cpu_add_dev_attr(struct device_attribute *attr); |
33 | extern void cpu_remove_sysdev_attr(struct sysdev_attribute *attr); | 33 | extern void cpu_remove_dev_attr(struct device_attribute *attr); |
34 | 34 | ||
35 | extern int cpu_add_sysdev_attr_group(struct attribute_group *attrs); | 35 | extern int cpu_add_dev_attr_group(struct attribute_group *attrs); |
36 | extern void cpu_remove_sysdev_attr_group(struct attribute_group *attrs); | 36 | extern void cpu_remove_dev_attr_group(struct attribute_group *attrs); |
37 | 37 | ||
38 | extern int sched_create_sysfs_power_savings_entries(struct sysdev_class *cls); | 38 | extern int sched_create_sysfs_power_savings_entries(struct device *dev); |
39 | 39 | ||
40 | #ifdef CONFIG_HOTPLUG_CPU | 40 | #ifdef CONFIG_HOTPLUG_CPU |
41 | extern void unregister_cpu(struct cpu *cpu); | 41 | extern void unregister_cpu(struct cpu *cpu); |
@@ -161,7 +161,7 @@ static inline void cpu_maps_update_done(void) | |||
161 | } | 161 | } |
162 | 162 | ||
163 | #endif /* CONFIG_SMP */ | 163 | #endif /* CONFIG_SMP */ |
164 | extern struct sysdev_class cpu_sysdev_class; | 164 | extern struct bus_type cpu_subsys; |
165 | 165 | ||
166 | #ifdef CONFIG_HOTPLUG_CPU | 166 | #ifdef CONFIG_HOTPLUG_CPU |
167 | /* Stop CPUs going up and down. */ | 167 | /* Stop CPUs going up and down. */ |
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index e7d9b20ddc5b..e8c3abc60811 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #define _DEBUGFS_H_ | 16 | #define _DEBUGFS_H_ |
17 | 17 | ||
18 | #include <linux/fs.h> | 18 | #include <linux/fs.h> |
19 | #include <linux/seq_file.h> | ||
19 | 20 | ||
20 | #include <linux/types.h> | 21 | #include <linux/types.h> |
21 | 22 | ||
@@ -26,6 +27,17 @@ struct debugfs_blob_wrapper { | |||
26 | unsigned long size; | 27 | unsigned long size; |
27 | }; | 28 | }; |
28 | 29 | ||
30 | struct debugfs_reg32 { | ||
31 | char *name; | ||
32 | unsigned long offset; | ||
33 | }; | ||
34 | |||
35 | struct debugfs_regset32 { | ||
36 | struct debugfs_reg32 *regs; | ||
37 | int nregs; | ||
38 | void __iomem *base; | ||
39 | }; | ||
40 | |||
29 | extern struct dentry *arch_debugfs_dir; | 41 | extern struct dentry *arch_debugfs_dir; |
30 | 42 | ||
31 | #if defined(CONFIG_DEBUG_FS) | 43 | #if defined(CONFIG_DEBUG_FS) |
@@ -74,6 +86,13 @@ struct dentry *debugfs_create_blob(const char *name, mode_t mode, | |||
74 | struct dentry *parent, | 86 | struct dentry *parent, |
75 | struct debugfs_blob_wrapper *blob); | 87 | struct debugfs_blob_wrapper *blob); |
76 | 88 | ||
89 | struct dentry *debugfs_create_regset32(const char *name, mode_t mode, | ||
90 | struct dentry *parent, | ||
91 | struct debugfs_regset32 *regset); | ||
92 | |||
93 | int debugfs_print_regs32(struct seq_file *s, const struct debugfs_reg32 *regs, | ||
94 | int nregs, void __iomem *base, char *prefix); | ||
95 | |||
77 | bool debugfs_initialized(void); | 96 | bool debugfs_initialized(void); |
78 | 97 | ||
79 | #else | 98 | #else |
@@ -188,6 +207,13 @@ static inline struct dentry *debugfs_create_blob(const char *name, mode_t mode, | |||
188 | return ERR_PTR(-ENODEV); | 207 | return ERR_PTR(-ENODEV); |
189 | } | 208 | } |
190 | 209 | ||
210 | static inline struct dentry *debugfs_create_regset32(const char *name, | ||
211 | mode_t mode, struct dentry *parent, | ||
212 | struct debugfs_regset32 *regset) | ||
213 | { | ||
214 | return ERR_PTR(-ENODEV); | ||
215 | } | ||
216 | |||
191 | static inline bool debugfs_initialized(void) | 217 | static inline bool debugfs_initialized(void) |
192 | { | 218 | { |
193 | return false; | 219 | return false; |
diff --git a/include/linux/device.h b/include/linux/device.h index 3136ede5a1e1..96acef8dd916 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -53,6 +53,8 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *); | |||
53 | * struct bus_type - The bus type of the device | 53 | * struct bus_type - The bus type of the device |
54 | * | 54 | * |
55 | * @name: The name of the bus. | 55 | * @name: The name of the bus. |
56 | * @dev_name: Used for subsystems to enumerate devices like ("foo%u", dev->id). | ||
57 | * @dev_root: Default device to use as the parent. | ||
56 | * @bus_attrs: Default attributes of the bus. | 58 | * @bus_attrs: Default attributes of the bus. |
57 | * @dev_attrs: Default attributes of the devices on the bus. | 59 | * @dev_attrs: Default attributes of the devices on the bus. |
58 | * @drv_attrs: Default attributes of the device drivers on the bus. | 60 | * @drv_attrs: Default attributes of the device drivers on the bus. |
@@ -86,6 +88,8 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *); | |||
86 | */ | 88 | */ |
87 | struct bus_type { | 89 | struct bus_type { |
88 | const char *name; | 90 | const char *name; |
91 | const char *dev_name; | ||
92 | struct device *dev_root; | ||
89 | struct bus_attribute *bus_attrs; | 93 | struct bus_attribute *bus_attrs; |
90 | struct device_attribute *dev_attrs; | 94 | struct device_attribute *dev_attrs; |
91 | struct driver_attribute *drv_attrs; | 95 | struct driver_attribute *drv_attrs; |
@@ -106,12 +110,30 @@ struct bus_type { | |||
106 | struct subsys_private *p; | 110 | struct subsys_private *p; |
107 | }; | 111 | }; |
108 | 112 | ||
109 | extern int __must_check bus_register(struct bus_type *bus); | 113 | /* This is a #define to keep the compiler from merging different |
114 | * instances of the __key variable */ | ||
115 | #define bus_register(subsys) \ | ||
116 | ({ \ | ||
117 | static struct lock_class_key __key; \ | ||
118 | __bus_register(subsys, &__key); \ | ||
119 | }) | ||
120 | extern int __must_check __bus_register(struct bus_type *bus, | ||
121 | struct lock_class_key *key); | ||
110 | extern void bus_unregister(struct bus_type *bus); | 122 | extern void bus_unregister(struct bus_type *bus); |
111 | 123 | ||
112 | extern int __must_check bus_rescan_devices(struct bus_type *bus); | 124 | extern int __must_check bus_rescan_devices(struct bus_type *bus); |
113 | 125 | ||
114 | /* iterator helpers for buses */ | 126 | /* iterator helpers for buses */ |
127 | struct subsys_dev_iter { | ||
128 | struct klist_iter ki; | ||
129 | const struct device_type *type; | ||
130 | }; | ||
131 | void subsys_dev_iter_init(struct subsys_dev_iter *iter, | ||
132 | struct bus_type *subsys, | ||
133 | struct device *start, | ||
134 | const struct device_type *type); | ||
135 | struct device *subsys_dev_iter_next(struct subsys_dev_iter *iter); | ||
136 | void subsys_dev_iter_exit(struct subsys_dev_iter *iter); | ||
115 | 137 | ||
116 | int bus_for_each_dev(struct bus_type *bus, struct device *start, void *data, | 138 | int bus_for_each_dev(struct bus_type *bus, struct device *start, void *data, |
117 | int (*fn)(struct device *dev, void *data)); | 139 | int (*fn)(struct device *dev, void *data)); |
@@ -121,10 +143,10 @@ struct device *bus_find_device(struct bus_type *bus, struct device *start, | |||
121 | struct device *bus_find_device_by_name(struct bus_type *bus, | 143 | struct device *bus_find_device_by_name(struct bus_type *bus, |
122 | struct device *start, | 144 | struct device *start, |
123 | const char *name); | 145 | const char *name); |
124 | 146 | struct device *subsys_find_device_by_id(struct bus_type *bus, unsigned int id, | |
147 | struct device *hint); | ||
125 | int bus_for_each_drv(struct bus_type *bus, struct device_driver *start, | 148 | int bus_for_each_drv(struct bus_type *bus, struct device_driver *start, |
126 | void *data, int (*fn)(struct device_driver *, void *)); | 149 | void *data, int (*fn)(struct device_driver *, void *)); |
127 | |||
128 | void bus_sort_breadthfirst(struct bus_type *bus, | 150 | void bus_sort_breadthfirst(struct bus_type *bus, |
129 | int (*compare)(const struct device *a, | 151 | int (*compare)(const struct device *a, |
130 | const struct device *b)); | 152 | const struct device *b)); |
@@ -256,6 +278,33 @@ struct device *driver_find_device(struct device_driver *drv, | |||
256 | int (*match)(struct device *dev, void *data)); | 278 | int (*match)(struct device *dev, void *data)); |
257 | 279 | ||
258 | /** | 280 | /** |
281 | * struct subsys_interface - interfaces to device functions | ||
282 | * @name name of the device function | ||
283 | * @subsystem subsytem of the devices to attach to | ||
284 | * @node the list of functions registered at the subsystem | ||
285 | * @add device hookup to device function handler | ||
286 | * @remove device hookup to device function handler | ||
287 | * | ||
288 | * Simple interfaces attached to a subsystem. Multiple interfaces can | ||
289 | * attach to a subsystem and its devices. Unlike drivers, they do not | ||
290 | * exclusively claim or control devices. Interfaces usually represent | ||
291 | * a specific functionality of a subsystem/class of devices. | ||
292 | */ | ||
293 | struct subsys_interface { | ||
294 | const char *name; | ||
295 | struct bus_type *subsys; | ||
296 | struct list_head node; | ||
297 | int (*add_dev)(struct device *dev, struct subsys_interface *sif); | ||
298 | int (*remove_dev)(struct device *dev, struct subsys_interface *sif); | ||
299 | }; | ||
300 | |||
301 | int subsys_interface_register(struct subsys_interface *sif); | ||
302 | void subsys_interface_unregister(struct subsys_interface *sif); | ||
303 | |||
304 | int subsys_system_register(struct bus_type *subsys, | ||
305 | const struct attribute_group **groups); | ||
306 | |||
307 | /** | ||
259 | * struct class - device classes | 308 | * struct class - device classes |
260 | * @name: Name of the class. | 309 | * @name: Name of the class. |
261 | * @owner: The module owner. | 310 | * @owner: The module owner. |
@@ -438,11 +487,31 @@ struct device_attribute { | |||
438 | const char *buf, size_t count); | 487 | const char *buf, size_t count); |
439 | }; | 488 | }; |
440 | 489 | ||
441 | #define DEVICE_ATTR(_name, _mode, _show, _store) \ | 490 | struct dev_ext_attribute { |
442 | struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store) | 491 | struct device_attribute attr; |
492 | void *var; | ||
493 | }; | ||
494 | |||
495 | ssize_t device_show_ulong(struct device *dev, struct device_attribute *attr, | ||
496 | char *buf); | ||
497 | ssize_t device_store_ulong(struct device *dev, struct device_attribute *attr, | ||
498 | const char *buf, size_t count); | ||
499 | ssize_t device_show_int(struct device *dev, struct device_attribute *attr, | ||
500 | char *buf); | ||
501 | ssize_t device_store_int(struct device *dev, struct device_attribute *attr, | ||
502 | const char *buf, size_t count); | ||
443 | 503 | ||
444 | extern int __must_check device_create_file(struct device *device, | 504 | #define DEVICE_ATTR(_name, _mode, _show, _store) \ |
445 | const struct device_attribute *entry); | 505 | struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store) |
506 | #define DEVICE_ULONG_ATTR(_name, _mode, _var) \ | ||
507 | struct dev_ext_attribute dev_attr_##_name = \ | ||
508 | { __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) } | ||
509 | #define DEVICE_INT_ATTR(_name, _mode, _var) \ | ||
510 | struct dev_ext_attribute dev_attr_##_name = \ | ||
511 | { __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) } | ||
512 | |||
513 | extern int device_create_file(struct device *device, | ||
514 | const struct device_attribute *entry); | ||
446 | extern void device_remove_file(struct device *dev, | 515 | extern void device_remove_file(struct device *dev, |
447 | const struct device_attribute *attr); | 516 | const struct device_attribute *attr); |
448 | extern int __must_check device_create_bin_file(struct device *dev, | 517 | extern int __must_check device_create_bin_file(struct device *dev, |
@@ -490,6 +559,9 @@ extern int devres_release_group(struct device *dev, void *id); | |||
490 | extern void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp); | 559 | extern void *devm_kzalloc(struct device *dev, size_t size, gfp_t gfp); |
491 | extern void devm_kfree(struct device *dev, void *p); | 560 | extern void devm_kfree(struct device *dev, void *p); |
492 | 561 | ||
562 | void __iomem *devm_request_and_ioremap(struct device *dev, | ||
563 | struct resource *res); | ||
564 | |||
493 | struct device_dma_parameters { | 565 | struct device_dma_parameters { |
494 | /* | 566 | /* |
495 | * a low level driver may set these to teach IOMMU code about | 567 | * a low level driver may set these to teach IOMMU code about |
@@ -600,6 +672,7 @@ struct device { | |||
600 | struct device_node *of_node; /* associated device tree node */ | 672 | struct device_node *of_node; /* associated device tree node */ |
601 | 673 | ||
602 | dev_t devt; /* dev_t, creates the sysfs "dev" */ | 674 | dev_t devt; /* dev_t, creates the sysfs "dev" */ |
675 | u32 id; /* device instance */ | ||
603 | 676 | ||
604 | spinlock_t devres_lock; | 677 | spinlock_t devres_lock; |
605 | struct list_head devres_head; | 678 | struct list_head devres_head; |
@@ -924,4 +997,25 @@ extern long sysfs_deprecated; | |||
924 | #define sysfs_deprecated 0 | 997 | #define sysfs_deprecated 0 |
925 | #endif | 998 | #endif |
926 | 999 | ||
1000 | /** | ||
1001 | * module_driver() - Helper macro for drivers that don't do anything | ||
1002 | * special in module init/exit. This eliminates a lot of boilerplate. | ||
1003 | * Each module may only use this macro once, and calling it replaces | ||
1004 | * module_init() and module_exit(). | ||
1005 | * | ||
1006 | * Use this macro to construct bus specific macros for registering | ||
1007 | * drivers, and do not use it on its own. | ||
1008 | */ | ||
1009 | #define module_driver(__driver, __register, __unregister) \ | ||
1010 | static int __init __driver##_init(void) \ | ||
1011 | { \ | ||
1012 | return __register(&(__driver)); \ | ||
1013 | } \ | ||
1014 | module_init(__driver##_init); \ | ||
1015 | static void __exit __driver##_exit(void) \ | ||
1016 | { \ | ||
1017 | __unregister(&(__driver)); \ | ||
1018 | } \ | ||
1019 | module_exit(__driver##_exit); | ||
1020 | |||
927 | #endif /* _DEVICE_H_ */ | 1021 | #endif /* _DEVICE_H_ */ |
diff --git a/include/linux/edac.h b/include/linux/edac.h index 055b248bdd53..1cd3947987e5 100644 --- a/include/linux/edac.h +++ b/include/linux/edac.h | |||
@@ -13,7 +13,7 @@ | |||
13 | #define _LINUX_EDAC_H_ | 13 | #define _LINUX_EDAC_H_ |
14 | 14 | ||
15 | #include <linux/atomic.h> | 15 | #include <linux/atomic.h> |
16 | #include <linux/sysdev.h> | 16 | #include <linux/device.h> |
17 | 17 | ||
18 | #define EDAC_OPSTATE_INVAL -1 | 18 | #define EDAC_OPSTATE_INVAL -1 |
19 | #define EDAC_OPSTATE_POLL 0 | 19 | #define EDAC_OPSTATE_POLL 0 |
@@ -23,12 +23,12 @@ | |||
23 | extern int edac_op_state; | 23 | extern int edac_op_state; |
24 | extern int edac_err_assert; | 24 | extern int edac_err_assert; |
25 | extern atomic_t edac_handlers; | 25 | extern atomic_t edac_handlers; |
26 | extern struct sysdev_class edac_class; | 26 | extern struct bus_type edac_subsys; |
27 | 27 | ||
28 | extern int edac_handler_set(void); | 28 | extern int edac_handler_set(void); |
29 | extern void edac_atomic_assert_error(void); | 29 | extern void edac_atomic_assert_error(void); |
30 | extern struct sysdev_class *edac_get_sysfs_class(void); | 30 | extern struct bus_type *edac_get_sysfs_subsys(void); |
31 | extern void edac_put_sysfs_class(void); | 31 | extern void edac_put_sysfs_subsys(void); |
32 | 32 | ||
33 | static inline void opstate_init(void) | 33 | static inline void opstate_init(void) |
34 | { | 34 | { |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 07d103a06d64..8e25a9167f13 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -482,6 +482,19 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap) | |||
482 | { | 482 | { |
483 | return adap->nr; | 483 | return adap->nr; |
484 | } | 484 | } |
485 | |||
486 | /** | ||
487 | * module_i2c_driver() - Helper macro for registering a I2C driver | ||
488 | * @__i2c_driver: i2c_driver struct | ||
489 | * | ||
490 | * Helper macro for I2C drivers which do not do anything special in module | ||
491 | * init/exit. This eliminates a lot of boilerplate. Each module may only | ||
492 | * use this macro once, and calling it replaces module_init() and module_exit() | ||
493 | */ | ||
494 | #define module_i2c_driver(__i2c_driver) \ | ||
495 | module_driver(__i2c_driver, i2c_add_driver, \ | ||
496 | i2c_del_driver) | ||
497 | |||
485 | #endif /* I2C */ | 498 | #endif /* I2C */ |
486 | #endif /* __KERNEL__ */ | 499 | #endif /* __KERNEL__ */ |
487 | 500 | ||
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index ad81e1c51487..fc615a97e2d3 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -191,8 +191,6 @@ static inline struct kobj_type *get_ktype(struct kobject *kobj) | |||
191 | } | 191 | } |
192 | 192 | ||
193 | extern struct kobject *kset_find_obj(struct kset *, const char *); | 193 | extern struct kobject *kset_find_obj(struct kset *, const char *); |
194 | extern struct kobject *kset_find_obj_hinted(struct kset *, const char *, | ||
195 | struct kobject *); | ||
196 | 194 | ||
197 | /* The global /sys/kernel/ kobject for people to chain off of */ | 195 | /* The global /sys/kernel/ kobject for people to chain off of */ |
198 | extern struct kobject *kernel_kobj; | 196 | extern struct kobject *kernel_kobj; |
diff --git a/include/linux/kref.h b/include/linux/kref.h index d4a62ab2ee5e..abc0120b09b7 100644 --- a/include/linux/kref.h +++ b/include/linux/kref.h | |||
@@ -15,16 +15,81 @@ | |||
15 | #ifndef _KREF_H_ | 15 | #ifndef _KREF_H_ |
16 | #define _KREF_H_ | 16 | #define _KREF_H_ |
17 | 17 | ||
18 | #include <linux/types.h> | 18 | #include <linux/bug.h> |
19 | #include <linux/atomic.h> | ||
19 | 20 | ||
20 | struct kref { | 21 | struct kref { |
21 | atomic_t refcount; | 22 | atomic_t refcount; |
22 | }; | 23 | }; |
23 | 24 | ||
24 | void kref_init(struct kref *kref); | 25 | /** |
25 | void kref_get(struct kref *kref); | 26 | * kref_init - initialize object. |
26 | int kref_put(struct kref *kref, void (*release) (struct kref *kref)); | 27 | * @kref: object in question. |
27 | int kref_sub(struct kref *kref, unsigned int count, | 28 | */ |
28 | void (*release) (struct kref *kref)); | 29 | static inline void kref_init(struct kref *kref) |
30 | { | ||
31 | atomic_set(&kref->refcount, 1); | ||
32 | } | ||
33 | |||
34 | /** | ||
35 | * kref_get - increment refcount for object. | ||
36 | * @kref: object. | ||
37 | */ | ||
38 | static inline void kref_get(struct kref *kref) | ||
39 | { | ||
40 | WARN_ON(!atomic_read(&kref->refcount)); | ||
41 | atomic_inc(&kref->refcount); | ||
42 | } | ||
29 | 43 | ||
44 | /** | ||
45 | * kref_sub - subtract a number of refcounts for object. | ||
46 | * @kref: object. | ||
47 | * @count: Number of recounts to subtract. | ||
48 | * @release: pointer to the function that will clean up the object when the | ||
49 | * last reference to the object is released. | ||
50 | * This pointer is required, and it is not acceptable to pass kfree | ||
51 | * in as this function. If the caller does pass kfree to this | ||
52 | * function, you will be publicly mocked mercilessly by the kref | ||
53 | * maintainer, and anyone else who happens to notice it. You have | ||
54 | * been warned. | ||
55 | * | ||
56 | * Subtract @count from the refcount, and if 0, call release(). | ||
57 | * Return 1 if the object was removed, otherwise return 0. Beware, if this | ||
58 | * function returns 0, you still can not count on the kref from remaining in | ||
59 | * memory. Only use the return value if you want to see if the kref is now | ||
60 | * gone, not present. | ||
61 | */ | ||
62 | static inline int kref_sub(struct kref *kref, unsigned int count, | ||
63 | void (*release)(struct kref *kref)) | ||
64 | { | ||
65 | WARN_ON(release == NULL); | ||
66 | |||
67 | if (atomic_sub_and_test((int) count, &kref->refcount)) { | ||
68 | release(kref); | ||
69 | return 1; | ||
70 | } | ||
71 | return 0; | ||
72 | } | ||
73 | |||
74 | /** | ||
75 | * kref_put - decrement refcount for object. | ||
76 | * @kref: object. | ||
77 | * @release: pointer to the function that will clean up the object when the | ||
78 | * last reference to the object is released. | ||
79 | * This pointer is required, and it is not acceptable to pass kfree | ||
80 | * in as this function. If the caller does pass kfree to this | ||
81 | * function, you will be publicly mocked mercilessly by the kref | ||
82 | * maintainer, and anyone else who happens to notice it. You have | ||
83 | * been warned. | ||
84 | * | ||
85 | * Decrement the refcount, and if 0, call release(). | ||
86 | * Return 1 if the object was removed, otherwise return 0. Beware, if this | ||
87 | * function returns 0, you still can not count on the kref from remaining in | ||
88 | * memory. Only use the return value if you want to see if the kref is now | ||
89 | * gone, not present. | ||
90 | */ | ||
91 | static inline int kref_put(struct kref *kref, void (*release)(struct kref *kref)) | ||
92 | { | ||
93 | return kref_sub(kref, 1, release); | ||
94 | } | ||
30 | #endif /* _KREF_H_ */ | 95 | #endif /* _KREF_H_ */ |
diff --git a/include/linux/memory.h b/include/linux/memory.h index 935699b30b7c..1ac7f6e405f9 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h | |||
@@ -15,7 +15,6 @@ | |||
15 | #ifndef _LINUX_MEMORY_H_ | 15 | #ifndef _LINUX_MEMORY_H_ |
16 | #define _LINUX_MEMORY_H_ | 16 | #define _LINUX_MEMORY_H_ |
17 | 17 | ||
18 | #include <linux/sysdev.h> | ||
19 | #include <linux/node.h> | 18 | #include <linux/node.h> |
20 | #include <linux/compiler.h> | 19 | #include <linux/compiler.h> |
21 | #include <linux/mutex.h> | 20 | #include <linux/mutex.h> |
@@ -38,7 +37,7 @@ struct memory_block { | |||
38 | int phys_device; /* to which fru does this belong? */ | 37 | int phys_device; /* to which fru does this belong? */ |
39 | void *hw; /* optional pointer to fw/hw data */ | 38 | void *hw; /* optional pointer to fw/hw data */ |
40 | int (*phys_callback)(struct memory_block *); | 39 | int (*phys_callback)(struct memory_block *); |
41 | struct sys_device sysdev; | 40 | struct device dev; |
42 | }; | 41 | }; |
43 | 42 | ||
44 | int arch_get_memory_phys_device(unsigned long start_pfn); | 43 | int arch_get_memory_phys_device(unsigned long start_pfn); |
diff --git a/include/linux/node.h b/include/linux/node.h index 92370e22343c..624e53cecc02 100644 --- a/include/linux/node.h +++ b/include/linux/node.h | |||
@@ -14,12 +14,12 @@ | |||
14 | #ifndef _LINUX_NODE_H_ | 14 | #ifndef _LINUX_NODE_H_ |
15 | #define _LINUX_NODE_H_ | 15 | #define _LINUX_NODE_H_ |
16 | 16 | ||
17 | #include <linux/sysdev.h> | 17 | #include <linux/device.h> |
18 | #include <linux/cpumask.h> | 18 | #include <linux/cpumask.h> |
19 | #include <linux/workqueue.h> | 19 | #include <linux/workqueue.h> |
20 | 20 | ||
21 | struct node { | 21 | struct node { |
22 | struct sys_device sysdev; | 22 | struct device dev; |
23 | 23 | ||
24 | #if defined(CONFIG_MEMORY_HOTPLUG_SPARSE) && defined(CONFIG_HUGETLBFS) | 24 | #if defined(CONFIG_MEMORY_HOTPLUG_SPARSE) && defined(CONFIG_HUGETLBFS) |
25 | struct work_struct node_work; | 25 | struct work_struct node_work; |
@@ -80,6 +80,6 @@ static inline void register_hugetlbfs_with_node(node_registration_func_t reg, | |||
80 | } | 80 | } |
81 | #endif | 81 | #endif |
82 | 82 | ||
83 | #define to_node(sys_device) container_of(sys_device, struct node, sysdev) | 83 | #define to_node(device) container_of(device, struct node, dev) |
84 | 84 | ||
85 | #endif /* _LINUX_NODE_H_ */ | 85 | #endif /* _LINUX_NODE_H_ */ |
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 2a23f7d1a825..5622fa24e97b 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
@@ -63,7 +63,7 @@ struct platform_device_info { | |||
63 | u64 dma_mask; | 63 | u64 dma_mask; |
64 | }; | 64 | }; |
65 | extern struct platform_device *platform_device_register_full( | 65 | extern struct platform_device *platform_device_register_full( |
66 | struct platform_device_info *pdevinfo); | 66 | const struct platform_device_info *pdevinfo); |
67 | 67 | ||
68 | /** | 68 | /** |
69 | * platform_device_register_resndata - add a platform-level device with | 69 | * platform_device_register_resndata - add a platform-level device with |
@@ -196,16 +196,8 @@ static inline void platform_set_drvdata(struct platform_device *pdev, void *data | |||
196 | * calling it replaces module_init() and module_exit() | 196 | * calling it replaces module_init() and module_exit() |
197 | */ | 197 | */ |
198 | #define module_platform_driver(__platform_driver) \ | 198 | #define module_platform_driver(__platform_driver) \ |
199 | static int __init __platform_driver##_init(void) \ | 199 | module_driver(__platform_driver, platform_driver_register, \ |
200 | { \ | 200 | platform_driver_unregister) |
201 | return platform_driver_register(&(__platform_driver)); \ | ||
202 | } \ | ||
203 | module_init(__platform_driver##_init); \ | ||
204 | static void __exit __platform_driver##_exit(void) \ | ||
205 | { \ | ||
206 | platform_driver_unregister(&(__platform_driver)); \ | ||
207 | } \ | ||
208 | module_exit(__platform_driver##_exit); | ||
209 | 201 | ||
210 | extern struct platform_device *platform_create_bundle(struct platform_driver *driver, | 202 | extern struct platform_device *platform_create_bundle(struct platform_driver *driver, |
211 | int (*probe)(struct platform_device *), | 203 | int (*probe)(struct platform_device *), |
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index bb4f5fbbbd8e..176fce9cc6b1 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -200,6 +200,17 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
200 | driver_unregister(&sdrv->driver); | 200 | driver_unregister(&sdrv->driver); |
201 | } | 201 | } |
202 | 202 | ||
203 | /** | ||
204 | * module_spi_driver() - Helper macro for registering a SPI driver | ||
205 | * @__spi_driver: spi_driver struct | ||
206 | * | ||
207 | * Helper macro for SPI drivers which do not do anything special in module | ||
208 | * init/exit. This eliminates a lot of boilerplate. Each module may only | ||
209 | * use this macro once, and calling it replaces module_init() and module_exit() | ||
210 | */ | ||
211 | #define module_spi_driver(__spi_driver) \ | ||
212 | module_driver(__spi_driver, spi_register_driver, \ | ||
213 | spi_unregister_driver) | ||
203 | 214 | ||
204 | /** | 215 | /** |
205 | * struct spi_master - interface to SPI master controller | 216 | * struct spi_master - interface to SPI master controller |
diff --git a/include/linux/usb.h b/include/linux/usb.h index d3d0c1374334..5d258c3180ae 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -953,6 +953,18 @@ extern int usb_register_driver(struct usb_driver *, struct module *, | |||
953 | 953 | ||
954 | extern void usb_deregister(struct usb_driver *); | 954 | extern void usb_deregister(struct usb_driver *); |
955 | 955 | ||
956 | /** | ||
957 | * module_usb_driver() - Helper macro for registering a USB driver | ||
958 | * @__usb_driver: usb_driver struct | ||
959 | * | ||
960 | * Helper macro for USB drivers which do not do anything special in module | ||
961 | * init/exit. This eliminates a lot of boilerplate. Each module may only | ||
962 | * use this macro once, and calling it replaces module_init() and module_exit() | ||
963 | */ | ||
964 | #define module_usb_driver(__usb_driver) \ | ||
965 | module_driver(__usb_driver, usb_register, \ | ||
966 | usb_deregister) | ||
967 | |||
956 | extern int usb_register_device_driver(struct usb_device_driver *, | 968 | extern int usb_register_device_driver(struct usb_device_driver *, |
957 | struct module *); | 969 | struct module *); |
958 | extern void usb_deregister_device_driver(struct usb_device_driver *); | 970 | extern void usb_deregister_device_driver(struct usb_device_driver *); |
diff --git a/include/xen/balloon.h b/include/xen/balloon.h index d29c153705bc..cc2e1a7e44ec 100644 --- a/include/xen/balloon.h +++ b/include/xen/balloon.h | |||
@@ -29,11 +29,11 @@ int alloc_xenballooned_pages(int nr_pages, struct page **pages, | |||
29 | bool highmem); | 29 | bool highmem); |
30 | void free_xenballooned_pages(int nr_pages, struct page **pages); | 30 | void free_xenballooned_pages(int nr_pages, struct page **pages); |
31 | 31 | ||
32 | struct sys_device; | 32 | struct device; |
33 | #ifdef CONFIG_XEN_SELFBALLOONING | 33 | #ifdef CONFIG_XEN_SELFBALLOONING |
34 | extern int register_xen_selfballooning(struct sys_device *sysdev); | 34 | extern int register_xen_selfballooning(struct device *dev); |
35 | #else | 35 | #else |
36 | static inline int register_xen_selfballooning(struct sys_device *sysdev) | 36 | static inline int register_xen_selfballooning(struct device *dev) |
37 | { | 37 | { |
38 | return -ENOSYS; | 38 | return -ENOSYS; |
39 | } | 39 | } |
diff --git a/kernel/rtmutex-tester.c b/kernel/rtmutex-tester.c index 3d9f31cd79e7..98ec49475460 100644 --- a/kernel/rtmutex-tester.c +++ b/kernel/rtmutex-tester.c | |||
@@ -6,11 +6,11 @@ | |||
6 | * Copyright (C) 2006, Timesys Corp., Thomas Gleixner <tglx@timesys.com> | 6 | * Copyright (C) 2006, Timesys Corp., Thomas Gleixner <tglx@timesys.com> |
7 | * | 7 | * |
8 | */ | 8 | */ |
9 | #include <linux/device.h> | ||
9 | #include <linux/kthread.h> | 10 | #include <linux/kthread.h> |
10 | #include <linux/export.h> | 11 | #include <linux/export.h> |
11 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
12 | #include <linux/spinlock.h> | 13 | #include <linux/spinlock.h> |
13 | #include <linux/sysdev.h> | ||
14 | #include <linux/timer.h> | 14 | #include <linux/timer.h> |
15 | #include <linux/freezer.h> | 15 | #include <linux/freezer.h> |
16 | 16 | ||
@@ -27,7 +27,7 @@ struct test_thread_data { | |||
27 | int opdata; | 27 | int opdata; |
28 | int mutexes[MAX_RT_TEST_MUTEXES]; | 28 | int mutexes[MAX_RT_TEST_MUTEXES]; |
29 | int event; | 29 | int event; |
30 | struct sys_device sysdev; | 30 | struct device dev; |
31 | }; | 31 | }; |
32 | 32 | ||
33 | static struct test_thread_data thread_data[MAX_RT_TEST_THREADS]; | 33 | static struct test_thread_data thread_data[MAX_RT_TEST_THREADS]; |
@@ -271,7 +271,7 @@ static int test_func(void *data) | |||
271 | * | 271 | * |
272 | * opcode:data | 272 | * opcode:data |
273 | */ | 273 | */ |
274 | static ssize_t sysfs_test_command(struct sys_device *dev, struct sysdev_attribute *attr, | 274 | static ssize_t sysfs_test_command(struct device *dev, struct device_attribute *attr, |
275 | const char *buf, size_t count) | 275 | const char *buf, size_t count) |
276 | { | 276 | { |
277 | struct sched_param schedpar; | 277 | struct sched_param schedpar; |
@@ -279,8 +279,8 @@ static ssize_t sysfs_test_command(struct sys_device *dev, struct sysdev_attribut | |||
279 | char cmdbuf[32]; | 279 | char cmdbuf[32]; |
280 | int op, dat, tid, ret; | 280 | int op, dat, tid, ret; |
281 | 281 | ||
282 | td = container_of(dev, struct test_thread_data, sysdev); | 282 | td = container_of(dev, struct test_thread_data, dev); |
283 | tid = td->sysdev.id; | 283 | tid = td->dev.id; |
284 | 284 | ||
285 | /* strings from sysfs write are not 0 terminated! */ | 285 | /* strings from sysfs write are not 0 terminated! */ |
286 | if (count >= sizeof(cmdbuf)) | 286 | if (count >= sizeof(cmdbuf)) |
@@ -334,7 +334,7 @@ static ssize_t sysfs_test_command(struct sys_device *dev, struct sysdev_attribut | |||
334 | * @dev: thread to query | 334 | * @dev: thread to query |
335 | * @buf: char buffer to be filled with thread status info | 335 | * @buf: char buffer to be filled with thread status info |
336 | */ | 336 | */ |
337 | static ssize_t sysfs_test_status(struct sys_device *dev, struct sysdev_attribute *attr, | 337 | static ssize_t sysfs_test_status(struct device *dev, struct device_attribute *attr, |
338 | char *buf) | 338 | char *buf) |
339 | { | 339 | { |
340 | struct test_thread_data *td; | 340 | struct test_thread_data *td; |
@@ -342,8 +342,8 @@ static ssize_t sysfs_test_status(struct sys_device *dev, struct sysdev_attribute | |||
342 | char *curr = buf; | 342 | char *curr = buf; |
343 | int i; | 343 | int i; |
344 | 344 | ||
345 | td = container_of(dev, struct test_thread_data, sysdev); | 345 | td = container_of(dev, struct test_thread_data, dev); |
346 | tsk = threads[td->sysdev.id]; | 346 | tsk = threads[td->dev.id]; |
347 | 347 | ||
348 | spin_lock(&rttest_lock); | 348 | spin_lock(&rttest_lock); |
349 | 349 | ||
@@ -360,28 +360,29 @@ static ssize_t sysfs_test_status(struct sys_device *dev, struct sysdev_attribute | |||
360 | spin_unlock(&rttest_lock); | 360 | spin_unlock(&rttest_lock); |
361 | 361 | ||
362 | curr += sprintf(curr, ", T: %p, R: %p\n", tsk, | 362 | curr += sprintf(curr, ", T: %p, R: %p\n", tsk, |
363 | mutexes[td->sysdev.id].owner); | 363 | mutexes[td->dev.id].owner); |
364 | 364 | ||
365 | return curr - buf; | 365 | return curr - buf; |
366 | } | 366 | } |
367 | 367 | ||
368 | static SYSDEV_ATTR(status, 0600, sysfs_test_status, NULL); | 368 | static DEVICE_ATTR(status, 0600, sysfs_test_status, NULL); |
369 | static SYSDEV_ATTR(command, 0600, NULL, sysfs_test_command); | 369 | static DEVICE_ATTR(command, 0600, NULL, sysfs_test_command); |
370 | 370 | ||
371 | static struct sysdev_class rttest_sysclass = { | 371 | static struct bus_type rttest_subsys = { |
372 | .name = "rttest", | 372 | .name = "rttest", |
373 | .dev_name = "rttest", | ||
373 | }; | 374 | }; |
374 | 375 | ||
375 | static int init_test_thread(int id) | 376 | static int init_test_thread(int id) |
376 | { | 377 | { |
377 | thread_data[id].sysdev.cls = &rttest_sysclass; | 378 | thread_data[id].dev.bus = &rttest_subsys; |
378 | thread_data[id].sysdev.id = id; | 379 | thread_data[id].dev.id = id; |
379 | 380 | ||
380 | threads[id] = kthread_run(test_func, &thread_data[id], "rt-test-%d", id); | 381 | threads[id] = kthread_run(test_func, &thread_data[id], "rt-test-%d", id); |
381 | if (IS_ERR(threads[id])) | 382 | if (IS_ERR(threads[id])) |
382 | return PTR_ERR(threads[id]); | 383 | return PTR_ERR(threads[id]); |
383 | 384 | ||
384 | return sysdev_register(&thread_data[id].sysdev); | 385 | return device_register(&thread_data[id].dev); |
385 | } | 386 | } |
386 | 387 | ||
387 | static int init_rttest(void) | 388 | static int init_rttest(void) |
@@ -393,7 +394,7 @@ static int init_rttest(void) | |||
393 | for (i = 0; i < MAX_RT_TEST_MUTEXES; i++) | 394 | for (i = 0; i < MAX_RT_TEST_MUTEXES; i++) |
394 | rt_mutex_init(&mutexes[i]); | 395 | rt_mutex_init(&mutexes[i]); |
395 | 396 | ||
396 | ret = sysdev_class_register(&rttest_sysclass); | 397 | ret = subsys_system_register(&rttest_subsys, NULL); |
397 | if (ret) | 398 | if (ret) |
398 | return ret; | 399 | return ret; |
399 | 400 | ||
@@ -401,10 +402,10 @@ static int init_rttest(void) | |||
401 | ret = init_test_thread(i); | 402 | ret = init_test_thread(i); |
402 | if (ret) | 403 | if (ret) |
403 | break; | 404 | break; |
404 | ret = sysdev_create_file(&thread_data[i].sysdev, &attr_status); | 405 | ret = device_create_file(&thread_data[i].dev, &dev_attr_status); |
405 | if (ret) | 406 | if (ret) |
406 | break; | 407 | break; |
407 | ret = sysdev_create_file(&thread_data[i].sysdev, &attr_command); | 408 | ret = device_create_file(&thread_data[i].dev, &dev_attr_command); |
408 | if (ret) | 409 | if (ret) |
409 | break; | 410 | break; |
410 | } | 411 | } |
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 4dbfd04a2148..2a4590fabcad 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -6675,54 +6675,52 @@ static ssize_t sched_power_savings_store(const char *buf, size_t count, int smt) | |||
6675 | } | 6675 | } |
6676 | 6676 | ||
6677 | #ifdef CONFIG_SCHED_MC | 6677 | #ifdef CONFIG_SCHED_MC |
6678 | static ssize_t sched_mc_power_savings_show(struct sysdev_class *class, | 6678 | static ssize_t sched_mc_power_savings_show(struct device *dev, |
6679 | struct sysdev_class_attribute *attr, | 6679 | struct device_attribute *attr, |
6680 | char *page) | 6680 | char *buf) |
6681 | { | 6681 | { |
6682 | return sprintf(page, "%u\n", sched_mc_power_savings); | 6682 | return sprintf(buf, "%u\n", sched_mc_power_savings); |
6683 | } | 6683 | } |
6684 | static ssize_t sched_mc_power_savings_store(struct sysdev_class *class, | 6684 | static ssize_t sched_mc_power_savings_store(struct device *dev, |
6685 | struct sysdev_class_attribute *attr, | 6685 | struct device_attribute *attr, |
6686 | const char *buf, size_t count) | 6686 | const char *buf, size_t count) |
6687 | { | 6687 | { |
6688 | return sched_power_savings_store(buf, count, 0); | 6688 | return sched_power_savings_store(buf, count, 0); |
6689 | } | 6689 | } |
6690 | static SYSDEV_CLASS_ATTR(sched_mc_power_savings, 0644, | 6690 | static DEVICE_ATTR(sched_mc_power_savings, 0644, |
6691 | sched_mc_power_savings_show, | 6691 | sched_mc_power_savings_show, |
6692 | sched_mc_power_savings_store); | 6692 | sched_mc_power_savings_store); |
6693 | #endif | 6693 | #endif |
6694 | 6694 | ||
6695 | #ifdef CONFIG_SCHED_SMT | 6695 | #ifdef CONFIG_SCHED_SMT |
6696 | static ssize_t sched_smt_power_savings_show(struct sysdev_class *dev, | 6696 | static ssize_t sched_smt_power_savings_show(struct device *dev, |
6697 | struct sysdev_class_attribute *attr, | 6697 | struct device_attribute *attr, |
6698 | char *page) | 6698 | char *buf) |
6699 | { | 6699 | { |
6700 | return sprintf(page, "%u\n", sched_smt_power_savings); | 6700 | return sprintf(buf, "%u\n", sched_smt_power_savings); |
6701 | } | 6701 | } |
6702 | static ssize_t sched_smt_power_savings_store(struct sysdev_class *dev, | 6702 | static ssize_t sched_smt_power_savings_store(struct device *dev, |
6703 | struct sysdev_class_attribute *attr, | 6703 | struct device_attribute *attr, |
6704 | const char *buf, size_t count) | 6704 | const char *buf, size_t count) |
6705 | { | 6705 | { |
6706 | return sched_power_savings_store(buf, count, 1); | 6706 | return sched_power_savings_store(buf, count, 1); |
6707 | } | 6707 | } |
6708 | static SYSDEV_CLASS_ATTR(sched_smt_power_savings, 0644, | 6708 | static DEVICE_ATTR(sched_smt_power_savings, 0644, |
6709 | sched_smt_power_savings_show, | 6709 | sched_smt_power_savings_show, |
6710 | sched_smt_power_savings_store); | 6710 | sched_smt_power_savings_store); |
6711 | #endif | 6711 | #endif |
6712 | 6712 | ||
6713 | int __init sched_create_sysfs_power_savings_entries(struct sysdev_class *cls) | 6713 | int __init sched_create_sysfs_power_savings_entries(struct device *dev) |
6714 | { | 6714 | { |
6715 | int err = 0; | 6715 | int err = 0; |
6716 | 6716 | ||
6717 | #ifdef CONFIG_SCHED_SMT | 6717 | #ifdef CONFIG_SCHED_SMT |
6718 | if (smt_capable()) | 6718 | if (smt_capable()) |
6719 | err = sysfs_create_file(&cls->kset.kobj, | 6719 | err = device_create_file(dev, &dev_attr_sched_smt_power_savings); |
6720 | &attr_sched_smt_power_savings.attr); | ||
6721 | #endif | 6720 | #endif |
6722 | #ifdef CONFIG_SCHED_MC | 6721 | #ifdef CONFIG_SCHED_MC |
6723 | if (!err && mc_capable()) | 6722 | if (!err && mc_capable()) |
6724 | err = sysfs_create_file(&cls->kset.kobj, | 6723 | err = device_create_file(dev, &dev_attr_sched_mc_power_savings); |
6725 | &attr_sched_mc_power_savings.attr); | ||
6726 | #endif | 6724 | #endif |
6727 | return err; | 6725 | return err; |
6728 | } | 6726 | } |
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index 1ecd6ba36d6c..9cd928f7a7c6 100644 --- a/kernel/time/clockevents.c +++ b/kernel/time/clockevents.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/module.h> | 17 | #include <linux/module.h> |
18 | #include <linux/notifier.h> | 18 | #include <linux/notifier.h> |
19 | #include <linux/smp.h> | 19 | #include <linux/smp.h> |
20 | #include <linux/sysdev.h> | ||
21 | 20 | ||
22 | #include "tick-internal.h" | 21 | #include "tick-internal.h" |
23 | 22 | ||
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index d3ad022136e5..a45ca167ab24 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c | |||
@@ -23,8 +23,8 @@ | |||
23 | * o Allow clocksource drivers to be unregistered | 23 | * o Allow clocksource drivers to be unregistered |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include <linux/device.h> | ||
26 | #include <linux/clocksource.h> | 27 | #include <linux/clocksource.h> |
27 | #include <linux/sysdev.h> | ||
28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
29 | #include <linux/module.h> | 29 | #include <linux/module.h> |
30 | #include <linux/sched.h> /* for spin_unlock_irq() using preempt_count() m68k */ | 30 | #include <linux/sched.h> /* for spin_unlock_irq() using preempt_count() m68k */ |
@@ -796,8 +796,8 @@ EXPORT_SYMBOL(clocksource_unregister); | |||
796 | * Provides sysfs interface for listing current clocksource. | 796 | * Provides sysfs interface for listing current clocksource. |
797 | */ | 797 | */ |
798 | static ssize_t | 798 | static ssize_t |
799 | sysfs_show_current_clocksources(struct sys_device *dev, | 799 | sysfs_show_current_clocksources(struct device *dev, |
800 | struct sysdev_attribute *attr, char *buf) | 800 | struct device_attribute *attr, char *buf) |
801 | { | 801 | { |
802 | ssize_t count = 0; | 802 | ssize_t count = 0; |
803 | 803 | ||
@@ -818,8 +818,8 @@ sysfs_show_current_clocksources(struct sys_device *dev, | |||
818 | * Takes input from sysfs interface for manually overriding the default | 818 | * Takes input from sysfs interface for manually overriding the default |
819 | * clocksource selection. | 819 | * clocksource selection. |
820 | */ | 820 | */ |
821 | static ssize_t sysfs_override_clocksource(struct sys_device *dev, | 821 | static ssize_t sysfs_override_clocksource(struct device *dev, |
822 | struct sysdev_attribute *attr, | 822 | struct device_attribute *attr, |
823 | const char *buf, size_t count) | 823 | const char *buf, size_t count) |
824 | { | 824 | { |
825 | size_t ret = count; | 825 | size_t ret = count; |
@@ -853,8 +853,8 @@ static ssize_t sysfs_override_clocksource(struct sys_device *dev, | |||
853 | * Provides sysfs interface for listing registered clocksources | 853 | * Provides sysfs interface for listing registered clocksources |
854 | */ | 854 | */ |
855 | static ssize_t | 855 | static ssize_t |
856 | sysfs_show_available_clocksources(struct sys_device *dev, | 856 | sysfs_show_available_clocksources(struct device *dev, |
857 | struct sysdev_attribute *attr, | 857 | struct device_attribute *attr, |
858 | char *buf) | 858 | char *buf) |
859 | { | 859 | { |
860 | struct clocksource *src; | 860 | struct clocksource *src; |
@@ -883,35 +883,36 @@ sysfs_show_available_clocksources(struct sys_device *dev, | |||
883 | /* | 883 | /* |
884 | * Sysfs setup bits: | 884 | * Sysfs setup bits: |
885 | */ | 885 | */ |
886 | static SYSDEV_ATTR(current_clocksource, 0644, sysfs_show_current_clocksources, | 886 | static DEVICE_ATTR(current_clocksource, 0644, sysfs_show_current_clocksources, |
887 | sysfs_override_clocksource); | 887 | sysfs_override_clocksource); |
888 | 888 | ||
889 | static SYSDEV_ATTR(available_clocksource, 0444, | 889 | static DEVICE_ATTR(available_clocksource, 0444, |
890 | sysfs_show_available_clocksources, NULL); | 890 | sysfs_show_available_clocksources, NULL); |
891 | 891 | ||
892 | static struct sysdev_class clocksource_sysclass = { | 892 | static struct bus_type clocksource_subsys = { |
893 | .name = "clocksource", | 893 | .name = "clocksource", |
894 | .dev_name = "clocksource", | ||
894 | }; | 895 | }; |
895 | 896 | ||
896 | static struct sys_device device_clocksource = { | 897 | static struct device device_clocksource = { |
897 | .id = 0, | 898 | .id = 0, |
898 | .cls = &clocksource_sysclass, | 899 | .bus = &clocksource_subsys, |
899 | }; | 900 | }; |
900 | 901 | ||
901 | static int __init init_clocksource_sysfs(void) | 902 | static int __init init_clocksource_sysfs(void) |
902 | { | 903 | { |
903 | int error = sysdev_class_register(&clocksource_sysclass); | 904 | int error = subsys_system_register(&clocksource_subsys, NULL); |
904 | 905 | ||
905 | if (!error) | 906 | if (!error) |
906 | error = sysdev_register(&device_clocksource); | 907 | error = device_register(&device_clocksource); |
907 | if (!error) | 908 | if (!error) |
908 | error = sysdev_create_file( | 909 | error = device_create_file( |
909 | &device_clocksource, | 910 | &device_clocksource, |
910 | &attr_current_clocksource); | 911 | &dev_attr_current_clocksource); |
911 | if (!error) | 912 | if (!error) |
912 | error = sysdev_create_file( | 913 | error = device_create_file( |
913 | &device_clocksource, | 914 | &device_clocksource, |
914 | &attr_available_clocksource); | 915 | &dev_attr_available_clocksource); |
915 | return error; | 916 | return error; |
916 | } | 917 | } |
917 | 918 | ||
diff --git a/lib/Makefile b/lib/Makefile index ff00d4dcb7ed..c0ffaaff6534 100644 --- a/lib/Makefile +++ b/lib/Makefile | |||
@@ -17,7 +17,7 @@ lib-y := ctype.o string.o vsprintf.o cmdline.o \ | |||
17 | lib-$(CONFIG_MMU) += ioremap.o | 17 | lib-$(CONFIG_MMU) += ioremap.o |
18 | lib-$(CONFIG_SMP) += cpumask.o | 18 | lib-$(CONFIG_SMP) += cpumask.o |
19 | 19 | ||
20 | lib-y += kobject.o kref.o klist.o | 20 | lib-y += kobject.o klist.o |
21 | 21 | ||
22 | obj-y += bcd.o div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \ | 22 | obj-y += bcd.o div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \ |
23 | bust_spinlocks.o hexdump.o kasprintf.o bitmap.o scatterlist.o \ | 23 | bust_spinlocks.o hexdump.o kasprintf.o bitmap.o scatterlist.o \ |
diff --git a/lib/devres.c b/lib/devres.c index 7c0e953a7486..4fbc09e6e9e6 100644 --- a/lib/devres.c +++ b/lib/devres.c | |||
@@ -85,6 +85,57 @@ void devm_iounmap(struct device *dev, void __iomem *addr) | |||
85 | } | 85 | } |
86 | EXPORT_SYMBOL(devm_iounmap); | 86 | EXPORT_SYMBOL(devm_iounmap); |
87 | 87 | ||
88 | /** | ||
89 | * devm_request_and_ioremap() - Check, request region, and ioremap resource | ||
90 | * @dev: Generic device to handle the resource for | ||
91 | * @res: resource to be handled | ||
92 | * | ||
93 | * Takes all necessary steps to ioremap a mem resource. Uses managed device, so | ||
94 | * everything is undone on driver detach. Checks arguments, so you can feed | ||
95 | * it the result from e.g. platform_get_resource() directly. Returns the | ||
96 | * remapped pointer or NULL on error. Usage example: | ||
97 | * | ||
98 | * res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
99 | * base = devm_request_and_ioremap(&pdev->dev, res); | ||
100 | * if (!base) | ||
101 | * return -EADDRNOTAVAIL; | ||
102 | */ | ||
103 | void __iomem *devm_request_and_ioremap(struct device *dev, | ||
104 | struct resource *res) | ||
105 | { | ||
106 | resource_size_t size; | ||
107 | const char *name; | ||
108 | void __iomem *dest_ptr; | ||
109 | |||
110 | BUG_ON(!dev); | ||
111 | |||
112 | if (!res || resource_type(res) != IORESOURCE_MEM) { | ||
113 | dev_err(dev, "invalid resource\n"); | ||
114 | return NULL; | ||
115 | } | ||
116 | |||
117 | size = resource_size(res); | ||
118 | name = res->name ?: dev_name(dev); | ||
119 | |||
120 | if (!devm_request_mem_region(dev, res->start, size, name)) { | ||
121 | dev_err(dev, "can't request region for resource %pR\n", res); | ||
122 | return NULL; | ||
123 | } | ||
124 | |||
125 | if (res->flags & IORESOURCE_CACHEABLE) | ||
126 | dest_ptr = devm_ioremap(dev, res->start, size); | ||
127 | else | ||
128 | dest_ptr = devm_ioremap_nocache(dev, res->start, size); | ||
129 | |||
130 | if (!dest_ptr) { | ||
131 | dev_err(dev, "ioremap failed for resource %pR\n", res); | ||
132 | devm_release_mem_region(dev, res->start, size); | ||
133 | } | ||
134 | |||
135 | return dest_ptr; | ||
136 | } | ||
137 | EXPORT_SYMBOL(devm_request_and_ioremap); | ||
138 | |||
88 | #ifdef CONFIG_HAS_IOPORT | 139 | #ifdef CONFIG_HAS_IOPORT |
89 | /* | 140 | /* |
90 | * Generic iomap devres | 141 | * Generic iomap devres |
@@ -348,5 +399,5 @@ void pcim_iounmap_regions(struct pci_dev *pdev, u16 mask) | |||
348 | } | 399 | } |
349 | } | 400 | } |
350 | EXPORT_SYMBOL(pcim_iounmap_regions); | 401 | EXPORT_SYMBOL(pcim_iounmap_regions); |
351 | #endif | 402 | #endif /* CONFIG_PCI */ |
352 | #endif | 403 | #endif /* CONFIG_HAS_IOPORT */ |
diff --git a/lib/kobject.c b/lib/kobject.c index 640bd98a4c8a..c33d7a18d635 100644 --- a/lib/kobject.c +++ b/lib/kobject.c | |||
@@ -746,43 +746,11 @@ void kset_unregister(struct kset *k) | |||
746 | */ | 746 | */ |
747 | struct kobject *kset_find_obj(struct kset *kset, const char *name) | 747 | struct kobject *kset_find_obj(struct kset *kset, const char *name) |
748 | { | 748 | { |
749 | return kset_find_obj_hinted(kset, name, NULL); | ||
750 | } | ||
751 | |||
752 | /** | ||
753 | * kset_find_obj_hinted - search for object in kset given a predecessor hint. | ||
754 | * @kset: kset we're looking in. | ||
755 | * @name: object's name. | ||
756 | * @hint: hint to possible object's predecessor. | ||
757 | * | ||
758 | * Check the hint's next object and if it is a match return it directly, | ||
759 | * otherwise, fall back to the behavior of kset_find_obj(). Either way | ||
760 | * a reference for the returned object is held and the reference on the | ||
761 | * hinted object is released. | ||
762 | */ | ||
763 | struct kobject *kset_find_obj_hinted(struct kset *kset, const char *name, | ||
764 | struct kobject *hint) | ||
765 | { | ||
766 | struct kobject *k; | 749 | struct kobject *k; |
767 | struct kobject *ret = NULL; | 750 | struct kobject *ret = NULL; |
768 | 751 | ||
769 | spin_lock(&kset->list_lock); | 752 | spin_lock(&kset->list_lock); |
770 | 753 | ||
771 | if (!hint) | ||
772 | goto slow_search; | ||
773 | |||
774 | /* end of list detection */ | ||
775 | if (hint->entry.next == kset->list.next) | ||
776 | goto slow_search; | ||
777 | |||
778 | k = container_of(hint->entry.next, struct kobject, entry); | ||
779 | if (!kobject_name(k) || strcmp(kobject_name(k), name)) | ||
780 | goto slow_search; | ||
781 | |||
782 | ret = kobject_get(k); | ||
783 | goto unlock_exit; | ||
784 | |||
785 | slow_search: | ||
786 | list_for_each_entry(k, &kset->list, entry) { | 754 | list_for_each_entry(k, &kset->list, entry) { |
787 | if (kobject_name(k) && !strcmp(kobject_name(k), name)) { | 755 | if (kobject_name(k) && !strcmp(kobject_name(k), name)) { |
788 | ret = kobject_get(k); | 756 | ret = kobject_get(k); |
@@ -790,12 +758,7 @@ slow_search: | |||
790 | } | 758 | } |
791 | } | 759 | } |
792 | 760 | ||
793 | unlock_exit: | ||
794 | spin_unlock(&kset->list_lock); | 761 | spin_unlock(&kset->list_lock); |
795 | |||
796 | if (hint) | ||
797 | kobject_put(hint); | ||
798 | |||
799 | return ret; | 762 | return ret; |
800 | } | 763 | } |
801 | 764 | ||
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c index ad72a03ce5e9..e66e9b632617 100644 --- a/lib/kobject_uevent.c +++ b/lib/kobject_uevent.c | |||
@@ -259,6 +259,9 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, | |||
259 | struct sk_buff *skb; | 259 | struct sk_buff *skb; |
260 | size_t len; | 260 | size_t len; |
261 | 261 | ||
262 | if (!netlink_has_listeners(uevent_sock, 1)) | ||
263 | continue; | ||
264 | |||
262 | /* allocate message with the maximum possible size */ | 265 | /* allocate message with the maximum possible size */ |
263 | len = strlen(action_string) + strlen(devpath) + 2; | 266 | len = strlen(action_string) + strlen(devpath) + 2; |
264 | skb = alloc_skb(len + env->buflen, GFP_KERNEL); | 267 | skb = alloc_skb(len + env->buflen, GFP_KERNEL); |
diff --git a/lib/kref.c b/lib/kref.c deleted file mode 100644 index 3efb882b11db..000000000000 --- a/lib/kref.c +++ /dev/null | |||
@@ -1,97 +0,0 @@ | |||
1 | /* | ||
2 | * kref.c - library routines for handling generic reference counted objects | ||
3 | * | ||
4 | * Copyright (C) 2004 Greg Kroah-Hartman <greg@kroah.com> | ||
5 | * Copyright (C) 2004 IBM Corp. | ||
6 | * | ||
7 | * based on lib/kobject.c which was: | ||
8 | * Copyright (C) 2002-2003 Patrick Mochel <mochel@osdl.org> | ||
9 | * | ||
10 | * This file is released under the GPLv2. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #include <linux/kref.h> | ||
15 | #include <linux/module.h> | ||
16 | #include <linux/slab.h> | ||
17 | |||
18 | /** | ||
19 | * kref_init - initialize object. | ||
20 | * @kref: object in question. | ||
21 | */ | ||
22 | void kref_init(struct kref *kref) | ||
23 | { | ||
24 | atomic_set(&kref->refcount, 1); | ||
25 | smp_mb(); | ||
26 | } | ||
27 | |||
28 | /** | ||
29 | * kref_get - increment refcount for object. | ||
30 | * @kref: object. | ||
31 | */ | ||
32 | void kref_get(struct kref *kref) | ||
33 | { | ||
34 | WARN_ON(!atomic_read(&kref->refcount)); | ||
35 | atomic_inc(&kref->refcount); | ||
36 | smp_mb__after_atomic_inc(); | ||
37 | } | ||
38 | |||
39 | /** | ||
40 | * kref_put - decrement refcount for object. | ||
41 | * @kref: object. | ||
42 | * @release: pointer to the function that will clean up the object when the | ||
43 | * last reference to the object is released. | ||
44 | * This pointer is required, and it is not acceptable to pass kfree | ||
45 | * in as this function. | ||
46 | * | ||
47 | * Decrement the refcount, and if 0, call release(). | ||
48 | * Return 1 if the object was removed, otherwise return 0. Beware, if this | ||
49 | * function returns 0, you still can not count on the kref from remaining in | ||
50 | * memory. Only use the return value if you want to see if the kref is now | ||
51 | * gone, not present. | ||
52 | */ | ||
53 | int kref_put(struct kref *kref, void (*release)(struct kref *kref)) | ||
54 | { | ||
55 | WARN_ON(release == NULL); | ||
56 | WARN_ON(release == (void (*)(struct kref *))kfree); | ||
57 | |||
58 | if (atomic_dec_and_test(&kref->refcount)) { | ||
59 | release(kref); | ||
60 | return 1; | ||
61 | } | ||
62 | return 0; | ||
63 | } | ||
64 | |||
65 | |||
66 | /** | ||
67 | * kref_sub - subtract a number of refcounts for object. | ||
68 | * @kref: object. | ||
69 | * @count: Number of recounts to subtract. | ||
70 | * @release: pointer to the function that will clean up the object when the | ||
71 | * last reference to the object is released. | ||
72 | * This pointer is required, and it is not acceptable to pass kfree | ||
73 | * in as this function. | ||
74 | * | ||
75 | * Subtract @count from the refcount, and if 0, call release(). | ||
76 | * Return 1 if the object was removed, otherwise return 0. Beware, if this | ||
77 | * function returns 0, you still can not count on the kref from remaining in | ||
78 | * memory. Only use the return value if you want to see if the kref is now | ||
79 | * gone, not present. | ||
80 | */ | ||
81 | int kref_sub(struct kref *kref, unsigned int count, | ||
82 | void (*release)(struct kref *kref)) | ||
83 | { | ||
84 | WARN_ON(release == NULL); | ||
85 | WARN_ON(release == (void (*)(struct kref *))kfree); | ||
86 | |||
87 | if (atomic_sub_and_test((int) count, &kref->refcount)) { | ||
88 | release(kref); | ||
89 | return 1; | ||
90 | } | ||
91 | return 0; | ||
92 | } | ||
93 | |||
94 | EXPORT_SYMBOL(kref_init); | ||
95 | EXPORT_SYMBOL(kref_get); | ||
96 | EXPORT_SYMBOL(kref_put); | ||
97 | EXPORT_SYMBOL(kref_sub); | ||
diff --git a/mm/compaction.c b/mm/compaction.c index 899d95638586..1253d7ac332b 100644 --- a/mm/compaction.c +++ b/mm/compaction.c | |||
@@ -721,23 +721,23 @@ int sysctl_extfrag_handler(struct ctl_table *table, int write, | |||
721 | } | 721 | } |
722 | 722 | ||
723 | #if defined(CONFIG_SYSFS) && defined(CONFIG_NUMA) | 723 | #if defined(CONFIG_SYSFS) && defined(CONFIG_NUMA) |
724 | ssize_t sysfs_compact_node(struct sys_device *dev, | 724 | ssize_t sysfs_compact_node(struct device *dev, |
725 | struct sysdev_attribute *attr, | 725 | struct device_attribute *attr, |
726 | const char *buf, size_t count) | 726 | const char *buf, size_t count) |
727 | { | 727 | { |
728 | compact_node(dev->id); | 728 | compact_node(dev->id); |
729 | 729 | ||
730 | return count; | 730 | return count; |
731 | } | 731 | } |
732 | static SYSDEV_ATTR(compact, S_IWUSR, NULL, sysfs_compact_node); | 732 | static DEVICE_ATTR(compact, S_IWUSR, NULL, sysfs_compact_node); |
733 | 733 | ||
734 | int compaction_register_node(struct node *node) | 734 | int compaction_register_node(struct node *node) |
735 | { | 735 | { |
736 | return sysdev_create_file(&node->sysdev, &attr_compact); | 736 | return device_create_file(&node->dev, &dev_attr_compact); |
737 | } | 737 | } |
738 | 738 | ||
739 | void compaction_unregister_node(struct node *node) | 739 | void compaction_unregister_node(struct node *node) |
740 | { | 740 | { |
741 | return sysdev_remove_file(&node->sysdev, &attr_compact); | 741 | return device_remove_file(&node->dev, &dev_attr_compact); |
742 | } | 742 | } |
743 | #endif /* CONFIG_SYSFS && CONFIG_NUMA */ | 743 | #endif /* CONFIG_SYSFS && CONFIG_NUMA */ |
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 2316840b337a..7acd12503f73 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -1592,9 +1592,9 @@ static void __init hugetlb_sysfs_init(void) | |||
1592 | 1592 | ||
1593 | /* | 1593 | /* |
1594 | * node_hstate/s - associate per node hstate attributes, via their kobjects, | 1594 | * node_hstate/s - associate per node hstate attributes, via their kobjects, |
1595 | * with node sysdevs in node_devices[] using a parallel array. The array | 1595 | * with node devices in node_devices[] using a parallel array. The array |
1596 | * index of a node sysdev or _hstate == node id. | 1596 | * index of a node device or _hstate == node id. |
1597 | * This is here to avoid any static dependency of the node sysdev driver, in | 1597 | * This is here to avoid any static dependency of the node device driver, in |
1598 | * the base kernel, on the hugetlb module. | 1598 | * the base kernel, on the hugetlb module. |
1599 | */ | 1599 | */ |
1600 | struct node_hstate { | 1600 | struct node_hstate { |
@@ -1604,7 +1604,7 @@ struct node_hstate { | |||
1604 | struct node_hstate node_hstates[MAX_NUMNODES]; | 1604 | struct node_hstate node_hstates[MAX_NUMNODES]; |
1605 | 1605 | ||
1606 | /* | 1606 | /* |
1607 | * A subset of global hstate attributes for node sysdevs | 1607 | * A subset of global hstate attributes for node devices |
1608 | */ | 1608 | */ |
1609 | static struct attribute *per_node_hstate_attrs[] = { | 1609 | static struct attribute *per_node_hstate_attrs[] = { |
1610 | &nr_hugepages_attr.attr, | 1610 | &nr_hugepages_attr.attr, |
@@ -1618,7 +1618,7 @@ static struct attribute_group per_node_hstate_attr_group = { | |||
1618 | }; | 1618 | }; |
1619 | 1619 | ||
1620 | /* | 1620 | /* |
1621 | * kobj_to_node_hstate - lookup global hstate for node sysdev hstate attr kobj. | 1621 | * kobj_to_node_hstate - lookup global hstate for node device hstate attr kobj. |
1622 | * Returns node id via non-NULL nidp. | 1622 | * Returns node id via non-NULL nidp. |
1623 | */ | 1623 | */ |
1624 | static struct hstate *kobj_to_node_hstate(struct kobject *kobj, int *nidp) | 1624 | static struct hstate *kobj_to_node_hstate(struct kobject *kobj, int *nidp) |
@@ -1641,13 +1641,13 @@ static struct hstate *kobj_to_node_hstate(struct kobject *kobj, int *nidp) | |||
1641 | } | 1641 | } |
1642 | 1642 | ||
1643 | /* | 1643 | /* |
1644 | * Unregister hstate attributes from a single node sysdev. | 1644 | * Unregister hstate attributes from a single node device. |
1645 | * No-op if no hstate attributes attached. | 1645 | * No-op if no hstate attributes attached. |
1646 | */ | 1646 | */ |
1647 | void hugetlb_unregister_node(struct node *node) | 1647 | void hugetlb_unregister_node(struct node *node) |
1648 | { | 1648 | { |
1649 | struct hstate *h; | 1649 | struct hstate *h; |
1650 | struct node_hstate *nhs = &node_hstates[node->sysdev.id]; | 1650 | struct node_hstate *nhs = &node_hstates[node->dev.id]; |
1651 | 1651 | ||
1652 | if (!nhs->hugepages_kobj) | 1652 | if (!nhs->hugepages_kobj) |
1653 | return; /* no hstate attributes */ | 1653 | return; /* no hstate attributes */ |
@@ -1663,7 +1663,7 @@ void hugetlb_unregister_node(struct node *node) | |||
1663 | } | 1663 | } |
1664 | 1664 | ||
1665 | /* | 1665 | /* |
1666 | * hugetlb module exit: unregister hstate attributes from node sysdevs | 1666 | * hugetlb module exit: unregister hstate attributes from node devices |
1667 | * that have them. | 1667 | * that have them. |
1668 | */ | 1668 | */ |
1669 | static void hugetlb_unregister_all_nodes(void) | 1669 | static void hugetlb_unregister_all_nodes(void) |
@@ -1671,7 +1671,7 @@ static void hugetlb_unregister_all_nodes(void) | |||
1671 | int nid; | 1671 | int nid; |
1672 | 1672 | ||
1673 | /* | 1673 | /* |
1674 | * disable node sysdev registrations. | 1674 | * disable node device registrations. |
1675 | */ | 1675 | */ |
1676 | register_hugetlbfs_with_node(NULL, NULL); | 1676 | register_hugetlbfs_with_node(NULL, NULL); |
1677 | 1677 | ||
@@ -1683,20 +1683,20 @@ static void hugetlb_unregister_all_nodes(void) | |||
1683 | } | 1683 | } |
1684 | 1684 | ||
1685 | /* | 1685 | /* |
1686 | * Register hstate attributes for a single node sysdev. | 1686 | * Register hstate attributes for a single node device. |
1687 | * No-op if attributes already registered. | 1687 | * No-op if attributes already registered. |
1688 | */ | 1688 | */ |
1689 | void hugetlb_register_node(struct node *node) | 1689 | void hugetlb_register_node(struct node *node) |
1690 | { | 1690 | { |
1691 | struct hstate *h; | 1691 | struct hstate *h; |
1692 | struct node_hstate *nhs = &node_hstates[node->sysdev.id]; | 1692 | struct node_hstate *nhs = &node_hstates[node->dev.id]; |
1693 | int err; | 1693 | int err; |
1694 | 1694 | ||
1695 | if (nhs->hugepages_kobj) | 1695 | if (nhs->hugepages_kobj) |
1696 | return; /* already allocated */ | 1696 | return; /* already allocated */ |
1697 | 1697 | ||
1698 | nhs->hugepages_kobj = kobject_create_and_add("hugepages", | 1698 | nhs->hugepages_kobj = kobject_create_and_add("hugepages", |
1699 | &node->sysdev.kobj); | 1699 | &node->dev.kobj); |
1700 | if (!nhs->hugepages_kobj) | 1700 | if (!nhs->hugepages_kobj) |
1701 | return; | 1701 | return; |
1702 | 1702 | ||
@@ -1707,7 +1707,7 @@ void hugetlb_register_node(struct node *node) | |||
1707 | if (err) { | 1707 | if (err) { |
1708 | printk(KERN_ERR "Hugetlb: Unable to add hstate %s" | 1708 | printk(KERN_ERR "Hugetlb: Unable to add hstate %s" |
1709 | " for node %d\n", | 1709 | " for node %d\n", |
1710 | h->name, node->sysdev.id); | 1710 | h->name, node->dev.id); |
1711 | hugetlb_unregister_node(node); | 1711 | hugetlb_unregister_node(node); |
1712 | break; | 1712 | break; |
1713 | } | 1713 | } |
@@ -1716,8 +1716,8 @@ void hugetlb_register_node(struct node *node) | |||
1716 | 1716 | ||
1717 | /* | 1717 | /* |
1718 | * hugetlb init time: register hstate attributes for all registered node | 1718 | * hugetlb init time: register hstate attributes for all registered node |
1719 | * sysdevs of nodes that have memory. All on-line nodes should have | 1719 | * devices of nodes that have memory. All on-line nodes should have |
1720 | * registered their associated sysdev by this time. | 1720 | * registered their associated device by this time. |
1721 | */ | 1721 | */ |
1722 | static void hugetlb_register_all_nodes(void) | 1722 | static void hugetlb_register_all_nodes(void) |
1723 | { | 1723 | { |
@@ -1725,12 +1725,12 @@ static void hugetlb_register_all_nodes(void) | |||
1725 | 1725 | ||
1726 | for_each_node_state(nid, N_HIGH_MEMORY) { | 1726 | for_each_node_state(nid, N_HIGH_MEMORY) { |
1727 | struct node *node = &node_devices[nid]; | 1727 | struct node *node = &node_devices[nid]; |
1728 | if (node->sysdev.id == nid) | 1728 | if (node->dev.id == nid) |
1729 | hugetlb_register_node(node); | 1729 | hugetlb_register_node(node); |
1730 | } | 1730 | } |
1731 | 1731 | ||
1732 | /* | 1732 | /* |
1733 | * Let the node sysdev driver know we're here so it can | 1733 | * Let the node device driver know we're here so it can |
1734 | * [un]register hstate attributes on node hotplug. | 1734 | * [un]register hstate attributes on node hotplug. |
1735 | */ | 1735 | */ |
1736 | register_hugetlbfs_with_node(hugetlb_register_node, | 1736 | register_hugetlbfs_with_node(hugetlb_register_node, |
diff --git a/mm/vmscan.c b/mm/vmscan.c index f54a05b7a61d..11adc890ce30 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -3475,16 +3475,16 @@ int scan_unevictable_handler(struct ctl_table *table, int write, | |||
3475 | * a specified node's per zone unevictable lists for evictable pages. | 3475 | * a specified node's per zone unevictable lists for evictable pages. |
3476 | */ | 3476 | */ |
3477 | 3477 | ||
3478 | static ssize_t read_scan_unevictable_node(struct sys_device *dev, | 3478 | static ssize_t read_scan_unevictable_node(struct device *dev, |
3479 | struct sysdev_attribute *attr, | 3479 | struct device_attribute *attr, |
3480 | char *buf) | 3480 | char *buf) |
3481 | { | 3481 | { |
3482 | warn_scan_unevictable_pages(); | 3482 | warn_scan_unevictable_pages(); |
3483 | return sprintf(buf, "0\n"); /* always zero; should fit... */ | 3483 | return sprintf(buf, "0\n"); /* always zero; should fit... */ |
3484 | } | 3484 | } |
3485 | 3485 | ||
3486 | static ssize_t write_scan_unevictable_node(struct sys_device *dev, | 3486 | static ssize_t write_scan_unevictable_node(struct device *dev, |
3487 | struct sysdev_attribute *attr, | 3487 | struct device_attribute *attr, |
3488 | const char *buf, size_t count) | 3488 | const char *buf, size_t count) |
3489 | { | 3489 | { |
3490 | warn_scan_unevictable_pages(); | 3490 | warn_scan_unevictable_pages(); |
@@ -3492,17 +3492,17 @@ static ssize_t write_scan_unevictable_node(struct sys_device *dev, | |||
3492 | } | 3492 | } |
3493 | 3493 | ||
3494 | 3494 | ||
3495 | static SYSDEV_ATTR(scan_unevictable_pages, S_IRUGO | S_IWUSR, | 3495 | static DEVICE_ATTR(scan_unevictable_pages, S_IRUGO | S_IWUSR, |
3496 | read_scan_unevictable_node, | 3496 | read_scan_unevictable_node, |
3497 | write_scan_unevictable_node); | 3497 | write_scan_unevictable_node); |
3498 | 3498 | ||
3499 | int scan_unevictable_register_node(struct node *node) | 3499 | int scan_unevictable_register_node(struct node *node) |
3500 | { | 3500 | { |
3501 | return sysdev_create_file(&node->sysdev, &attr_scan_unevictable_pages); | 3501 | return device_create_file(&node->dev, &dev_attr_scan_unevictable_pages); |
3502 | } | 3502 | } |
3503 | 3503 | ||
3504 | void scan_unevictable_unregister_node(struct node *node) | 3504 | void scan_unevictable_unregister_node(struct node *node) |
3505 | { | 3505 | { |
3506 | sysdev_remove_file(&node->sysdev, &attr_scan_unevictable_pages); | 3506 | device_remove_file(&node->dev, &dev_attr_scan_unevictable_pages); |
3507 | } | 3507 | } |
3508 | #endif | 3508 | #endif |
diff --git a/sound/usb/6fire/chip.c b/sound/usb/6fire/chip.c index c7dca7b0b9fe..ac2d5e10f1a8 100644 --- a/sound/usb/6fire/chip.c +++ b/sound/usb/6fire/chip.c | |||
@@ -211,22 +211,11 @@ static struct usb_device_id device_table[] = { | |||
211 | 211 | ||
212 | MODULE_DEVICE_TABLE(usb, device_table); | 212 | MODULE_DEVICE_TABLE(usb, device_table); |
213 | 213 | ||
214 | static struct usb_driver driver = { | 214 | static struct usb_driver usb_driver = { |
215 | .name = "snd-usb-6fire", | 215 | .name = "snd-usb-6fire", |
216 | .probe = usb6fire_chip_probe, | 216 | .probe = usb6fire_chip_probe, |
217 | .disconnect = usb6fire_chip_disconnect, | 217 | .disconnect = usb6fire_chip_disconnect, |
218 | .id_table = device_table, | 218 | .id_table = device_table, |
219 | }; | 219 | }; |
220 | 220 | ||
221 | static int __init usb6fire_chip_init(void) | 221 | module_usb_driver(usb_driver); |
222 | { | ||
223 | return usb_register(&driver); | ||
224 | } | ||
225 | |||
226 | static void __exit usb6fire_chip_cleanup(void) | ||
227 | { | ||
228 | usb_deregister(&driver); | ||
229 | } | ||
230 | |||
231 | module_init(usb6fire_chip_init); | ||
232 | module_exit(usb6fire_chip_cleanup); | ||
diff --git a/sound/usb/caiaq/device.c b/sound/usb/caiaq/device.c index 3eb605bd9503..457fb274ff92 100644 --- a/sound/usb/caiaq/device.c +++ b/sound/usb/caiaq/device.c | |||
@@ -538,16 +538,5 @@ static struct usb_driver snd_usb_driver = { | |||
538 | .id_table = snd_usb_id_table, | 538 | .id_table = snd_usb_id_table, |
539 | }; | 539 | }; |
540 | 540 | ||
541 | static int __init snd_module_init(void) | 541 | module_usb_driver(snd_usb_driver); |
542 | { | ||
543 | return usb_register(&snd_usb_driver); | ||
544 | } | ||
545 | |||
546 | static void __exit snd_module_exit(void) | ||
547 | { | ||
548 | usb_deregister(&snd_usb_driver); | ||
549 | } | ||
550 | |||
551 | module_init(snd_module_init) | ||
552 | module_exit(snd_module_exit) | ||
553 | 542 | ||
diff --git a/sound/usb/misc/ua101.c b/sound/usb/misc/ua101.c index c0609c210303..4c11da911a14 100644 --- a/sound/usb/misc/ua101.c +++ b/sound/usb/misc/ua101.c | |||
@@ -1387,16 +1387,4 @@ static struct usb_driver ua101_driver = { | |||
1387 | #endif | 1387 | #endif |
1388 | }; | 1388 | }; |
1389 | 1389 | ||
1390 | static int __init alsa_card_ua101_init(void) | 1390 | module_usb_driver(ua101_driver); |
1391 | { | ||
1392 | return usb_register(&ua101_driver); | ||
1393 | } | ||
1394 | |||
1395 | static void __exit alsa_card_ua101_exit(void) | ||
1396 | { | ||
1397 | usb_deregister(&ua101_driver); | ||
1398 | mutex_destroy(&devices_mutex); | ||
1399 | } | ||
1400 | |||
1401 | module_init(alsa_card_ua101_init); | ||
1402 | module_exit(alsa_card_ua101_exit); | ||
diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c index 726c1a7b89b8..625f7ca6a894 100644 --- a/sound/usb/usx2y/us122l.c +++ b/sound/usb/usx2y/us122l.c | |||
@@ -772,16 +772,4 @@ static struct usb_driver snd_us122l_usb_driver = { | |||
772 | .supports_autosuspend = 1 | 772 | .supports_autosuspend = 1 |
773 | }; | 773 | }; |
774 | 774 | ||
775 | 775 | module_usb_driver(snd_us122l_usb_driver); | |
776 | static int __init snd_us122l_module_init(void) | ||
777 | { | ||
778 | return usb_register(&snd_us122l_usb_driver); | ||
779 | } | ||
780 | |||
781 | static void __exit snd_us122l_module_exit(void) | ||
782 | { | ||
783 | usb_deregister(&snd_us122l_usb_driver); | ||
784 | } | ||
785 | |||
786 | module_init(snd_us122l_module_init) | ||
787 | module_exit(snd_us122l_module_exit) | ||
diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c index cbd37f2c76d0..0c738ed3ed38 100644 --- a/sound/usb/usx2y/usbusx2y.c +++ b/sound/usb/usx2y/usbusx2y.c | |||
@@ -459,15 +459,4 @@ static void usX2Y_usb_disconnect(struct usb_device *device, void* ptr) | |||
459 | } | 459 | } |
460 | } | 460 | } |
461 | 461 | ||
462 | static int __init snd_usX2Y_module_init(void) | 462 | module_usb_driver(snd_usX2Y_usb_driver); |
463 | { | ||
464 | return usb_register(&snd_usX2Y_usb_driver); | ||
465 | } | ||
466 | |||
467 | static void __exit snd_usX2Y_module_exit(void) | ||
468 | { | ||
469 | usb_deregister(&snd_usX2Y_usb_driver); | ||
470 | } | ||
471 | |||
472 | module_init(snd_usX2Y_module_init) | ||
473 | module_exit(snd_usX2Y_module_exit) | ||