Skip to contentSkip to conversation

dm: core: Correct references to DM_SPL

PATCH In review Simon Glass 1 participant 3 messages Sep 20, 2023 – Oct 4, 2023 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 dm: core: Correct references to DM_SPL

This does not existing anymore. Update the two in-tree uses of it to the correct Kconfig option, which is SPL_DM

---

Changes in v2:
- Add new patch to correct references to DM_SPL

 drivers/block/Kconfig | 2 +-
 drivers/core/Kconfig  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/block/Kconfig +1 -1
index 1abea3f10db4..ef41aba03555 100644
@@ -13,7 +13,7 @@ config BLK
 
 config SPL_LEGACY_BLOCK
 	bool # "Enable Legacy Block Device"
-	depends on SPL && !DM_SPL
+	depends on SPL && !SPL_DM
 	default y if SPL_MMC || SPL_USB_STORAGE || SCSI || NVME || IDE
 	default y if SPL_AHCI_PCI
 	help
drivers/core/Kconfig +1 -1
index f0d848f45d8e..6c287c68a1c2 100644
@@ -88,7 +88,7 @@ config DM_STATS
 
 config SPL_DM_STATS
 	bool "Collect and show driver model stats in SPL"
-	depends on DM_SPL
+	depends on SPL_DM
 	help
 	  Enable this to collect and display memory statistics about driver
 	  model. This can help to figure out where all the memory is going and
Signature · 1 line
2.42.0.459.ge4e396fd5e-goog
#1 lore raw

PATCH 2/2 dm: core: Adjust dump-sorting to get stats only when needed

If we are not sorting the tree we don't need to get the stats. Adjust the code to avoid the wasted time.

---

(no changes since v1)

 drivers/core/dump.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/core/dump.c +3 -3
index 3e77832a3a00..bf95c0f52379 100644
@@ -91,14 +91,14 @@ void dm_dump_tree(bool sort)
 
 	root = dm_root();
 	if (root) {
-		int dev_count, uclasses;
 		struct udevice **devs = NULL;
 
-		dm_get_stats(&dev_count, &uclasses);
-
 		printf(" Class     Index  Probed  Driver                Name\n");
 		printf("-----------------------------------------------------------\n");
 		if (sort) {
+			int dev_count, uclasses;
+
+			dm_get_stats(&dev_count, &uclasses);
 			devs = calloc(dev_count, sizeof(struct udevice *));
 			if (!devs) {
 				printf("(out of memory)\n");
Signature · 1 line
2.42.0.459.ge4e396fd5e-goog
#2 lore raw

Re: [PATCH 2/2] dm: core: Adjust dump-sorting to get stats only when needed

If we are not sorting the tree we don't need to get the stats. Adjust the code to avoid the wasted time.

---

(no changes since v1)

 drivers/core/dump.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Applied to u-boot-dm, thanks!