risc-v/espressif: Panic if CPU interrupt allocation fails

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
This commit is contained in:
Gustavo Henrique Nihei 2023-04-03 15:43:04 -03:00 committed by Alan Carvalho de Assis
parent 7aecd751f0
commit 8be8aab9bb
3 changed files with 4 additions and 11 deletions

View File

@ -422,8 +422,7 @@ void esp_route_intr(int source, int cpuint, irq_priority_t priority,
* type - Interrupt trigger type. * type - Interrupt trigger type.
* *
* Returned Value: * Returned Value:
* The allocated CPU interrupt on success, a negated errno value on * Allocated CPU interrupt.
* failure.
* *
****************************************************************************/ ****************************************************************************/
@ -449,11 +448,10 @@ int esp_setup_irq(int source, irq_priority_t priority, irq_trigger_t type)
cpuint = esp_cpuint_alloc(irq); cpuint = esp_cpuint_alloc(irq);
if (cpuint < 0) if (cpuint < 0)
{ {
irqerr("Unable to allocate CPU interrupt for priority=%d and type=%d", _alert("Unable to allocate CPU interrupt for source=%d\n",
priority, type); priority, type);
leave_critical_section(irqstate);
return cpuint; PANIC();
} }
esp_route_intr(source, cpuint, priority, type); esp_route_intr(source, cpuint, priority, type);

View File

@ -115,8 +115,7 @@ void esp_route_intr(int source, int cpuint, irq_priority_t priority,
* type - Interrupt trigger type. * type - Interrupt trigger type.
* *
* Returned Value: * Returned Value:
* The allocated CPU interrupt on success, a negated errno value on * Allocated CPU interrupt.
* failure.
* *
****************************************************************************/ ****************************************************************************/

View File

@ -493,10 +493,6 @@ static int esp_attach(uart_dev_t *dev)
priv->cpuint = esp_setup_irq(priv->source, priv->int_pri, priv->cpuint = esp_setup_irq(priv->source, priv->int_pri,
ESP_IRQ_TRIGGER_LEVEL); ESP_IRQ_TRIGGER_LEVEL);
if (priv->cpuint < 0)
{
return priv->cpuint;
}
/* Attach and enable the IRQ */ /* Attach and enable the IRQ */