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-s3c2412/cpu-freq.c | 13 +++++++------ arch/arm/mach-s3c2412/dma.c | 12 +++++++----- arch/arm/mach-s3c2412/irq.c | 12 +++++++----- arch/arm/mach-s3c2412/pm.c | 12 +++++++----- arch/arm/mach-s3c2412/s3c2412.c | 15 ++++++++------- 5 files changed, 36 insertions(+), 28 deletions(-) (limited to 'arch/arm/mach-s3c2412') 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 @@ #include #include #include -#include +#include #include #include #include @@ -194,7 +194,7 @@ static struct s3c_cpufreq_info s3c2412_cpufreq_info = { .debug_io_show = s3c_cpufreq_debugfs_call(s3c2412_iotiming_debugfs), }; -static int s3c2412_cpufreq_add(struct sys_device *sysdev) +static int s3c2412_cpufreq_add(struct device *dev) { unsigned long fclk_rate; @@ -244,14 +244,15 @@ err_fclk: return -ENOENT; } -static struct sysdev_driver s3c2412_cpufreq_driver = { - .add = s3c2412_cpufreq_add, +static struct subsys_interface s3c2412_cpufreq_interface = { + .name = "s3c2412_cpufreq", + .subsys = &s3c2412_subsys, + .add_dev = s3c2412_cpufreq_add, }; static int s3c2412_cpufreq_init(void) { - return sysdev_driver_register(&s3c2412_sysclass, - &s3c2412_cpufreq_driver); + return subsys_interface_register(&s3c2412_cpufreq_interface); } 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 @@ #include #include -#include +#include #include #include @@ -159,19 +159,21 @@ static struct s3c24xx_dma_selection __initdata s3c2412_dma_sel = { .map_size = ARRAY_SIZE(s3c2412_dma_mappings), }; -static int __init s3c2412_dma_add(struct sys_device *sysdev) +static int __init s3c2412_dma_add(struct device *dev) { s3c2410_dma_init(); return s3c24xx_dma_init_map(&s3c2412_dma_sel); } -static struct sysdev_driver s3c2412_dma_driver = { - .add = s3c2412_dma_add, +static struct subsys_interface s3c2412_dma_interface = { + .name = "s3c2412_dma", + .subsys = &s3c2412_subsys, + .add_dev = s3c2412_dma_add, }; static int __init s3c2412_dma_init(void) { - return sysdev_driver_register(&s3c2412_sysclass, &s3c2412_dma_driver); + return subsys_interface_register(&s3c2412_dma_interface); } 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 @@ #include #include #include -#include +#include #include #include @@ -170,7 +170,7 @@ static int s3c2412_irq_rtc_wake(struct irq_data *data, unsigned int state) static struct irq_chip s3c2412_irq_rtc_chip; -static int s3c2412_irq_add(struct sys_device *sysdev) +static int s3c2412_irq_add(struct device *dev) { unsigned int irqno; @@ -200,13 +200,15 @@ static int s3c2412_irq_add(struct sys_device *sysdev) return 0; } -static struct sysdev_driver s3c2412_irq_driver = { - .add = s3c2412_irq_add, +static struct subsys_interface s3c2412_irq_interface = { + .name = "s3c2412_irq", + .subsys = &s3c2412_subsys, + .add_dev = s3c2412_irq_add, }; static int s3c2412_irq_init(void) { - return sysdev_driver_register(&s3c2412_sysclass, &s3c2412_irq_driver); + return subsys_interface_register(&s3c2412_irq_interface); } arch_initcall(s3c2412_irq_init); diff --git a/arch/arm/mach-s3c2412/pm.c b/arch/arm/mach-s3c2412/pm.c index f4077efa51fa..fd7210d74db9 100644 --- a/arch/arm/mach-s3c2412/pm.c +++ b/arch/arm/mach-s3c2412/pm.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include @@ -56,7 +56,7 @@ static void s3c2412_pm_prepare(void) { } -static int s3c2412_pm_add(struct sys_device *sysdev) +static int s3c2412_pm_add(struct device *dev) { pm_cpu_prep = s3c2412_pm_prepare; pm_cpu_sleep = s3c2412_cpu_suspend; @@ -87,13 +87,15 @@ static struct sleep_save s3c2412_sleep[] = { SAVE_ITEM(S3C2413_GPJSLPCON), }; -static struct sysdev_driver s3c2412_pm_driver = { - .add = s3c2412_pm_add, +static struct subsys_interface s3c2412_pm_interface = { + .name = "s3c2412_pm", + .subsys = &s3c2412_subsys, + .add_dev = s3c2412_pm_add, }; static __init int s3c2412_pm_init(void) { - return sysdev_driver_register(&s3c2412_sysclass, &s3c2412_pm_driver); + return subsys_interface_register_register(&s3c2412_pm_interface); } arch_initcall(s3c2412_pm_init); diff --git a/arch/arm/mach-s3c2412/s3c2412.c b/arch/arm/mach-s3c2412/s3c2412.c index 57a1e01e4e50..6c7253ffc5bc 100644 --- a/arch/arm/mach-s3c2412/s3c2412.c +++ b/arch/arm/mach-s3c2412/s3c2412.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include @@ -220,25 +220,26 @@ void __init s3c2412_init_clocks(int xtal) s3c2412_baseclk_add(); } -/* 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 s3c2412 based system) * as a driver which may support both 2410 and 2440 may try and use it. */ -struct sysdev_class s3c2412_sysclass = { +struct bus_type s3c2412_subsys = { .name = "s3c2412-core", + .dev_name = "s3c2412-core", }; static int __init s3c2412_core_init(void) { - return sysdev_class_register(&s3c2412_sysclass); + return subsys_system_register(&s3c2412_subsys, NULL); } core_initcall(s3c2412_core_init); -static struct sys_device s3c2412_sysdev = { - .cls = &s3c2412_sysclass, +static struct device s3c2412_dev = { + .bus = &s3c2412_subsys, }; int __init s3c2412_init(void) @@ -250,5 +251,5 @@ int __init s3c2412_init(void) #endif register_syscore_ops(&s3c24xx_irq_syscore_ops); - return sysdev_register(&s3c2412_sysdev); + return device_register(&s3c2412_dev); } -- cgit v1.2.3 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-s3c2412/clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/mach-s3c2412') 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 @@ #include #include #include -#include +#include #include #include #include -- cgit v1.2.3 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-s3c2412/pm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/mach-s3c2412') diff --git a/arch/arm/mach-s3c2412/pm.c b/arch/arm/mach-s3c2412/pm.c index fd7210d74db9..d1adfa65f66d 100644 --- a/arch/arm/mach-s3c2412/pm.c +++ b/arch/arm/mach-s3c2412/pm.c @@ -95,7 +95,7 @@ static struct subsys_interface s3c2412_pm_interface = { static __init int s3c2412_pm_init(void) { - return subsys_interface_register_register(&s3c2412_pm_interface); + return subsys_interface_register(&s3c2412_pm_interface); } arch_initcall(s3c2412_pm_init); -- cgit v1.2.3