diff options
author | Simon Glass <sjg@chromium.org> | 2021-01-24 14:32:45 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-02-03 03:38:41 -0700 |
commit | c51d2e704a1c89d504b379b133bd552c3387fa6c (patch) | |
tree | 419e3d4ec2f5dd7a95640e1d51472df9d678105b /test/dm | |
parent | b1f25fcfefc4c8e05f91d948f316c7bdbb4cd527 (diff) | |
download | u-boot-c51d2e704a1c89d504b379b133bd552c3387fa6c.tar.gz |
dm: core: Avoid partially removing devices
At present if device_remove() decides that the device should not actually
be removed, it still calls the uclass pre_remove() method and powers the
device down.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/dm')
-rw-r--r-- | test/dm/virtio.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/dm/virtio.c b/test/dm/virtio.c index ad355981cf..9a7e658cce 100644 --- a/test/dm/virtio.c +++ b/test/dm/virtio.c @@ -123,7 +123,9 @@ static int dm_test_virtio_remove(struct unit_test_state *uts) /* check the device can be successfully removed */ dev_or_flags(dev, DM_FLAG_ACTIVATED); - ut_assertok(device_remove(bus, DM_REMOVE_ACTIVE_ALL)); + ut_asserteq(-EKEYREJECTED, device_remove(bus, DM_REMOVE_ACTIVE_ALL)); + + ut_asserteq(false, device_active(dev)); return 0; } |