format cdev debug messages
authorMiroslav Ondra <ondra@faster.cz>
Wed, 5 Sep 2018 09:36:30 +0000 (11:36 +0200)
committerMiroslav Ondra <ondra@faster.cz>
Wed, 5 Sep 2018 09:36:30 +0000 (11:36 +0200)
clean old code

modules/unipi/src/unipi_spi.c
modules/unipi/src/unipi_spi.h

index 4eded518530f03f0064961c2818eabb8afece8bb..65a6c97b2757faf9aeaaf443c938f9f4c8fbc932 100644 (file)
@@ -1142,33 +1142,33 @@ s32 char_register_driver(void)
        s32 ret = 0;
 
        // Character device registration
-       unipi_spi_trace(KERN_DEBUG "UNIPISPI: Initialising Character Device\n");
+       unipi_spi_trace(KERN_DEBUG "UNIPISPI: CDEV Initialising Character Device\n");
 
        neuronspi_cdrv.major_number = register_chrdev(0, NEURON_DEVICE_NAME, &file_ops);
        if (neuronspi_cdrv.major_number < 0){
-          printk(KERN_ALERT "NEURONSPI: failed to register a major number\n");
+          printk(KERN_ALERT "NEURONSPI: CDEV Failed to register chrdev\n");
           return neuronspi_cdrv.major_number;
        }
-       unipi_spi_trace(KERN_DEBUG "UNIPISPI: registered correctly with major number %d\n", neuronspi_cdrv.major_number);
+       unipi_spi_trace(KERN_DEBUG "UNIPISPI: CDEV major number %d\n", neuronspi_cdrv.major_number);
 
        // Character class registration
        neuronspi_cdrv.driver_class = class_create(THIS_MODULE, NEURON_DEVICE_CLASS);
        if (IS_ERR(neuronspi_cdrv.driver_class)) {
                unregister_chrdev(neuronspi_cdrv.major_number, NEURON_DEVICE_NAME);
-               printk(KERN_ALERT "NEURONSPI: Failed to register device class\n");
+               printk(KERN_ALERT "NEURONSPI: CDEV Failed to register device class\n");
                return PTR_ERR(neuronspi_cdrv.driver_class);
        }
-       unipi_spi_trace(KERN_DEBUG "UNIPISPI: device class registered correctly\n");
+       unipi_spi_trace(KERN_DEBUG "UNIPISPI: CDEV Device class registered\n");
 
        // Device driver registration
        neuronspi_cdrv.dev = device_create_with_groups(neuronspi_cdrv.driver_class, &(neuron_plc_dev->dev), MKDEV(neuronspi_cdrv.major_number, 0), NULL, neuron_plc_attr_groups, NEURON_DEVICE_NAME);
        if (IS_ERR(neuronspi_cdrv.dev)) {
                class_destroy(neuronspi_cdrv.driver_class);
         unregister_chrdev(neuronspi_cdrv.major_number, NEURON_DEVICE_NAME);
-        printk(KERN_ALERT "NEURONSPI: Failed to create the device\n");
+        printk(KERN_ALERT "NEURONSPI: CDEV Failed to create the device\n");
         return PTR_ERR(neuronspi_cdrv.dev);
        }
-       unipi_spi_trace(KERN_DEBUG "UNIPISPI: device class created correctly\n");
+       unipi_spi_trace(KERN_DEBUG "UNIPISPI: CDEV Device class created\n");
 
        return ret;
 }
@@ -1179,7 +1179,7 @@ s32 char_unregister_driver(void)
        class_unregister(neuronspi_cdrv.driver_class);                                                          // Unregister the class
        class_destroy(neuronspi_cdrv.driver_class);                                                             // Destroy the class
        unregister_chrdev(neuronspi_cdrv.major_number, NEURON_DEVICE_NAME);                                     // Unregister the major number
-       printk(KERN_INFO "UNIPISPI: Device unloaded successfully\n");
+       printk(KERN_INFO "UNIPISPI: CDEV unloaded\n");
        return 0;
 }
 
@@ -1216,11 +1216,10 @@ static s32 __init neuronspi_init(void)
        ret = spi_register_driver(&neuronspi_spi_driver);
 
        if (ret < 0) {
-               printk(KERN_ERR "UNIPISPI: Failed to init neuronspi spi --> %d\n", ret);
+               printk(KERN_ERR "UNIPISPI: Failed to init spi driver --> %d\n", ret);
                return ret;
-       } else {
-               printk(KERN_INFO "UNIPISPI: SPI Driver Registered, Major Version: %s\n", NEURONSPI_MAJOR_VERSIONSTRING);
        }
+       printk(KERN_INFO "UNIPISPI: SPI Driver Registered, Major Version: %s\n", NEURONSPI_MAJOR_VERSIONSTRING);
 
        neuronspi_invalidate_thread = kthread_create(neuronspi_regmap_invalidate, NULL, "unipispi_inv");
        if (neuronspi_invalidate_thread != NULL) {
index b3f24d299e8cf6e400810653a96c9a8b70ab9735..ba8e964a763091b842b97b450efdce37ccc59d1f 100644 (file)
@@ -165,107 +165,7 @@ static const struct regmap_config neuronspi_regmap_config_default =
                .can_multi_write                = 1,
 };
 
-/*
-static const struct iio_chan_spec neuronspi_stm_ai_chan_spec[] = {
-       {
-                       .type = IIO_VOLTAGE,
-                       .indexed = 1,
-                       .channel = 0,
-                       .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
-                       .output = 0
-       },
-       {
-                       .type = IIO_CURRENT,
-                       .indexed = 1,
-                       .channel = 1,
-                       .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
-                       .output = 0
-       }
-};
-
-static const struct iio_chan_spec neuronspi_stm_ao_chan_spec[] = {
-       {
-                       .type = IIO_VOLTAGE,
-                       .indexed = 1,
-                       .channel = 0,
-                       .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
-                       .output = 1
-       },
-       {
-                       .type = IIO_CURRENT,
-                       .indexed = 1,
-                       .channel = 1,
-                       .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
-                       .output = 1
-       },
-       {
-                       .type = IIO_RESISTANCE,
-                       .indexed = 1,
-                       .channel = 2,
-                       .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
-                       .output = 0
-       }
-};
-
-static const struct iio_chan_spec neuronspi_sec_ai_chan_spec[] = {
-       {
-                       .type = IIO_VOLTAGE,
-                       .indexed = 1,
-                       .channel = 0,
-                       .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
-                       .output = 0
-       },
-       {
-                       .type = IIO_CURRENT,
-                       .indexed = 1,
-                       .channel = 1,
-                       .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
-                       .output = 0
-       },
-       {
-                       .type = IIO_RESISTANCE,
-                       .indexed = 1,
-                       .channel = 2,
-                       .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
-                       .output = 0
-       }
-};
-
-static const struct iio_chan_spec neuronspi_sec_ao_chan_spec[] = {
-       {
-                       .type = IIO_VOLTAGE,
-                       .indexed = 1,
-                       .channel = 0,
-                       .info_mask_separate = BIT(IIO_CHAN_INFO_RAW),
-                       .output = 1
-       }
-};
 
-static const struct iio_info neuronspi_stm_ai_info = {
-       .read_raw = neuronspi_iio_stm_ai_read_raw,
-       .driver_module = THIS_MODULE,
-       .attrs = &neuron_stm_ai_group,
-};
-
-static const struct iio_info neuronspi_stm_ao_info = {
-       .read_raw = neuronspi_iio_stm_ao_read_raw,
-       .write_raw = neuronspi_iio_stm_ao_write_raw,
-       .driver_module = THIS_MODULE,
-       .attrs = &neuron_stm_ao_group,
-};
-
-static const struct iio_info neuronspi_sec_ai_info = {
-       .read_raw = neuronspi_iio_sec_ai_read_raw,
-       .driver_module = THIS_MODULE,
-       .attrs = &neuron_sec_ai_group,
-};
-
-static const struct iio_info neuronspi_sec_ao_info = {
-       .write_raw = neuronspi_iio_sec_ao_write_raw,
-       .driver_module = THIS_MODULE,
-       //.attrs = &neuron_sec_ao_group,
-};
-*/
 // These defines need to be at the end
 #define to_neuronspi_uart_data(p,e)  ((container_of((p), struct neuronspi_uart_data, e)))
 #define to_neuronspi_port(p,e) ((container_of((p), struct neuronspi_port, e)))