@@ -524,14 +524,13 @@ static bool qcom_iommu_capable(enum iommu_cap cap)
524
524
}
525
525
}
526
526
527
- static int qcom_iommu_add_device (struct device * dev )
527
+ static struct iommu_device * qcom_iommu_probe_device (struct device * dev )
528
528
{
529
529
struct qcom_iommu_dev * qcom_iommu = to_iommu (dev );
530
- struct iommu_group * group ;
531
530
struct device_link * link ;
532
531
533
532
if (!qcom_iommu )
534
- return - ENODEV ;
533
+ return ERR_PTR ( - ENODEV ) ;
535
534
536
535
/*
537
536
* Establish the link between iommu and master, so that the
@@ -542,28 +541,19 @@ static int qcom_iommu_add_device(struct device *dev)
542
541
if (!link ) {
543
542
dev_err (qcom_iommu -> dev , "Unable to create device link between %s and %s\n" ,
544
543
dev_name (qcom_iommu -> dev ), dev_name (dev ));
545
- return - ENODEV ;
544
+ return ERR_PTR ( - ENODEV ) ;
546
545
}
547
546
548
- group = iommu_group_get_for_dev (dev );
549
- if (IS_ERR (group ))
550
- return PTR_ERR (group );
551
-
552
- iommu_group_put (group );
553
- iommu_device_link (& qcom_iommu -> iommu , dev );
554
-
555
- return 0 ;
547
+ return & qcom_iommu -> iommu ;
556
548
}
557
549
558
- static void qcom_iommu_remove_device (struct device * dev )
550
+ static void qcom_iommu_release_device (struct device * dev )
559
551
{
560
552
struct qcom_iommu_dev * qcom_iommu = to_iommu (dev );
561
553
562
554
if (!qcom_iommu )
563
555
return ;
564
556
565
- iommu_device_unlink (& qcom_iommu -> iommu , dev );
566
- iommu_group_remove_device (dev );
567
557
iommu_fwspec_free (dev );
568
558
}
569
559
@@ -619,8 +609,8 @@ static const struct iommu_ops qcom_iommu_ops = {
619
609
.flush_iotlb_all = qcom_iommu_flush_iotlb_all ,
620
610
.iotlb_sync = qcom_iommu_iotlb_sync ,
621
611
.iova_to_phys = qcom_iommu_iova_to_phys ,
622
- .add_device = qcom_iommu_add_device ,
623
- .remove_device = qcom_iommu_remove_device ,
612
+ .probe_device = qcom_iommu_probe_device ,
613
+ .release_device = qcom_iommu_release_device ,
624
614
.device_group = generic_device_group ,
625
615
.of_xlate = qcom_iommu_of_xlate ,
626
616
.pgsize_bitmap = SZ_4K | SZ_64K | SZ_1M | SZ_16M ,
0 commit comments