diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2015-10-14 07:42:51 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2015-10-14 10:27:11 -0400 |
commit | 7ab388e85faa97a35d520720269e7c8e00ad54a0 (patch) | |
tree | fd86e39dad1274e1ae216f127339d00f1bc2a2ec | |
parent | b2c843a196b8f5aca74ebabd16c60d59480d6721 (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>
-rw-r--r-- | arch/arm/mach-davinci/devices-da8xx.c | 38 | ||||
-rw-r--r-- | arch/arm/mach-davinci/dm355.c | 20 | ||||
-rw-r--r-- | arch/arm/mach-davinci/dm644x.c | 20 | ||||
-rw-r--r-- | arch/arm/mach-davinci/dm646x.c | 18 |
4 files changed, 57 insertions, 39 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[] = { | |||
213 | }, | 213 | }, |
214 | }; | 214 | }; |
215 | 215 | ||
216 | static struct platform_device da8xx_edma0_device = { | 216 | static const struct platform_device_info da8xx_edma0_device __initconst = { |
217 | .name = "edma", | 217 | .name = "edma", |
218 | .id = 0, | 218 | .id = 0, |
219 | .dev = { | 219 | .res = da8xx_edma0_resources, |
220 | .platform_data = &da8xx_edma0_pdata, | 220 | .num_res = ARRAY_SIZE(da8xx_edma0_resources), |
221 | }, | 221 | .data = &da8xx_edma0_pdata, |
222 | .num_resources = ARRAY_SIZE(da8xx_edma0_resources), | 222 | .size_data = sizeof(da8xx_edma0_pdata), |
223 | .resource = da8xx_edma0_resources, | ||
224 | }; | 223 | }; |
225 | 224 | ||
226 | static struct platform_device da850_edma1_device = { | 225 | static const struct platform_device_info da850_edma1_device __initconst = { |
227 | .name = "edma", | 226 | .name = "edma", |
228 | .id = 1, | 227 | .id = 1, |
229 | .dev = { | 228 | .res = da850_edma1_resources, |
230 | .platform_data = &da850_edma1_pdata, | 229 | .num_res = ARRAY_SIZE(da850_edma1_resources), |
231 | }, | 230 | .data = &da850_edma1_pdata, |
232 | .num_resources = ARRAY_SIZE(da850_edma1_resources), | 231 | .size_data = sizeof(da850_edma1_pdata), |
233 | .resource = da850_edma1_resources, | ||
234 | }; | 232 | }; |
235 | 233 | ||
236 | int __init da830_register_edma(struct edma_rsv_info *rsv) | 234 | int __init da830_register_edma(struct edma_rsv_info *rsv) |
237 | { | 235 | { |
236 | struct platform_device *edma_pdev; | ||
237 | |||
238 | da8xx_edma0_pdata.rsv = rsv; | 238 | da8xx_edma0_pdata.rsv = rsv; |
239 | 239 | ||
240 | return platform_device_register(&da8xx_edma0_device); | 240 | edma_pdev = platform_device_register_full(&da8xx_edma0_device); |
241 | return IS_ERR(edma_pdev) ? PTR_ERR(edma_pdev) : 0; | ||
241 | } | 242 | } |
242 | 243 | ||
243 | int __init da850_register_edma(struct edma_rsv_info *rsv[2]) | 244 | int __init da850_register_edma(struct edma_rsv_info *rsv[2]) |
244 | { | 245 | { |
245 | int ret; | 246 | struct platform_device *edma_pdev; |
246 | 247 | ||
247 | if (rsv) { | 248 | if (rsv) { |
248 | da8xx_edma0_pdata.rsv = rsv[0]; | 249 | da8xx_edma0_pdata.rsv = rsv[0]; |
249 | da850_edma1_pdata.rsv = rsv[1]; | 250 | da850_edma1_pdata.rsv = rsv[1]; |
250 | } | 251 | } |
251 | 252 | ||
252 | ret = platform_device_register(&da8xx_edma0_device); | 253 | edma_pdev = platform_device_register_full(&da8xx_edma0_device); |
253 | if (ret) { | 254 | if (IS_ERR(edma_pdev)) { |
254 | pr_warn("%s: Failed to register eDMA0\n", __func__); | 255 | pr_warn("%s: Failed to register eDMA0\n", __func__); |
255 | return ret; | 256 | return PTR_ERR(edma_pdev); |
256 | } | 257 | } |
257 | return platform_device_register(&da850_edma1_device); | 258 | edma_pdev = platform_device_register_full(&da850_edma1_device); |
259 | return IS_ERR(edma_pdev) ? PTR_ERR(edma_pdev) : 0; | ||
258 | } | 260 | } |
259 | 261 | ||
260 | static struct resource da8xx_i2c_resources0[] = { | 262 | static struct resource da8xx_i2c_resources0[] = { |
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c index a50bb9c66952..5f10c6695e31 100644 --- a/arch/arm/mach-davinci/dm355.c +++ b/arch/arm/mach-davinci/dm355.c | |||
@@ -613,12 +613,13 @@ static struct resource edma_resources[] = { | |||
613 | /* not using (or muxing) TC*_ERR */ | 613 | /* not using (or muxing) TC*_ERR */ |
614 | }; | 614 | }; |
615 | 615 | ||
616 | static struct platform_device dm355_edma_device = { | 616 | static const struct platform_device_info dm355_edma_device __initconst = { |
617 | .name = "edma", | 617 | .name = "edma", |
618 | .id = 0, | 618 | .id = 0, |
619 | .dev.platform_data = &dm355_edma_pdata, | 619 | .res = edma_resources, |
620 | .num_resources = ARRAY_SIZE(edma_resources), | 620 | .num_res = ARRAY_SIZE(edma_resources), |
621 | .resource = edma_resources, | 621 | .data = &dm355_edma_pdata, |
622 | .size_data = sizeof(dm355_edma_pdata), | ||
622 | }; | 623 | }; |
623 | 624 | ||
624 | static struct resource dm355_asp1_resources[] = { | 625 | static struct resource dm355_asp1_resources[] = { |
@@ -1057,13 +1058,18 @@ int __init dm355_init_video(struct vpfe_config *vpfe_cfg, | |||
1057 | 1058 | ||
1058 | static int __init dm355_init_devices(void) | 1059 | static int __init dm355_init_devices(void) |
1059 | { | 1060 | { |
1061 | struct platform_device *edma_pdev; | ||
1060 | int ret = 0; | 1062 | int ret = 0; |
1061 | 1063 | ||
1062 | if (!cpu_is_davinci_dm355()) | 1064 | if (!cpu_is_davinci_dm355()) |
1063 | return 0; | 1065 | return 0; |
1064 | 1066 | ||
1065 | davinci_cfg_reg(DM355_INT_EDMA_CC); | 1067 | davinci_cfg_reg(DM355_INT_EDMA_CC); |
1066 | platform_device_register(&dm355_edma_device); | 1068 | edma_pdev = platform_device_register_full(&dm355_edma_device); |
1069 | if (IS_ERR(edma_pdev)) { | ||
1070 | pr_warn("%s: Failed to register eDMA\n", __func__); | ||
1071 | return PTR_ERR(edma_pdev); | ||
1072 | } | ||
1067 | 1073 | ||
1068 | ret = davinci_init_wdt(); | 1074 | ret = davinci_init_wdt(); |
1069 | if (ret) | 1075 | if (ret) |
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c index d759ca8e58e8..aa3453b40d5f 100644 --- a/arch/arm/mach-davinci/dm644x.c +++ b/arch/arm/mach-davinci/dm644x.c | |||
@@ -542,12 +542,13 @@ static struct resource edma_resources[] = { | |||
542 | /* not using TC*_ERR */ | 542 | /* not using TC*_ERR */ |
543 | }; | 543 | }; |
544 | 544 | ||
545 | static struct platform_device dm644x_edma_device = { | 545 | static const struct platform_device_info dm644x_edma_device __initconst = { |
546 | .name = "edma", | 546 | .name = "edma", |
547 | .id = 0, | 547 | .id = 0, |
548 | .dev.platform_data = &dm644x_edma_pdata, | 548 | .res = edma_resources, |
549 | .num_resources = ARRAY_SIZE(edma_resources), | 549 | .num_res = ARRAY_SIZE(edma_resources), |
550 | .resource = edma_resources, | 550 | .data = &dm644x_edma_pdata, |
551 | .size_data = sizeof(dm644x_edma_pdata), | ||
551 | }; | 552 | }; |
552 | 553 | ||
553 | /* DM6446 EVM uses ASP0; line-out is a pair of RCA jacks */ | 554 | /* DM6446 EVM uses ASP0; line-out is a pair of RCA jacks */ |
@@ -945,12 +946,17 @@ int __init dm644x_init_video(struct vpfe_config *vpfe_cfg, | |||
945 | 946 | ||
946 | static int __init dm644x_init_devices(void) | 947 | static int __init dm644x_init_devices(void) |
947 | { | 948 | { |
949 | struct platform_device *edma_pdev; | ||
948 | int ret = 0; | 950 | int ret = 0; |
949 | 951 | ||
950 | if (!cpu_is_davinci_dm644x()) | 952 | if (!cpu_is_davinci_dm644x()) |
951 | return 0; | 953 | return 0; |
952 | 954 | ||
953 | platform_device_register(&dm644x_edma_device); | 955 | edma_pdev = platform_device_register_full(&dm644x_edma_device); |
956 | if (IS_ERR(edma_pdev)) { | ||
957 | pr_warn("%s: Failed to register eDMA\n", __func__); | ||
958 | return PTR_ERR(edma_pdev); | ||
959 | } | ||
954 | 960 | ||
955 | platform_device_register(&dm644x_mdio_device); | 961 | platform_device_register(&dm644x_mdio_device); |
956 | platform_device_register(&dm644x_emac_device); | 962 | platform_device_register(&dm644x_emac_device); |
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c index 219ebc8f674a..79c1d8917dd3 100644 --- a/arch/arm/mach-davinci/dm646x.c +++ b/arch/arm/mach-davinci/dm646x.c | |||
@@ -589,12 +589,13 @@ static struct resource edma_resources[] = { | |||
589 | /* not using TC*_ERR */ | 589 | /* not using TC*_ERR */ |
590 | }; | 590 | }; |
591 | 591 | ||
592 | static struct platform_device dm646x_edma_device = { | 592 | static const struct platform_device_info dm646x_edma_device __initconst = { |
593 | .name = "edma", | 593 | .name = "edma", |
594 | .id = 0, | 594 | .id = 0, |
595 | .dev.platform_data = &dm646x_edma_pdata, | 595 | .res = edma_resources, |
596 | .num_resources = ARRAY_SIZE(edma_resources), | 596 | .num_res = ARRAY_SIZE(edma_resources), |
597 | .resource = edma_resources, | 597 | .data = &dm646x_edma_pdata, |
598 | .size_data = sizeof(dm646x_edma_pdata), | ||
598 | }; | 599 | }; |
599 | 600 | ||
600 | static struct resource dm646x_mcasp0_resources[] = { | 601 | static struct resource dm646x_mcasp0_resources[] = { |
@@ -931,9 +932,12 @@ void dm646x_setup_vpif(struct vpif_display_config *display_config, | |||
931 | 932 | ||
932 | int __init dm646x_init_edma(struct edma_rsv_info *rsv) | 933 | int __init dm646x_init_edma(struct edma_rsv_info *rsv) |
933 | { | 934 | { |
935 | struct platform_device *edma_pdev; | ||
936 | |||
934 | dm646x_edma_pdata.rsv = rsv; | 937 | dm646x_edma_pdata.rsv = rsv; |
935 | 938 | ||
936 | return platform_device_register(&dm646x_edma_device); | 939 | edma_pdev = platform_device_register_full(&dm646x_edma_device); |
940 | return IS_ERR(edma_pdev) ? PTR_ERR(edma_pdev) : 0; | ||
937 | } | 941 | } |
938 | 942 | ||
939 | void __init dm646x_init(void) | 943 | void __init dm646x_init(void) |