Commit 8e730c7f authored by Sekhar Nori's avatar Sekhar Nori

ARM: davinci: dm644x: remove unnecessary postcore_initcall()

dm644x_init_devices() is unnecessarily implemented as a
postcore_initcall().

This does not cause any issues now, but creates issues when
converting to common clock framework where clocks themselves
become platform devices and are initialized later. Because of
this, device clock acquisition and runtime PM on that device
fails.

Move the call to .init_machine() callback along with rest of
platform device's registration.

While at it, convert it to return void since return value is
ignored by caller anyway.
Reviewed-by: default avatarDavid Lechner <david@lechnology.com>
Signed-off-by: default avatarSekhar Nori <nsekhar@ti.com>
parent 60cc43fc
...@@ -768,6 +768,8 @@ static __init void davinci_evm_init(void) ...@@ -768,6 +768,8 @@ static __init void davinci_evm_init(void)
struct clk *aemif_clk; struct clk *aemif_clk;
struct davinci_soc_info *soc_info = &davinci_soc_info; struct davinci_soc_info *soc_info = &davinci_soc_info;
dm644x_init_devices();
ret = dm644x_gpio_register(); ret = dm644x_gpio_register();
if (ret) if (ret)
pr_warn("%s: GPIO init failed: %d\n", __func__, ret); pr_warn("%s: GPIO init failed: %d\n", __func__, ret);
......
...@@ -174,6 +174,8 @@ static __init void davinci_ntosd2_init(void) ...@@ -174,6 +174,8 @@ static __init void davinci_ntosd2_init(void)
struct clk *aemif_clk; struct clk *aemif_clk;
struct davinci_soc_info *soc_info = &davinci_soc_info; struct davinci_soc_info *soc_info = &davinci_soc_info;
dm644x_init_devices();
ret = dm644x_gpio_register(); ret = dm644x_gpio_register();
if (ret) if (ret)
pr_warn("%s: GPIO init failed: %d\n", __func__, ret); pr_warn("%s: GPIO init failed: %d\n", __func__, ret);
......
...@@ -134,6 +134,8 @@ static __init void davinci_sffsdr_init(void) ...@@ -134,6 +134,8 @@ static __init void davinci_sffsdr_init(void)
{ {
struct davinci_soc_info *soc_info = &davinci_soc_info; struct davinci_soc_info *soc_info = &davinci_soc_info;
dm644x_init_devices();
platform_add_devices(davinci_sffsdr_devices, platform_add_devices(davinci_sffsdr_devices,
ARRAY_SIZE(davinci_sffsdr_devices)); ARRAY_SIZE(davinci_sffsdr_devices));
sffsdr_init_i2c(); sffsdr_init_i2c();
......
...@@ -104,6 +104,7 @@ int dm365_gpio_register(void); ...@@ -104,6 +104,7 @@ int dm365_gpio_register(void);
/* DM644x function declarations */ /* DM644x function declarations */
void dm644x_init(void); void dm644x_init(void);
void dm644x_init_devices(void);
void dm644x_init_time(void); void dm644x_init_time(void);
void dm644x_init_asp(void); void dm644x_init_asp(void);
int dm644x_init_video(struct vpfe_config *, struct vpbe_config *); int dm644x_init_video(struct vpfe_config *, struct vpbe_config *);
......
...@@ -961,19 +961,14 @@ int __init dm644x_init_video(struct vpfe_config *vpfe_cfg, ...@@ -961,19 +961,14 @@ int __init dm644x_init_video(struct vpfe_config *vpfe_cfg,
return 0; return 0;
} }
static int __init dm644x_init_devices(void) void __init dm644x_init_devices(void)
{ {
struct platform_device *edma_pdev; struct platform_device *edma_pdev;
int ret = 0; int ret;
if (!cpu_is_davinci_dm644x())
return 0;
edma_pdev = platform_device_register_full(&dm644x_edma_device); edma_pdev = platform_device_register_full(&dm644x_edma_device);
if (IS_ERR(edma_pdev)) { if (IS_ERR(edma_pdev))
pr_warn("%s: Failed to register eDMA\n", __func__); pr_warn("%s: Failed to register eDMA\n", __func__);
return PTR_ERR(edma_pdev);
}
platform_device_register(&dm644x_mdio_device); platform_device_register(&dm644x_mdio_device);
platform_device_register(&dm644x_emac_device); platform_device_register(&dm644x_emac_device);
...@@ -982,6 +977,4 @@ static int __init dm644x_init_devices(void) ...@@ -982,6 +977,4 @@ static int __init dm644x_init_devices(void)
if (ret) if (ret)
pr_warn("%s: watchdog init failed: %d\n", __func__, ret); pr_warn("%s: watchdog init failed: %d\n", __func__, ret);
return ret;
} }
postcore_initcall(dm644x_init_devices);
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