@@ -757,11 +757,10 @@ static int tegra_smmu_configure(struct tegra_smmu *smmu, struct device *dev,
757
757
return 0 ;
758
758
}
759
759
760
- static int tegra_smmu_add_device (struct device * dev )
760
+ static struct iommu_device * tegra_smmu_probe_device (struct device * dev )
761
761
{
762
762
struct device_node * np = dev -> of_node ;
763
763
struct tegra_smmu * smmu = NULL ;
764
- struct iommu_group * group ;
765
764
struct of_phandle_args args ;
766
765
unsigned int index = 0 ;
767
766
int err ;
@@ -774,7 +773,7 @@ static int tegra_smmu_add_device(struct device *dev)
774
773
of_node_put (args .np );
775
774
776
775
if (err < 0 )
777
- return err ;
776
+ return ERR_PTR ( err ) ;
778
777
779
778
/*
780
779
* Only a single IOMMU master interface is currently
@@ -783,8 +782,6 @@ static int tegra_smmu_add_device(struct device *dev)
783
782
*/
784
783
dev -> archdata .iommu = smmu ;
785
784
786
- iommu_device_link (& smmu -> iommu , dev );
787
-
788
785
break ;
789
786
}
790
787
@@ -793,26 +790,14 @@ static int tegra_smmu_add_device(struct device *dev)
793
790
}
794
791
795
792
if (!smmu )
796
- return - ENODEV ;
797
-
798
- group = iommu_group_get_for_dev (dev );
799
- if (IS_ERR (group ))
800
- return PTR_ERR (group );
801
-
802
- iommu_group_put (group );
793
+ return ERR_PTR (- ENODEV );
803
794
804
- return 0 ;
795
+ return & smmu -> iommu ;
805
796
}
806
797
807
- static void tegra_smmu_remove_device (struct device * dev )
798
+ static void tegra_smmu_release_device (struct device * dev )
808
799
{
809
- struct tegra_smmu * smmu = dev -> archdata .iommu ;
810
-
811
- if (smmu )
812
- iommu_device_unlink (& smmu -> iommu , dev );
813
-
814
800
dev -> archdata .iommu = NULL ;
815
- iommu_group_remove_device (dev );
816
801
}
817
802
818
803
static const struct tegra_smmu_group_soc *
@@ -895,8 +880,8 @@ static const struct iommu_ops tegra_smmu_ops = {
895
880
.domain_free = tegra_smmu_domain_free ,
896
881
.attach_dev = tegra_smmu_attach_dev ,
897
882
.detach_dev = tegra_smmu_detach_dev ,
898
- .add_device = tegra_smmu_add_device ,
899
- .remove_device = tegra_smmu_remove_device ,
883
+ .probe_device = tegra_smmu_probe_device ,
884
+ .release_device = tegra_smmu_release_device ,
900
885
.device_group = tegra_smmu_device_group ,
901
886
.map = tegra_smmu_map ,
902
887
.unmap = tegra_smmu_unmap ,
@@ -1015,7 +1000,7 @@ struct tegra_smmu *tegra_smmu_probe(struct device *dev,
1015
1000
* value. However the IOMMU registration process will attempt to add
1016
1001
* all devices to the IOMMU when bus_set_iommu() is called. In order
1017
1002
* not to rely on global variables to track the IOMMU instance, we
1018
- * set it here so that it can be looked up from the .add_device ()
1003
+ * set it here so that it can be looked up from the .probe_device ()
1019
1004
* callback via the IOMMU device's .drvdata field.
1020
1005
*/
1021
1006
mc -> smmu = smmu ;
0 commit comments