Skip to content

Commit b638823

Browse files
Alejandro Merynsekhar
authored andcommitted
ARM: davinci: Use platform_device_register_full() to create pdev for dm365's eDMA
Convert the DM365 EDMA platform device creation to use struct platform_device_info XXXXXX __initconst and platform_device_register_full() This will allow us to specify the dma_mask for the device in an upcoming patch. Without this, EDMA on DM365 refuses to probe. Fixes: 7ab388e ("ARM: davinci: Use platform_device_register_full() to create pdev for eDMA") Reviewed-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Alejandro Mery <amery@hanoverdisplays.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com>
1 parent 4fbd8d1 commit b638823

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

arch/arm/mach-davinci/dm365.c

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -925,12 +925,13 @@ static struct resource edma_resources[] = {
925925
/* not using TC*_ERR */
926926
};
927927

928-
static struct platform_device dm365_edma_device = {
929-
.name = "edma",
930-
.id = 0,
931-
.dev.platform_data = &dm365_edma_pdata,
932-
.num_resources = ARRAY_SIZE(edma_resources),
933-
.resource = edma_resources,
928+
static const struct platform_device_info dm365_edma_device __initconst = {
929+
.name = "edma",
930+
.id = 0,
931+
.res = edma_resources,
932+
.num_res = ARRAY_SIZE(edma_resources),
933+
.data = &dm365_edma_pdata,
934+
.size_data = sizeof(dm365_edma_pdata),
934935
};
935936

936937
static struct resource dm365_asp_resources[] = {
@@ -1428,13 +1429,18 @@ int __init dm365_init_video(struct vpfe_config *vpfe_cfg,
14281429

14291430
static int __init dm365_init_devices(void)
14301431
{
1432+
struct platform_device *edma_pdev;
14311433
int ret = 0;
14321434

14331435
if (!cpu_is_davinci_dm365())
14341436
return 0;
14351437

14361438
davinci_cfg_reg(DM365_INT_EDMA_CC);
1437-
platform_device_register(&dm365_edma_device);
1439+
edma_pdev = platform_device_register_full(&dm365_edma_device);
1440+
if (IS_ERR(edma_pdev)) {
1441+
pr_warn("%s: Failed to register eDMA\n", __func__);
1442+
return PTR_ERR(edma_pdev);
1443+
}
14381444

14391445
platform_device_register(&dm365_mdio_device);
14401446
platform_device_register(&dm365_emac_device);

0 commit comments

Comments
 (0)