diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2011-12-21 16:01:38 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-12-21 16:01:38 -0800 |
commit | 4a858cfc9af87cc60b3113c3b7b377a4305eac6a (patch) | |
tree | 22ab8aa44aab760d2e1afcb8559e4debe6092d28 /arch/arm/mach-s3c2410 | |
parent | 8f1e938db9230d9f828420adea96f691c722e473 (diff) | |
download | blackbird-obmc-linux-4a858cfc9af87cc60b3113c3b7b377a4305eac6a.tar.gz blackbird-obmc-linux-4a858cfc9af87cc60b3113c3b7b377a4305eac6a.zip |
arm: convert sysdev_class to a regular subsystem
After all sysdev classes are ported to regular driver core entities, the
sysdev implementation will be entirely removed from the kernel.
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Boojin Kim <boojin.kim@samsung.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Cc: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/arm/mach-s3c2410')
-rw-r--r-- | arch/arm/mach-s3c2410/cpu-freq.c | 26 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/dma.c | 28 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/include/mach/dma.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/pll.c | 20 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/pm.c | 36 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/s3c2410.c | 24 |
6 files changed, 80 insertions, 58 deletions
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 @@ #include <linux/interrupt.h> #include <linux/ioport.h> #include <linux/cpufreq.h> -#include <linux/sysdev.h> +#include <linux/device.h> #include <linux/clk.h> #include <linux/err.h> #include <linux/io.h> @@ -115,24 +115,25 @@ static struct s3c_cpufreq_info s3c2410_cpufreq_info = { .debug_io_show = s3c_cpufreq_debugfs_call(s3c2410_iotiming_debugfs), }; -static int s3c2410_cpufreq_add(struct sys_device *sysdev) +static int s3c2410_cpufreq_add(struct device *dev) { return s3c_cpufreq_register(&s3c2410_cpufreq_info); } -static struct sysdev_driver s3c2410_cpufreq_driver = { - .add = s3c2410_cpufreq_add, +static struct subsys_interface s3c2410_cpufreq_interface = { + .name = "s3c2410_cpufreq", + .subsys = &s3c2410_subsys, + .add_dev = s3c2410_cpufreq_add, }; static int __init s3c2410_cpufreq_init(void) { - return sysdev_driver_register(&s3c2410_sysclass, - &s3c2410_cpufreq_driver); + return subsys_interface_register(&s3c2410_cpufreq_interface); } arch_initcall(s3c2410_cpufreq_init); -static int s3c2410a_cpufreq_add(struct sys_device *sysdev) +static int s3c2410a_cpufreq_add(struct device *dev) { /* alter the maximum freq settings for S3C2410A. If a board knows * 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) s3c2410_cpufreq_info.max.pclk = 66500000; s3c2410_cpufreq_info.name = "s3c2410a"; - return s3c2410_cpufreq_add(sysdev); + return s3c2410_cpufreq_add(dev); } -static struct sysdev_driver s3c2410a_cpufreq_driver = { - .add = s3c2410a_cpufreq_add, +static struct subsys_interface s3c2410a_cpufreq_interface = { + .name = "s3c2410a_cpufreq", + .subsys = &s3c2410a_subsys, + .add_dev = s3c2410a_cpufreq_add, }; static int __init s3c2410a_cpufreq_init(void) { - return sysdev_driver_register(&s3c2410a_sysclass, - &s3c2410a_cpufreq_driver); + return subsys_interface_register(&s3c2410a_cpufreq_interface); } 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 @@ #include <linux/kernel.h> #include <linux/init.h> -#include <linux/sysdev.h> +#include <linux/device.h> #include <linux/serial_core.h> #include <mach/map.h> @@ -132,7 +132,7 @@ static struct s3c24xx_dma_order __initdata s3c2410_dma_order = { }, }; -static int __init s3c2410_dma_add(struct sys_device *sysdev) +static int __init s3c2410_dma_add(struct device *dev) { s3c2410_dma_init(); s3c24xx_dma_order_set(&s3c2410_dma_order); @@ -140,24 +140,28 @@ static int __init s3c2410_dma_add(struct sys_device *sysdev) } #if defined(CONFIG_CPU_S3C2410) -static struct sysdev_driver s3c2410_dma_driver = { - .add = s3c2410_dma_add, +static struct subsys_interface s3c2410_dma_interface = { + .name = "s3c2410_dma", + .subsys = &s3c2410_subsys, + .add_dev = s3c2410_dma_add, }; static int __init s3c2410_dma_drvinit(void) { - return sysdev_driver_register(&s3c2410_sysclass, &s3c2410_dma_driver); + return subsys_interface_register(&s3c2410_interface); } arch_initcall(s3c2410_dma_drvinit); -static struct sysdev_driver s3c2410a_dma_driver = { - .add = s3c2410_dma_add, +static struct subsys_interface s3c2410a_dma_interface = { + .name = "s3c2410a_dma", + .subsys = &s3c2410a_subsys, + .add_dev = s3c2410_dma_add, }; static int __init s3c2410a_dma_drvinit(void) { - return sysdev_driver_register(&s3c2410a_sysclass, &s3c2410a_dma_driver); + return subsys_interface_register(&s3c2410a_dma_interface); } arch_initcall(s3c2410a_dma_drvinit); @@ -165,13 +169,15 @@ arch_initcall(s3c2410a_dma_drvinit); #if defined(CONFIG_CPU_S3C2442) /* S3C2442 DMA contains the same selection table as the S3C2410 */ -static struct sysdev_driver s3c2442_dma_driver = { - .add = s3c2410_dma_add, +static struct subsys_interface s3c2442_dma_interface = { + .name = "s3c2442_dma", + .subsys = &s3c2442_subsys, + .add_dev = s3c2410_dma_add, }; static int __init s3c2442_dma_drvinit(void) { - return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_dma_driver); + return subsys_interface_register(&s3c2442_dma_interface); } 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 @@ #ifndef __ASM_ARCH_DMA_H #define __ASM_ARCH_DMA_H __FILE__ -#include <linux/sysdev.h> +#include <linux/device.h> #define MAX_DMA_TRANSFER_SIZE 0x100000 /* Data Unit is half word */ @@ -202,7 +202,7 @@ struct s3c2410_dma_chan { struct s3c2410_dma_buf *end; /* end of queue */ /* system device */ - struct sys_device dev; + struct device dev; }; typedef unsigned long dma_device_t; 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 @@ #include <linux/types.h> #include <linux/kernel.h> #include <linux/module.h> -#include <linux/sysdev.h> +#include <linux/device.h> #include <linux/list.h> #include <linux/clk.h> #include <linux/err.h> @@ -66,30 +66,34 @@ static struct cpufreq_frequency_table pll_vals_12MHz[] = { { .frequency = 270000000, .index = PLLVAL(127, 1, 1), }, }; -static int s3c2410_plls_add(struct sys_device *dev) +static int s3c2410_plls_add(struct device *dev) { return s3c_plltab_register(pll_vals_12MHz, ARRAY_SIZE(pll_vals_12MHz)); } -static struct sysdev_driver s3c2410_plls_drv = { - .add = s3c2410_plls_add, +static struct subsys_interface s3c2410_plls_interface = { + .name = "s3c2410_plls", + .subsys = &s3c2410_subsys, + .add_dev = s3c2410_plls_add, }; static int __init s3c2410_pll_init(void) { - return sysdev_driver_register(&s3c2410_sysclass, &s3c2410_plls_drv); + return subsys_interface_register(&s3c2410_plls_interface); } arch_initcall(s3c2410_pll_init); -static struct sysdev_driver s3c2410a_plls_drv = { - .add = s3c2410_plls_add, +static struct subsys_interface s3c2410a_plls_interface = { + .name = "s3c2410a_plls", + .subsys = &s3c2410a_subsys, + .add_dev = s3c2410_plls_add, }; static int __init s3c2410a_pll_init(void) { - return sysdev_driver_register(&s3c2410a_sysclass, &s3c2410a_plls_drv); + return subsys_interface_register(&s3c2410a_plls_interface); } arch_initcall(s3c2410a_pll_init); diff --git a/arch/arm/mach-s3c2410/pm.c b/arch/arm/mach-s3c2410/pm.c index 4728f9aa7df1..4b948eca73ef 100644 --- a/arch/arm/mach-s3c2410/pm.c +++ b/arch/arm/mach-s3c2410/pm.c @@ -24,7 +24,7 @@ #include <linux/suspend.h> #include <linux/errno.h> #include <linux/time.h> -#include <linux/sysdev.h> +#include <linux/device.h> #include <linux/syscore_ops.h> #include <linux/gpio.h> #include <linux/io.h> @@ -111,7 +111,7 @@ struct syscore_ops s3c2410_pm_syscore_ops = { .resume = s3c2410_pm_resume, }; -static int s3c2410_pm_add(struct sys_device *dev) +static int s3c2410_pm_add(struct device *dev) { pm_cpu_prep = s3c2410_pm_prepare; pm_cpu_sleep = s3c2410_cpu_suspend; @@ -120,52 +120,60 @@ static int s3c2410_pm_add(struct sys_device *dev) } #if defined(CONFIG_CPU_S3C2410) -static struct sysdev_driver s3c2410_pm_driver = { - .add = s3c2410_pm_add, +static struct subsys_interface s3c2410_pm_interface = { + .name = "s3c2410_pm", + .subsys = &s3c2410_subsys, + .add_dev = s3c2410_pm_add, }; /* register ourselves */ static int __init s3c2410_pm_drvinit(void) { - return sysdev_driver_register(&s3c2410_sysclass, &s3c2410_pm_driver); + return subsys_interface_register(&s3c2410_pm_interface); } arch_initcall(s3c2410_pm_drvinit); -static struct sysdev_driver s3c2410a_pm_driver = { - .add = s3c2410_pm_add, +static struct subsys_interface s3c2410a_pm_interface = { + .name = "s3c2410a_pm", + subsys = &s3c2410a_subsys, + .add_dev = s3c2410_pm_add, }; static int __init s3c2410a_pm_drvinit(void) { - return sysdev_driver_register(&s3c2410a_sysclass, &s3c2410a_pm_driver); + return subsys_interface_register(&s3c2410a_pm_interface); } arch_initcall(s3c2410a_pm_drvinit); #endif #if defined(CONFIG_CPU_S3C2440) -static struct sysdev_driver s3c2440_pm_driver = { - .add = s3c2410_pm_add, +static struct subsys_interface s3c2440_pm_interface = { + .name = "s3c2440_pm", + .subsys = &s3c2440_subsys, + .add_dev = s3c2410_pm_add, }; static int __init s3c2440_pm_drvinit(void) { - return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_pm_driver); + return subsys_interface_register(&s3c2440_pm_interface); } arch_initcall(s3c2440_pm_drvinit); #endif #if defined(CONFIG_CPU_S3C2442) -static struct sysdev_driver s3c2442_pm_driver = { - .add = s3c2410_pm_add, +static struct subsys_interface s3c2442_pm_interface = { + .name = "s3c2442_pm", + .subsys = &s3c2442_subsys, + .add_dev = s3c2410_pm_add, }; static int __init s3c2442_pm_drvinit(void) { - return sysdev_driver_register(&s3c2442_sysclass, &s3c2442_pm_driver); + return subsys_interface_register(&s3c2442_pm_interface); } arch_initcall(s3c2442_pm_drvinit); diff --git a/arch/arm/mach-s3c2410/s3c2410.c b/arch/arm/mach-s3c2410/s3c2410.c index 3d7ebc557a72..da6651556eb9 100644 --- a/arch/arm/mach-s3c2410/s3c2410.c +++ b/arch/arm/mach-s3c2410/s3c2410.c @@ -18,7 +18,7 @@ #include <linux/init.h> #include <linux/gpio.h> #include <linux/clk.h> -#include <linux/sysdev.h> +#include <linux/device.h> #include <linux/syscore_ops.h> #include <linux/serial_core.h> #include <linux/platform_device.h> @@ -131,22 +131,24 @@ void __init s3c2410_init_clocks(int xtal) s3c24xx_register_clock(&s3c2410_armclk); } -struct sysdev_class s3c2410_sysclass = { +struct bus_type s3c2410_subsys = { .name = "s3c2410-core", + .dev_name = "s3c2410-core", }; /* Note, we would have liked to name this s3c2410-core, but we cannot - * register two sysdev_class with the same name. + * register two subsystems with the same name. */ -struct sysdev_class s3c2410a_sysclass = { +struct bus_type s3c2410a_subsys = { .name = "s3c2410a-core", + .dev_name = "s3c2410a-core", }; -static struct sys_device s3c2410_sysdev = { - .cls = &s3c2410_sysclass, +static struct device s3c2410_dev = { + .bus = &s3c2410_subsys, }; -/* need to register class before we actually register the device, and +/* need to register the subsystem before we actually register the device, and * we also need to ensure that it has been initialised before any of the * drivers even try to use it (even if not on an s3c2410 based system) * as a driver which may support both 2410 and 2440 may try and use it. @@ -154,14 +156,14 @@ static struct sys_device s3c2410_sysdev = { static int __init s3c2410_core_init(void) { - return sysdev_class_register(&s3c2410_sysclass); + return subsys_system_register(&s3c2410_subsys, NULL); } core_initcall(s3c2410_core_init); static int __init s3c2410a_core_init(void) { - return sysdev_class_register(&s3c2410a_sysclass); + return subsys_system_register(&s3c2410a_subsys, NULL); } core_initcall(s3c2410a_core_init); @@ -175,11 +177,11 @@ int __init s3c2410_init(void) #endif register_syscore_ops(&s3c24xx_irq_syscore_ops); - return sysdev_register(&s3c2410_sysdev); + return device_register(&s3c2410_dev); } int __init s3c2410a_init(void) { - s3c2410_sysdev.cls = &s3c2410a_sysclass; + s3c2410_dev.bus = &s3c2410a_subsys; return s3c2410_init(); } |