mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 01:33:00 -04:00
drivers: remove force dma flag from buses
With each bus implementing its own DMA configuration callback, there is no need for bus to explicitly set the force_dma flag. Modify the of_dma_configure function to accept an input parameter which specifies if implicit DMA configuration is required when it is not described by the firmware. Signed-off-by: Nipun Gupta <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> # PCI parts Reviewed-by: Rob Herring <[email protected]> [hch: tweaked the changelog a bit] Signed-off-by: Christoph Hellwig <[email protected]>
This commit is contained in:
parent
07397df29e
commit
3d6ce86ee7
10 changed files with 17 additions and 19 deletions
|
|
@ -76,6 +76,8 @@ int of_device_add(struct platform_device *ofdev)
|
|||
* of_dma_configure - Setup DMA configuration
|
||||
* @dev: Device to apply DMA configuration
|
||||
* @np: Pointer to OF node having DMA configuration
|
||||
* @force_dma: Whether device is to be set up by of_dma_configure() even if
|
||||
* DMA capability is not explicitly described by firmware.
|
||||
*
|
||||
* Try to get devices's DMA configuration from DT and update it
|
||||
* accordingly.
|
||||
|
|
@ -84,7 +86,7 @@ int of_device_add(struct platform_device *ofdev)
|
|||
* can use a platform bus notifier and handle BUS_NOTIFY_ADD_DEVICE events
|
||||
* to fix up DMA configuration.
|
||||
*/
|
||||
int of_dma_configure(struct device *dev, struct device_node *np)
|
||||
int of_dma_configure(struct device *dev, struct device_node *np, bool force_dma)
|
||||
{
|
||||
u64 dma_addr, paddr, size = 0;
|
||||
int ret;
|
||||
|
|
@ -100,7 +102,7 @@ int of_dma_configure(struct device *dev, struct device_node *np)
|
|||
* DMA configuration regardless of whether "dma-ranges" is
|
||||
* correctly specified or not.
|
||||
*/
|
||||
if (!dev->bus->force_dma)
|
||||
if (!force_dma)
|
||||
return ret == -ENODEV ? 0 : ret;
|
||||
|
||||
dma_addr = offset = 0;
|
||||
|
|
|
|||
|
|
@ -353,7 +353,7 @@ int of_reserved_mem_device_init_by_idx(struct device *dev,
|
|||
/* ensure that dma_ops is set for virtual devices
|
||||
* using reserved memory
|
||||
*/
|
||||
of_dma_configure(dev, np);
|
||||
of_dma_configure(dev, np, true);
|
||||
|
||||
dev_info(dev, "assigned reserved memory node %s\n", rmem->name);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue