iommufd/selftest: Check the bus type during probe
authorJason Gunthorpe <jgg@nvidia.com>
Wed, 3 Jan 2024 15:27:22 +0000 (11:27 -0400)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 11 Jan 2024 19:53:28 +0000 (15:53 -0400)
commit47f2bd2ff382e5fe766b1322e354558a8da4a470
treecf2dc2589ba5088a9989ef520df24f2893b640ad
parentf6f3721244a8224fa97952b34fbb21e4ee40e8a8
iommufd/selftest: Check the bus type during probe

This relied on the probe function only being invoked by the bus type mock
was registered on. The removal of the bus ops broke this assumption and
the probe could be called on non-mock bus types like PCI.

Check the bus type directly in probe.

Fixes: 17de3f5fdd35 ("iommu: Retire bus ops")
Link: https://lore.kernel.org/r/0-v1-82d59f7eab8c+40c-iommufd_mock_bus_jgg@nvidia.com
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/iommu/iommufd/selftest.c