]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
x86: Allow pirq_init() to return an error
authorSimon Glass <sjg@chromium.org>
Mon, 10 Aug 2015 13:05:08 +0000 (07:05 -0600)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 10 Sep 2015 08:23:20 +0000 (10:23 +0200)
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>
arch/x86/cpu/baytrail/valleyview.c
arch/x86/cpu/irq.c
arch/x86/cpu/qemu/qemu.c
arch/x86/cpu/quark/quark.c
arch/x86/cpu/queensbay/tnc.c
arch/x86/include/asm/irq.h

index 610e9d9b1d8a4237e02cf5e36b2c04f03d58c8bf..225ea38acc41d92c140146cd9620b32737c02f94 100644 (file)
@@ -40,8 +40,6 @@ int arch_cpu_init(void)
 
 int arch_misc_init(void)
 {
-       pirq_init();
-
-       return 0;
+       return pirq_init();
 }
 #endif
index 6be2f81734670fe77bb274bf1d71243138bbd79a..35b29f69d8459cceb0fbbc5c0f3dd4e12b992564 100644 (file)
@@ -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)
index 64634a9229a428a4114bb3982089955ab1342ae3..7c03e0295beb9ab7d1787a3ced939fb93d170272 100644 (file)
@@ -41,7 +41,5 @@ void reset_cpu(ulong addr)
 
 int arch_misc_init(void)
 {
-       pirq_init();
-
-       return 0;
+       return pirq_init();
 }
index 20cc09e113d9d568ab92306a09b07953499b0cef..12ac3761d2565ec5e4ffb3435ec56d81ecb14410 100644 (file)
@@ -174,7 +174,5 @@ void cpu_irq_init(void)
 
 int arch_misc_init(void)
 {
-       pirq_init();
-
-       return 0;
+       return pirq_init();
 }
index de50893e6fb178e8ca906cb46e7a4eff229f1854..c4656422e15ec0c51826a4541d853208edef6b38 100644 (file)
@@ -80,7 +80,5 @@ void cpu_irq_init(void)
 
 int arch_misc_init(void)
 {
-       pirq_init();
-
-       return 0;
+       return pirq_init();
 }
index 4de5512ce1333081ab1f5ad80bb146d3a12aee36..6697da3b859124d0bf69e00471e006b12180ba47 100644 (file)
@@ -70,7 +70,9 @@ void cpu_irq_init(void);
  *
  * This initializes the PIRQ routing on the platform and configures all PCI
  * devices' interrupt line register to a working IRQ number on the 8259 PIC.
+ *
+ * @return 0 if OK, -ve on error
  */
-void pirq_init(void);
+int pirq_init(void);
 
 #endif /* _ARCH_IRQ_H_ */