drivers: serial: Fix uart_irq_callback_user_data_t usage

Now providing the device pointer that calls the callback.

Fixes #26923

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2020-06-24 15:47:15 +02:00 committed by Carles Cufí
commit 04d6d0b120
27 changed files with 29 additions and 28 deletions

View file

@ -237,7 +237,7 @@ static void leuart_gecko_isr(void *arg)
struct leuart_gecko_data *data = dev->driver_data;
if (data->callback) {
data->callback(data->cb_data);
data->callback(dev, data->cb_data);
}
}
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */

View file

@ -345,10 +345,11 @@ static void uart_cc13xx_cc26xx_irq_callback_set(
static void uart_cc13xx_cc26xx_isr(void *arg)
{
struct uart_cc13xx_cc26xx_data *data = get_dev_data(arg);
struct device *dev = (struct device *)arg;
struct uart_cc13xx_cc26xx_data *data = get_dev_data(dev);
if (data->callback) {
data->callback(data->user_data);
data->callback(dev, data->user_data);
}
}

View file

@ -282,7 +282,7 @@ static void uart_cc32xx_isr(void *arg)
1);
if (dev_data->cb) {
dev_data->cb(dev_data->cb_data);
dev_data->cb(dev, dev_data->cb_data);
}
/*
* RX/TX interrupt should have been implicitly cleared by Zephyr UART

View file

@ -430,7 +430,7 @@ void uart_cmsdk_apb_isr(void *arg)
/* Verify if the callback has been registered */
if (data->irq_cb) {
data->irq_cb(data->irq_cb_data);
data->irq_cb(dev, data->irq_cb_data);
}
}

View file

@ -437,7 +437,7 @@ void uart_esp32_isr(void *arg)
/* Verify if the callback has been registered */
if (data->irq_cb) {
data->irq_cb(data->irq_cb_data);
data->irq_cb(dev, data->irq_cb_data);
}
}

View file

@ -229,7 +229,7 @@ static void uart_gecko_isr(void *arg)
struct uart_gecko_data *data = dev->driver_data;
if (data->callback) {
data->callback(data->cb_data);
data->callback(dev, data->cb_data);
}
}
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */

View file

@ -255,7 +255,7 @@ void uart_imx_isr(void *arg)
struct imx_uart_data *data = dev->driver_data;
if (data->callback) {
data->callback(data->cb_data);
data->callback(dev, data->cb_data);
}
}
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */

View file

@ -279,7 +279,7 @@ static void liteuart_uart_irq_handler(void *arg)
int key = irq_lock();
if (data->callback) {
data->callback(data->cb_data);
data->callback(dev, data->cb_data);
}
/* clear events */

View file

@ -298,7 +298,7 @@ static void uart_mcux_isr(void *arg)
struct uart_mcux_data *data = dev->driver_data;
if (data->callback) {
data->callback(data->cb_data);
data->callback(dev, data->cb_data);
}
}
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */

View file

@ -236,7 +236,7 @@ static void mcux_flexcomm_isr(void *arg)
struct mcux_flexcomm_data *data = dev->driver_data;
if (data->callback) {
data->callback(data->cb_data);
data->callback(dev, data->cb_data);
}
}
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */

View file

@ -227,7 +227,7 @@ static void mcux_lpsci_isr(void *arg)
struct mcux_lpsci_data *data = dev->driver_data;
if (data->callback) {
data->callback(data->cb_data);
data->callback(dev, data->cb_data);
}
}
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */

View file

@ -227,7 +227,7 @@ static void mcux_lpuart_isr(void *arg)
struct mcux_lpuart_data *data = dev->driver_data;
if (data->callback) {
data->callback(data->cb_data);
data->callback(dev, data->cb_data);
}
}
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */

View file

@ -300,7 +300,7 @@ static void uart_miv_irq_handler(void *arg)
struct uart_miv_data *data = DEV_DATA(dev);
if (data->callback) {
data->callback(data->cb_data);
data->callback(dev, data->cb_data);
}
}

View file

@ -329,7 +329,7 @@ static void uart_msp432p4xx_isr(void *arg)
(unsigned long)config->base);
if (dev_data->cb) {
dev_data->cb(dev_data->cb_data);
dev_data->cb(dev, dev_data->cb_data);
}
/*
* Clear interrupts only after cb called, as Zephyr UART clients expect

View file

@ -950,7 +950,7 @@ static void uart_nrfx_isr(void *arg)
}
if (irq_callback) {
irq_callback(irq_cb_data);
irq_callback(dev, irq_cb_data);
}
}
#endif /* CONFIG_UART_0_INTERRUPT_DRIVEN */

View file

@ -191,7 +191,7 @@ static void uarte_nrfx_isr_int(void *arg)
}
if (data->int_driven->cb) {
data->int_driven->cb(data->int_driven->cb_data);
data->int_driven->cb(dev, data->int_driven->cb_data);
}
}
#endif /* UARTE_INTERRUPT_DRIVEN */

View file

@ -853,7 +853,7 @@ static void uart_ns16550_isr(void *arg)
struct uart_ns16550_dev_data_t * const dev_data = DEV_DATA(dev);
if (dev_data->cb) {
dev_data->cb(dev_data->cb_data);
dev_data->cb(dev, dev_data->cb_data);
}
}

View file

@ -402,7 +402,7 @@ void pl011_isr(void *arg)
/* Verify if the callback has been registered */
if (data->irq_cb) {
data->irq_cb(data->irq_cb_data);
data->irq_cb(dev, data->irq_cb_data);
}
}
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */

View file

@ -230,7 +230,7 @@ static void rv32m1_lpuart_isr(void *arg)
struct rv32m1_lpuart_data *data = dev->driver_data;
if (data->callback) {
data->callback(data->cb_data);
data->callback(dev, data->cb_data);
}
}
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */

View file

@ -294,7 +294,7 @@ static void uart_sam_isr(void *arg)
struct uart_sam_dev_data *const dev_data = DEV_DATA(dev);
if (dev_data->irq_cb) {
dev_data->irq_cb(dev_data->irq_cb_data);
dev_data->irq_cb(dev, dev_data->irq_cb_data);
}
}

View file

@ -662,7 +662,7 @@ static void uart_sam0_isr(void *arg)
#if CONFIG_UART_INTERRUPT_DRIVEN
if (dev_data->cb) {
dev_data->cb(dev_data->cb_data);
dev_data->cb(dev, dev_data->cb_data);
}
#endif

View file

@ -323,7 +323,7 @@ static void uart_sifive_irq_handler(void *arg)
struct uart_sifive_data *data = DEV_DATA(dev);
if (data->callback)
data->callback(data->cb_data);
data->callback(dev, data->cb_data);
}
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */

View file

@ -597,7 +597,7 @@ static void uart_stellaris_isr(void *arg)
struct uart_stellaris_dev_data_t * const dev_data = DEV_DATA(dev);
if (dev_data->cb) {
dev_data->cb(dev_data->cb_data);
dev_data->cb(dev, dev_data->cb_data);
}
}

View file

@ -615,7 +615,7 @@ static void uart_stm32_isr(void *arg)
struct uart_stm32_data *data = DEV_DATA(dev);
if (data->user_cb) {
data->user_cb(data->user_data);
data->user_cb(dev, data->user_data);
}
}

View file

@ -1139,7 +1139,7 @@ static void uart_xlnx_ps_isr(void *arg)
const struct uart_xlnx_ps_dev_data_t *data = DEV_DATA(dev);
if (data->user_cb) {
data->user_cb(data->user_data);
data->user_cb(dev, data->user_data);
}
}
#endif /* CONFIG_UART_INTERRUPT_DRIVEN */

View file

@ -295,7 +295,7 @@ static void usart_sam_isr(void *arg)
struct usart_sam_dev_data *const dev_data = DEV_DATA(dev);
if (dev_data->irq_cb) {
dev_data->irq_cb(dev_data->cb_data);
dev_data->irq_cb(dev, dev_data->cb_data);
}
}

View file

@ -519,7 +519,7 @@ static void cdc_acm_irq_callback_work_handler(struct k_work *work)
dev_data = CONTAINER_OF(work, struct cdc_acm_dev_data_t, cb_work);
dev_data->cb(dev_data->cb_data);
dev_data->cb(dev_data->common.dev, dev_data->cb_data);
}
/**