diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-11-22 20:44:19 (GMT) |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-11-22 20:44:19 (GMT) |
commit | 7334c6755eb7dbaa5d3112a33f5f2cb9826abe8c (patch) | |
tree | f4937b349b3dae67725d24a3b08c9a973ffc57c4 /arch/arm/kernel | |
parent | 53cbcbcf4362ef39e0a692b1d23c395999397fca (diff) | |
parent | e5a21327644adba32816f74a415114d11c57f2e9 (diff) | |
download | linux-fsl-qoriq-7334c6755eb7dbaa5d3112a33f5f2cb9826abe8c.tar.xz |
Merge branch 'for-rmk' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux into fixes
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r-- | arch/arm/kernel/perf_event.c | 11 | ||||
-rw-r--r-- | arch/arm/kernel/pmu.c | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c index 24e2347..c475379 100644 --- a/arch/arm/kernel/perf_event.c +++ b/arch/arm/kernel/perf_event.c @@ -343,8 +343,14 @@ validate_group(struct perf_event *event) { struct perf_event *sibling, *leader = event->group_leader; struct pmu_hw_events fake_pmu; + DECLARE_BITMAP(fake_used_mask, ARMPMU_MAX_HWEVENTS); - memset(&fake_pmu, 0, sizeof(fake_pmu)); + /* + * Initialise the fake PMU. We only need to populate the + * used_mask for the purposes of validation. + */ + memset(fake_used_mask, 0, sizeof(fake_used_mask)); + fake_pmu.used_mask = fake_used_mask; if (!validate_event(&fake_pmu, leader)) return -ENOSPC; @@ -396,6 +402,9 @@ armpmu_reserve_hardware(struct arm_pmu *armpmu) int i, err, irq, irqs; struct platform_device *pmu_device = armpmu->plat_device; + if (!pmu_device) + return -ENODEV; + err = reserve_pmu(armpmu->type); if (err) { pr_warning("unable to reserve pmu\n"); diff --git a/arch/arm/kernel/pmu.c b/arch/arm/kernel/pmu.c index 2c3407e..2334bf8 100644 --- a/arch/arm/kernel/pmu.c +++ b/arch/arm/kernel/pmu.c @@ -33,3 +33,4 @@ release_pmu(enum arm_pmu_type type) { clear_bit_unlock(type, pmu_lock); } +EXPORT_SYMBOL_GPL(release_pmu); |