AMD/IOMMU: disable previously enabled IOMMUs upon init failure
authorJan Beulich <jbeulich@suse.com>
Mon, 13 May 2019 07:52:43 +0000 (09:52 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 13 May 2019 07:52:43 +0000 (09:52 +0200)
commit87a3347d476443c66c79953d77d6aef1d2bb3bbd
treeb582b41a77dc7a82554af3bb1eaac119e3e64c9b
parent3fd3b266d4198c06e8e421ca515d9ba09ccd5155
AMD/IOMMU: disable previously enabled IOMMUs upon init failure

If any IOMMUs were successfully initialized before encountering failure,
the successfully enabled ones should be disabled again before cleaning
up their resources.

Move disable_iommu() next to enable_iommu() to avoid a forward
declaration, and take the opportunity to remove stray blank lines ahead
of both functions' final closing braces.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Brian Woods <brian.woods@amd.com>
xen/drivers/passthrough/amd/iommu_init.c