summaryrefslogtreecommitdiff
path: root/arch/arm/mach-davinci/devices-da8xx.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2015-10-14 14:42:51 +0300
committerVinod Koul <vinod.koul@intel.com>2015-10-14 19:57:11 +0530
commit7ab388e85faa97a35d520720269e7c8e00ad54a0 (patch)
treefd86e39dad1274e1ae216f127339d00f1bc2a2ec /arch/arm/mach-davinci/devices-da8xx.c
parentb2c843a196b8f5aca74ebabd16c60d59480d6721 (diff)
ARM: davinci: Use platform_device_register_full() to create pdev for eDMA
Convert the eDMA platform device creation to use struct platform_device_info XXXXXX __initconst and platform_device_register_full() This will allow us to cleanly specify the dma_mask for the devices in an upcoming patch. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'arch/arm/mach-davinci/devices-da8xx.c')
-rw-r--r--arch/arm/mach-davinci/devices-da8xx.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index 9ae049ae816a..9f7d266faa0c 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -213,48 +213,50 @@ static struct resource da850_edma1_resources[] = {
},
};
-static struct platform_device da8xx_edma0_device = {
+static const struct platform_device_info da8xx_edma0_device __initconst = {
.name = "edma",
.id = 0,
- .dev = {
- .platform_data = &da8xx_edma0_pdata,
- },
- .num_resources = ARRAY_SIZE(da8xx_edma0_resources),
- .resource = da8xx_edma0_resources,
+ .res = da8xx_edma0_resources,
+ .num_res = ARRAY_SIZE(da8xx_edma0_resources),
+ .data = &da8xx_edma0_pdata,
+ .size_data = sizeof(da8xx_edma0_pdata),
};
-static struct platform_device da850_edma1_device = {
+static const struct platform_device_info da850_edma1_device __initconst = {
.name = "edma",
.id = 1,
- .dev = {
- .platform_data = &da850_edma1_pdata,
- },
- .num_resources = ARRAY_SIZE(da850_edma1_resources),
- .resource = da850_edma1_resources,
+ .res = da850_edma1_resources,
+ .num_res = ARRAY_SIZE(da850_edma1_resources),
+ .data = &da850_edma1_pdata,
+ .size_data = sizeof(da850_edma1_pdata),
};
int __init da830_register_edma(struct edma_rsv_info *rsv)
{
+ struct platform_device *edma_pdev;
+
da8xx_edma0_pdata.rsv = rsv;
- return platform_device_register(&da8xx_edma0_device);
+ edma_pdev = platform_device_register_full(&da8xx_edma0_device);
+ return IS_ERR(edma_pdev) ? PTR_ERR(edma_pdev) : 0;
}
int __init da850_register_edma(struct edma_rsv_info *rsv[2])
{
- int ret;
+ struct platform_device *edma_pdev;
if (rsv) {
da8xx_edma0_pdata.rsv = rsv[0];
da850_edma1_pdata.rsv = rsv[1];
}
- ret = platform_device_register(&da8xx_edma0_device);
- if (ret) {
+ edma_pdev = platform_device_register_full(&da8xx_edma0_device);
+ if (IS_ERR(edma_pdev)) {
pr_warn("%s: Failed to register eDMA0\n", __func__);
- return ret;
+ return PTR_ERR(edma_pdev);
}
- return platform_device_register(&da850_edma1_device);
+ edma_pdev = platform_device_register_full(&da850_edma1_device);
+ return IS_ERR(edma_pdev) ? PTR_ERR(edma_pdev) : 0;
}
static struct resource da8xx_i2c_resources0[] = {