aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-08-24 04:28:18 -0400
committerChristoph Hellwig <hch@lst.de>2018-09-08 05:19:28 -0400
commitdc3c05504d38849f77149cb962caeaedd1efa127 (patch)
tree93e5ec8eae100c5f4daff9e0062b717721f97a8f
parentccf640f4c9988653ef884672381b03b9be247bec (diff)
dma-mapping: remove dma_deconfigure
This goes through a lot of hooks just to call arch_teardown_dma_ops. Replace it with a direct call instead. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Robin Murphy <robin.murphy@arm.com>
-rw-r--r--drivers/acpi/arm64/iort.c2
-rw-r--r--drivers/acpi/scan.c10
-rw-r--r--drivers/base/dd.c4
-rw-r--r--drivers/of/device.c12
-rw-r--r--include/acpi/acpi_bus.h1
-rw-r--r--include/linux/acpi.h2
-rw-r--r--include/linux/dma-mapping.h6
-rw-r--r--include/linux/of_device.h3
-rw-r--r--kernel/dma/mapping.c6
9 files changed, 3 insertions, 43 deletions
diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
index 08f26db2da7e..2a361e22d38d 100644
--- a/drivers/acpi/arm64/iort.c
+++ b/drivers/acpi/arm64/iort.c
@@ -1428,7 +1428,7 @@ static int __init iort_add_platform_device(struct acpi_iort_node *node,
1428 return 0; 1428 return 0;
1429 1429
1430dma_deconfigure: 1430dma_deconfigure:
1431 acpi_dma_deconfigure(&pdev->dev); 1431 arch_teardown_dma_ops(&pdev->dev);
1432dev_put: 1432dev_put:
1433 platform_device_put(pdev); 1433 platform_device_put(pdev);
1434 1434
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index e1b6231cfa1c..56676a56b3e3 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1469,16 +1469,6 @@ int acpi_dma_configure(struct device *dev, enum dev_dma_attr attr)
1469} 1469}
1470EXPORT_SYMBOL_GPL(acpi_dma_configure); 1470EXPORT_SYMBOL_GPL(acpi_dma_configure);
1471 1471
1472/**
1473 * acpi_dma_deconfigure - Tear-down DMA configuration for the device.
1474 * @dev: The pointer to the device
1475 */
1476void acpi_dma_deconfigure(struct device *dev)
1477{
1478 arch_teardown_dma_ops(dev);
1479}
1480EXPORT_SYMBOL_GPL(acpi_dma_deconfigure);
1481
1482static void acpi_init_coherency(struct acpi_device *adev) 1472static void acpi_init_coherency(struct acpi_device *adev)
1483{ 1473{
1484 unsigned long long cca = 0; 1474 unsigned long long cca = 0;
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 65128cf8427c..169412ee4ae8 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -539,7 +539,7 @@ re_probe:
539 goto done; 539 goto done;
540 540
541probe_failed: 541probe_failed:
542 dma_deconfigure(dev); 542 arch_teardown_dma_ops(dev);
543dma_failed: 543dma_failed:
544 if (dev->bus) 544 if (dev->bus)
545 blocking_notifier_call_chain(&dev->bus->p->bus_notifier, 545 blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
@@ -968,7 +968,7 @@ static void __device_release_driver(struct device *dev, struct device *parent)
968 drv->remove(dev); 968 drv->remove(dev);
969 969
970 device_links_driver_cleanup(dev); 970 device_links_driver_cleanup(dev);
971 dma_deconfigure(dev); 971 arch_teardown_dma_ops(dev);
972 972
973 devres_release_all(dev); 973 devres_release_all(dev);
974 dev->driver = NULL; 974 dev->driver = NULL;
diff --git a/drivers/of/device.c b/drivers/of/device.c
index 5957cd4fa262..c7fa5a9697c9 100644
--- a/drivers/of/device.c
+++ b/drivers/of/device.c
@@ -170,18 +170,6 @@ int of_dma_configure(struct device *dev, struct device_node *np, bool force_dma)
170} 170}
171EXPORT_SYMBOL_GPL(of_dma_configure); 171EXPORT_SYMBOL_GPL(of_dma_configure);
172 172
173/**
174 * of_dma_deconfigure - Clean up DMA configuration
175 * @dev: Device for which to clean up DMA configuration
176 *
177 * Clean up all configuration performed by of_dma_configure_ops() and free all
178 * resources that have been allocated.
179 */
180void of_dma_deconfigure(struct device *dev)
181{
182 arch_teardown_dma_ops(dev);
183}
184
185int of_device_register(struct platform_device *pdev) 173int of_device_register(struct platform_device *pdev)
186{ 174{
187 device_initialize(&pdev->dev); 175 device_initialize(&pdev->dev);
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index ba4dd54f2c82..53600f527a70 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -595,7 +595,6 @@ enum dev_dma_attr acpi_get_dma_attr(struct acpi_device *adev);
595int acpi_dma_get_range(struct device *dev, u64 *dma_addr, u64 *offset, 595int acpi_dma_get_range(struct device *dev, u64 *dma_addr, u64 *offset,
596 u64 *size); 596 u64 *size);
597int acpi_dma_configure(struct device *dev, enum dev_dma_attr attr); 597int acpi_dma_configure(struct device *dev, enum dev_dma_attr attr);
598void acpi_dma_deconfigure(struct device *dev);
599 598
600struct acpi_device *acpi_find_child_device(struct acpi_device *parent, 599struct acpi_device *acpi_find_child_device(struct acpi_device *parent,
601 u64 address, bool check_children); 600 u64 address, bool check_children);
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index de8d3d3fa651..af4628979d13 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -831,8 +831,6 @@ static inline int acpi_dma_configure(struct device *dev,
831 return 0; 831 return 0;
832} 832}
833 833
834static inline void acpi_dma_deconfigure(struct device *dev) { }
835
836#define ACPI_PTR(_ptr) (NULL) 834#define ACPI_PTR(_ptr) (NULL)
837 835
838static inline void acpi_device_set_enumerated(struct acpi_device *adev) 836static inline void acpi_device_set_enumerated(struct acpi_device *adev)
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 1c6c7c09bcf2..1423b69f3cc9 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -753,12 +753,6 @@ dma_mark_declared_memory_occupied(struct device *dev,
753} 753}
754#endif /* CONFIG_HAVE_GENERIC_DMA_COHERENT */ 754#endif /* CONFIG_HAVE_GENERIC_DMA_COHERENT */
755 755
756#ifdef CONFIG_HAS_DMA
757void dma_deconfigure(struct device *dev);
758#else
759static inline void dma_deconfigure(struct device *dev) {}
760#endif
761
762/* 756/*
763 * Managed DMA API 757 * Managed DMA API
764 */ 758 */
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
index 165fd302b442..8d31e39dd564 100644
--- a/include/linux/of_device.h
+++ b/include/linux/of_device.h
@@ -58,7 +58,6 @@ static inline struct device_node *of_cpu_device_node_get(int cpu)
58int of_dma_configure(struct device *dev, 58int of_dma_configure(struct device *dev,
59 struct device_node *np, 59 struct device_node *np,
60 bool force_dma); 60 bool force_dma);
61void of_dma_deconfigure(struct device *dev);
62#else /* CONFIG_OF */ 61#else /* CONFIG_OF */
63 62
64static inline int of_driver_match_device(struct device *dev, 63static inline int of_driver_match_device(struct device *dev,
@@ -113,8 +112,6 @@ static inline int of_dma_configure(struct device *dev,
113{ 112{
114 return 0; 113 return 0;
115} 114}
116static inline void of_dma_deconfigure(struct device *dev)
117{}
118#endif /* CONFIG_OF */ 115#endif /* CONFIG_OF */
119 116
120#endif /* _LINUX_OF_DEVICE_H */ 117#endif /* _LINUX_OF_DEVICE_H */
diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c
index 25607ceb4a50..3540cb399bd2 100644
--- a/kernel/dma/mapping.c
+++ b/kernel/dma/mapping.c
@@ -327,9 +327,3 @@ void dma_common_free_remap(void *cpu_addr, size_t size, unsigned long vm_flags)
327 vunmap(cpu_addr); 327 vunmap(cpu_addr);
328} 328}
329#endif 329#endif
330
331void dma_deconfigure(struct device *dev)
332{
333 of_dma_deconfigure(dev);
334 acpi_dma_deconfigure(dev);
335}