]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/amd: Improve amd_iommu_v2_exit()
authorSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Tue, 1 Mar 2022 08:56:26 +0000 (14:26 +0530)
committerJoerg Roedel <jroedel@suse.de>
Tue, 8 Mar 2022 11:19:29 +0000 (12:19 +0100)
commita1c583c0e3382de2c8e326530801f50d323b2d42
tree71e5d705ba7d21e819714d8c787870abd4b4a94b
parentb04079d3123e19a61da603ec810f9135c331ef2b
iommu/amd: Improve amd_iommu_v2_exit()

During module exit, the current logic loops through all possible
16-bit device ID space to search for existing devices and clean up
device state structures. This can be simplified by looping through
the device state list.

Also, refactor various clean up logic into free_device_state()
for better reusability.

Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Link: https://lore.kernel.org/r/20220301085626.87680-6-vasant.hegde@amd.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd/iommu_v2.c