Skip to content

Commit

Permalink
Merge branch 'for-rmk' of git://git.kernel.org/pub/scm/linux/kernel/g…
Browse files Browse the repository at this point in the history
…it/will/linux into fixes
  • Loading branch information
Russell King committed Nov 22, 2011
2 parents 53cbcbc + e5a2132 commit 7334c67
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 0 additions & 10 deletions arch/arm/include/asm/pmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,6 @@ reserve_pmu(enum arm_pmu_type type);
extern void
release_pmu(enum arm_pmu_type type);

/**
* init_pmu() - Initialise the PMU.
*
* Initialise the system ready for PMU enabling. This should typically set the
* IRQ affinity and nothing else. The users (oprofile/perf events etc) will do
* the actual hardware initialisation.
*/
extern int
init_pmu(enum arm_pmu_type type);

#else /* CONFIG_CPU_HAS_PMU */

#include <linux/err.h>
Expand Down
11 changes: 10 additions & 1 deletion arch/arm/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down
1 change: 1 addition & 0 deletions arch/arm/kernel/pmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ release_pmu(enum arm_pmu_type type)
{
clear_bit_unlock(type, pmu_lock);
}
EXPORT_SYMBOL_GPL(release_pmu);

0 comments on commit 7334c67

Please sign in to comment.