Skip to content

Commit

Permalink
dma-mapping: remove dma_configure
Browse files Browse the repository at this point in the history
There is no good reason for this indirection given that the method
always exists.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Robin Murphy <[email protected]>
  • Loading branch information
Christoph Hellwig committed Sep 8, 2018
1 parent 58643a3 commit ccf640f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
8 changes: 5 additions & 3 deletions drivers/base/dd.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,11 @@ static int really_probe(struct device *dev, struct device_driver *drv)
if (ret)
goto pinctrl_bind_failed;

ret = dma_configure(dev);
if (ret)
goto dma_failed;
if (dev->bus->dma_configure) {
ret = dev->bus->dma_configure(dev);
if (ret)
goto dma_failed;
}

if (driver_sysfs_add(dev)) {
printk(KERN_ERR "%s: driver_sysfs_add(%s) failed\n",
Expand Down
6 changes: 0 additions & 6 deletions include/linux/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -754,14 +754,8 @@ dma_mark_declared_memory_occupied(struct device *dev,
#endif /* CONFIG_HAVE_GENERIC_DMA_COHERENT */

#ifdef CONFIG_HAS_DMA
int dma_configure(struct device *dev);
void dma_deconfigure(struct device *dev);
#else
static inline int dma_configure(struct device *dev)
{
return 0;
}

static inline void dma_deconfigure(struct device *dev) {}
#endif

Expand Down
10 changes: 0 additions & 10 deletions kernel/dma/mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,16 +328,6 @@ void dma_common_free_remap(void *cpu_addr, size_t size, unsigned long vm_flags)
}
#endif

/*
* enables DMA API use for a device
*/
int dma_configure(struct device *dev)
{
if (dev->bus->dma_configure)
return dev->bus->dma_configure(dev);
return 0;
}

void dma_deconfigure(struct device *dev)
{
of_dma_deconfigure(dev);
Expand Down

0 comments on commit ccf640f

Please sign in to comment.