Module: xenomai-abe
Branch: comedi
Commit: 9696c506628c55094b227bb6c203dcce9d352c17
URL:    
http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=9696c506628c55094b227bb6c203dcce9d352c17

Author: Alexis Berlemont <alexis.berlem...@gmail.com>
Date:   Sat Sep 19 00:27:19 2009 +0200

Remove useless wrappers (comedi_kmalloc, comedi_kfree)

---

 include/comedi/os_facilities.h                     |   10 ----
 ksrc/drivers/comedi/buffer.c                       |    4 +-
 ksrc/drivers/comedi/command.c                      |   10 ++--
 ksrc/drivers/comedi/device.c                       |   24 +++++-----
 ksrc/drivers/comedi/instruction.c                  |   12 +++---
 .../comedi/national_instruments/mio_common.c       |   48 ++++++++++----------
 ksrc/drivers/comedi/national_instruments/mite.c    |    6 +-
 ksrc/drivers/comedi/national_instruments/mite.h    |    6 +-
 .../comedi/national_instruments/tio_common.c       |   10 ++--
 ksrc/drivers/comedi/subdevice.c                    |   14 +++---
 ksrc/drivers/comedi/transfer.c                     |   18 ++++----
 11 files changed, 76 insertions(+), 86 deletions(-)

diff --git a/include/comedi/os_facilities.h b/include/comedi/os_facilities.h
index 2f326c2..e9315b7 100644
--- a/include/comedi/os_facilities.h
+++ b/include/comedi/os_facilities.h
@@ -89,16 +89,6 @@
 
 /* --- Allocation / MMU section --- */
 
-static inline void *comedi_kmalloc(int size)
-{
-       return rtdm_malloc(size);
-}
-
-static inline void comedi_kfree(void *pinp)
-{
-       rtdm_free(pinp);
-}
-
 static inline int __comedi_copy_from_user(rtdm_user_info_t * user_info,
                                          void *pind, void *pins, int size)
 {
diff --git a/ksrc/drivers/comedi/buffer.c b/ksrc/drivers/comedi/buffer.c
index edd9807..27696d8 100644
--- a/ksrc/drivers/comedi/buffer.c
+++ b/ksrc/drivers/comedi/buffer.c
@@ -38,7 +38,7 @@
 void comedi_free_buffer(comedi_buf_t * buf_desc)
 {
        if (buf_desc->pg_list != NULL) {
-               comedi_kfree(buf_desc->pg_list);
+               rtdm_free(buf_desc->pg_list);
                buf_desc->pg_list = NULL;
        }
 
@@ -75,7 +75,7 @@ int comedi_alloc_buffer(comedi_buf_t * buf_desc)
             vaddr += PAGE_SIZE)
                SetPageReserved(vmalloc_to_page(vaddr));
 
-       buf_desc->pg_list = comedi_kmalloc(((buf_desc->size) >> PAGE_SHIFT) *
+       buf_desc->pg_list = rtdm_malloc(((buf_desc->size) >> PAGE_SHIFT) *
                                           sizeof(unsigned long));
        if (buf_desc->pg_list == NULL) {
                ret = -ENOMEM;
diff --git a/ksrc/drivers/comedi/command.c b/ksrc/drivers/comedi/command.c
index 0ad63e9..069d748 100644
--- a/ksrc/drivers/comedi/command.c
+++ b/ksrc/drivers/comedi/command.c
@@ -47,7 +47,7 @@ int comedi_fill_cmddesc(comedi_cxt_t * cxt, comedi_cmd_t * 
desc, void *arg)
                goto out_cmddesc;
        }
 
-       tmpchans = comedi_kmalloc(desc->nb_chan * sizeof(unsigned int));
+       tmpchans = rtdm_malloc(desc->nb_chan * sizeof(unsigned int));
        if (tmpchans == NULL) {
                ret = -ENOMEM;
                goto out_cmddesc;
@@ -74,7 +74,7 @@ int comedi_fill_cmddesc(comedi_cxt_t * cxt, comedi_cmd_t * 
desc, void *arg)
 
        if (ret != 0) {
                if (tmpchans != NULL)
-                       comedi_kfree(tmpchans);
+                       rtdm_free(tmpchans);
                desc->chan_descs = NULL;
        }
 
@@ -84,7 +84,7 @@ int comedi_fill_cmddesc(comedi_cxt_t * cxt, comedi_cmd_t * 
desc, void *arg)
 void comedi_free_cmddesc(comedi_cmd_t * desc)
 {
        if (desc->chan_descs != NULL)
-               comedi_kfree(desc->chan_descs);
+               rtdm_free(desc->chan_descs);
 }
 
 int comedi_check_cmddesc(comedi_cxt_t * cxt, comedi_cmd_t * desc)
@@ -257,7 +257,7 @@ int comedi_ioctl_cmd(comedi_cxt_t * cxt, void *arg)
                     "comedi_ioctl_cmd: minor=%d\n", comedi_get_minor(cxt));
 
        /* Allocates the command */
-       cmd_desc = (comedi_cmd_t *) comedi_kmalloc(sizeof(comedi_cmd_t));
+       cmd_desc = (comedi_cmd_t *) rtdm_malloc(sizeof(comedi_cmd_t));
        if (cmd_desc == NULL)
                return -ENOMEM;
        memset(cmd_desc, 0, sizeof(comedi_cmd_t));
@@ -314,7 +314,7 @@ int comedi_ioctl_cmd(comedi_cxt_t * cxt, void *arg)
       out_ioctl_cmd:
        if (ret != 0 || simul_flag == 1) {
                comedi_free_cmddesc(cmd_desc);
-               comedi_kfree(cmd_desc);
+               rtdm_free(cmd_desc);
        }
 
        return ret;
diff --git a/ksrc/drivers/comedi/device.c b/ksrc/drivers/comedi/device.c
index aff6e70..875c6d8 100644
--- a/ksrc/drivers/comedi/device.c
+++ b/ksrc/drivers/comedi/device.c
@@ -123,7 +123,7 @@ int comedi_proc_attach(comedi_cxt_t * cxt)
        char *entry_name, *p;
 
        /* Allocates the buffer for the file name */
-       entry_name = comedi_kmalloc(COMEDI_NAMELEN + 4);
+       entry_name = rtdm_malloc(COMEDI_NAMELEN + 4);
        if ((p = entry_name) == NULL) {
                __comedi_err("comedi_proc_attach: failed to allocate buffer\n");
                return -ENOMEM;
@@ -151,7 +151,7 @@ int comedi_proc_attach(comedi_cxt_t * cxt)
 
       out_setup_proc_transfer:
        /* Frees the file name buffer */
-       comedi_kfree(entry_name);
+       rtdm_free(entry_name);
 
        return ret;
 }
@@ -162,7 +162,7 @@ void comedi_proc_detach(comedi_cxt_t * cxt)
        comedi_dev_t *dev = comedi_get_dev(cxt);
 
        /* Allocates the buffer for the file name */
-       entry_name = comedi_kmalloc(COMEDI_NAMELEN + 4);
+       entry_name = rtdm_malloc(COMEDI_NAMELEN + 4);
        if ((p = entry_name) == NULL) {
                __comedi_err("comedi_proc_detach: "
                             "failed to allocate filename buffer\n");
@@ -177,7 +177,7 @@ void comedi_proc_detach(comedi_cxt_t * cxt)
        remove_proc_entry(entry_name, comedi_proc_root);
 
        /* Frees the temporary buffer */
-       comedi_kfree(entry_name);
+       rtdm_free(entry_name);
 }
 
 #else /* !CONFIG_PROC_FS */
@@ -214,7 +214,7 @@ int comedi_fill_lnkdesc(comedi_cxt_t * cxt,
        }
 
        if (link_arg->bname_size != 0 && link_arg->bname != NULL) {
-               tmpname = comedi_kmalloc(link_arg->bname_size + 1);
+               tmpname = rtdm_malloc(link_arg->bname_size + 1);
                if (tmpname == NULL) {
                        __comedi_err("comedi_fill_lnkdesc: "
                                     "call1(alloc) failed\n");
@@ -239,7 +239,7 @@ int comedi_fill_lnkdesc(comedi_cxt_t * cxt,
        }
 
        if (link_arg->opts_size != 0 && link_arg->opts != NULL) {
-               tmpopts = comedi_kmalloc(link_arg->opts_size);
+               tmpopts = rtdm_malloc(link_arg->opts_size);
 
                if (tmpopts == NULL) {
                        __comedi_err("comedi_fill_lnkdesc: "
@@ -283,10 +283,10 @@ void comedi_free_lnkdesc(comedi_cxt_t * cxt, 
comedi_lnkdesc_t * link_arg)
                     "comedi_free_lnkdesc: minor=%d\n", comedi_get_minor(cxt));
 
        if (link_arg->bname != NULL)
-               comedi_kfree(link_arg->bname);
+               rtdm_free(link_arg->bname);
 
        if (link_arg->opts != NULL)
-               comedi_kfree(link_arg->opts);
+               rtdm_free(link_arg->opts);
 }
 
 int comedi_assign_driver(comedi_cxt_t * cxt,
@@ -308,7 +308,7 @@ int comedi_assign_driver(comedi_cxt_t * cxt,
 
                INIT_LIST_HEAD(&dev->subdvsq);
        
-               dev->priv = comedi_kmalloc(drv->privdata_size);
+               dev->priv = rtdm_malloc(drv->privdata_size);
                if (dev->priv == NULL && drv->privdata_size != 0) {
                        __comedi_err("comedi_assign_driver: "
                                     "call(alloc) failed\n");
@@ -329,7 +329,7 @@ int comedi_assign_driver(comedi_cxt_t * cxt,
                ret = -ENODEV;
 
        if (ret != 0 && dev->priv != NULL) {
-               comedi_kfree(dev->priv);
+               rtdm_free(dev->priv);
                dev->driver = NULL;
        }
 
@@ -360,11 +360,11 @@ int comedi_release_driver(comedi_cxt_t * cxt)
                comedi_subd_t *tmp = list_entry(this, comedi_subd_t, list);
 
                list_del(this);
-               comedi_kfree(tmp);
+               rtdm_free(tmp);
        }
 
        /* Free the private field */ 
-       comedi_kfree(dev->priv);
+       rtdm_free(dev->priv);
        dev->driver = NULL;
 
       out_release_driver:
diff --git a/ksrc/drivers/comedi/instruction.c 
b/ksrc/drivers/comedi/instruction.c
index 987c545..658d7fd 100644
--- a/ksrc/drivers/comedi/instruction.c
+++ b/ksrc/drivers/comedi/instruction.c
@@ -113,7 +113,7 @@ int comedi_fill_insndsc(comedi_cxt_t * cxt, comedi_kinsn_t 
* dsc, void *arg)
        }
 
        if (dsc->data_size != 0 && dsc->data != NULL) {
-               tmp_data = comedi_kmalloc(dsc->data_size);
+               tmp_data = rtdm_malloc(dsc->data_size);
                if (tmp_data == NULL) {
                        ret = -ENOMEM;
                        goto out_insndsc;
@@ -134,7 +134,7 @@ int comedi_fill_insndsc(comedi_cxt_t * cxt, comedi_kinsn_t 
* dsc, void *arg)
       out_insndsc:
 
        if (ret != 0 && tmp_data != NULL)
-               comedi_kfree(tmp_data);
+               rtdm_free(tmp_data);
 
        return ret;
 }
@@ -149,7 +149,7 @@ int comedi_free_insndsc(comedi_cxt_t * cxt, comedi_kinsn_t 
* dsc)
                                          dsc->data, dsc->data_size);
 
        if (dsc->data != NULL)
-               comedi_kfree(dsc->data);
+               rtdm_free(dsc->data);
 
        return ret;
 }
@@ -279,7 +279,7 @@ int comedi_fill_ilstdsc(comedi_cxt_t * cxt, comedi_kilst_t 
* dsc, void *arg)
        /* Keeps the user pointer in an opaque field */
        dsc->__uinsns = dsc->insns;
 
-       dsc->insns = comedi_kmalloc(dsc->count * sizeof(comedi_kinsn_t));
+       dsc->insns = rtdm_malloc(dsc->count * sizeof(comedi_kinsn_t));
        if (dsc->insns == NULL)
                return -ENOMEM;
 
@@ -292,7 +292,7 @@ int comedi_fill_ilstdsc(comedi_cxt_t * cxt, comedi_kilst_t 
* dsc, void *arg)
 
        /* In case of error, frees the allocated memory */
        if (ret < 0 && dsc->insns != NULL)
-               comedi_kfree(dsc->insns);
+               rtdm_free(dsc->insns);
 
        return ret;
 }
@@ -311,7 +311,7 @@ int comedi_free_ilstdsc(comedi_cxt_t * cxt, comedi_kilst_t 
* dsc)
                        i++;
                }
 
-               comedi_kfree(dsc->insns);
+               rtdm_free(dsc->insns);
        }
 
        return ret;
diff --git a/ksrc/drivers/comedi/national_instruments/mio_common.c 
b/ksrc/drivers/comedi/national_instruments/mio_common.c
index ccb23bd..0e40fab 100644
--- a/ksrc/drivers/comedi/national_instruments/mio_common.c
+++ b/ksrc/drivers/comedi/national_instruments/mio_common.c
@@ -4195,8 +4195,8 @@ static void caldac_setup(comedi_dev_t *dev, comedi_subd_t 
*subd)
                        comedi_err(dev, "BUG! MAX_N_CALDACS too small\n");
                }
 
-               subd->chan_desc = comedi_kmalloc(sizeof(comedi_chdesc_t) + 
-                                               n_chans * 
sizeof(comedi_chan_t));
+               subd->chan_desc = kmalloc(sizeof(comedi_chdesc_t) + 
+                                         n_chans * sizeof(comedi_chan_t), 
GFP_KERNEL);
 
                memset(subd->chan_desc, 
                       0, 
@@ -4223,8 +4223,8 @@ static void caldac_setup(comedi_dev_t *dev, comedi_subd_t 
*subd)
                        ni_write_caldac(dev, chan, tmp);
                }
        } else {
-               subd->chan_desc = comedi_kmalloc(sizeof(comedi_chdesc_t) + 
-                                                sizeof(comedi_chan_t));
+               subd->chan_desc = kmalloc(sizeof(comedi_chdesc_t) + 
+                                         sizeof(comedi_chan_t), GFP_KERNEL);
                
                memset(subd->chan_desc, 
                       0, sizeof(comedi_chdesc_t) + sizeof(comedi_chan_t));
@@ -4738,8 +4738,8 @@ int ni_E_init(comedi_dev_t *dev)
                subd->flags = COMEDI_SUBD_AI | COMEDI_SUBD_CMD;
                subd->rng_desc = ni_range_lkup[boardtype.gainlkup];
 
-               subd->chan_desc = comedi_kmalloc(sizeof(comedi_chdesc_t) + 
-                                               sizeof(comedi_chan_t));
+               subd->chan_desc = kmalloc(sizeof(comedi_chdesc_t) + 
+                                         sizeof(comedi_chan_t), GFP_KERNEL);
 
                subd->chan_desc->mode = COMEDI_CHAN_GLOBAL_CHANDESC;
                subd->chan_desc->length = boardtype.n_adchan;
@@ -4774,8 +4774,8 @@ int ni_E_init(comedi_dev_t *dev)
        if (boardtype.n_aochan) {
                subd->flags = COMEDI_SUBD_AO;
 
-               subd->chan_desc = comedi_kmalloc(sizeof(comedi_chdesc_t) + 
-                                               sizeof(comedi_chan_t));
+               subd->chan_desc = kmalloc(sizeof(comedi_chdesc_t) + 
+                                         sizeof(comedi_chan_t), GFP_KERNEL);
 
                subd->chan_desc->mode = COMEDI_CHAN_GLOBAL_CHANDESC;
                subd->chan_desc->length = boardtype.n_aochan;
@@ -4820,8 +4820,8 @@ int ni_E_init(comedi_dev_t *dev)
 
        subd->flags = COMEDI_SUBD_DIO;
 
-       subd->chan_desc = comedi_kmalloc(sizeof(comedi_chdesc_t) + 
-                                       sizeof(comedi_chan_t));
+       subd->chan_desc = kmalloc(sizeof(comedi_chdesc_t) + 
+                                 sizeof(comedi_chan_t), GFP_KERNEL);
        
        subd->chan_desc->mode = COMEDI_CHAN_GLOBAL_CHANDESC;
        subd->chan_desc->length = boardtype.num_p0_dio_channels;
@@ -4914,8 +4914,8 @@ int ni_E_init(comedi_dev_t *dev)
 
        subd->flags = COMEDI_SUBD_MEMORY;
 
-       subd->chan_desc = comedi_kmalloc(sizeof(comedi_chdesc_t) + 
-                                       sizeof(comedi_chan_t)); 
+       subd->chan_desc = kmalloc(sizeof(comedi_chdesc_t) + 
+                                 sizeof(comedi_chan_t), GFP_KERNEL);   
        subd->chan_desc->mode = COMEDI_CHAN_GLOBAL_CHANDESC;
        subd->chan_desc->chans[0].flags = 0;
        subd->chan_desc->chans[0].nb_bits = 8;
@@ -4939,8 +4939,8 @@ int ni_E_init(comedi_dev_t *dev)
 
        subd->flags = COMEDI_SUBD_DIO;
 
-       subd->chan_desc = comedi_kmalloc(sizeof(comedi_chdesc_t) + 
-                                       sizeof(comedi_chan_t)); 
+       subd->chan_desc = kmalloc(sizeof(comedi_chdesc_t) + 
+                                 sizeof(comedi_chan_t), GFP_KERNEL);   
        subd->chan_desc->mode = COMEDI_CHAN_GLOBAL_CHANDESC;
        subd->chan_desc->chans[0].flags = 0;
        subd->chan_desc->chans[0].nb_bits = 1;
@@ -4977,8 +4977,8 @@ int ni_E_init(comedi_dev_t *dev)
 
        if (boardtype.reg_type & ni_reg_67xx_mask) {
 
-               subd->chan_desc = comedi_kmalloc(sizeof(comedi_chdesc_t) + 
-                                               sizeof(comedi_chan_t)); 
+               subd->chan_desc = kmalloc(sizeof(comedi_chdesc_t) + 
+                                         sizeof(comedi_chan_t), GFP_KERNEL);   
                subd->chan_desc->mode = COMEDI_CHAN_GLOBAL_CHANDESC;
                subd->chan_desc->length = boardtype.n_aochan;
                subd->chan_desc->chans[0].flags = 0;
@@ -5003,8 +5003,8 @@ int ni_E_init(comedi_dev_t *dev)
 
        subd->flags = COMEDI_SUBD_SERIAL;
 
-       subd->chan_desc = comedi_kmalloc(sizeof(comedi_chdesc_t) + 
-                                       sizeof(comedi_chan_t)); 
+       subd->chan_desc = kmalloc(sizeof(comedi_chdesc_t) + 
+                                 sizeof(comedi_chan_t), GFP_KERNEL);   
        subd->chan_desc->mode = COMEDI_CHAN_GLOBAL_CHANDESC;
        subd->chan_desc->length = 1;
        subd->chan_desc->chans[0].flags = 0;
@@ -5030,8 +5030,8 @@ int ni_E_init(comedi_dev_t *dev)
 #else /* TODO: add RTSI subdevice */
        subd->flags = COMEDI_SUBD_DIO;
 
-       subd->chan_desc = comedi_kmalloc(sizeof(comedi_chdesc_t) + 
-                                       sizeof(comedi_chan_t)); 
+       subd->chan_desc = kmalloc(sizeof(comedi_chdesc_t) + 
+                                 sizeof(comedi_chan_t), GFP_KERNEL);   
        subd->chan_desc->mode = COMEDI_CHAN_GLOBAL_CHANDESC;
        subd->chan_desc->length = 8;
        subd->chan_desc->chans[0].flags = 0;
@@ -5068,8 +5068,8 @@ int ni_E_init(comedi_dev_t *dev)
 
                subd->flags |= COMEDI_SUBD_CMD;
 
-               subd->chan_desc = comedi_kmalloc(sizeof(comedi_chdesc_t) + 
-                                               sizeof(comedi_chan_t)); 
+               subd->chan_desc = kmalloc(sizeof(comedi_chdesc_t) + 
+                                         sizeof(comedi_chan_t), GFP_KERNEL);   
                subd->chan_desc->mode = COMEDI_CHAN_GLOBAL_CHANDESC;
                subd->chan_desc->length = 3;
                subd->chan_desc->chans[0].flags = 0;
@@ -5108,8 +5108,8 @@ int ni_E_init(comedi_dev_t *dev)
 
        subd->flags = COMEDI_SUBD_COUNTER;
 
-       subd->chan_desc = comedi_kmalloc(sizeof(comedi_chdesc_t) + 
-                                       sizeof(comedi_chan_t)); 
+       subd->chan_desc = kmalloc(sizeof(comedi_chdesc_t) + 
+                                 sizeof(comedi_chan_t), GFP_KERNEL);   
        subd->chan_desc->mode = COMEDI_CHAN_GLOBAL_CHANDESC;
        subd->chan_desc->length = 1;
        subd->chan_desc->chans[0].flags = 0;
diff --git a/ksrc/drivers/comedi/national_instruments/mite.c 
b/ksrc/drivers/comedi/national_instruments/mite.c
index b91bd59..c776f12 100644
--- a/ksrc/drivers/comedi/national_instruments/mite.c
+++ b/ksrc/drivers/comedi/national_instruments/mite.c
@@ -64,7 +64,7 @@ static int mite_probe(struct pci_dev *dev, const struct 
pci_device_id *id)
        int i;
        struct mite_struct *mite;
 
-       mite = comedi_kmalloc(sizeof(struct mite_struct));
+       mite = kmalloc(sizeof(struct mite_struct), GFP_KERNEL);
        if(mite == NULL)
                return -ENOMEM;
 
@@ -92,7 +92,7 @@ static void mite_remove(struct pci_dev *dev)
                
                if(mite->pcidev == dev) {
                        list_del(this);
-                       comedi_kfree(mite);
+                       kfree(mite);
                        break;
                }                       
        }
@@ -776,7 +776,7 @@ static void __exit mite_cleanup(void)
                        list_entry(this, struct mite_struct, list);
                
                list_del(this);
-               comedi_kfree(mite);
+               kfree(mite);
        }
 }
 
diff --git a/ksrc/drivers/comedi/national_instruments/mite.h 
b/ksrc/drivers/comedi/national_instruments/mite.h
index a2c70d5..508457f 100644
--- a/ksrc/drivers/comedi/national_instruments/mite.h
+++ b/ksrc/drivers/comedi/national_instruments/mite.h
@@ -76,7 +76,7 @@ static inline
 struct mite_dma_descriptor_ring *mite_alloc_ring(struct        mite_struct 
*mite)
 {
        struct mite_dma_descriptor_ring *ring =
-               comedi_kmalloc(sizeof(struct mite_dma_descriptor_ring));
+               kmalloc(sizeof(struct mite_dma_descriptor_ring), GFP_DMA);
 
        if (ring == NULL)
                return ring;
@@ -85,7 +85,7 @@ struct mite_dma_descriptor_ring *mite_alloc_ring(struct       
mite_struct *mite)
 
        ring->pcidev = mite->pcidev;
        if (ring->pcidev == NULL) {
-               comedi_kfree(ring);
+               kfree(ring);
                return NULL;
        }
 
@@ -102,7 +102,7 @@ static inline void mite_free_ring(struct 
mite_dma_descriptor_ring *ring)
                                sizeof(struct mite_dma_descriptor),
                                ring->descriptors, ring->descriptors_dma_addr);
                }
-               comedi_kfree(ring);
+               kfree(ring);
        }
 };
 
diff --git a/ksrc/drivers/comedi/national_instruments/tio_common.c 
b/ksrc/drivers/comedi/national_instruments/tio_common.c
index c36065b..12514b5 100644
--- a/ksrc/drivers/comedi/national_instruments/tio_common.c
+++ b/ksrc/drivers/comedi/national_instruments/tio_common.c
@@ -67,7 +67,7 @@ struct ni_gpct_device *ni_gpct_device_construct(comedi_dev_t 
* dev,
        unsigned int num_counters)
 {
        struct ni_gpct_device *counter_dev =
-               comedi_kmalloc(sizeof(struct ni_gpct_device));
+               kmalloc(sizeof(struct ni_gpct_device), GFP_KERNEL);
        if (counter_dev == NULL)
                return NULL;
        
@@ -81,10 +81,10 @@ struct ni_gpct_device 
*ni_gpct_device_construct(comedi_dev_t * dev,
        BUG_ON(num_counters == 0);
 
        counter_dev->counters = 
-               comedi_kmalloc(sizeof(struct ni_gpct *) * num_counters);
+               kmalloc(sizeof(struct ni_gpct *) * num_counters, GFP_KERNEL);
 
        if (counter_dev->counters == NULL) {
-                comedi_kfree(counter_dev);
+                kfree(counter_dev);
                return NULL;
        }
 
@@ -98,8 +98,8 @@ void ni_gpct_device_destroy(struct ni_gpct_device 
*counter_dev)
 {
        if (counter_dev->counters == NULL)
                return;
-       comedi_kfree(counter_dev->counters);
-       comedi_kfree(counter_dev);
+       kfree(counter_dev->counters);
+       kfree(counter_dev);
 }
 
 static 
diff --git a/ksrc/drivers/comedi/subdevice.c b/ksrc/drivers/comedi/subdevice.c
index 1069d2e..fe2352c 100644
--- a/ksrc/drivers/comedi/subdevice.c
+++ b/ksrc/drivers/comedi/subdevice.c
@@ -126,7 +126,7 @@ comedi_subd_t * comedi_alloc_subd(int sizeof_priv,
 {
        comedi_subd_t *subd;
        
-       subd = comedi_kmalloc(sizeof(comedi_subd_t) + sizeof_priv);
+       subd = rtdm_malloc(sizeof(comedi_subd_t) + sizeof_priv);
 
        if(subd != NULL) {
                memset(subd, 0 , sizeof(comedi_subd_t) + sizeof_priv);
@@ -189,7 +189,7 @@ int comedi_ioctl_subdinfo(comedi_cxt_t * cxt, void *arg)
                return -EINVAL;
 
        subd_info =
-           comedi_kmalloc(dev->transfer.nb_subd * sizeof(comedi_sbinfo_t));
+           rtdm_malloc(dev->transfer.nb_subd * sizeof(comedi_sbinfo_t));
        if (subd_info == NULL)
                return -ENOMEM;
 
@@ -207,7 +207,7 @@ int comedi_ioctl_subdinfo(comedi_cxt_t * cxt, void *arg)
                                sizeof(comedi_sbinfo_t)) != 0)
                ret = -EFAULT;
 
-       comedi_kfree(subd_info);
+       rtdm_free(subd_info);
 
        return ret;
 
@@ -273,7 +273,7 @@ int comedi_ioctl_chaninfo(comedi_cxt_t * cxt, void *arg)
        if(rng_desc == NULL)
                rng_desc = &range_fake;
 
-       chan_info = comedi_kmalloc(chan_desc->length * sizeof(comedi_chinfo_t));
+       chan_info = rtdm_malloc(chan_desc->length * sizeof(comedi_chinfo_t));
        if (chan_info == NULL)
                return -ENOMEM;
 
@@ -298,7 +298,7 @@ int comedi_ioctl_chaninfo(comedi_cxt_t * cxt, void *arg)
                                chan_desc->length * sizeof(comedi_chinfo_t)) != 
0)
                return -EFAULT;
 
-       comedi_kfree(chan_info);
+       rtdm_free(chan_info);
 
        return ret;
 }
@@ -383,7 +383,7 @@ int comedi_ioctl_rnginfo(comedi_cxt_t * cxt, void *arg)
        tmp = (rng_desc->mode != COMEDI_RNG_GLOBAL_RNGDESC) ?
            inarg.idx_chan : 0;
 
-       rng_info = comedi_kmalloc(rng_desc->rngtabs[tmp]->length *
+       rng_info = rtdm_malloc(rng_desc->rngtabs[tmp]->length *
                                  sizeof(comedi_rnginfo_t));
        if (rng_info == NULL)
                return -ENOMEM;
@@ -404,7 +404,7 @@ int comedi_ioctl_rnginfo(comedi_cxt_t * cxt, void *arg)
                                sizeof(comedi_rnginfo_t)) != 0)
                return -EFAULT;
 
-       comedi_kfree(rng_info);
+       rtdm_free(rng_info);
 
        return ret;
 }
diff --git a/ksrc/drivers/comedi/transfer.c b/ksrc/drivers/comedi/transfer.c
index effd26f..b3c4fde 100644
--- a/ksrc/drivers/comedi/transfer.c
+++ b/ksrc/drivers/comedi/transfer.c
@@ -59,22 +59,22 @@ int comedi_cleanup_transfer(comedi_cxt_t * cxt)
 
        /* Releases the various buffers */
        if (tsf->status != NULL)
-               comedi_kfree(tsf->status);
+               rtdm_free(tsf->status);
 
        if (tsf->bufs != NULL) {
                for (i = 0; i < tsf->nb_subd; i++) {
                        if (tsf->bufs[i] != NULL) {
                                comedi_free_buffer(tsf->bufs[i]);
                                comedi_cleanup_sync(&tsf->bufs[i]->sync);
-                               comedi_kfree(tsf->bufs[i]);
+                               rtdm_free(tsf->bufs[i]);
                        }
                }
-               comedi_kfree(tsf->bufs);
+               rtdm_free(tsf->bufs);
        }
 
        /* Releases the pointers tab, if need be */
        if (tsf->subds != NULL) {
-               comedi_kfree(tsf->subds);
+               rtdm_free(tsf->subds);
        }
 
        return 0;
@@ -126,7 +126,7 @@ int comedi_setup_transfer(comedi_cxt_t * cxt)
        }
 
        /* Allocates a suitable tab for the subdevices */
-       tsf->subds = comedi_kmalloc(tsf->nb_subd * sizeof(comedi_subd_t *));
+       tsf->subds = rtdm_malloc(tsf->nb_subd * sizeof(comedi_subd_t *));
        if (tsf->subds == NULL) {
                __comedi_err("comedi_setup_transfer: call2(alloc) failed \n");
                ret = -ENOMEM;
@@ -147,7 +147,7 @@ int comedi_setup_transfer(comedi_cxt_t * cxt)
        }
 
        /* Allocates various buffers */
-       tsf->bufs = comedi_kmalloc(tsf->nb_subd * sizeof(comedi_buf_t *));
+       tsf->bufs = rtdm_malloc(tsf->nb_subd * sizeof(comedi_buf_t *));
        if (tsf->bufs == NULL) {
                ret = -ENOMEM;
                goto out_setup_tsf;
@@ -156,7 +156,7 @@ int comedi_setup_transfer(comedi_cxt_t * cxt)
 
        for (i = 0; i < tsf->nb_subd; i++) {
                if (tsf->subds[i]->flags & COMEDI_SUBD_CMD) {
-                       tsf->bufs[i] = comedi_kmalloc(sizeof(comedi_buf_t));
+                       tsf->bufs[i] = rtdm_malloc(sizeof(comedi_buf_t));
                        if (tsf->bufs[i] == NULL) {
                                __comedi_err("comedi_setup_transfer: "
                                             "call5-6(alloc) failed \n");
@@ -172,7 +172,7 @@ int comedi_setup_transfer(comedi_cxt_t * cxt)
                }
        }
 
-       tsf->status = comedi_kmalloc(tsf->nb_subd * sizeof(unsigned long));
+       tsf->status = rtdm_malloc(tsf->nb_subd * sizeof(unsigned long));
        if (tsf->status == NULL) {
                __comedi_err("comedi_setup_transfer: call8(alloc) failed \n");
                ret = -ENOMEM;
@@ -280,7 +280,7 @@ int comedi_cancel_transfer(comedi_cxt_t * cxt, int idx_subd)
            dev->transfer.bufs[idx_subd]->cur_cmd != NULL) {
 
                comedi_free_cmddesc(dev->transfer.bufs[idx_subd]->cur_cmd);
-               comedi_kfree(dev->transfer.bufs[idx_subd]->cur_cmd);
+               rtdm_free(dev->transfer.bufs[idx_subd]->cur_cmd);
                dev->transfer.bufs[idx_subd]->cur_cmd = NULL;
 
                /* ...we must also clean the events flags */


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to