ARM: highbank: cpuidle: convert to platform driver
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Fri, 27 Sep 2013 10:47:45 +0000 (12:47 +0200)
committerRob Herring <rob.herring@calxeda.com>
Tue, 1 Oct 2013 21:30:20 +0000 (16:30 -0500)
As the ux500 and the kirkwood driver, make the calxeda driver a platform driver

[Compiled only]

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
arch/arm/mach-highbank/highbank.c
drivers/cpuidle/cpuidle-calxeda.c

index 8e63ccdb0de3c9c80923e46eadec91e6e9e1689e..a78ed62d6542364cf77fdac4eb5f9ebb01f5f66f 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/of_address.h>
 #include <linux/amba/bus.h>
 #include <linux/clk-provider.h>
+#include <linux/platform_device.h>
 
 #include <asm/cacheflush.h>
 #include <asm/cputype.h>
@@ -153,6 +154,10 @@ static struct notifier_block highbank_platform_nb = {
        .notifier_call = highbank_platform_notifier,
 };
 
+static struct platform_device highbank_cpuidle_device = {
+       .name = "cpuidle-calxeda",
+};
+
 static void __init highbank_init(void)
 {
        pm_power_off = highbank_power_off;
@@ -162,6 +167,9 @@ static void __init highbank_init(void)
        bus_register_notifier(&amba_bustype, &highbank_amba_nb);
 
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
+
+       if (of_machine_is_compatible("calxeda,highbank"))
+               platform_device_register(&highbank_cpuidle_device);
 }
 
 static const char *highbank_match[] __initconst = {
index bed707ab6d6e14f9950b112c3184d2cb0e001f0a..6d49527d4a0cabb01ebe226142e1f68963caeb2d 100644 (file)
 #include <linux/cpu_pm.h>
 #include <linux/init.h>
 #include <linux/io.h>
-#include <linux/of.h>
 #include <linux/time.h>
 #include <linux/delay.h>
 #include <linux/suspend.h>
+#include <linux/platform_device.h>
 #include <asm/cpuidle.h>
 #include <asm/proc-fns.h>
 #include <asm/smp_scu.h>
@@ -92,11 +92,17 @@ static struct cpuidle_driver calxeda_idle_driver = {
        .state_count = 2,
 };
 
-static int __init calxeda_cpuidle_init(void)
+static int __init calxeda_cpuidle_probe(struct platform_device *pdev)
 {
-       if (!of_machine_is_compatible("calxeda,highbank"))
-               return -ENODEV;
-
        return cpuidle_register(&calxeda_idle_driver, NULL);
 }
-module_init(calxeda_cpuidle_init);
+
+static struct platform_driver calxeda_cpuidle_plat_driver = {
+        .driver = {
+                .name = "cpuidle-calxeda",
+                .owner = THIS_MODULE,
+        },
+        .probe = calxeda_cpuidle_probe,
+};
+
+module_platform_driver(calxeda_cpuidle_plat_driver);