|
@@ -82,7 +82,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.
|
|
|
*/
|
|
|
-void of_dma_configure(struct device *dev, struct device_node *np)
|
|
|
+int of_dma_configure(struct device *dev, struct device_node *np)
|
|
|
{
|
|
|
u64 dma_addr, paddr, size;
|
|
|
int ret;
|
|
@@ -123,7 +123,7 @@ void of_dma_configure(struct device *dev, struct device_node *np)
|
|
|
|
|
|
if (!size) {
|
|
|
dev_err(dev, "Adjusted size 0x%llx invalid\n", size);
|
|
|
- return;
|
|
|
+ return -EINVAL;
|
|
|
}
|
|
|
dev_dbg(dev, "dma_pfn_offset(%#08lx)\n", offset);
|
|
|
}
|
|
@@ -144,10 +144,15 @@ void of_dma_configure(struct device *dev, struct device_node *np)
|
|
|
coherent ? " " : " not ");
|
|
|
|
|
|
iommu = of_iommu_configure(dev, np);
|
|
|
+ if (IS_ERR(iommu))
|
|
|
+ return PTR_ERR(iommu);
|
|
|
+
|
|
|
dev_dbg(dev, "device is%sbehind an iommu\n",
|
|
|
iommu ? " " : " not ");
|
|
|
|
|
|
arch_setup_dma_ops(dev, dma_addr, size, iommu, coherent);
|
|
|
+
|
|
|
+ return 0;
|
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(of_dma_configure);
|
|
|
|