aboutsummaryrefslogtreecommitdiff
path: root/test/dm/test-driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/dm/test-driver.c')
-rw-r--r--test/dm/test-driver.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/test/dm/test-driver.c b/test/dm/test-driver.c
index 08bdf01194..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>
@@ -21,7 +22,7 @@ static struct unit_test_state *uts = &global_dm_test_state;
static int testdrv_ping(struct udevice *dev, int pingval, int *pingret)
{
- const struct dm_test_pdata *pdata = dev_get_platdata(dev);
+ const struct dm_test_pdata *pdata = dev_get_plat(dev);
struct dm_test_priv *priv = dev_get_priv(dev);
*pingret = pingval + pdata->ping_add;
@@ -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;
@@ -81,7 +82,7 @@ U_BOOT_DRIVER(test_drv) = {
.probe = test_probe,
.remove = test_remove,
.unbind = test_unbind,
- .priv_auto_alloc_size = sizeof(struct dm_test_priv),
+ .priv_auto = sizeof(struct dm_test_priv),
};
U_BOOT_DRIVER(test2_drv) = {
@@ -92,7 +93,7 @@ U_BOOT_DRIVER(test2_drv) = {
.probe = test_probe,
.remove = test_remove,
.unbind = test_unbind,
- .priv_auto_alloc_size = sizeof(struct dm_test_priv),
+ .priv_auto = sizeof(struct dm_test_priv),
};
static int test_manual_drv_ping(struct udevice *dev, int pingval, int *pingret)
@@ -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;