Skip to content

Commit

Permalink
arm_pmu: fold platform helpers into platform code
Browse files Browse the repository at this point in the history
The armpmu_{request,free}_irqs() helpers are only used by
arm_pmu_platform.c, so let's fold them in and make them static.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
  • Loading branch information
Mark Rutland authored and Will Deacon committed Feb 20, 2018
1 parent c0248c9 commit d3d5aac
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 23 deletions.
21 changes: 0 additions & 21 deletions drivers/perf/arm_pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,14 +534,6 @@ void armpmu_free_irq(struct arm_pmu *armpmu, int cpu)
free_irq(irq, per_cpu_ptr(&hw_events->percpu_pmu, cpu));
}

void armpmu_free_irqs(struct arm_pmu *armpmu)
{
int cpu;

for_each_cpu(cpu, &armpmu->supported_cpus)
armpmu_free_irq(armpmu, cpu);
}

int armpmu_request_irq(struct arm_pmu *armpmu, int cpu)
{
int err = 0;
Expand Down Expand Up @@ -593,19 +585,6 @@ int armpmu_request_irq(struct arm_pmu *armpmu, int cpu)
return err;
}

int armpmu_request_irqs(struct arm_pmu *armpmu)
{
int cpu, err;

for_each_cpu(cpu, &armpmu->supported_cpus) {
err = armpmu_request_irq(armpmu, cpu);
if (err)
break;
}

return err;
}

static int armpmu_get_cpu_irq(struct arm_pmu *pmu, int cpu)
{
struct pmu_hw_events __percpu *hw_events = pmu->hw_events;
Expand Down
21 changes: 21 additions & 0 deletions drivers/perf/arm_pmu_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,27 @@ static int pmu_parse_irqs(struct arm_pmu *pmu)
return 0;
}

static int armpmu_request_irqs(struct arm_pmu *armpmu)
{
int cpu, err;

for_each_cpu(cpu, &armpmu->supported_cpus) {
err = armpmu_request_irq(armpmu, cpu);
if (err)
break;
}

return err;
}

static void armpmu_free_irqs(struct arm_pmu *armpmu)
{
int cpu;

for_each_cpu(cpu, &armpmu->supported_cpus)
armpmu_free_irq(armpmu, cpu);
}

int arm_pmu_device_probe(struct platform_device *pdev,
const struct of_device_id *of_table,
const struct pmu_probe_info *probe_table)
Expand Down
2 changes: 0 additions & 2 deletions include/linux/perf/arm_pmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ static inline int arm_pmu_acpi_probe(armpmu_init_fn init_fn) { return 0; }
struct arm_pmu *armpmu_alloc(void);
void armpmu_free(struct arm_pmu *pmu);
int armpmu_register(struct arm_pmu *pmu);
int armpmu_request_irqs(struct arm_pmu *armpmu);
void armpmu_free_irqs(struct arm_pmu *armpmu);
int armpmu_request_irq(struct arm_pmu *armpmu, int cpu);
void armpmu_free_irq(struct arm_pmu *armpmu, int cpu);

Expand Down

0 comments on commit d3d5aac

Please sign in to comment.