powerpc/pseries/iommu: Reorganize iommu_table_setparms*() with new helper
authorLeonardo Bras <leobras.c@gmail.com>
Tue, 17 Aug 2021 06:39:25 +0000 (03:39 -0300)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 26 Aug 2021 14:56:55 +0000 (00:56 +1000)
commitfc8cba8f989fb98e496b33a78476861e246c42a0
tree8895d02e03e6576a931a48fbaf4de360d772c981
parent7ed2ed2db2685a285cb09ab330dc4efea0b64022
powerpc/pseries/iommu: Reorganize iommu_table_setparms*() with new helper

Add a new helper _iommu_table_setparms(), and use it in
iommu_table_setparms() and iommu_table_setparms_lpar() to avoid duplicated
code.

Also, setting tbl->it_ops was happening outsite iommu_table_setparms*(),
so move it to the new helper. Since we need the iommu_table_ops to be
declared before used, declare iommu_table_lpar_multi_ops and
iommu_table_pseries_ops to before their respective iommu_table_setparms*().

Signed-off-by: Leonardo Bras <leobras.c@gmail.com>
Reviewed-by: Frederic Barrat <fbarrat@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210817063929.38701-8-leobras.c@gmail.com
arch/powerpc/platforms/pseries/iommu.c