summaryrefslogtreecommitdiff
path: root/drivers/cdx/cdx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cdx/cdx.c')
-rw-r--r--drivers/cdx/cdx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/cdx/cdx.c b/drivers/cdx/cdx.c
index 7811aa734053..092306ca2541 100644
--- a/drivers/cdx/cdx.c
+++ b/drivers/cdx/cdx.c
@@ -360,7 +360,8 @@ static int cdx_dma_configure(struct device *dev)
return ret;
}
- if (!ret && !cdx_drv->driver_managed_dma) {
+ /* @cdx_drv may not be valid when we're called from the IOMMU layer */
+ if (!ret && dev->driver && !cdx_drv->driver_managed_dma) {
ret = iommu_device_use_default_domain(dev);
if (ret)
arch_teardown_dma_ops(dev);