diff options
| -rw-r--r-- | drivers/coresight/of_coresight.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/coresight/of_coresight.c b/drivers/coresight/of_coresight.c index 9a5ff56f34d9..c3efa418a86d 100644 --- a/drivers/coresight/of_coresight.c +++ b/drivers/coresight/of_coresight.c | |||
| @@ -117,7 +117,7 @@ struct coresight_platform_data *of_get_coresight_platform_data( | |||
| 117 | struct coresight_platform_data *pdata; | 117 | struct coresight_platform_data *pdata; |
| 118 | struct of_endpoint endpoint, rendpoint; | 118 | struct of_endpoint endpoint, rendpoint; |
| 119 | struct device *rdev; | 119 | struct device *rdev; |
| 120 | struct device_node *cpu; | 120 | struct device_node *dn; |
| 121 | struct device_node *ep = NULL; | 121 | struct device_node *ep = NULL; |
| 122 | struct device_node *rparent = NULL; | 122 | struct device_node *rparent = NULL; |
| 123 | struct device_node *rport = NULL; | 123 | struct device_node *rport = NULL; |
| @@ -186,14 +186,16 @@ struct coresight_platform_data *of_get_coresight_platform_data( | |||
| 186 | 186 | ||
| 187 | /* Affinity defaults to CPU0 */ | 187 | /* Affinity defaults to CPU0 */ |
| 188 | pdata->cpu = 0; | 188 | pdata->cpu = 0; |
| 189 | cpu = of_parse_phandle(node, "cpu", 0); | 189 | dn = of_parse_phandle(node, "cpu", 0); |
| 190 | if (cpu) { | 190 | if (dn) { |
| 191 | const u32 *mpidr; | 191 | const u32 *cell; |
| 192 | int len, index; | 192 | int len, index; |
| 193 | u64 hwid; | ||
| 193 | 194 | ||
| 194 | mpidr = of_get_property(cpu, "reg", &len); | 195 | cell = of_get_property(dn, "reg", &len); |
| 195 | if (mpidr && len == 4) { | 196 | if (cell) { |
| 196 | index = get_logical_index(be32_to_cpup(mpidr)); | 197 | hwid = of_read_number(cell, of_n_addr_cells(dn)); |
| 198 | index = get_logical_index(hwid); | ||
| 197 | if (index != -EINVAL) | 199 | if (index != -EINVAL) |
| 198 | pdata->cpu = index; | 200 | pdata->cpu = index; |
| 199 | } | 201 | } |
