File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -1312,26 +1312,24 @@ static int vhost_vdpa_alloc_domain(struct vhost_vdpa *v)
1312
1312
struct vdpa_device * vdpa = v -> vdpa ;
1313
1313
const struct vdpa_config_ops * ops = vdpa -> config ;
1314
1314
struct device * dma_dev = vdpa_get_dma_dev (vdpa );
1315
- const struct bus_type * bus ;
1316
1315
int ret ;
1317
1316
1318
1317
/* Device want to do DMA by itself */
1319
1318
if (ops -> set_map || ops -> dma_map )
1320
1319
return 0 ;
1321
1320
1322
- bus = dma_dev -> bus ;
1323
- if (!bus )
1324
- return - EFAULT ;
1325
-
1326
1321
if (!device_iommu_capable (dma_dev , IOMMU_CAP_CACHE_COHERENCY )) {
1327
1322
dev_warn_once (& v -> dev ,
1328
1323
"Failed to allocate domain, device is not IOMMU cache coherent capable\n" );
1329
1324
return - ENOTSUPP ;
1330
1325
}
1331
1326
1332
- v -> domain = iommu_domain_alloc (bus );
1333
- if (!v -> domain )
1334
- return - EIO ;
1327
+ v -> domain = iommu_paging_domain_alloc (dma_dev );
1328
+ if (IS_ERR (v -> domain )) {
1329
+ ret = PTR_ERR (v -> domain );
1330
+ v -> domain = NULL ;
1331
+ return ret ;
1332
+ }
1335
1333
1336
1334
ret = iommu_attach_device (v -> domain , dma_dev );
1337
1335
if (ret )
You can’t perform that action at this time.
0 commit comments