@@ -837,14 +837,6 @@ static void viommu_get_resv_regions(struct device *dev, struct list_head *head)
837
837
iommu_dma_get_resv_regions (dev , head );
838
838
}
839
839
840
- static void viommu_put_resv_regions (struct device * dev , struct list_head * head )
841
- {
842
- struct iommu_resv_region * entry , * next ;
843
-
844
- list_for_each_entry_safe (entry , next , head , list )
845
- kfree (entry );
846
- }
847
-
848
840
static struct iommu_ops viommu_ops ;
849
841
static struct virtio_driver virtio_iommu_drv ;
850
842
@@ -914,7 +906,7 @@ static int viommu_add_device(struct device *dev)
914
906
err_unlink_dev :
915
907
iommu_device_unlink (& viommu -> iommu , dev );
916
908
err_free_dev :
917
- viommu_put_resv_regions (dev , & vdev -> resv_regions );
909
+ generic_iommu_put_resv_regions (dev , & vdev -> resv_regions );
918
910
kfree (vdev );
919
911
920
912
return ret ;
@@ -932,7 +924,7 @@ static void viommu_remove_device(struct device *dev)
932
924
933
925
iommu_group_remove_device (dev );
934
926
iommu_device_unlink (& vdev -> viommu -> iommu , dev );
935
- viommu_put_resv_regions (dev , & vdev -> resv_regions );
927
+ generic_iommu_put_resv_regions (dev , & vdev -> resv_regions );
936
928
kfree (vdev );
937
929
}
938
930
@@ -961,7 +953,7 @@ static struct iommu_ops viommu_ops = {
961
953
.remove_device = viommu_remove_device ,
962
954
.device_group = viommu_device_group ,
963
955
.get_resv_regions = viommu_get_resv_regions ,
964
- .put_resv_regions = viommu_put_resv_regions ,
956
+ .put_resv_regions = generic_iommu_put_resv_regions ,
965
957
.of_xlate = viommu_of_xlate ,
966
958
};
967
959
0 commit comments