Skip to content

Commit

Permalink
cpufreq: imx: Use generic platdev driver
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Viresh Kumar authored and Rafael J. Wysocki committed Apr 25, 2016
1 parent a59511d commit 7ead83f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 21 deletions.
10 changes: 0 additions & 10 deletions arch/arm/mach-imx/imx27-dt.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@
#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
Expand All @@ -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
3 changes: 0 additions & 3 deletions arch/arm/mach-imx/mach-imx51.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/mach-imx/mach-imx53.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
6 changes: 0 additions & 6 deletions arch/arm/mach-imx/mach-imx7d.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,13 @@ 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,
};

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
5 changes: 5 additions & 0 deletions drivers/cpufreq/cpufreq-dt-platdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
#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", },
Expand Down

0 comments on commit 7ead83f

Please sign in to comment.