Fix sysled support
authorMiroslav Ondra <ondra@faster.cz>
Wed, 22 Jan 2020 13:18:30 +0000 (14:18 +0100)
committerMiroslav Ondra <ondra@faster.cz>
Wed, 22 Jan 2020 13:18:30 +0000 (14:18 +0100)
modules/unipi/src/unipi_common.h
modules/unipi/src/unipi_misc.c
modules/unipi/src/unipi_uart.c

index 84320ed16454b8662a30a0aff070cb8de48fe8dc..6e53e7cf1a648aba88e510249677b4d57a5e7b58 100644 (file)
@@ -52,7 +52,7 @@
 #if NEURONSPI_SCHED_REQUIRED > 0
        #include <uapi/linux/sched/types.h>
 #endif
-#define NEURONSPI_MAJOR_VERSIONSTRING "Version 1.33:2020:01:22"
+#define NEURONSPI_MAJOR_VERSIONSTRING "Version 1.37:2020:01:22"
 
 #define NEURONSPI_MAX_DEVS                             3
 #define NEURONSPI_MAX_UART                             16
index f774f29efe480243635ecc9d3c499fef16fa217b..1ceb1b387c13811a1d8144bd47dd401e31778d60 100644 (file)
@@ -55,9 +55,9 @@ struct neuronspi_led_driver * neuronspi_led_probe(int uled_count, int sysled_cou
 {
     struct spi_device* spi = neuronspi_s_dev[neuron_index];
        struct neuronspi_driver_data *n_spi = spi_get_drvdata(spi);
+    int led_count = uled_count + sysled_count;
        struct neuronspi_led_driver * led_driver = kzalloc(sizeof(struct neuronspi_led_driver) * led_count, GFP_ATOMIC);
        int i, coil;
-    int led_count = uled_count + sysled_count;
 
        if (n_spi->features != NULL) {
                coil = n_spi->features->di_count + n_spi->features->do_count + n_spi->features->ro_count;
@@ -68,7 +68,7 @@ struct neuronspi_led_driver * neuronspi_led_probe(int uled_count, int sysled_cou
        for (i = 0; i < led_count; i++) {
         if (i < uled_count) {
                        scnprintf(led_driver[i].name, sizeof(led_driver[i].name), "unipi:green:uled-x%x", i);
-               { else {
+               } else {
                        scnprintf(led_driver[i].name, sizeof(led_driver[i].name), "unipi:green:sysled-x%x", i-uled_count);
                }
                // Initialise the rest of the structure
index e0817c21dd8a832721e09d5b7ca40592cd40f5ef..0facb35375d1ec167262acfce98e4cbb691f83de 100644 (file)
@@ -317,7 +317,7 @@ void neuronspi_uart_handle_rx(struct neuronspi_port *port, int rxlen, u8* pbuf)
 
                        ch = *pbuf;
             pbuf++;
-                       if (uart_handle_sysrq_char(port, ch))
+                       if (uart_handle_sysrq_char(&port->port, ch))
                                continue;
 
                        uart_insert_char(&port->port, 0, 0, ch, flag);