diff options
| author | Mathieu Poirier <mathieu.poirier@linaro.org> | 2015-03-30 16:13:34 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-04-03 10:17:03 -0400 |
| commit | 8c02a5ba34a1fae6def8cb5a39bb582f09bca49c (patch) | |
| tree | c498d4dd691794fe9d314f67695c8bfa03b10e6a /drivers/coresight | |
| parent | d86fb45b5c52d8f2a3e78e81afd85a2a9d4478d7 (diff) | |
coresight: making cpu index lookup arm64 compliant
Function "get_logical_index()" is not available on arm64.
Instead of adding the function simply using "of_get_cpu_node()" and
comparing the return value with cpu handles yields the same
result.
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/coresight')
| -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 | ||
