Commit bc2f37cc authored by Patrick Mochel's avatar Patrick Mochel

[oprofile] Convert to use new system device API.

parent 9191f600
......@@ -31,53 +31,48 @@ static int nmi_enabled = 0;
#ifdef CONFIG_PM
static int nmi_suspend(struct device *dev, u32 state, u32 level)
static int nmi_suspend(struct sys_device *dev, u32 state)
{
if (level != SUSPEND_POWER_DOWN)
return 0;
if (nmi_enabled == 1)
nmi_stop();
return 0;
}
static int nmi_resume(struct device *dev, u32 level)
static int nmi_resume(struct sys_device *dev)
{
if (level != RESUME_POWER_ON)
return 0;
if (nmi_enabled == 1)
nmi_start();
return 0;
}
static struct device_driver nmi_driver = {
.name = "oprofile",
.bus = &system_bus_type,
static struct sysdev_class oprofile_sysclass = {
set_kset_name("oprofile"),
.resume = nmi_resume,
.suspend = nmi_suspend,
};
static struct device device_nmi = {
.name = "oprofile",
.bus_id = "oprofile",
.driver = &nmi_driver,
.parent = &device_lapic.dev,
static struct sys_device device_oprofile = {
.id = 0,
.cls = &oprofile_sysclass,
};
static int __init init_driverfs(void)
{
driver_register(&nmi_driver);
return device_register(&device_nmi);
int error;
if (!(error = sysdev_class_register(&oprofile_sysclass)))
error = sys_device_register(&device_oprofile);
return error;
}
static void __exit exit_driverfs(void)
{
device_unregister(&device_nmi);
driver_unregister(&nmi_driver);
sys_device_unregister(&device_oprofile);
sysdev_class_unregister(&oprofile_sysclass);
}
#else
......
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