Skip to content

Commit dc3c055

Browse files
author
Christoph Hellwig
committed
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>
1 parent ccf640f commit dc3c055

9 files changed

Lines changed: 3 additions & 43 deletions

File tree

‎drivers/acpi/arm64/iort.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1428,7 +1428,7 @@ static int __init iort_add_platform_device(struct acpi_iort_node *node,
14281428
return 0;
14291429

14301430
dma_deconfigure:
1431-
acpi_dma_deconfigure(&pdev->dev);
1431+
arch_teardown_dma_ops(&pdev->dev);
14321432
dev_put:
14331433
platform_device_put(pdev);
14341434

‎drivers/acpi/scan.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,16 +1469,6 @@ int acpi_dma_configure(struct device *dev, enum dev_dma_attr attr)
14691469
}
14701470
EXPORT_SYMBOL_GPL(acpi_dma_configure);
14711471

1472-
/**
1473-
* acpi_dma_deconfigure - Tear-down DMA configuration for the device.
1474-
* @dev: The pointer to the device
1475-
*/
1476-
void acpi_dma_deconfigure(struct device *dev)
1477-
{
1478-
arch_teardown_dma_ops(dev);
1479-
}
1480-
EXPORT_SYMBOL_GPL(acpi_dma_deconfigure);
1481-
14821472
static void acpi_init_coherency(struct acpi_device *adev)
14831473
{
14841474
unsigned long long cca = 0;

‎drivers/base/dd.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ static int really_probe(struct device *dev, struct device_driver *drv)
539539
goto done;
540540

541541
probe_failed:
542-
dma_deconfigure(dev);
542+
arch_teardown_dma_ops(dev);
543543
dma_failed:
544544
if (dev->bus)
545545
blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
@@ -968,7 +968,7 @@ static void __device_release_driver(struct device *dev, struct device *parent)
968968
drv->remove(dev);
969969

970970
device_links_driver_cleanup(dev);
971-
dma_deconfigure(dev);
971+
arch_teardown_dma_ops(dev);
972972

973973
devres_release_all(dev);
974974
dev->driver = NULL;

‎drivers/of/device.c‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -170,18 +170,6 @@ int of_dma_configure(struct device *dev, struct device_node *np, bool force_dma)
170170
}
171171
EXPORT_SYMBOL_GPL(of_dma_configure);
172172

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-
*/
180-
void of_dma_deconfigure(struct device *dev)
181-
{
182-
arch_teardown_dma_ops(dev);
183-
}
184-
185173
int of_device_register(struct platform_device *pdev)
186174
{
187175
device_initialize(&pdev->dev);

‎include/acpi/acpi_bus.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,6 @@ enum dev_dma_attr acpi_get_dma_attr(struct acpi_device *adev);
595595
int acpi_dma_get_range(struct device *dev, u64 *dma_addr, u64 *offset,
596596
u64 *size);
597597
int acpi_dma_configure(struct device *dev, enum dev_dma_attr attr);
598-
void acpi_dma_deconfigure(struct device *dev);
599598

600599
struct acpi_device *acpi_find_child_device(struct acpi_device *parent,
601600
u64 address, bool check_children);

‎include/linux/acpi.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,8 +831,6 @@ static inline int acpi_dma_configure(struct device *dev,
831831
return 0;
832832
}
833833

834-
static inline void acpi_dma_deconfigure(struct device *dev) { }
835-
836834
#define ACPI_PTR(_ptr) (NULL)
837835

838836
static inline void acpi_device_set_enumerated(struct acpi_device *adev)

‎include/linux/dma-mapping.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -753,12 +753,6 @@ dma_mark_declared_memory_occupied(struct device *dev,
753753
}
754754
#endif /* CONFIG_HAVE_GENERIC_DMA_COHERENT */
755755

756-
#ifdef CONFIG_HAS_DMA
757-
void dma_deconfigure(struct device *dev);
758-
#else
759-
static inline void dma_deconfigure(struct device *dev) {}
760-
#endif
761-
762756
/*
763757
* Managed DMA API
764758
*/

‎include/linux/of_device.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ static inline struct device_node *of_cpu_device_node_get(int cpu)
5858
int of_dma_configure(struct device *dev,
5959
struct device_node *np,
6060
bool force_dma);
61-
void of_dma_deconfigure(struct device *dev);
6261
#else /* CONFIG_OF */
6362

6463
static inline int of_driver_match_device(struct device *dev,
@@ -113,8 +112,6 @@ static inline int of_dma_configure(struct device *dev,
113112
{
114113
return 0;
115114
}
116-
static inline void of_dma_deconfigure(struct device *dev)
117-
{}
118115
#endif /* CONFIG_OF */
119116

120117
#endif /* _LINUX_OF_DEVICE_H */

‎kernel/dma/mapping.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,3 @@ void dma_common_free_remap(void *cpu_addr, size_t size, unsigned long vm_flags)
327327
vunmap(cpu_addr);
328328
}
329329
#endif
330-
331-
void dma_deconfigure(struct device *dev)
332-
{
333-
of_dma_deconfigure(dev);
334-
acpi_dma_deconfigure(dev);
335-
}

0 commit comments

Comments
 (0)