mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-12-15 03:31:49 +00:00
lib: utils/cache: Handle last-level cache correctly in fdt_cache_add()
The fdt_cache_add() helper attempts to retrieve the next-level cache and returns SBI_ENOENT when there is none. Since this condition only indicates that the current cache is the last-level cache, the helper should not treat it as an error. Signed-off-by: Nick Hu <nick.hu@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20251114-sifive-cache-drivers-v1-1-8423a721924c@sifive.com Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
4
lib/utils/cache/fdt_cache.c
vendored
4
lib/utils/cache/fdt_cache.c
vendored
@@ -23,7 +23,9 @@ int fdt_cache_add(const void *fdt, int noff, struct cache_device *dev)
|
||||
sbi_dprintf("%s: %s\n", __func__, dev->name);
|
||||
|
||||
rc = fdt_next_cache_get(fdt, noff, &dev->next);
|
||||
if (rc)
|
||||
if (rc == SBI_ENOENT)
|
||||
dev->next = NULL;
|
||||
else if (rc)
|
||||
return rc;
|
||||
|
||||
return cache_add(dev);
|
||||
|
||||
Reference in New Issue
Block a user