.. | .. |
---|
6 | 6 | * Copyright (C) 2010 ARM Ltd., Will Deacon <will.deacon@arm.com> |
---|
7 | 7 | */ |
---|
8 | 8 | #define pr_fmt(fmt) "hw perfevents: " fmt |
---|
| 9 | +#define dev_fmt pr_fmt |
---|
9 | 10 | |
---|
10 | 11 | #include <linux/bug.h> |
---|
11 | 12 | #include <linux/cpumask.h> |
---|
.. | .. |
---|
77 | 78 | |
---|
78 | 79 | dn = of_parse_phandle(node, "interrupt-affinity", i); |
---|
79 | 80 | 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); |
---|
82 | 83 | return -EINVAL; |
---|
83 | 84 | } |
---|
84 | 85 | |
---|
85 | 86 | cpu = of_cpu_node_to_id(dn); |
---|
86 | 87 | 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); |
---|
88 | 89 | cpu = nr_cpu_ids; |
---|
89 | 90 | } |
---|
90 | 91 | |
---|
.. | .. |
---|
100 | 101 | struct pmu_hw_events __percpu *hw_events = pmu->hw_events; |
---|
101 | 102 | |
---|
102 | 103 | 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"); |
---|
107 | 106 | |
---|
108 | 107 | /* |
---|
109 | 108 | * In this case we have no idea which CPUs are covered by the PMU. |
---|
.. | .. |
---|
118 | 117 | |
---|
119 | 118 | if (num_irqs == 1) { |
---|
120 | 119 | int irq = platform_get_irq(pdev, 0); |
---|
121 | | - if (irq && irq_is_percpu_devid(irq)) |
---|
| 120 | + if ((irq > 0) && irq_is_percpu_devid(irq)) |
---|
122 | 121 | return pmu_parse_percpu_irq(pmu, irq); |
---|
123 | 122 | } |
---|
124 | 123 | |
---|