diff options
author | Simon Glass <sjg@chromium.org> | 2015-03-05 12:25:20 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-04-16 19:27:42 -0600 |
commit | e564f054af002d9e6a1080ed9d4bc2c6052a4435 (patch) | |
tree | 7b945d568d32c7febf5a8b70c6bce26b5157663c /test/dm | |
parent | 106cce9604306743c86addd4d27426cce498c9d1 (diff) |
dm: core: Add dev_get_uclass_priv() to access uclass private data
Add a convenience function to access the private data that a uclass stores
for each of its devices. Convert over most existing uses for consistency
and to provide an example for others.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/dm')
-rw-r--r-- | test/dm/core.c | 2 | ||||
-rw-r--r-- | test/dm/test-uclass.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/test/dm/core.c b/test/dm/core.c index eccda0974d..7be28e4701 100644 --- a/test/dm/core.c +++ b/test/dm/core.c @@ -179,7 +179,7 @@ static int dm_test_autoprobe(struct dm_test_state *dms) ut_assertok(uclass_find_device(UCLASS_TEST, i, &dev)); ut_assert(dev); - priv = dev->uclass_priv; + priv = dev_get_uclass_priv(dev); ut_assert(priv); ut_asserteq(expected_base_add, priv->base_add); diff --git a/test/dm/test-uclass.c b/test/dm/test-uclass.c index 017e097928..1b9a3fdfa6 100644 --- a/test/dm/test-uclass.c +++ b/test/dm/test-uclass.c @@ -47,7 +47,7 @@ static int test_post_probe(struct udevice *dev) struct udevice *prev = list_entry(dev->uclass_node.prev, struct udevice, uclass_node); - struct dm_test_uclass_perdev_priv *priv = dev->uclass_priv; + struct dm_test_uclass_perdev_priv *priv = dev_get_uclass_priv(dev); struct uclass *uc = dev->uclass; dm_testdrv_op_count[DM_TEST_OP_POST_PROBE]++; @@ -58,7 +58,7 @@ static int test_post_probe(struct udevice *dev) return 0; if (&prev->uclass_node != &uc->dev_head) { struct dm_test_uclass_perdev_priv *prev_uc_priv - = prev->uclass_priv; + = dev_get_uclass_priv(prev); struct dm_test_pdata *pdata = prev->platdata; ut_assert(pdata); |