@@ -106,6 +106,10 @@ enum {
106
106
IOMMU_SET_DOMAIN_MUST_SUCCEED = 1 << 0 ,
107
107
};
108
108
109
+ static int __iommu_device_set_domain (struct iommu_group * group ,
110
+ struct device * dev ,
111
+ struct iommu_domain * new_domain ,
112
+ unsigned int flags );
109
113
static int __iommu_group_set_domain_internal (struct iommu_group * group ,
110
114
struct iommu_domain * new_domain ,
111
115
unsigned int flags );
@@ -401,17 +405,6 @@ static int __iommu_probe_device(struct device *dev, struct list_head *group_list
401
405
return ret ;
402
406
}
403
407
404
- static int iommu_group_do_dma_first_attach (struct device * dev , void * data )
405
- {
406
- struct iommu_domain * domain = data ;
407
-
408
- lockdep_assert_held (& dev -> iommu_group -> mutex );
409
-
410
- if (dev -> iommu -> attach_deferred )
411
- return 0 ;
412
- return __iommu_attach_device (domain , dev );
413
- }
414
-
415
408
int iommu_probe_device (struct device * dev )
416
409
{
417
410
const struct iommu_ops * ops ;
@@ -442,7 +435,7 @@ int iommu_probe_device(struct device *dev)
442
435
* attach the default domain.
443
436
*/
444
437
if (group -> default_domain && !group -> owner ) {
445
- ret = iommu_group_do_dma_first_attach ( dev , group -> default_domain );
438
+ ret = __iommu_device_set_domain ( group , dev , group -> domain , 0 );
446
439
if (ret ) {
447
440
mutex_unlock (& group -> mutex );
448
441
iommu_group_put (group );
0 commit comments