diff options
author | Deng-Cheng Zhu <dczhu@mips.com> | 2011-11-21 14:28:48 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2011-12-07 17:04:41 -0500 |
commit | ff5d7265cfb88e8f8943a55afde90255fc5deacb (patch) | |
tree | 0b93a78af8c04bc0cee71e641583d31a815d9245 /arch/mips/kernel | |
parent | 266623b7597c97e6ff987b45719540b227751420 (diff) |
MIPS/Perf-events: Cleanup event->destroy at event init
Simplify the code by changing the place of event->destroy().
Signed-off-by: Deng-Cheng Zhu <dczhu@mips.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: David Daney <david.daney@cavium.com>
Cc: Eyal Barzilay <eyal@mips.com>
Cc: Zenon Fortuna <zenon@mips.com>
Patchwork: https://patchwork.linux-mips.org/patch/3109/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/perf_event_mipsxx.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c index b22cc5fd596d..bda4bc9e6988 100644 --- a/arch/mips/kernel/perf_event_mipsxx.c +++ b/arch/mips/kernel/perf_event_mipsxx.c | |||
@@ -633,11 +633,7 @@ static int mipspmu_event_init(struct perf_event *event) | |||
633 | if (err) | 633 | if (err) |
634 | return err; | 634 | return err; |
635 | 635 | ||
636 | err = __hw_perf_event_init(event); | 636 | return __hw_perf_event_init(event); |
637 | if (err) | ||
638 | hw_perf_event_destroy(event); | ||
639 | |||
640 | return err; | ||
641 | } | 637 | } |
642 | 638 | ||
643 | static struct pmu pmu = { | 639 | static struct pmu pmu = { |
@@ -1262,13 +1258,14 @@ static int __hw_perf_event_init(struct perf_event *event) | |||
1262 | } | 1258 | } |
1263 | 1259 | ||
1264 | err = 0; | 1260 | err = 0; |
1265 | if (event->group_leader != event) { | 1261 | if (event->group_leader != event) |
1266 | err = validate_group(event); | 1262 | err = validate_group(event); |
1267 | if (err) | ||
1268 | return -EINVAL; | ||
1269 | } | ||
1270 | 1263 | ||
1271 | event->destroy = hw_perf_event_destroy; | 1264 | event->destroy = hw_perf_event_destroy; |
1265 | |||
1266 | if (err) | ||
1267 | event->destroy(event); | ||
1268 | |||
1272 | return err; | 1269 | return err; |
1273 | } | 1270 | } |
1274 | 1271 | ||