diff options
| -rw-r--r-- | arch/arm/common/edma.c | 9 | ||||
| -rw-r--r-- | drivers/dma/edma.c | 40 |
2 files changed, 10 insertions, 39 deletions
diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c index d86771abbf57..72041f002b7e 100644 --- a/arch/arm/common/edma.c +++ b/arch/arm/common/edma.c | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include <linux/io.h> | 26 | #include <linux/io.h> |
| 27 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
| 28 | #include <linux/edma.h> | 28 | #include <linux/edma.h> |
| 29 | #include <linux/dma-mapping.h> | ||
| 29 | #include <linux/of_address.h> | 30 | #include <linux/of_address.h> |
| 30 | #include <linux/of_device.h> | 31 | #include <linux/of_device.h> |
| 31 | #include <linux/of_dma.h> | 32 | #include <linux/of_dma.h> |
| @@ -1623,6 +1624,11 @@ static int edma_probe(struct platform_device *pdev) | |||
| 1623 | struct device_node *node = pdev->dev.of_node; | 1624 | struct device_node *node = pdev->dev.of_node; |
| 1624 | struct device *dev = &pdev->dev; | 1625 | struct device *dev = &pdev->dev; |
| 1625 | int ret; | 1626 | int ret; |
| 1627 | struct platform_device_info edma_dev_info = { | ||
| 1628 | .name = "edma-dma-engine", | ||
| 1629 | .dma_mask = DMA_BIT_MASK(32), | ||
| 1630 | .parent = &pdev->dev, | ||
| 1631 | }; | ||
| 1626 | 1632 | ||
| 1627 | if (node) { | 1633 | if (node) { |
| 1628 | /* Check if this is a second instance registered */ | 1634 | /* Check if this is a second instance registered */ |
| @@ -1793,6 +1799,9 @@ static int edma_probe(struct platform_device *pdev) | |||
| 1793 | edma_write_array(j, EDMA_QRAE, i, 0x0); | 1799 | edma_write_array(j, EDMA_QRAE, i, 0x0); |
| 1794 | } | 1800 | } |
| 1795 | arch_num_cc++; | 1801 | arch_num_cc++; |
| 1802 | |||
| 1803 | edma_dev_info.id = j; | ||
| 1804 | platform_device_register_full(&edma_dev_info); | ||
| 1796 | } | 1805 | } |
| 1797 | 1806 | ||
| 1798 | return 0; | 1807 | return 0; |
diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c index 123f578d6dd3..4cfaaa5a49be 100644 --- a/drivers/dma/edma.c +++ b/drivers/dma/edma.c | |||
| @@ -1107,52 +1107,14 @@ bool edma_filter_fn(struct dma_chan *chan, void *param) | |||
| 1107 | } | 1107 | } |
| 1108 | EXPORT_SYMBOL(edma_filter_fn); | 1108 | EXPORT_SYMBOL(edma_filter_fn); |
| 1109 | 1109 | ||
| 1110 | static struct platform_device *pdev0, *pdev1; | ||
| 1111 | |||
| 1112 | static const struct platform_device_info edma_dev_info0 = { | ||
| 1113 | .name = "edma-dma-engine", | ||
| 1114 | .id = 0, | ||
| 1115 | .dma_mask = DMA_BIT_MASK(32), | ||
| 1116 | }; | ||
| 1117 | |||
| 1118 | static const struct platform_device_info edma_dev_info1 = { | ||
| 1119 | .name = "edma-dma-engine", | ||
| 1120 | .id = 1, | ||
| 1121 | .dma_mask = DMA_BIT_MASK(32), | ||
| 1122 | }; | ||
| 1123 | |||
| 1124 | static int edma_init(void) | 1110 | static int edma_init(void) |
| 1125 | { | 1111 | { |
| 1126 | int ret = platform_driver_register(&edma_driver); | 1112 | return platform_driver_register(&edma_driver); |
| 1127 | |||
| 1128 | if (ret == 0) { | ||
| 1129 | pdev0 = platform_device_register_full(&edma_dev_info0); | ||
| 1130 | if (IS_ERR(pdev0)) { | ||
| 1131 | platform_driver_unregister(&edma_driver); | ||
| 1132 | ret = PTR_ERR(pdev0); | ||
| 1133 | goto out; | ||
| 1134 | } | ||
| 1135 | } | ||
| 1136 | |||
| 1137 | if (!of_have_populated_dt() && EDMA_CTLRS == 2) { | ||
| 1138 | pdev1 = platform_device_register_full(&edma_dev_info1); | ||
| 1139 | if (IS_ERR(pdev1)) { | ||
| 1140 | platform_driver_unregister(&edma_driver); | ||
| 1141 | platform_device_unregister(pdev0); | ||
| 1142 | ret = PTR_ERR(pdev1); | ||
| 1143 | } | ||
| 1144 | } | ||
| 1145 | |||
| 1146 | out: | ||
| 1147 | return ret; | ||
| 1148 | } | 1113 | } |
| 1149 | subsys_initcall(edma_init); | 1114 | subsys_initcall(edma_init); |
| 1150 | 1115 | ||
| 1151 | static void __exit edma_exit(void) | 1116 | static void __exit edma_exit(void) |
| 1152 | { | 1117 | { |
| 1153 | platform_device_unregister(pdev0); | ||
| 1154 | if (pdev1) | ||
| 1155 | platform_device_unregister(pdev1); | ||
| 1156 | platform_driver_unregister(&edma_driver); | 1118 | platform_driver_unregister(&edma_driver); |
| 1157 | } | 1119 | } |
| 1158 | module_exit(edma_exit); | 1120 | module_exit(edma_exit); |
