Skip to contentSkip to conversation

iommufd/selftest: fix unregister device

PATCH Applied Yang Yingliang 3 participants 3 messages Aug 16, 2023 – Aug 18, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iommufd/selftest: fix unregister device

It should call platform_device_unregister() instead of platform_device_del() to unregister the device.

Fixes 23a1b46f15d5 ("iommufd/selftest: Make the mock iommu driver into a real driver")
---
 drivers/iommu/iommufd/selftest.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iommu/iommufd/selftest.c +2 -2
index 9223ff3f23f9..2d0ac02bbd67 100644
@@ -1073,7 +1073,7 @@ int __init iommufd_test_init(void)
 err_bus:
 	bus_unregister(&iommufd_mock_bus_type.bus);
 err_platform:
-	platform_device_del(selftest_iommu_dev);
+	platform_device_unregister(selftest_iommu_dev);
 err_dbgfs:
 	debugfs_remove_recursive(dbgfs_root);
 	return rc;
@@ -1086,6 +1086,6 @@ void iommufd_test_exit(void)
 				    &iommufd_mock_bus_type.bus,
 				    &iommufd_mock_bus_type.nb);
 	bus_unregister(&iommufd_mock_bus_type.bus);
-	platform_device_del(selftest_iommu_dev);
+	platform_device_unregister(selftest_iommu_dev);
 	debugfs_remove_recursive(dbgfs_root);
 }
Signature · 1 line
2.25.1
#2 lore raw
In reply to Yang Yingliang
Quoted 8 lines · Yang Yingliang

It should call platform_device_unregister() instead of platform_device_del() to unregister the device.

Fixes 23a1b46f15d5 ("iommufd/selftest: Make the mock iommu driver into a real driver")
---
 drivers/iommu/iommufd/selftest.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks

Jason