aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc/test_drv.c
diff options
context:
space:
mode:
authorSimon Glass2022-05-08 04:39:24 -0600
committerSimon Glass2022-06-28 03:09:52 +0100
commit930a3ddadebf3660cc3163081671de189300afdd (patch)
tree9bc3064b0b9e15d409d78beba75b2e38d3a867ef /drivers/misc/test_drv.c
parent53c20bebb2215caaadc58b2eee2c80c61456b93d (diff)
dm: core: Support accessing core tags
At present tag numbers are only allocated for non-core data, meaning that the 'core' data, like priv and plat, are accessed through dedicated functions. For debugging and consistency it is convenient to use tags for this 'core' data too. Add support for this, with new tag numbers and functions to access the pointer and size for each. Update one of the test drivers so that the uclass-private data can be tested here. There is some code duplication with functions like device_alloc_priv() but this is not addressed for now. At some point, some rationalisation may help to reduce code size, but more thought it needed on that. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/misc/test_drv.c')
-rw-r--r--drivers/misc/test_drv.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/misc/test_drv.c b/drivers/misc/test_drv.c
index b6df1189032..927618256f0 100644
--- a/drivers/misc/test_drv.c
+++ b/drivers/misc/test_drv.c
@@ -108,7 +108,9 @@ UCLASS_DRIVER(testbus) = {
.child_pre_probe = testbus_child_pre_probe_uclass,
.child_post_probe = testbus_child_post_probe_uclass,
- /* This is for dtoc testing only */
+ .per_device_auto = sizeof(struct dm_test_uclass_priv),
+
+ /* Note: this is for dtoc testing as well as tags*/
.per_device_plat_auto = sizeof(struct dm_test_uclass_plat),
};