ARM: davinci: cpuidle: use init/exit common routine
Remove the duplicated code and use the cpuidle common code for initialization. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Acked-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Родитель
30dc72c6fa
Коммит
3aec034590
|
@ -25,7 +25,6 @@
|
||||||
|
|
||||||
#define DAVINCI_CPUIDLE_MAX_STATES 2
|
#define DAVINCI_CPUIDLE_MAX_STATES 2
|
||||||
|
|
||||||
static DEFINE_PER_CPU(struct cpuidle_device, davinci_cpuidle_device);
|
|
||||||
static void __iomem *ddr2_reg_base;
|
static void __iomem *ddr2_reg_base;
|
||||||
static bool ddr2_pdown;
|
static bool ddr2_pdown;
|
||||||
|
|
||||||
|
@ -76,12 +75,8 @@ static struct cpuidle_driver davinci_idle_driver = {
|
||||||
|
|
||||||
static int __init davinci_cpuidle_probe(struct platform_device *pdev)
|
static int __init davinci_cpuidle_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
struct cpuidle_device *device;
|
|
||||||
struct davinci_cpuidle_config *pdata = pdev->dev.platform_data;
|
struct davinci_cpuidle_config *pdata = pdev->dev.platform_data;
|
||||||
|
|
||||||
device = &per_cpu(davinci_cpuidle_device, smp_processor_id());
|
|
||||||
|
|
||||||
if (!pdata) {
|
if (!pdata) {
|
||||||
dev_err(&pdev->dev, "cannot get platform data\n");
|
dev_err(&pdev->dev, "cannot get platform data\n");
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
|
@ -91,20 +86,7 @@ static int __init davinci_cpuidle_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
ddr2_pdown = pdata->ddr2_pdown;
|
ddr2_pdown = pdata->ddr2_pdown;
|
||||||
|
|
||||||
ret = cpuidle_register_driver(&davinci_idle_driver);
|
return cpuidle_register(&davinci_idle_driver, NULL);
|
||||||
if (ret) {
|
|
||||||
dev_err(&pdev->dev, "failed to register driver\n");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = cpuidle_register_device(device);
|
|
||||||
if (ret) {
|
|
||||||
dev_err(&pdev->dev, "failed to register device\n");
|
|
||||||
cpuidle_unregister_driver(&davinci_idle_driver);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct platform_driver davinci_cpuidle_driver = {
|
static struct platform_driver davinci_cpuidle_driver = {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче