From: Rob Herring (Arm) Date: Wed, 31 Jul 2024 19:12:53 +0000 (-0600) Subject: perf: arm_pmu: Use of_property_present() X-Git-Tag: v6.12-rc1~221^2~4^2~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=48b035121a564f2695462fbab0d2af51cb4f4b7a;p=thirdparty%2Fkernel%2Flinux.git perf: arm_pmu: Use of_property_present() Use of_property_present() to test for property presence rather than of_find_property(). This is part of a larger effort to remove callers of of_find_property() and similar functions. of_find_property() leaks the DT struct property and data pointers which is a problem for dynamically allocated nodes which may be freed. Signed-off-by: Rob Herring (Arm) Acked-by: Mark Rutland Reviewed-by: Anshuman Khandual Link: https://lore.kernel.org/r/20240731191312.1710417-15-robh@kernel.org Signed-off-by: Will Deacon --- diff --git a/drivers/perf/arm_pmu_platform.c b/drivers/perf/arm_pmu_platform.c index 4b1a9a92ea117..118170a5cedef 100644 --- a/drivers/perf/arm_pmu_platform.c +++ b/drivers/perf/arm_pmu_platform.c @@ -59,7 +59,7 @@ static int pmu_parse_percpu_irq(struct arm_pmu *pmu, int irq) static bool pmu_has_irq_affinity(struct device_node *node) { - return !!of_find_property(node, "interrupt-affinity", NULL); + return of_property_present(node, "interrupt-affinity"); } static int pmu_parse_irq_affinity(struct device *dev, int i)