diff options
author | Simon Glass <sjg@chromium.org> | 2015-08-10 13:05:08 (GMT) |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-08-14 09:24:21 (GMT) |
commit | 7e4be120e88974d49ebb4bcf837134cfb71efc8c (patch) | |
tree | 0f51a3f0d1447962b9b0f8cb5a9c6c3b5604e40f /arch/x86/cpu | |
parent | 412400abaaa6ef02adff35419188689ea6d3ec7e (diff) | |
download | u-boot-7e4be120e88974d49ebb4bcf837134cfb71efc8c.tar.xz |
x86: Allow pirq_init() to return an error
This function can fail. In this case we should return the error rather than
swallowing it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch/x86/cpu')
-rw-r--r-- | arch/x86/cpu/baytrail/valleyview.c | 4 | ||||
-rw-r--r-- | arch/x86/cpu/irq.c | 17 | ||||
-rw-r--r-- | arch/x86/cpu/qemu/qemu.c | 4 | ||||
-rw-r--r-- | arch/x86/cpu/quark/quark.c | 4 | ||||
-rw-r--r-- | arch/x86/cpu/queensbay/tnc.c | 4 |
5 files changed, 15 insertions, 18 deletions
diff --git a/arch/x86/cpu/baytrail/valleyview.c b/arch/x86/cpu/baytrail/valleyview.c index 610e9d9..225ea38 100644 --- a/arch/x86/cpu/baytrail/valleyview.c +++ b/arch/x86/cpu/baytrail/valleyview.c @@ -40,8 +40,6 @@ int arch_cpu_init(void) int arch_misc_init(void) { - pirq_init(); - - return 0; + return pirq_init(); } #endif diff --git a/arch/x86/cpu/irq.c b/arch/x86/cpu/irq.c index 6be2f81..35b29f6 100644 --- a/arch/x86/cpu/irq.c +++ b/arch/x86/cpu/irq.c @@ -225,17 +225,22 @@ static int create_pirq_routing_table(void) return 0; } -void pirq_init(void) +int pirq_init(void) { + int ret; + cpu_irq_init(); - if (create_pirq_routing_table()) { + ret = create_pirq_routing_table(); + if (ret) { debug("Failed to create pirq routing table\n"); - } else { - /* Route PIRQ */ - pirq_route_irqs(pirq_routing_table->slots, - get_irq_slot_count(pirq_routing_table)); + return ret; } + /* Route PIRQ */ + pirq_route_irqs(pirq_routing_table->slots, + get_irq_slot_count(pirq_routing_table)); + + return 0; } u32 write_pirq_routing_table(u32 addr) diff --git a/arch/x86/cpu/qemu/qemu.c b/arch/x86/cpu/qemu/qemu.c index 64634a9..7c03e02 100644 --- a/arch/x86/cpu/qemu/qemu.c +++ b/arch/x86/cpu/qemu/qemu.c @@ -41,7 +41,5 @@ void reset_cpu(ulong addr) int arch_misc_init(void) { - pirq_init(); - - return 0; + return pirq_init(); } diff --git a/arch/x86/cpu/quark/quark.c b/arch/x86/cpu/quark/quark.c index 20cc09e..12ac376 100644 --- a/arch/x86/cpu/quark/quark.c +++ b/arch/x86/cpu/quark/quark.c @@ -174,7 +174,5 @@ void cpu_irq_init(void) int arch_misc_init(void) { - pirq_init(); - - return 0; + return pirq_init(); } diff --git a/arch/x86/cpu/queensbay/tnc.c b/arch/x86/cpu/queensbay/tnc.c index de50893..c465642 100644 --- a/arch/x86/cpu/queensbay/tnc.c +++ b/arch/x86/cpu/queensbay/tnc.c @@ -80,7 +80,5 @@ void cpu_irq_init(void) int arch_misc_init(void) { - pirq_init(); - - return 0; + return pirq_init(); } |