Quoting Stephen Boyd (2024-04-24 11:11:21)
Quoting Stephen Boyd (2024-04-22 16:23:58)
diff --git a/drivers/base/test/platform_kunit.c b/drivers/base/test/platform_kunit.c
[...]
/*
* Wait for the driver to probe (or at least flush out of the deferred
* workqueue)
*/
wait_for_device_probe();
Should this be removed? I was thinking that this isn't a pure wrapper around platform_driver_register() because it has this wait call. Maybe it's better to have some other kunit API that can wait for a specific device to probe and timeout if it doesn't happen in that amount of time. That API would use the bus notifiers and look for BUS_NOTIFY_BOUND_DRIVER. Or maybe that function could setup a completion that the test can wait on.
I have an implementation that does this that I'll send.