Commit 9bbfa0fa authored by Patrick Mochel's avatar Patrick Mochel

[x86-64 i8259] Convert to use new system device API.

parent bc2f37cc
...@@ -413,35 +413,31 @@ static void setup_timer(void) ...@@ -413,35 +413,31 @@ static void setup_timer(void)
outb(LATCH >> 8 , 0x40); /* MSB */ outb(LATCH >> 8 , 0x40); /* MSB */
} }
static int timer_resume(struct device *dev, u32 level) static int timer_resume(struct sys_device *dev)
{ {
if (level == RESUME_POWER_ON)
setup_timer(); setup_timer();
return 0; return 0;
} }
static struct device_driver timer_driver = { static struct sysdev_class timer_sysclass = {
.name = "timer", set_kset_name("timer"),
.bus = &system_bus_type,
.resume = timer_resume, .resume = timer_resume,
}; };
static struct sys_device device_timer = { static struct sys_device device_timer = {
.name = "timer",
.id = 0, .id = 0,
.dev = { .cls &timer_sysclass,
.name = "timer",
.driver = &timer_driver,
},
}; };
static int __init init_timer_devicefs(void) static int __init init_timer_sysfs(void)
{ {
driver_register(&timer_driver); int error = sysdev_class_register(&timer_sysclass);
return sys_device_register(&device_timer); if (!error)
error = sys_device_register(&device_timer);
return error;
} }
device_initcall(init_timer_devicefs); device_initcall(init_timer_sysfs);
void __init init_IRQ(void) void __init init_IRQ(void)
{ {
......
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