powerpc/iommu: Refactor spapr_tce_platform_iommu_attach_dev()
authorShivaprasad G Bhat <sbhat@linux.ibm.com>
Thu, 15 Feb 2024 13:52:32 +0000 (07:52 -0600)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 3 Apr 2024 03:28:55 +0000 (14:28 +1100)
commit5bd31ab5f79eb6e3bdfa0ca0b57650f9d1604062
tree6e037a4cca22a9b46be4a9e6d1224b3e372e31ef
parent39cd87c4eb2b893354f3b850f916353f2658ae6f
powerpc/iommu: Refactor spapr_tce_platform_iommu_attach_dev()

The patch makes the iommu_group_get() call only when using it
thereby avoiding the unnecessary get & put for domain already
being set case.

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/170800513841.2411.13524607664262048895.stgit@linux.ibm.com
arch/powerpc/kernel/iommu.c