irqchip/gic: Return an error if GIC initialisation fails
authorJon Hunter <jonathanh@nvidia.com>
Tue, 10 May 2016 15:14:42 +0000 (16:14 +0100)
committerMarc Zyngier <marc.zyngier@arm.com>
Wed, 11 May 2016 09:12:43 +0000 (10:12 +0100)
commitdc9722cc57eba336038b2ade111436656c5a87d0
tree733721c1e42a0256969b0f9a33f2d21c33f9b73d
parentc2baa2f3f42fc6ea302bb666889c5843986a19a3
irqchip/gic: Return an error if GIC initialisation fails

If the GIC initialisation fails, then currently we do not return an error
or clean-up afterwards. Although for root controllers, this failure may be
fatal anyway, for secondary controllers, it may not be fatal and so return
an error on failure and clean-up.

Update the functions gic_cpu_init() and gic_pm_init() to return an error
instead of calling BUG() and perform any necessary clean-up.

For non-banked GIC controllers, make sure that we free any memory
allocated if we fail to initialise the IRQ domain. Please note that
free_percpu() only frees memory if the pointer passed to it is not NULL
and so it is unnecessary to check if both pointers are valid or not.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
drivers/irqchip/irq-gic.c