Skip to content

Commit

Permalink
arm: convert sysdev_class to a regular subsystem
Browse files Browse the repository at this point in the history
After all sysdev classes are ported to regular driver core entities, the
sysdev implementation will be entirely removed from the kernel.

Cc: Kukjin Kim <[email protected]>
Cc: Russell King <[email protected]>
Cc: Ben Dooks <[email protected]>
Cc: Vinod Koul <[email protected]>
Cc: Boojin Kim <[email protected]>
Cc: Linus Walleij <[email protected]>
Cc: Lucas De Marchi <[email protected]>
Cc: Heiko Stuebner <[email protected]>
Signed-off-by: Kay Sievers <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
kaysievers authored and gregkh committed Dec 22, 2011
1 parent 8f1e938 commit 4a858cf
Show file tree
Hide file tree
Showing 43 changed files with 368 additions and 293 deletions.
2 changes: 1 addition & 1 deletion arch/arm/include/asm/mach/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#ifndef __ASM_ARM_MACH_TIME_H
#define __ASM_ARM_MACH_TIME_H

#include <linux/sysdev.h>
#include <linux/device.h>

/*
* This is our kernel timer structure.
Expand Down
15 changes: 8 additions & 7 deletions arch/arm/mach-exynos/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/

#include <linux/sched.h>
#include <linux/sysdev.h>
#include <linux/device.h>

#include <asm/mach/map.h>
#include <asm/mach/irq.h>
Expand Down Expand Up @@ -243,17 +243,18 @@ void __init exynos4_init_irq(void)
s5p_init_irq(NULL, 0);
}

struct sysdev_class exynos4_sysclass = {
.name = "exynos4-core",
struct bus_type exynos4_subsys = {
.name = "exynos4-core",
.dev_name = "exynos4-core",
};

static struct sys_device exynos4_sysdev = {
.cls = &exynos4_sysclass,
static struct device exynos4_dev = {
.bus = &exynos4_subsys,
};

static int __init exynos4_core_init(void)
{
return sysdev_class_register(&exynos4_sysclass);
return subsys_system_register(&exynos4_subsys, NULL);
}
core_initcall(exynos4_core_init);

Expand Down Expand Up @@ -294,5 +295,5 @@ int __init exynos_init(void)
if (soc_is_exynos4210() || soc_is_exynos4212() || soc_is_exynos4412())
s5p_reset_hook = exynos4_sw_reset;

return sysdev_register(&exynos4_sysdev);
return device_register(&exynos4_dev);
}
10 changes: 6 additions & 4 deletions arch/arm/mach-exynos/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ static void exynos4_pm_prepare(void)

}

static int exynos4_pm_add(struct sys_device *sysdev)
static int exynos4_pm_add(struct device *dev)
{
pm_cpu_prep = exynos4_pm_prepare;
pm_cpu_sleep = exynos4_cpu_suspend;
Expand Down Expand Up @@ -301,8 +301,10 @@ static void exynos4_restore_pll(void)
} while (epll_wait || vpll_wait);
}

static struct sysdev_driver exynos4_pm_driver = {
.add = exynos4_pm_add,
static struct subsys_interface exynos4_pm_interface = {
.name = "exynos4_pm",
.subsys = &exynos4_subsys,
.add_dev = exynos4_pm_add,
};

static __init int exynos4_pm_drvinit(void)
Expand All @@ -325,7 +327,7 @@ static __init int exynos4_pm_drvinit(void)
clk_put(pll_base);
}

return sysdev_driver_register(&exynos4_sysclass, &exynos4_pm_driver);
return subsys_interface_register(&exynos4_pm_interface);
}
arch_initcall(exynos4_pm_drvinit);

Expand Down
26 changes: 14 additions & 12 deletions arch/arm/mach-s3c2410/cpu-freq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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
Expand All @@ -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);
28 changes: 17 additions & 11 deletions arch/arm/mach-s3c2410/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -132,46 +132,52 @@ 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);
return s3c24xx_dma_init_map(&s3c2410_dma_sel);
}

#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);
#endif

#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);
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-s3c2410/include/mach/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down Expand Up @@ -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;
Expand Down
20 changes: 12 additions & 8 deletions arch/arm/mach-s3c2410/pll.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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);
36 changes: 22 additions & 14 deletions arch/arm/mach-s3c2410/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down
Loading

0 comments on commit 4a858cf

Please sign in to comment.