From 4a858cfc9af87cc60b3113c3b7b377a4305eac6a Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 21 Dec 2011 16:01:38 -0800 Subject: 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 Cc: Russell King Cc: Ben Dooks Cc: Vinod Koul Cc: Boojin Kim Cc: Linus Walleij Cc: Lucas De Marchi Cc: Heiko Stuebner Signed-off-by: Kay Sievers Signed-off-by: Greg Kroah-Hartman --- arch/arm/mach-s3c2410/cpu-freq.c | 26 ++++++++++++----------- arch/arm/mach-s3c2410/dma.c | 28 +++++++++++++++---------- arch/arm/mach-s3c2410/include/mach/dma.h | 4 ++-- arch/arm/mach-s3c2410/pll.c | 20 +++++++++++------- arch/arm/mach-s3c2410/pm.c | 36 +++++++++++++++++++------------- arch/arm/mach-s3c2410/s3c2410.c | 24 +++++++++++---------- 6 files changed, 80 insertions(+), 58 deletions(-) (limited to 'arch/arm/mach-s3c2410') 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 #include #include -#include +#include #include #include #include @@ -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 #include -#include +#include #include #include @@ -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 +#include #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 #include #include -#include +#include #include #include #include @@ -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 #include #include -#include +#include #include #include #include @@ -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 #include #include -#include +#include #include #include #include @@ -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(); } -- cgit v1.2.2 From edbaa603eb801655e80808a9cf3d3b622e8ac66b Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 21 Dec 2011 16:26:03 -0800 Subject: driver-core: remove sysdev.h usage. The sysdev.h file should not be needed by any in-kernel code, so remove the .h file from these random files that seem to still want to include it. The sysdev code will be going away soon, so this include needs to be removed no matter what. Cc: Jiandong Zheng Cc: Scott Branden Cc: Russell King Cc: Kukjin Kim Cc: David Brown Cc: Daniel Walker Cc: Bryan Huntsman Cc: Ben Dooks Cc: Wan ZongShun Cc: Haavard Skinnemoen Cc: Hans-Christian Egtvedt Cc: Guan Xuetao Cc: "Venkatesh Pallipadi Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Grant Likely Cc: Richard Purdie Cc: Matthew Garrett Signed-off-by: Kay Sievers --- arch/arm/mach-s3c2410/bast-irq.c | 2 +- arch/arm/mach-s3c2410/mach-h1940.c | 2 +- arch/arm/mach-s3c2410/mach-qt2410.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'arch/arm/mach-s3c2410') 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 @@ #include #include #include -#include +#include #include #include diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c index 05a7d16e59f5..837a2d6f3524 100644 --- a/arch/arm/mach-s3c2410/mach-h1940.c +++ b/arch/arm/mach-s3c2410/mach-h1940.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/arch/arm/mach-s3c2410/mach-qt2410.c b/arch/arm/mach-s3c2410/mach-qt2410.c index 451852156254..6f69789943d5 100644 --- a/arch/arm/mach-s3c2410/mach-qt2410.c +++ b/arch/arm/mach-s3c2410/mach-qt2410.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include -- cgit v1.2.2 From ea04018e6bc5ddb2f0466c0e5b986bd4901b7e8e Mon Sep 17 00:00:00 2001 From: Kukjin Kim Date: Fri, 6 Jan 2012 16:08:09 +0900 Subject: arm: fix up some samsung merge sysdev conversion problems Following should be fixed in your driver-core/driver-core-next. From: Kukjin Kim Signed-off-by: Greg Kroah-Hartman --- arch/arm/mach-s3c2410/pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/mach-s3c2410') diff --git a/arch/arm/mach-s3c2410/pm.c b/arch/arm/mach-s3c2410/pm.c index 4b948eca73ef..fda5385deff6 100644 --- a/arch/arm/mach-s3c2410/pm.c +++ b/arch/arm/mach-s3c2410/pm.c @@ -137,7 +137,7 @@ arch_initcall(s3c2410_pm_drvinit); static struct subsys_interface s3c2410a_pm_interface = { .name = "s3c2410a_pm", - subsys = &s3c2410a_subsys, + .subsys = &s3c2410a_subsys, .add_dev = s3c2410_pm_add, }; -- cgit v1.2.2