cpufreq: imx: Use generic platdev driver
authorViresh Kumar <viresh.kumar@linaro.org>
Fri, 22 Apr 2016 11:28:41 +0000 (16:58 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 25 Apr 2016 14:18:23 +0000 (16:18 +0200)
The cpufreq-dt-platdev driver supports creation of cpufreq-dt platform
device now, reuse that and remove similar code from platform code.

Note that the complete routine imx27_dt_init() is removed as

of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);

has same effect as a NULL .init_machine machine callback pointer.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
arch/arm/mach-imx/imx27-dt.c
arch/arm/mach-imx/mach-imx51.c
arch/arm/mach-imx/mach-imx53.c
arch/arm/mach-imx/mach-imx7d.c
drivers/cpufreq/cpufreq-dt-platdev.c

index bd42d1bd10aff1a1f0f28db8ea4fe3fac7ee4adc..530a728c2acc2d9e5d5e7398109de02fc58805ca 100644 (file)
 #include "common.h"
 #include "mx27.h"
 
-static void __init imx27_dt_init(void)
-{
-       struct platform_device_info devinfo = { .name = "cpufreq-dt", };
-
-       of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
-
-       platform_device_register_full(&devinfo);
-}
-
 static const char * const imx27_dt_board_compat[] __initconst = {
        "fsl,imx27",
        NULL
@@ -36,6 +27,5 @@ DT_MACHINE_START(IMX27_DT, "Freescale i.MX27 (Device Tree Support)")
        .map_io         = mx27_map_io,
        .init_early     = imx27_init_early,
        .init_irq       = mx27_init_irq,
-       .init_machine   = imx27_dt_init,
        .dt_compat      = imx27_dt_board_compat,
 MACHINE_END
index 6883fbaf9484b2da00324d42ce2ada3e70cefc66..10a82a4f1e5889894c04519cf257a7059e282191 100644 (file)
@@ -50,13 +50,10 @@ static void __init imx51_ipu_mipi_setup(void)
 
 static void __init imx51_dt_init(void)
 {
-       struct platform_device_info devinfo = { .name = "cpufreq-dt", };
-
        imx51_ipu_mipi_setup();
        imx_src_init();
 
        of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
-       platform_device_register_full(&devinfo);
 }
 
 static void __init imx51_init_late(void)
index 86316a979297fbafdafb815e4a140a24540d4bc8..18b5c5c136db94aeb0456e3fd248f7943e7f85c2 100644 (file)
@@ -40,8 +40,6 @@ static void __init imx53_dt_init(void)
 static void __init imx53_init_late(void)
 {
        imx53_pm_init();
-
-       platform_device_register_simple("cpufreq-dt", -1, NULL, 0);
 }
 
 static const char * const imx53_dt_board_compat[] __initconst = {
index 5a27f20c9a82b84fbeb39a2dd402348c7e0c6862..b450f525a670961b79cd0b3d28271a238dba70a1 100644 (file)
@@ -105,11 +105,6 @@ static void __init imx7d_init_irq(void)
        irqchip_init();
 }
 
-static void __init imx7d_init_late(void)
-{
-       platform_device_register_simple("cpufreq-dt", -1, NULL, 0);
-}
-
 static const char *const imx7d_dt_compat[] __initconst = {
        "fsl,imx7d",
        NULL,
@@ -117,7 +112,6 @@ static const char *const imx7d_dt_compat[] __initconst = {
 
 DT_MACHINE_START(IMX7D, "Freescale i.MX7 Dual (Device Tree)")
        .init_irq       = imx7d_init_irq,
-       .init_late      = imx7d_init_late,
        .init_machine   = imx7d_init_machine,
        .dt_compat      = imx7d_dt_compat,
 MACHINE_END
index 3e1c8211c213958c0c8032421b3ad6ea4f10e334..3843314389c7ca31f883f3edc80afa277a93e011 100644 (file)
 #include <linux/platform_device.h>
 
 static const struct of_device_id machines[] __initconst = {
+       { .compatible = "fsl,imx27", },
+       { .compatible = "fsl,imx51", },
+       { .compatible = "fsl,imx53", },
+       { .compatible = "fsl,imx7d", },
+
        { .compatible = "marvell,berlin", },
 
        { .compatible = "samsung,exynos3250", },