The event at the end of the function doesn't really belong there,
move it out so the function becomes cleaner. It also avoids having
to pass a number of parameters around, another sign this is the correct
thing to do. This continues refactoring started a while ago to improve
and modularise the code.
(Bitbake rev: f712b927a84e8b8deaa8c907e8f9bcdec681f2aa)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>