]> git.sur5r.net Git - u-boot/blobdiff - test/dm/test-driver.c
SPDX: Convert all of our single license tags to Linux Kernel style
[u-boot] / test / dm / test-driver.c
index 0f1a37b36e52faabdba5b2a78e28a33852600c4f..abb5b7115a33013f9743688b8d849e0696622fb1 100644 (file)
@@ -1,10 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (c) 2013 Google, Inc
  *
  * (C) Copyright 2012
  * Pavel Herrmann <morpheus.ibis@gmail.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 #include <errno.h>
 #include <malloc.h>
 #include <dm/test.h>
-#include <dm/ut.h>
+#include <test/ut.h>
 #include <asm/io.h>
 
 int dm_testdrv_op_count[DM_TEST_OP_COUNT];
-static struct dm_test_state *dms = &global_test_state;
+static struct unit_test_state *uts = &global_dm_test_state;
 
 static int testdrv_ping(struct udevice *dev, int pingval, int *pingret)
 {
@@ -114,6 +113,8 @@ static int test_manual_bind(struct udevice *dev)
 
 static int test_manual_probe(struct udevice *dev)
 {
+       struct dm_test_state *dms = uts->priv;
+
        dm_testdrv_op_count[DM_TEST_OP_PROBE]++;
        if (!dms->force_fail_alloc)
                dev->priv = calloc(1, sizeof(struct dm_test_priv));
@@ -144,3 +145,25 @@ U_BOOT_DRIVER(test_manual_drv) = {
        .remove = test_manual_remove,
        .unbind = test_manual_unbind,
 };
+
+U_BOOT_DRIVER(test_pre_reloc_drv) = {
+       .name   = "test_pre_reloc_drv",
+       .id     = UCLASS_TEST,
+       .ops    = &test_manual_ops,
+       .bind   = test_manual_bind,
+       .probe  = test_manual_probe,
+       .remove = test_manual_remove,
+       .unbind = test_manual_unbind,
+       .flags  = DM_FLAG_PRE_RELOC,
+};
+
+U_BOOT_DRIVER(test_act_dma_drv) = {
+       .name   = "test_act_dma_drv",
+       .id     = UCLASS_TEST,
+       .ops    = &test_manual_ops,
+       .bind   = test_manual_bind,
+       .probe  = test_manual_probe,
+       .remove = test_manual_remove,
+       .unbind = test_manual_unbind,
+       .flags  = DM_FLAG_ACTIVE_DMA,
+};