Skip to content

Commit

Permalink
ARM: davinci: Use platform_device_register_full() to create pdev for …
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
Alejandro Mery authored and nsekhar committed Dec 7, 2017
1 parent 4fbd8d1 commit b638823
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions arch/arm/mach-davinci/dm365.c
Original file line number Diff line number Diff line change
Expand Up @@ -925,12 +925,13 @@ static struct resource edma_resources[] = {
/* not using TC*_ERR */
};

static struct platform_device dm365_edma_device = {
.name = "edma",
.id = 0,
.dev.platform_data = &dm365_edma_pdata,
.num_resources = ARRAY_SIZE(edma_resources),
.resource = edma_resources,
static const struct platform_device_info dm365_edma_device __initconst = {
.name = "edma",
.id = 0,
.res = edma_resources,
.num_res = ARRAY_SIZE(edma_resources),
.data = &dm365_edma_pdata,
.size_data = sizeof(dm365_edma_pdata),
};

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

static int __init dm365_init_devices(void)
{
struct platform_device *edma_pdev;
int ret = 0;

if (!cpu_is_davinci_dm365())
return 0;

davinci_cfg_reg(DM365_INT_EDMA_CC);
platform_device_register(&dm365_edma_device);
edma_pdev = platform_device_register_full(&dm365_edma_device);
if (IS_ERR(edma_pdev)) {
pr_warn("%s: Failed to register eDMA\n", __func__);
return PTR_ERR(edma_pdev);
}

platform_device_register(&dm365_mdio_device);
platform_device_register(&dm365_emac_device);
Expand Down

0 comments on commit b638823

Please sign in to comment.