Skip to content

Commit ccf640f

Browse files
author
Christoph Hellwig
committed
dma-mapping: remove dma_configure
There is no good reason for this indirection given that the method always exists. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Robin Murphy <robin.murphy@arm.com>
1 parent 58643a3 commit ccf640f

3 files changed

Lines changed: 5 additions & 19 deletions

File tree

‎drivers/base/dd.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,9 +480,11 @@ static int really_probe(struct device *dev, struct device_driver *drv)
480480
if (ret)
481481
goto pinctrl_bind_failed;
482482

483-
ret = dma_configure(dev);
484-
if (ret)
485-
goto dma_failed;
483+
if (dev->bus->dma_configure) {
484+
ret = dev->bus->dma_configure(dev);
485+
if (ret)
486+
goto dma_failed;
487+
}
486488

487489
if (driver_sysfs_add(dev)) {
488490
printk(KERN_ERR "%s: driver_sysfs_add(%s) failed\n",

‎include/linux/dma-mapping.h‎

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

756756
#ifdef CONFIG_HAS_DMA
757-
int dma_configure(struct device *dev);
758757
void dma_deconfigure(struct device *dev);
759758
#else
760-
static inline int dma_configure(struct device *dev)
761-
{
762-
return 0;
763-
}
764-
765759
static inline void dma_deconfigure(struct device *dev) {}
766760
#endif
767761

‎kernel/dma/mapping.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -328,16 +328,6 @@ void dma_common_free_remap(void *cpu_addr, size_t size, unsigned long vm_flags)
328328
}
329329
#endif
330330

331-
/*
332-
* enables DMA API use for a device
333-
*/
334-
int dma_configure(struct device *dev)
335-
{
336-
if (dev->bus->dma_configure)
337-
return dev->bus->dma_configure(dev);
338-
return 0;
339-
}
340-
341331
void dma_deconfigure(struct device *dev)
342332
{
343333
of_dma_deconfigure(dev);

0 commit comments

Comments
 (0)