mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
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>
This commit is contained in:
parent
412400abaa
commit
7e4be120e8
6 changed files with 18 additions and 19 deletions
|
@ -40,8 +40,6 @@ int arch_cpu_init(void)
|
||||||
|
|
||||||
int arch_misc_init(void)
|
int arch_misc_init(void)
|
||||||
{
|
{
|
||||||
pirq_init();
|
return pirq_init();
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -225,17 +225,22 @@ static int create_pirq_routing_table(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void pirq_init(void)
|
int pirq_init(void)
|
||||||
{
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
cpu_irq_init();
|
cpu_irq_init();
|
||||||
|
|
||||||
if (create_pirq_routing_table()) {
|
ret = create_pirq_routing_table();
|
||||||
|
if (ret) {
|
||||||
debug("Failed to create pirq routing table\n");
|
debug("Failed to create pirq routing table\n");
|
||||||
} else {
|
return ret;
|
||||||
/* Route PIRQ */
|
|
||||||
pirq_route_irqs(pirq_routing_table->slots,
|
|
||||||
get_irq_slot_count(pirq_routing_table));
|
|
||||||
}
|
}
|
||||||
|
/* 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)
|
u32 write_pirq_routing_table(u32 addr)
|
||||||
|
|
|
@ -41,7 +41,5 @@ void reset_cpu(ulong addr)
|
||||||
|
|
||||||
int arch_misc_init(void)
|
int arch_misc_init(void)
|
||||||
{
|
{
|
||||||
pirq_init();
|
return pirq_init();
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,7 +174,5 @@ void cpu_irq_init(void)
|
||||||
|
|
||||||
int arch_misc_init(void)
|
int arch_misc_init(void)
|
||||||
{
|
{
|
||||||
pirq_init();
|
return pirq_init();
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,5 @@ void cpu_irq_init(void)
|
||||||
|
|
||||||
int arch_misc_init(void)
|
int arch_misc_init(void)
|
||||||
{
|
{
|
||||||
pirq_init();
|
return pirq_init();
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,9 @@ void cpu_irq_init(void);
|
||||||
*
|
*
|
||||||
* This initializes the PIRQ routing on the platform and configures all PCI
|
* 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.
|
* 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_ */
|
#endif /* _ARCH_IRQ_H_ */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue