Add flush_buffer to uart
authorMiroslav Ondra <ondra@faster.cz>
Wed, 22 Jan 2020 21:07:08 +0000 (22:07 +0100)
committerMiroslav Ondra <ondra@faster.cz>
Wed, 22 Jan 2020 21:07:08 +0000 (22:07 +0100)
modules/unipi/src/unipi_spi.c

index 851c7dda720a06615ce37aa5b69257be8f2cc518..0356bfa41d278a1ad394b5dad7cab1b2602d9f5b 100644 (file)
@@ -1120,6 +1120,7 @@ void neuronspi_spi_set_irqs(struct spi_device* spi_dev, u16 to)
 void neuronspi_uart_flush_proc(struct kthread_work *ws)
 {
        struct neuronspi_port *n_port = ((container_of((ws), struct neuronspi_port, flush_work)));
+    struct neuronspi_driver_data *n_spi = n_port->n_spi;
        struct spi_device *spi = neuronspi_s_dev[n_spi->neuron_index];
     struct neuronspi_op_buffer recv_buf;
        unsigned long flags;
@@ -1135,7 +1136,7 @@ void neuronspi_uart_flush_proc(struct kthread_work *ws)
 
        spin_lock_irqsave(&n_port->port.lock, flags);
     n_port->accept_rx = 1;
-    spin_lock_irqrestore(&n_port->port.lock, flags);
+    spin_unlock_irqrestore(&n_port->port.lock, flags);
 
 }