Commit 0e9c3be2 authored by Tejun Heo's avatar Tejun Heo Committed by Linus Torvalds

events: convert to idr_alloc()

Convert to the much saner new idr interface.
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d228d9ec
...@@ -5965,13 +5965,9 @@ int perf_pmu_register(struct pmu *pmu, char *name, int type) ...@@ -5965,13 +5965,9 @@ int perf_pmu_register(struct pmu *pmu, char *name, int type)
pmu->name = name; pmu->name = name;
if (type < 0) { if (type < 0) {
int err = idr_pre_get(&pmu_idr, GFP_KERNEL); type = idr_alloc(&pmu_idr, pmu, PERF_TYPE_MAX, 0, GFP_KERNEL);
if (!err) if (type < 0) {
goto free_pdc; ret = type;
err = idr_get_new_above(&pmu_idr, pmu, PERF_TYPE_MAX, &type);
if (err) {
ret = err;
goto free_pdc; goto free_pdc;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment