forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 297b60346df8beafee954a0fd7c2d64f33f3b9bc
kernel/drivers/perf/arm_pmu_platform.c
....@@ -6,6 +6,7 @@
66 * Copyright (C) 2010 ARM Ltd., Will Deacon <will.deacon@arm.com>
77 */
88 #define pr_fmt(fmt) "hw perfevents: " fmt
9
+#define dev_fmt pr_fmt
910
1011 #include <linux/bug.h>
1112 #include <linux/cpumask.h>
....@@ -77,14 +78,14 @@
7778
7879 dn = of_parse_phandle(node, "interrupt-affinity", i);
7980 if (!dn) {
80
- pr_warn("failed to parse interrupt-affinity[%d] for %s\n",
81
- i, node->name);
81
+ pr_warn("failed to parse interrupt-affinity[%d] for %pOFn\n",
82
+ i, node);
8283 return -EINVAL;
8384 }
8485
8586 cpu = of_cpu_node_to_id(dn);
8687 if (cpu < 0) {
87
- pr_warn("failed to find logical CPU for %s\n", dn->name);
88
+ pr_warn("failed to find logical CPU for %pOFn\n", dn);
8889 cpu = nr_cpu_ids;
8990 }
9091
....@@ -100,10 +101,8 @@
100101 struct pmu_hw_events __percpu *hw_events = pmu->hw_events;
101102
102103 num_irqs = platform_irq_count(pdev);
103
- if (num_irqs < 0) {
104
- pr_err("unable to count PMU IRQs\n");
105
- return num_irqs;
106
- }
104
+ if (num_irqs < 0)
105
+ return dev_err_probe(&pdev->dev, num_irqs, "unable to count PMU IRQs\n");
107106
108107 /*
109108 * In this case we have no idea which CPUs are covered by the PMU.
....@@ -118,7 +117,7 @@
118117
119118 if (num_irqs == 1) {
120119 int irq = platform_get_irq(pdev, 0);
121
- if (irq && irq_is_percpu_devid(irq))
120
+ if ((irq > 0) && irq_is_percpu_devid(irq))
122121 return pmu_parse_percpu_irq(pmu, irq);
123122 }
124123