Commit 3cc944bb authored by Patrick Mochel's avatar Patrick Mochel

[lapic] Convert to new system device API.

parent 60c37a8b
......@@ -484,13 +484,11 @@ static struct {
unsigned int apic_thmr;
} apic_pm_state;
static int lapic_suspend(struct device *dev, u32 state, u32 level)
static int lapic_suspend(struct sys_device *dev, u32 state)
{
unsigned int l, h;
unsigned long flags;
if (level != SUSPEND_POWER_DOWN)
return 0;
if (!apic_pm_state.active)
return 0;
......@@ -517,13 +515,11 @@ static int lapic_suspend(struct device *dev, u32 state, u32 level)
return 0;
}
static int lapic_resume(struct device *dev, u32 level)
static int lapic_resume(struct sys_device *dev)
{
unsigned int l, h;
unsigned long flags;
if (level != RESUME_POWER_ON)
return 0;
if (!apic_pm_state.active)
return 0;
......@@ -557,38 +553,37 @@ static int lapic_resume(struct device *dev, u32 level)
return 0;
}
static struct device_driver lapic_driver = {
.name = "lapic",
.bus = &system_bus_type,
static struct sysdev_class lapic_sysclass = {
set_kset_name("lapic"),
.resume = lapic_resume,
.suspend = lapic_suspend,
};
/* not static, needed by child devices */
struct sys_device device_lapic = {
.name = "lapic",
.id = 0,
.dev = {
.name = "lapic",
.driver = &lapic_driver,
},
static struct sys_device device_lapic = {
.id = 0,
.cls = &lapic_sysclass,
};
EXPORT_SYMBOL(device_lapic);
static void __init apic_pm_activate(void)
{
apic_pm_state.active = 1;
}
static int __init init_lapic_devicefs(void)
static int __init init_lapic_sysfs(void)
{
int error;
if (!cpu_has_apic)
return 0;
/* XXX: remove suspend/resume procs if !apic_pm_state.active? */
driver_register(&lapic_driver);
return sys_device_register(&device_lapic);
error = sysdev_class_register(&lapic_sysclass);
if (!error)
error = sys_device_register(&device_lapic);
return error;
}
device_initcall(init_lapic_devicefs);
device_initcall(init_lapic_sysfs);
#else /* CONFIG_PM */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment