summaryrefslogtreecommitdiff
path: root/test/dm/virtio.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-01-25 00:32:45 +0300
committerSimon Glass <sjg@chromium.org>2021-02-03 13:38:41 +0300
commitc51d2e704a1c89d504b379b133bd552c3387fa6c (patch)
tree419e3d4ec2f5dd7a95640e1d51472df9d678105b /test/dm/virtio.c
parentb1f25fcfefc4c8e05f91d948f316c7bdbb4cd527 (diff)
downloadu-boot-c51d2e704a1c89d504b379b133bd552c3387fa6c.tar.xz
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/virtio.c')
-rw-r--r--test/dm/virtio.c4
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;
}