]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dm: cache: Add enable and disable ops for sandbox and test
authorRick Chen <rick@andestech.com>
Wed, 28 Aug 2019 10:46:05 +0000 (18:46 +0800)
committerAndes <uboot@andestech.com>
Tue, 3 Sep 2019 01:31:03 +0000 (09:31 +0800)
Add cache enable and disable ops for test coverage.

Signed-off-by: Rick Chen <rick@andestech.com>
Cc: KC Lin <kclin@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
drivers/cache/sandbox_cache.c
test/dm/cache.c

index 14cc6b0c0ac1ff7dc5303a08741d1c218cc8ecb5..9050c4cf3406f51982f33a2479dd6565e8b1c75b 100644 (file)
@@ -17,8 +17,21 @@ static int sandbox_get_info(struct udevice *dev, struct cache_info *info)
        return 0;
 }
 
+static int sandbox_enable(struct udevice *dev)
+{
+       return 0;
+}
+
+static int snadbox_disable(struct udevice *dev)
+{
+       return 0;
+}
+
+
 static const struct cache_ops sandbox_cache_ops = {
        .get_info       = sandbox_get_info,
+       .enable         = sandbox_enable,
+       .disable        = snadbox_disable,
 };
 
 static const struct udevice_id sandbox_cache_ids[] = {
index d4144aab76f4f2a1a6973cb27e1402dc2d0c0aac..2e244b109f3f45a26a3485647f6f45e6d5ea1148 100644 (file)
@@ -14,6 +14,8 @@ static int dm_test_reset(struct unit_test_state *uts)
 
        ut_assertok(uclass_get_device(UCLASS_CACHE, 0, &dev_cache));
        ut_assertok(cache_get_info(dev, &info));
+       ut_assertok(cache_enable(dev));
+       ut_assertok(cache_disable(dev));
 
        return 0;
 }