lib: utils/fdt: Fix DT parsing in fdt_pmu_setup()
authorAnup Patel <apatel@ventanamicro.com>
Tue, 13 Sep 2022 09:10:15 +0000 (14:40 +0530)
committerAnup Patel <anup@brainfault.org>
Tue, 13 Sep 2022 11:45:58 +0000 (17:15 +0530)
commit8ce486a781f61941c136efd507a91677f34da713
tree53684711bc7bcfa04482762c2ff54d84e41b6e9d
parent46e744ab6736c0d14a1a1609d9dda3b802c164fe
lib: utils/fdt: Fix DT parsing in fdt_pmu_setup()

This patch does following fixes in fdt_pmu_setup():
1) If any of the event mapping DT property is absent or too small
   then don't skip parsing of other DT properties.
2) Return failure if sbi_pmu_add_hw_event_counter_map() fails.
3) Return failure if sbi_pmu_add_raw_event_counter_map() fails.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
lib/utils/fdt/fdt_pmu.c