]> git.ipfire.org Git - people/ms/linux.git/commitdiff
of: unittest: Fix build on architectures without CONFIG_OF_ADDRESS
authorCatalin Marinas <catalin.marinas@arm.com>
Tue, 1 Dec 2020 12:47:25 +0000 (12:47 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 2 Dec 2020 16:49:39 +0000 (16:49 +0000)
of_dma_get_max_cpu_address() is not defined if !CONFIG_OF_ADDRESS, so
return early in of_unittest_dma_get_max_cpu_address().

Fixes: 07d13a1d6120 ("of: unittest: Add test for of_dma_get_max_cpu_address()")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
drivers/of/unittest.c

index 98cc0163301bfce994ae6d36664cf0244695fbd5..eb51bc147440172ceb00ba4239e72f0c1bc358a8 100644 (file)
@@ -874,6 +874,9 @@ static void __init of_unittest_dma_get_max_cpu_address(void)
        struct device_node *np;
        phys_addr_t cpu_addr;
 
+       if (!IS_ENABLED(CONFIG_OF_ADDRESS))
+               return;
+
        np = of_find_node_by_path("/testcase-data/address-tests");
        if (!np) {
                pr_err("missing testcase data\n");