From: Bin Meng <bmeng.cn@gmail.com>
Date: Fri, 3 Aug 2018 08:14:38 +0000 (-0700)
Subject: test: dm: pci: Remove unnecessary steps in dm_test_pci_swapcase()
X-Git-Tag: v2025.01-rc5-pxa1908~3795^2~17
X-Git-Url: http://git.dujemihanovic.xyz/%22/icons/right.gif/static/%7B%7B%20%24image.RelPermalink%20%7D%7D?a=commitdiff_plain;h=dd4808f9fab54b94df76447b7a7f383cd1b2f5d0;p=u-boot.git

test: dm: pci: Remove unnecessary steps in dm_test_pci_swapcase()

The check on uclass_get_device() and device_active() is unnecessary
as the follow-up test operations will implicitly probe the driver.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

diff --git a/test/dm/pci.c b/test/dm/pci.c
index 47b5d22af8..be1208cfbd 100644
--- a/test/dm/pci.c
+++ b/test/dm/pci.c
@@ -34,14 +34,12 @@ DM_TEST(dm_test_pci_busnum, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
 /* Test that we can use the swapcase device correctly */
 static int dm_test_pci_swapcase(struct unit_test_state *uts)
 {
-	struct udevice *emul, *swap;
+	struct udevice *swap;
 	ulong io_addr, mem_addr;
 	char *ptr;
 
 	/* Check that asking for the device automatically fires up PCI */
-	ut_assertok(uclass_get_device(UCLASS_PCI_EMUL, 0, &emul));
 	ut_assertok(dm_pci_bus_find_bdf(PCI_BDF(0, 0x1f, 0), &swap));
-	ut_assert(device_active(swap));
 
 	/* First test I/O */
 	io_addr = dm_pci_read_bar32(swap, 0);