diff options
-rw-r--r-- | drivers/coresight/of_coresight.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/coresight/of_coresight.c b/drivers/coresight/of_coresight.c index c3efa418a86d..f3cc8e97a0f8 100644 --- a/drivers/coresight/of_coresight.c +++ b/drivers/coresight/of_coresight.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
23 | #include <linux/amba/bus.h> | 23 | #include <linux/amba/bus.h> |
24 | #include <linux/coresight.h> | 24 | #include <linux/coresight.h> |
25 | #include <linux/cpumask.h> | ||
25 | #include <asm/smp_plat.h> | 26 | #include <asm/smp_plat.h> |
26 | 27 | ||
27 | 28 | ||
@@ -113,7 +114,7 @@ static int of_coresight_alloc_memory(struct device *dev, | |||
113 | struct coresight_platform_data *of_get_coresight_platform_data( | 114 | struct coresight_platform_data *of_get_coresight_platform_data( |
114 | struct device *dev, struct device_node *node) | 115 | struct device *dev, struct device_node *node) |
115 | { | 116 | { |
116 | int i = 0, ret = 0; | 117 | int i = 0, ret = 0, cpu; |
117 | struct coresight_platform_data *pdata; | 118 | struct coresight_platform_data *pdata; |
118 | struct of_endpoint endpoint, rendpoint; | 119 | struct of_endpoint endpoint, rendpoint; |
119 | struct device *rdev; | 120 | struct device *rdev; |
@@ -187,17 +188,10 @@ struct coresight_platform_data *of_get_coresight_platform_data( | |||
187 | /* Affinity defaults to CPU0 */ | 188 | /* Affinity defaults to CPU0 */ |
188 | pdata->cpu = 0; | 189 | pdata->cpu = 0; |
189 | dn = of_parse_phandle(node, "cpu", 0); | 190 | dn = of_parse_phandle(node, "cpu", 0); |
190 | if (dn) { | 191 | for (cpu = 0; dn && cpu < nr_cpu_ids; cpu++) { |
191 | const u32 *cell; | 192 | if (dn == of_get_cpu_node(cpu, NULL)) { |
192 | int len, index; | 193 | pdata->cpu = cpu; |
193 | u64 hwid; | 194 | break; |
194 | |||
195 | cell = of_get_property(dn, "reg", &len); | ||
196 | if (cell) { | ||
197 | hwid = of_read_number(cell, of_n_addr_cells(dn)); | ||
198 | index = get_logical_index(hwid); | ||
199 | if (index != -EINVAL) | ||
200 | pdata->cpu = index; | ||
201 | } | 195 | } |
202 | } | 196 | } |
203 | 197 | ||