diff options
author | RajithaY <rajithax.yerrumsetty@intel.com> | 2017-04-25 03:31:15 -0700 |
---|---|---|
committer | Rajitha Yerrumchetty <rajithax.yerrumsetty@intel.com> | 2017-05-22 06:48:08 +0000 |
commit | bb756eebdac6fd24e8919e2c43f7d2c8c4091f59 (patch) | |
tree | ca11e03542edf2d8f631efeca5e1626d211107e3 /qemu/roms/u-boot/test/dm/test-driver.c | |
parent | a14b48d18a9ed03ec191cf16b162206998a895ce (diff) |
Adding qemu as a submodule of KVMFORNFV
This Patch includes the changes to add qemu as a submodule to
kvmfornfv repo and make use of the updated latest qemu for the
execution of all testcase
Change-Id: I1280af507a857675c7f81d30c95255635667bdd7
Signed-off-by:RajithaY<rajithax.yerrumsetty@intel.com>
Diffstat (limited to 'qemu/roms/u-boot/test/dm/test-driver.c')
-rw-r--r-- | qemu/roms/u-boot/test/dm/test-driver.c | 146 |
1 files changed, 0 insertions, 146 deletions
diff --git a/qemu/roms/u-boot/test/dm/test-driver.c b/qemu/roms/u-boot/test/dm/test-driver.c deleted file mode 100644 index c4be8a12d..000000000 --- a/qemu/roms/u-boot/test/dm/test-driver.c +++ /dev/null @@ -1,146 +0,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 <dm.h> -#include <errno.h> -#include <malloc.h> -#include <dm/test.h> -#include <dm/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 int testdrv_ping(struct device *dev, int pingval, int *pingret) -{ - const struct dm_test_pdata *pdata = dev_get_platdata(dev); - struct dm_test_priv *priv = dev_get_priv(dev); - - *pingret = pingval + pdata->ping_add; - priv->ping_total += *pingret; - - return 0; -} - -static const struct test_ops test_ops = { - .ping = testdrv_ping, -}; - -static int test_bind(struct device *dev) -{ - /* Private data should not be allocated */ - ut_assert(!dev_get_priv(dev)); - - dm_testdrv_op_count[DM_TEST_OP_BIND]++; - return 0; -} - -static int test_probe(struct device *dev) -{ - struct dm_test_priv *priv = dev_get_priv(dev); - - /* Private data should be allocated */ - ut_assert(priv); - - dm_testdrv_op_count[DM_TEST_OP_PROBE]++; - priv->ping_total += DM_TEST_START_TOTAL; - return 0; -} - -static int test_remove(struct device *dev) -{ - /* Private data should still be allocated */ - ut_assert(dev_get_priv(dev)); - - dm_testdrv_op_count[DM_TEST_OP_REMOVE]++; - return 0; -} - -static int test_unbind(struct device *dev) -{ - /* Private data should not be allocated */ - ut_assert(!dev->priv); - - dm_testdrv_op_count[DM_TEST_OP_UNBIND]++; - return 0; -} - -U_BOOT_DRIVER(test_drv) = { - .name = "test_drv", - .id = UCLASS_TEST, - .ops = &test_ops, - .bind = test_bind, - .probe = test_probe, - .remove = test_remove, - .unbind = test_unbind, - .priv_auto_alloc_size = sizeof(struct dm_test_priv), -}; - -U_BOOT_DRIVER(test2_drv) = { - .name = "test2_drv", - .id = UCLASS_TEST, - .ops = &test_ops, - .bind = test_bind, - .probe = test_probe, - .remove = test_remove, - .unbind = test_unbind, - .priv_auto_alloc_size = sizeof(struct dm_test_priv), -}; - -static int test_manual_drv_ping(struct device *dev, int pingval, int *pingret) -{ - *pingret = pingval + 2; - - return 0; -} - -static const struct test_ops test_manual_ops = { - .ping = test_manual_drv_ping, -}; - -static int test_manual_bind(struct device *dev) -{ - dm_testdrv_op_count[DM_TEST_OP_BIND]++; - - return 0; -} - -static int test_manual_probe(struct device *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) - return -ENOMEM; - - return 0; -} - -static int test_manual_remove(struct device *dev) -{ - dm_testdrv_op_count[DM_TEST_OP_REMOVE]++; - return 0; -} - -static int test_manual_unbind(struct device *dev) -{ - dm_testdrv_op_count[DM_TEST_OP_UNBIND]++; - return 0; -} - -U_BOOT_DRIVER(test_manual_drv) = { - .name = "test_manual_drv", - .id = UCLASS_TEST, - .ops = &test_manual_ops, - .bind = test_manual_bind, - .probe = test_manual_probe, - .remove = test_manual_remove, - .unbind = test_manual_unbind, -}; |