提交 64d0d394 编写于 作者: M Mark Rutland 提交者: Will Deacon

arm: perf: make of_pmu_irq_cfg take arm_pmu

To support multiple PMUs we'll need to pass the arm_pmu instance around.
Update of_pmu_irq_cfg to take an arm_pmu, and acquire the platform
device from this.
Acked-by: NWill Deacon <will.deacon@arm.com>
Signed-off-by: NMark Rutland <mark.rutland@arm.com>
Signed-off-by: NWill Deacon <will.deacon@arm.com>
上级 d06f23e7
...@@ -301,9 +301,10 @@ static int probe_current_pmu(struct arm_pmu *pmu) ...@@ -301,9 +301,10 @@ static int probe_current_pmu(struct arm_pmu *pmu)
return ret; return ret;
} }
static int of_pmu_irq_cfg(struct platform_device *pdev) static int of_pmu_irq_cfg(struct arm_pmu *pmu)
{ {
int i; int i;
struct platform_device *pdev = pmu->plat_device;
int *irqs = kcalloc(pdev->num_resources, sizeof(*irqs), GFP_KERNEL); int *irqs = kcalloc(pdev->num_resources, sizeof(*irqs), GFP_KERNEL);
if (!irqs) if (!irqs)
...@@ -336,7 +337,7 @@ static int of_pmu_irq_cfg(struct platform_device *pdev) ...@@ -336,7 +337,7 @@ static int of_pmu_irq_cfg(struct platform_device *pdev)
} }
if (i == pdev->num_resources) if (i == pdev->num_resources)
cpu_pmu->irq_affinity = irqs; pmu->irq_affinity = irqs;
else else
kfree(irqs); kfree(irqs);
...@@ -368,7 +369,7 @@ static int cpu_pmu_device_probe(struct platform_device *pdev) ...@@ -368,7 +369,7 @@ static int cpu_pmu_device_probe(struct platform_device *pdev)
if (node && (of_id = of_match_node(cpu_pmu_of_device_ids, pdev->dev.of_node))) { if (node && (of_id = of_match_node(cpu_pmu_of_device_ids, pdev->dev.of_node))) {
init_fn = of_id->data; init_fn = of_id->data;
ret = of_pmu_irq_cfg(pdev); ret = of_pmu_irq_cfg(pmu);
if (!ret) if (!ret)
ret = init_fn(pmu); ret = init_fn(pmu);
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册