Skip to content
Commit 829388b7 authored by David Gow's avatar David Gow Committed by Shuah Khan
Browse files

kunit: device: Unregister the kunit_bus on shutdown



If KUnit is built as a module, and it's unloaded, the kunit_bus is not
unregistered. This causes an error if it's then re-loaded later, as we
try to re-register the bus.

Unregister the bus and root_device on shutdown, if it looks valid.

In addition, be more specific about the value of kunit_bus_device. It
is:
- a valid struct device* if the kunit_bus initialised correctly.
- an ERR_PTR if it failed to initialise.
- NULL before initialisation and after shutdown.

Fixes: d03c720e ("kunit: Add APIs for managing devices")
Signed-off-by: default avatarDavid Gow <davidgow@google.com>
Reviewed-by: default avatarRae Moar <rmoar@google.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 1a9f2c77
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment