Cleaned up kernel prints
authorTom Knot <tomasknot@gmail.com>
Mon, 9 Apr 2018 10:03:49 +0000 (12:03 +0200)
committerTom Knot <tomasknot@gmail.com>
Mon, 9 Apr 2018 10:03:49 +0000 (12:03 +0200)
modules/unipi/src/unipi_misc.c
modules/unipi/src/unipi_spi.c
modules/unipi/src/unipi_spi.h
modules/unipi/src/unipi_uart.c

index 6efb89c3ca7d197dcef99f1b51e217ef524cde77..ae9eba0c09f7999ad6ba998196b08c714a654baa 100644 (file)
@@ -26,7 +26,6 @@
 void neuronspi_led_proc(struct kthread_work *ws)
 {
        struct neuronspi_led_driver *led = to_led_driver(ws, led_work);
-       printk("NEURONSPI: BRIGHT id:%d\n", led->id);
        neuronspi_spi_led_set_brightness(led->spi, led->brightness, led->id);
 }
 
index eea0d69b0d4a8f8474cfb33e3dd8b81e6f5eb997..c4e6abfde8751e48edece92042bcc42d1acee863 100644 (file)
@@ -849,7 +849,6 @@ void neuronspi_spi_led_set_brightness(struct spi_device* spi_dev, enum led_brigh
        if (!d_data->reserved_device) {
                neuronspi_spi_send_message(spi_dev, message_buf, recv_buf, NEURONSPI_SPI_LED_SET_MESSAGE_LEN, frequency, 25, 0);
        }
-       printk(KERN_INFO "NEURONSPI: Brightness set to %d on led %d\n", brightness, id);
        kfree(message_buf);
        kfree(recv_buf);
 }
@@ -861,12 +860,11 @@ int neuronspi_spi_gpio_di_get(struct spi_device* spi_dev, u32 id)
        u32 offset = id / 16;
        struct neuronspi_driver_data *d_data = spi_get_drvdata(spi_dev);
        recv_buf = kzalloc(4, GFP_KERNEL);
-       printk(KERN_INFO "NEURONSPI: REGMAP TEST: %d\n", regmap_read(d_data->reg_map, d_data->regstart_table->di_val_reg + offset, (void*)recv_buf));
+       regmap_read(d_data->reg_map, d_data->regstart_table->di_val_reg + offset, (void*)recv_buf);
        if (*recv_buf & (0x1 << offset)) {
                ret = 1;
        }
        kfree(recv_buf);
-       printk(KERN_INFO "NEURONSPI: GPIO DI %d get %d\n", id, ret);
        return ret;
 }
 
@@ -882,7 +880,6 @@ int neuronspi_spi_gpio_do_set(struct spi_device* spi_dev, u32 id, int value)
        current_value&= mask;
        current_value|= off_val;
        regmap_write(d_data->reg_map, d_data->regstart_table->do_val_reg + offset, current_value);
-       printk(KERN_INFO "NEURONSPI: GPIO DO %d set %d\n", id, value);
        return ret;
 }
 
@@ -898,7 +895,6 @@ int neuronspi_spi_gpio_ro_set(struct spi_device* spi_dev, u32 id, int value)
        current_value&= mask;
        current_value|= off_val;
        regmap_write(d_data->reg_map, d_data->regstart_table->ro_val_reg + offset, current_value);
-       printk(KERN_INFO "NEURONSPI: GPIO RO %d set %d\n", id, value);
        return ret;
 }
 
index f61f7ee8064f43ead1c17688c6655c534563cc9e..9edb27dc2d3537553381fa5cbedbd769571227d6 100644 (file)
@@ -419,7 +419,6 @@ static __always_inline size_t neuronspi_spi_compose_single_register_write(u16 st
        (*buf_inp)[1] = 0x06;
        (*buf_inp)[2] = start & 0xFF;
        (*buf_inp)[3] = start >> 8;
-       printk(KERN_INFO "NEURONSPI: COMPOSE SINGLE WRITE DATA: %x\n", data);
        crc1 = neuronspi_spi_crc(*buf_inp, 4, 0);
        memcpy(&(*buf_inp)[4], &crc1, 2);
        memcpy(&(*buf_inp)[6], *buf_inp, 4);
index d117f4ad0971bcd8235565eed3d40297340a1e0a..768afbe626bd1f26ca96ab33f892159647c91383 100644 (file)
@@ -71,11 +71,15 @@ int neuronspi_uart_ioctl (struct uart_port *port, unsigned int ioctl_code, unsig
        n_spi = spi_get_drvdata(spi);
        switch (ioctl_code) {
        case TIOCSETD: {
+#if NEURONSPI_DETAILED_DEBUG > 0
                printk(KERN_INFO "NEURONSPI: IOCTL TIOCSETD (processed via set_termios)\n");
+#endif
                return 1;
        }
        case 0x5480: {
+#if NEURONSPI_DETAILED_DEBUG > 0
                printk(KERN_INFO "NEURONSPI: IOCTL 0x5480\n");
+#endif
                write_length = neuronspi_spi_compose_single_register_write(NEURONSPI_UART_TIMEOUT_REGISTER, &inp_buf, &outp_buf, (ioctl_arg * 1000000) / n_port->baud);
                neuronspi_spi_send_message(spi, inp_buf, outp_buf, write_length, n_spi->ideal_frequency, 25, 1);
                kfree(inp_buf);
@@ -83,7 +87,9 @@ int   neuronspi_uart_ioctl (struct uart_port *port, unsigned int ioctl_code, unsig
                return 1;
        }
        case 0x5481: {
+#if NEURONSPI_DETAILED_DEBUG > 0
                printk(KERN_INFO "NEURONSPI: IOCTL 0x5481\n");
+#endif
                write_length = neuronspi_spi_compose_single_register_write(NEURONSPI_UART_TIMEOUT_REGISTER, &inp_buf, &outp_buf, ioctl_arg);
                neuronspi_spi_send_message(spi, inp_buf, outp_buf, write_length, n_spi->ideal_frequency, 25, 1);
                kfree(inp_buf);
@@ -106,7 +112,9 @@ void neuronspi_uart_set_parmrk(struct uart_port *port, int to)
        n_port = to_neuronspi_port(port, port);
        spi = neuronspi_s_dev[n_port->dev_index];
        n_spi = spi_get_drvdata(spi);
+#if NEURONSPI_DETAILED_DEBUG > 0
        printk(KERN_INFO "NEURONSPI: SET PARMRK to %d\n", to);
+#endif
        write_length = neuronspi_spi_compose_single_register_write(NEURONSPI_UART_IFLAGS_REGISTER, &inp_buf, &outp_buf, to);
        neuronspi_spi_send_message(spi, inp_buf, outp_buf, write_length, n_spi->ideal_frequency, 25, 1);
        kfree(inp_buf);
@@ -123,7 +131,9 @@ void neuronspi_uart_set_ldisc(struct uart_port *port, struct ktermios *kterm)
        n_port = to_neuronspi_port(port, port);
        spi = neuronspi_s_dev[n_port->dev_index];
        n_spi = spi_get_drvdata(spi);
+#if NEURONSPI_DETAILED_DEBUG > 0
        printk(KERN_INFO "NEURONSPI: PROFIBUS discipline set\n");
+#endif
        write_length = neuronspi_spi_compose_single_register_write(NEURONSPI_UART_LDISC_REGISTER, &inp_buf, &outp_buf, kterm->c_line);
        neuronspi_spi_send_message(spi, inp_buf, outp_buf, write_length, n_spi->ideal_frequency, 25, 1);
        kfree(inp_buf);
@@ -135,7 +145,9 @@ void neuronspi_uart_set_termios(struct uart_port *port, struct ktermios *termios
        struct neuronspi_port *n_port;
        n_port = to_neuronspi_port(port, port);
        if (old && old->c_iflag && old->c_iflag != termios->c_iflag) {
+#if NEURONSPI_DETAILED_DEBUG > 0
                printk(KERN_INFO "NEURONSPI: c_iflag termios:%d\n", termios->c_iflag);
+#endif
        }
 #if NEURONSPI_DETAILED_DEBUG > 0
        printk(KERN_DEBUG "NEURONSPI: TERMIOS Set, p:%d, c_cflag:%x\n", port->line, termios->c_cflag);
@@ -150,7 +162,9 @@ void neuronspi_uart_set_termios(struct uart_port *port, struct ktermios *termios
        }
        if (old && termios && old->c_line != termios->c_line) {
                if (termios->c_line == N_PROFIBUS_FDL) {
+#if NEURONSPI_DETAILED_DEBUG > 0
                        printk(KERN_INFO "NEURONSPI: Line Discipline change/n");
+#endif
                        neuronspi_uart_set_ldisc(port, termios);
                }
        }