diff options
author | Simon Glass <sjg@chromium.org> | 2020-12-22 19:30:28 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-01-05 12:24:40 -0700 |
commit | 0fd3d91152df5bb6c5f7b9ee68f01a9a1c9a875d (patch) | |
tree | 1dbc5b936b98393e343cc99a40382b2734ac778e /test/dm/test-driver.c | |
parent | 12559f5bab3e43b603dccfa6c354ffd7da03249c (diff) |
dm: Use access methods for dev/uclass private data
Most drivers use these access methods but a few do not. Update them.
In some cases the access is not permitted, so mark those with a FIXME tag
for the maintainer to check.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Pratyush Yadav <p.yadav@ti.com>
Diffstat (limited to 'test/dm/test-driver.c')
-rw-r--r-- | test/dm/test-driver.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/dm/test-driver.c b/test/dm/test-driver.c index b9f49de10a..a67f5d3f98 100644 --- a/test/dm/test-driver.c +++ b/test/dm/test-driver.c @@ -12,6 +12,7 @@ #include <log.h> #include <malloc.h> #include <asm/io.h> +#include <dm/device-internal.h> #include <dm/test.h> #include <test/test.h> #include <test/ut.h> @@ -67,7 +68,7 @@ static int test_remove(struct udevice *dev) static int test_unbind(struct udevice *dev) { /* Private data should not be allocated */ - ut_assert(!dev->priv); + ut_assert(!dev_get_priv(dev)); dm_testdrv_op_count[DM_TEST_OP_UNBIND]++; return 0; @@ -119,8 +120,8 @@ static int test_manual_probe(struct udevice *dev) dm_testdrv_op_count[DM_TEST_OP_PROBE]++; if (!dms->force_fail_alloc) - dev->priv = calloc(1, sizeof(struct dm_test_priv)); - if (!dev->priv) + dev_set_priv(dev, calloc(1, sizeof(struct dm_test_priv))); + if (!dev_get_priv(dev)) return -ENOMEM; return 0; |