]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
removed debugging code
authorLothar Waßmann <LW@KARO-electronics.de>
Wed, 28 Mar 2012 14:17:44 +0000 (16:17 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 28 Mar 2012 14:17:44 +0000 (16:17 +0200)
drivers/staging/iio/industrialio-core.c
drivers/staging/iio/industrialio-trigger.c
drivers/staging/iio/inkern.c

index 62e581b2bdc74470a3d95a7a67603a572fca9b62..2b5b8481eb29b0d556f58aee51cfc8aaa7d98d5a 100644 (file)
 #include <linux/slab.h>
 #include <linux/anon_inodes.h>
 #include <linux/debugfs.h>
-
-#ifdef DEBUG
-#define __debug_var    industrialio_debug
-int industrialio_debug = 1;
-module_param(industrialio_debug, int, S_IRUGO | S_IWUSR);
-#else
-static int industrialio_debug;
-module_param(industrialio_debug, int, 0);
-#endif
-
 #include "iio.h"
 #include "iio_core.h"
 #include "iio_core_trigger.h"
@@ -751,14 +741,11 @@ static void iio_dev_release(struct device *device)
 {
        struct iio_dev *indio_dev = container_of(device, struct iio_dev, dev);
        cdev_del(&indio_dev->chrdev);
-       _DBG(0, "%s: Release iio_dev %p modes=%08x\n", __func__, indio_dev,
-               indio_dev->modes);
        if (indio_dev->modes & INDIO_BUFFER_TRIGGERED)
                iio_device_unregister_trigger_consumer(indio_dev);
        iio_device_unregister_eventset(indio_dev);
        iio_device_unregister_sysfs(indio_dev);
        iio_device_unregister_debugfs(indio_dev);
-       _DBG(0, "%s: Freeing iio_dev %p\n", __func__, indio_dev);
        kfree(indio_dev);
 }
 
@@ -776,14 +763,6 @@ struct iio_dev *iio_allocate_device(int sizeof_priv)
        if (sizeof_priv) {
                alloc_size = ALIGN(alloc_size, IIO_ALIGN);
                alloc_size += sizeof_priv;
-               DBG(0, "%s: alloc_size = %u + %u + %u + %u = %u\n", __func__,
-                       sizeof(struct iio_dev),
-                       ALIGN(alloc_size, IIO_ALIGN - sizeof(struct iio_dev)),
-                       sizeof_priv, IIO_ALIGN - 1, alloc_size + IIO_ALIGN - 1);
-       } else {
-               DBG(0, "%s: alloc_size = %u + %u = %u\n", __func__,
-                       sizeof(struct iio_dev), IIO_ALIGN - 1,
-                       alloc_size + IIO_ALIGN - 1);
        }
        /* ensure 32-byte alignment of whole construct ? */
        alloc_size += IIO_ALIGN - 1;
@@ -808,7 +787,6 @@ struct iio_dev *iio_allocate_device(int sizeof_priv)
                }
                dev_set_name(&dev->dev, "iio:device%d", dev->id);
                get_device(&dev->dev);
-               DBG(0, "%s: Allocated iio_dev %p\n", __func__, dev);
        }
 
        return dev;
@@ -819,9 +797,7 @@ void iio_free_device(struct iio_dev *dev)
 {
        if (dev) {
                ida_simple_remove(&iio_ida, dev->id);
-               DBG(0, "%s: Releasing iio_dev %p!\n", __func__, dev);
                put_device(&dev->dev);
-//             kfree(dev);
        }
 }
 EXPORT_SYMBOL(iio_free_device);
index 8a83b6e9ecaa68aeafee6b52569741bd4cfb1f53..d85fd6e6d6f87c4c404d3297785509d0b2c0e621 100644 (file)
 #include <linux/interrupt.h>
 #include <linux/list.h>
 #include <linux/slab.h>
-
-#ifdef DEBUG
-#define __debug_var    industrialio_debug
-#endif
-
 #include "iio.h"
 #include "trigger.h"
 #include "iio_core.h"
@@ -292,7 +287,6 @@ struct iio_poll_func
                kfree(pf);
                return NULL;
        }
-       DBG(0, "%s: Allocated pollfunc %p\n", __func__, pf);
        pf->h = h;
        pf->thread = thread;
        pf->type = type;
@@ -305,7 +299,6 @@ EXPORT_SYMBOL_GPL(iio_alloc_pollfunc);
 void iio_dealloc_pollfunc(struct iio_poll_func *pf)
 {
        kfree(pf->name);
-       DBG(0, "%s: Freeing pollfunc %p\n", __func__, pf);
        kfree(pf);
 }
 EXPORT_SYMBOL_GPL(iio_dealloc_pollfunc);
@@ -411,7 +404,6 @@ static void iio_trig_release(struct device *device)
                               CONFIG_IIO_CONSUMERS_PER_TRIGGER);
        }
        kfree(trig->name);
-       DBG(0, "%s: Freeing trigger %p\n", __func__, trig);
        kfree(trig);
 }
 
@@ -480,7 +472,6 @@ struct iio_trigger *iio_allocate_trigger(const char *fmt, ...)
                                          IRQ_NOPROBE);
                }
                get_device(&trig->dev);
-               DBG(0, "%s: Allocated trigger %p\n", __func__, trig);
        }
        return trig;
 }
@@ -488,7 +479,6 @@ EXPORT_SYMBOL(iio_allocate_trigger);
 
 void iio_free_trigger(struct iio_trigger *trig)
 {
-       DBG(0, "%s: Releasing trigger %p\n", __func__, trig);
        if (trig)
                put_device(&trig->dev);
 }
@@ -496,7 +486,6 @@ EXPORT_SYMBOL(iio_free_trigger);
 
 void iio_device_register_trigger_consumer(struct iio_dev *indio_dev)
 {
-       _DBG(0, "%s: dev=%p\n", __func__, indio_dev);
        indio_dev->groups[indio_dev->groupcounter++] =
                &iio_trigger_consumer_attr_group;
 }
@@ -505,7 +494,6 @@ EXPORT_SYMBOL(iio_device_register_trigger_consumer);
 void iio_device_unregister_trigger_consumer(struct iio_dev *indio_dev)
 {
        /* Clean up any associated but not attached triggers references */
-       _DBG(0, "%s: dev=%p\n", __func__, indio_dev);
 #if 0
        if (indio_dev->trig)
                iio_put_trigger(indio_dev->trig);
index b59af3a77d94569ecd1e2998d292baf5328118b8..709140f2591dbff7fe6d707a50a468574c8b66b0 100644 (file)
@@ -39,24 +39,18 @@ int iio_map_array_register(struct iio_dev *indio_dev, struct iio_map *maps)
                return 0;
 
        mutex_lock(&iio_map_list_lock);
-       DBG(0, "%s: Registering %p chan_map %p\n", __func__,
-               indio_dev, maps);
        while (maps[i].consumer_dev_name != NULL) {
                mapi = kzalloc(sizeof(*mapi), GFP_KERNEL);
                if (mapi == NULL) {
                        ret = -ENOMEM;
                        goto error_ret;
                }
-               DBG(0, "%s: Registering entry %p '%s','%s','%s' @ %p\n",
-                       __func__, &maps[i], maps[i].adc_channel_label,
-                       maps[i].consumer_dev_name, maps[i].consumer_channel, mapi);
                mapi->map = &maps[i];
                mapi->indio_dev = indio_dev;
                list_add(&mapi->l, &iio_map_list);
                i++;
        }
 error_ret:
-       DBG(0, "%s: Done\n", __func__);
        mutex_unlock(&iio_map_list_lock);
 
        return ret;
@@ -79,17 +73,11 @@ int iio_map_array_unregister(struct iio_dev *indio_dev,
                return 0;
 
        mutex_lock(&iio_map_list_lock);
-       DBG(0, "%s: Unregistering %p chan_map %p\n", __func__,
-               indio_dev, maps);
        while (maps[i].consumer_dev_name != NULL) {
-               DBG(0, "%s: Unregistering entry %p '%s','%s'\n",
-                       __func__, &maps[i], maps[i].adc_channel_label,
-                       maps[i].consumer_dev_name);
                found_it = false;
                list_for_each_entry(mapi, &iio_map_list, l)
                        if (&maps[i] == mapi->map) {
                                list_del(&mapi->l);
-                               DBG(0, "Freeing %p\n", mapi);
                                kfree(mapi);
                                found_it = true;
                                break;
@@ -104,7 +92,6 @@ int iio_map_array_unregister(struct iio_dev *indio_dev,
                i++;
        }
 error_ret:
-       DBG(0, "%s: Done\n", __func__);
        mutex_unlock(&iio_map_list_lock);
 
        return ret;
@@ -118,24 +105,13 @@ static const struct iio_chan_spec
        int i;
        const struct iio_chan_spec *chan = NULL;
 
-       DBG(0, "%s: Searching channel '%s' out of %u channels from dev %p\n",
-               __func__, name, indio_dev->num_channels, indio_dev);
        for (i = 0; i < indio_dev->num_channels; i++) {
-               DBG(0, "%s: dev %p '%s' chan[%d] ds name: '%s'\n",
-                       __func__, indio_dev, indio_dev->name, i,
-                       indio_dev->channels[i].datasheet_name);
                if (indio_dev->channels[i].datasheet_name &&
                    strcmp(name, indio_dev->channels[i].datasheet_name) == 0) {
                        chan = &indio_dev->channels[i];
                        break;
                }
        }
-       if (chan)
-               DBG(0, "%s: found channel %p '%s'\n",
-                       __func__, chan, chan->datasheet_name);
-       else
-               DBG(0, "%s: channel '%s' not found\n",
-                       __func__, name);
 
        return chan;
 }
@@ -152,12 +128,7 @@ struct iio_channel *iio_st_channel_get(const char *name,
 
        /* first find matching entry the channel map */
        mutex_lock(&iio_map_list_lock);
-       DBG(0, "%s: Searching for channel '%s' for device '%s'\n",
-               __func__, channel_name, name);
        list_for_each_entry(c_i, &iio_map_list, l) {
-               DBG(0, "label='%s' dev='%s' key='%s'\n",
-                       c_i->map->adc_channel_label, c_i->map->consumer_dev_name,
-                       c_i->map->consumer_channel);
                if ((name && strcmp(name, c_i->map->consumer_dev_name) != 0) ||
                    (channel_name &&
                     strcmp(channel_name, c_i->map->adc_channel_label) != 0))
@@ -166,13 +137,7 @@ struct iio_channel *iio_st_channel_get(const char *name,
                get_device(&c->indio_dev->dev);
                break;
        }
-       if (c)
-               DBG(0, "found channel label='%s' dev='%s' key='%s' on iio_dev %p\n",
-                       c->map->adc_channel_label, c->map->consumer_dev_name,
-                       c->map->consumer_channel, c->indio_dev);
-       else
-               pr_err("Channel '%s' not found for device %s\n",
-                       channel_name, name);
+
        mutex_unlock(&iio_map_list_lock);
        if (c == NULL)
                return ERR_PTR(-ENODEV);
@@ -239,12 +204,7 @@ struct iio_channel *iio_st_channel_get_all(const char *name)
        }
 
        /* for each map fill in the chans element */
-       DBG(0, "%s: Searching channels for '%s'\n", __func__,
-               name);
        list_for_each_entry(c, &iio_map_list, l) {
-               DBG(0, "label='%s' dev='%s' key='%s'\n",
-                       c->map->adc_channel_label, c->map->consumer_dev_name,
-                       c->map->consumer_channel);
                if (name && strcmp(name, c->map->consumer_dev_name) != 0)
                        continue;
                chans[mapind].indio_dev = c->indio_dev;