[PATCH v2 4/5] drivers/mtd/nvmxip: Move sandbox_set_enable_memio() to test
Marek Vasut
marek.vasut+renesas at mailbox.org
Wed Aug 23 02:18:20 CEST 2023
The sandbox_set_enable_memio() should only ever be set during
sandbox testing, not within driver itself, move it back to test/ .
Signed-off-by: Marek Vasut <marek.vasut+renesas at mailbox.org>
---
Cc: Abdellatif El Khlifi <abdellatif.elkhlifi at arm.com>
Cc: Simon Glass <sjg at chromium.org>
---
V2: New patch
---
drivers/mtd/nvmxip/nvmxip-uclass.c | 4 ----
test/dm/nvmxip.c | 2 ++
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/nvmxip/nvmxip-uclass.c b/drivers/mtd/nvmxip/nvmxip-uclass.c
index 36eb056c213..9a316d1de39 100644
--- a/drivers/mtd/nvmxip/nvmxip-uclass.c
+++ b/drivers/mtd/nvmxip/nvmxip-uclass.c
@@ -29,10 +29,6 @@ int nvmxip_probe(struct udevice *udev)
char bdev_name[NVMXIP_BLKDEV_NAME_SZ + 1];
int devnum;
-#if CONFIG_IS_ENABLED(SANDBOX64)
- sandbox_set_enable_memio(true);
-#endif
-
devnum = uclass_id_count(UCLASS_NVMXIP);
snprintf(bdev_name, NVMXIP_BLKDEV_NAME_SZ, "blk#%d", devnum);
diff --git a/test/dm/nvmxip.c b/test/dm/nvmxip.c
index 89bf481f616..f0ad47d4efe 100644
--- a/test/dm/nvmxip.c
+++ b/test/dm/nvmxip.c
@@ -103,6 +103,8 @@ static int dm_test_nvmxip(struct unit_test_state *uts)
void *buffer = NULL;
unsigned long flashsz;
+ sandbox_set_enable_memio(true);
+
/* set the flash content first for both devices */
dm_nvmxip_flash_sanity(uts, 0, NULL);
dm_nvmxip_flash_sanity(uts, 1, NULL);
--
2.40.1
More information about the U-Boot
mailing list