iommu: Move the iommu driver sysfs setup into iommu_init/deinit_device()
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 6 Jun 2023 00:59:44 +0000 (21:59 -0300)
committerJoerg Roedel <jroedel@suse.de>
Fri, 14 Jul 2023 14:14:14 +0000 (16:14 +0200)
commit14891af3799e8cd24dee14f78c31fa663cfb5ba9
treeb9f0c432a2e1a298f298fbb8ede494725d059e25
parentaa0958570f24f562422afa41fefd1b3a1fe0f6d0
iommu: Move the iommu driver sysfs setup into iommu_init/deinit_device()

It makes logical sense that once the driver is attached to the device the
sysfs links appear, even if we haven't fully created the group_device or
attached the device to a domain.

Fix the missing error handling on sysfs creation since
iommu_init_device() can trivially handle this.

Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/6-v3-328044aa278c+45e49-iommu_probe_jgg@nvidia.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iommu-sysfs.c
drivers/iommu/iommu.c