Brijesh-Thakkar commented on code in PR #20842:
URL: https://github.com/apache/nuttx/pull/20842#discussion_r4342494761
##########
drivers/serial/uart_16550.c:
##########
@@ -983,23 +983,30 @@ static int u16550_attach(struct uart_dev_s *dev)
/* Attach and enable the IRQ */
- ret = irq_attach(priv->irq, priv->ops->isr, dev);
-#ifndef CONFIG_ARCH_NOINTC
- if (ret == OK)
+ if (priv->ops->attach != NULL)
{
- /* Enable the interrupt (RX and TX interrupts are still disabled
- * in the UART
- */
-
- up_enable_irq(priv->irq);
-
-#ifdef HAVE_16550_UART_DMA
- if (priv->chanrx)
+ ret = priv->ops->attach(priv, dev);
+ }
+ else
+ {
+ ret = irq_attach(priv->irq, priv->ops->isr, dev);
+#ifndef CONFIG_ARCH_NOINTC
+ if (ret == OK)
{
- DMA_RESUME(priv->chanrx);
+ /* Enable the interrupt (RX and TX interrupts are still disabled
+ * in the UART
+ */
+
+ up_enable_irq(priv->irq);
}
#endif
}
+
+#if defined(HAVE_16550_UART_DMA) && !defined(CONFIG_ARCH_NOINTC)
Review Comment:
thanks. That condition came from my commit when I moved DMA_RESUME out
of the NOINTC block; no NOINTC arch uses 16550 and no defconfig enables 16550
DMA, so plain #ifdef HAVE_16550_UART_DMA is fine.
I'll fold it into the attach/detach commit.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]