Commit 30dc72c6 authored by Daniel Lezcano's avatar Daniel Lezcano Committed by Rafael J. Wysocki

ARM: kirkwood: cpuidle: use init/exit common routine

Remove the duplicated code and use the cpuidle common code for initialization.
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Tested-by: default avatarAndrew Lunn <andrew@lunn.ch>
Acked-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 0b210d96
...@@ -52,9 +52,6 @@ static struct cpuidle_driver kirkwood_idle_driver = { ...@@ -52,9 +52,6 @@ static struct cpuidle_driver kirkwood_idle_driver = {
}, },
.state_count = KIRKWOOD_MAX_STATES, .state_count = KIRKWOOD_MAX_STATES,
}; };
static struct cpuidle_device *device;
static DEFINE_PER_CPU(struct cpuidle_device, kirkwood_cpuidle_device);
/* Initialize CPU idle by registering the idle states */ /* Initialize CPU idle by registering the idle states */
static int kirkwood_cpuidle_probe(struct platform_device *pdev) static int kirkwood_cpuidle_probe(struct platform_device *pdev)
...@@ -69,22 +66,12 @@ static int kirkwood_cpuidle_probe(struct platform_device *pdev) ...@@ -69,22 +66,12 @@ static int kirkwood_cpuidle_probe(struct platform_device *pdev)
if (IS_ERR(ddr_operation_base)) if (IS_ERR(ddr_operation_base))
return PTR_ERR(ddr_operation_base); return PTR_ERR(ddr_operation_base);
device = &per_cpu(kirkwood_cpuidle_device, smp_processor_id()); return cpuidle_register(&kirkwood_idle_driver, NULL);
device->state_count = KIRKWOOD_MAX_STATES;
cpuidle_register_driver(&kirkwood_idle_driver);
if (cpuidle_register_device(device)) {
pr_err("kirkwood_init_cpuidle: Failed registering\n");
return -EIO;
}
return 0;
} }
int kirkwood_cpuidle_remove(struct platform_device *pdev) int kirkwood_cpuidle_remove(struct platform_device *pdev)
{ {
cpuidle_unregister_device(device); cpuidle_unregister(&kirkwood_idle_driver);
cpuidle_unregister_driver(&kirkwood_idle_driver);
return 0; return 0;
} }
......
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