]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
staging: comedi: use comedi_alloc_devpriv()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 24 Jun 2013 23:55:44 +0000 (16:55 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Jul 2013 21:04:59 +0000 (14:04 -0700)
Use the helper function to allocate memory and set the comedi_device
private data pointer.

This removes the dependency on slab.h from most of the drivers so
remove the global #include in comedidev.h and the local #include
in some of the drivers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
97 files changed:
drivers/staging/comedi/comedidev.h
drivers/staging/comedi/drivers/8255_pci.c
drivers/staging/comedi/drivers/addi-data/addi_common.c
drivers/staging/comedi/drivers/addi_apci_1032.c
drivers/staging/comedi/drivers/addi_apci_1516.c
drivers/staging/comedi/drivers/addi_apci_1710.c
drivers/staging/comedi/drivers/addi_apci_3120.c
drivers/staging/comedi/drivers/addi_apci_3501.c
drivers/staging/comedi/drivers/addi_apci_3xxx.c
drivers/staging/comedi/drivers/adl_pci6208.c
drivers/staging/comedi/drivers/adl_pci9111.c
drivers/staging/comedi/drivers/adl_pci9118.c
drivers/staging/comedi/drivers/adq12b.c
drivers/staging/comedi/drivers/adv_pci1710.c
drivers/staging/comedi/drivers/adv_pci1723.c
drivers/staging/comedi/drivers/adv_pci1724.c
drivers/staging/comedi/drivers/adv_pci_dio.c
drivers/staging/comedi/drivers/aio_aio12_8.c
drivers/staging/comedi/drivers/amplc_dio200.c
drivers/staging/comedi/drivers/amplc_dio200_common.c
drivers/staging/comedi/drivers/amplc_dio200_pci.c
drivers/staging/comedi/drivers/amplc_pc236.c
drivers/staging/comedi/drivers/amplc_pci224.c
drivers/staging/comedi/drivers/amplc_pci230.c
drivers/staging/comedi/drivers/cb_das16_cs.c
drivers/staging/comedi/drivers/cb_pcidas.c
drivers/staging/comedi/drivers/cb_pcidas64.c
drivers/staging/comedi/drivers/cb_pcidda.c
drivers/staging/comedi/drivers/cb_pcimdas.c
drivers/staging/comedi/drivers/cb_pcimdda.c
drivers/staging/comedi/drivers/comedi_bond.c
drivers/staging/comedi/drivers/comedi_parport.c
drivers/staging/comedi/drivers/comedi_test.c
drivers/staging/comedi/drivers/daqboard2000.c
drivers/staging/comedi/drivers/das08_cs.c
drivers/staging/comedi/drivers/das08_isa.c
drivers/staging/comedi/drivers/das08_pci.c
drivers/staging/comedi/drivers/das16.c
drivers/staging/comedi/drivers/das16m1.c
drivers/staging/comedi/drivers/das1800.c
drivers/staging/comedi/drivers/das6402.c
drivers/staging/comedi/drivers/das800.c
drivers/staging/comedi/drivers/dmm32at.c
drivers/staging/comedi/drivers/dt2801.c
drivers/staging/comedi/drivers/dt2811.c
drivers/staging/comedi/drivers/dt2814.c
drivers/staging/comedi/drivers/dt2815.c
drivers/staging/comedi/drivers/dt282x.c
drivers/staging/comedi/drivers/dt3000.c
drivers/staging/comedi/drivers/dt9812.c
drivers/staging/comedi/drivers/dyna_pci10xx.c
drivers/staging/comedi/drivers/fl512.c
drivers/staging/comedi/drivers/gsc_hpdi.c
drivers/staging/comedi/drivers/icp_multi.c
drivers/staging/comedi/drivers/ii_pci20kc.c
drivers/staging/comedi/drivers/jr3_pci.c
drivers/staging/comedi/drivers/me4000.c
drivers/staging/comedi/drivers/me_daq.c
drivers/staging/comedi/drivers/mpc624.c
drivers/staging/comedi/drivers/multiq3.c
drivers/staging/comedi/drivers/ni_6527.c
drivers/staging/comedi/drivers/ni_65xx.c
drivers/staging/comedi/drivers/ni_660x.c
drivers/staging/comedi/drivers/ni_670x.c
drivers/staging/comedi/drivers/ni_at_a2150.c
drivers/staging/comedi/drivers/ni_at_ao.c
drivers/staging/comedi/drivers/ni_atmio16d.c
drivers/staging/comedi/drivers/ni_daq_700.c
drivers/staging/comedi/drivers/ni_labpc.c
drivers/staging/comedi/drivers/ni_labpc_cs.c
drivers/staging/comedi/drivers/ni_labpc_pci.c
drivers/staging/comedi/drivers/ni_mio_common.c
drivers/staging/comedi/drivers/ni_pcidio.c
drivers/staging/comedi/drivers/ni_tio.c
drivers/staging/comedi/drivers/pcl711.c
drivers/staging/comedi/drivers/pcl726.c
drivers/staging/comedi/drivers/pcl812.c
drivers/staging/comedi/drivers/pcl816.c
drivers/staging/comedi/drivers/pcl818.c
drivers/staging/comedi/drivers/pcm3724.c
drivers/staging/comedi/drivers/pcmda12.c
drivers/staging/comedi/drivers/pcmmio.c
drivers/staging/comedi/drivers/pcmuio.c
drivers/staging/comedi/drivers/poc.c
drivers/staging/comedi/drivers/quatech_daqp_cs.c
drivers/staging/comedi/drivers/rtd520.c
drivers/staging/comedi/drivers/rti800.c
drivers/staging/comedi/drivers/rti802.c
drivers/staging/comedi/drivers/s526.c
drivers/staging/comedi/drivers/s626.c
drivers/staging/comedi/drivers/s626.h
drivers/staging/comedi/drivers/serial2002.c
drivers/staging/comedi/drivers/skel.c
drivers/staging/comedi/drivers/unioxx5.c
drivers/staging/comedi/drivers/usbduxfast.c
drivers/staging/comedi/drivers/usbduxsigma.c
drivers/staging/comedi/drivers/vmk80xx.c

index bfbe4160edf0766ec7a86dac0da0ec9f7f250598..c6a7c096f625a2b857e13afb6a4f84b5432d5c4f 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/kdev_t.h>
-#include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
 #include <linux/spinlock.h>
index 3d3547c194806fae3e2cb1d84d61d13dc52f1fb1..b58e28bb206dd5d88d1dcf6ccd6bf63c1d381caf 100644 (file)
@@ -186,10 +186,9 @@ static int pci_8255_auto_attach(struct comedi_device *dev,
        dev->board_ptr = board;
        dev->board_name = board->name;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_pci_enable(dev);
        if (ret)
index f25e0085219d33b8e2764a771bd0cedd69f6cd9f..63dff7729ea893e8e76ce2fdcad61ca50ebb9d45 100644 (file)
@@ -85,10 +85,9 @@ static int addi_auto_attach(struct comedi_device *dev,
 
        dev->board_name = this_board->pc_DriverName;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_pci_enable(dev);
        if (ret)
index 8a93542faedcaadbc6aa12fc11601a27df231466..242903aac829a60da5bf2b99ae20638cf4d90530 100644 (file)
@@ -289,10 +289,9 @@ static int apci1032_auto_attach(struct comedi_device *dev,
        struct comedi_subdevice *s;
        int ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_pci_enable(dev);
        if (ret)
index b626738bb73c4c3feac97d6b5b64b1754b701398..7523c8b0e8f7846bd94927178a793b69fe34f023 100644 (file)
@@ -136,10 +136,9 @@ static int apci1516_auto_attach(struct comedi_device *dev,
        dev->board_ptr = this_board;
        dev->board_name = this_board->name;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_pci_enable(dev);
        if (ret)
index c9e6471eb06ba1c6f3f499cd7b0f90f3e1a51958..e533f55a1d2f0ee2d80096018f35479c6d7cb1b3 100644 (file)
@@ -35,10 +35,9 @@ static int apci1710_auto_attach(struct comedi_device *dev,
        struct comedi_subdevice *s;
        int ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_pci_enable(dev);
        if (ret)
index 61452848510ff27373412463365c9c7a19ce173c..a7828bb64a917d5182bcd2c5a7fa9d891e872f7d 100644 (file)
@@ -65,10 +65,9 @@ static int apci3120_auto_attach(struct comedi_device *dev,
        dev->board_ptr = this_board;
        dev->board_name = this_board->pc_DriverName;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_pci_enable(dev);
        if (ret)
index f9b63689a12af2b35d34536fd5a36247acfeaf8a..9b8544b43b24011a62031b611ae546d87ad73e49 100644 (file)
@@ -332,10 +332,9 @@ static int apci3501_auto_attach(struct comedi_device *dev,
        int ao_n_chan;
        int ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_pci_enable(dev);
        if (ret)
index 5b37cbf9228ee9a4d9b6b7d270fad473bb0c5cf1..cf60248c726dbb34c197603c8f733381ad4629e2 100644 (file)
@@ -801,10 +801,9 @@ static int apci3xxx_auto_attach(struct comedi_device *dev,
        dev->board_ptr = board;
        dev->board_name = board->name;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_pci_enable(dev);
        if (ret)
index b5e4e53f737f76068536d0e060d4979bcff42bab..ffd91e4f90bf070b048ce5f8947dac8285adceb2 100644 (file)
@@ -172,10 +172,9 @@ static int pci6208_auto_attach(struct comedi_device *dev,
        dev->board_ptr = boardinfo;
        dev->board_name = boardinfo->name;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_pci_enable(dev);
        if (ret)
index af51c746004845e02255f130d63b41ead49c40be..cf93e416dd29ec2f81e1eaeda2bd11f01762d518 100644 (file)
@@ -855,10 +855,9 @@ static int pci9111_auto_attach(struct comedi_device *dev,
        struct comedi_subdevice *s;
        int ret;
 
-       dev_private = kzalloc(sizeof(*dev_private), GFP_KERNEL);
+       dev_private = comedi_alloc_devpriv(dev, sizeof(*dev_private));
        if (!dev_private)
                return -ENOMEM;
-       dev->private = dev_private;
 
        ret = comedi_pci_enable(dev);
        if (ret)
index cb4ef2dcbf020133bd78580ee33faf62b074a7bc..2a48f8421ca0492b0fcb507df1cc49d0587b7639 100644 (file)
@@ -2140,10 +2140,9 @@ static int pci9118_attach(struct comedi_device *dev,
        softsshdelay = it->options[4];
        hw_err_mask = it->options[5];
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        pcidev = pci9118_find_pci(dev, it);
        if (!pcidev)
@@ -2160,10 +2159,9 @@ static int pci9118_auto_attach(struct comedi_device *dev,
        struct pci_dev *pcidev = comedi_to_pci_dev(dev);
        struct pci9118_private *devpriv;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        dev->board_ptr = pci9118_find_boardinfo(pcidev);
        if (dev->board_ptr == NULL) {
index d187a7bf0a55e1e04c34fa362aae05f9268f9f48..72e88d8465eae328018c3f6feafcd073a5ace647 100644 (file)
@@ -214,10 +214,9 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (ret)
                return ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        devpriv->unipolar = it->options[1];
        devpriv->differential = it->options[2];
index f847bbc175e72103a59d528a0e026e98f5db44d4..53653d3c49375a9beb7ec393a4fef7c2f7b61367 100644 (file)
@@ -1233,10 +1233,9 @@ static int pci1710_auto_attach(struct comedi_device *dev,
        dev->board_ptr = this_board;
        dev->board_name = this_board->name;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_pci_enable(dev);
        if (ret)
index 8430a27ec1b59d22fbbfb4b6b688d2c89c840dc2..919babae4cbe3cfd106e69af4008c2114c8cabb3 100644 (file)
@@ -237,10 +237,9 @@ static int pci1723_auto_attach(struct comedi_device *dev,
        struct comedi_subdevice *s;
        int ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_pci_enable(dev);
        if (ret)
index da7462e01faa9f987092c4e9161364b0ef5d39bf..d27730e2d29fa6c339ef320412f9731ff2ee6807 100644 (file)
@@ -340,10 +340,9 @@ static int adv_pci1724_auto_attach(struct comedi_device *dev,
        int retval;
        unsigned int board_id;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        /* init software copies of output values to indicate we don't know
         * what the output value is since it has never been written. */
index 8e6ec75bd294faf12863d2f352c1a0007a5b56aa..ff48cb30d4af19203950359986418b162a514b80 100644 (file)
@@ -1107,10 +1107,9 @@ static int pci_dio_auto_attach(struct comedi_device *dev,
        dev->board_ptr = this_board;
        dev->board_name = this_board->name;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_pci_enable(dev);
        if (ret)
index 279dfe8951f703d78f56e0cde365f61aad998f04..ae88fe1f79d08fcf326d8f1610bd45266b94c62e 100644 (file)
@@ -202,10 +202,9 @@ static int aio_aio12_8_attach(struct comedi_device *dev,
        if (ret)
                return ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_alloc_subdevices(dev, 4);
        if (ret)
index e2478105ac1a0d9439b63b34b91bd503a7a64414..d1436733e91374a00c4f278f843477e8d2a15878 100644 (file)
  * order they appear in the channel list.
  */
 
-#include <linux/slab.h>
-
 #include "../comedidev.h"
 
 #include "amplc_dio200.h"
@@ -272,10 +270,9 @@ static int dio200_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
        irq = it->options[1];
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_request_region(dev, it->options[0], thisboard->mainsize);
        if (ret)
index 649fc69724fb70373c3880f324315e0c853495fa..56b783642155290b0d7b50a55432d2c9b53c1227 100644 (file)
@@ -20,7 +20,6 @@
 */
 
 #include <linux/interrupt.h>
-#include <linux/slab.h>
 
 #include "../comedidev.h"
 
index d7d9f5cc3ab40fe81dc074f588c863871b34948a..25d9cc00b888e5a3ae5d6cf0df13a9033cd178dc 100644 (file)
 
 #include <linux/pci.h>
 #include <linux/interrupt.h>
-#include <linux/slab.h>
 
 #include "../comedidev.h"
 
@@ -380,10 +379,9 @@ static int dio200_pci_auto_attach(struct comedi_device *dev,
        dev_info(dev->class_dev, "%s: attach pci %s (%s)\n",
                 dev->driver->driver_name, pci_name(pci_dev), dev->board_name);
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_pci_enable(dev);
        if (ret)
index 4e889b82cbf2a3827010d2d7a37fd046e6c240cf..81b9b80f8a64b5de8e63d8df59fea958999811bc 100644 (file)
@@ -467,10 +467,9 @@ static int pc236_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        struct pc236_private *devpriv;
        int ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        /* Process options according to bus type. */
        if (is_isa_board(thisboard)) {
@@ -510,10 +509,9 @@ static int pc236_auto_attach(struct comedi_device *dev,
        dev_info(dev->class_dev, PC236_DRIVER_NAME ": attach pci %s\n",
                 pci_name(pci_dev));
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        dev->board_ptr = pc236_find_pci_board(pci_dev);
        if (dev->board_ptr == NULL) {
index f1e36f08b103950e5ce4d7c39c44abe64ca3d935..043120448cf9412e1c7224cb38a0d2c129a7e22d 100644 (file)
@@ -100,7 +100,6 @@ Caveats:
 
 #include <linux/pci.h>
 #include <linux/interrupt.h>
-#include <linux/slab.h>
 
 #include "../comedidev.h"
 
@@ -1419,10 +1418,9 @@ static int pci224_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
        dev_info(dev->class_dev, DRIVER_NAME ": attach\n");
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        pci_dev = pci224_find_pci_dev(dev, it);
        if (!pci_dev)
@@ -1440,10 +1438,9 @@ pci224_auto_attach(struct comedi_device *dev, unsigned long context_unused)
        dev_info(dev->class_dev, DRIVER_NAME ": attach pci %s\n",
                 pci_name(pci_dev));
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        dev->board_ptr = pci224_find_pci_board(pci_dev);
        if (dev->board_ptr == NULL) {
index 846d6448fa4dd68ee3485b826270b08cb3d03ae5..147702b51872fb5f02f5ac950292337744457e73 100644 (file)
@@ -2615,10 +2615,9 @@ static int pci230_alloc_private(struct comedi_device *dev)
 {
        struct pci230_private *devpriv;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        spin_lock_init(&devpriv->isr_spinlock);
        spin_lock_init(&devpriv->res_spinlock);
index ae9a2082b5a44ee482ea0a3f1acc3bb7921ac8d2..ff0f8939ae78627b17918df917218cc8190b8be7 100644 (file)
@@ -35,7 +35,6 @@ Status: experimental
 */
 
 #include <linux/interrupt.h>
-#include <linux/slab.h>
 #include <linux/delay.h>
 
 #include "../comedidev.h"
@@ -420,10 +419,9 @@ static int das16cs_auto_attach(struct comedi_device *dev,
                return ret;
        dev->irq = link->irq;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_alloc_subdevices(dev, 3);
        if (ret)
index 58bca184bf22d4d85f86550835708e82fed2fc43..d70d1dd30502b936785624920e7f509186e567ce 100644 (file)
@@ -1444,10 +1444,9 @@ static int cb_pcidas_auto_attach(struct comedi_device *dev,
        dev->board_ptr  = thisboard;
        dev->board_name = thisboard->name;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_pci_enable(dev);
        if (ret)
index 43c0bf58771ad6deac07067144c565260598c849..e8222b0fe841145688e2638987ac6926808ba041 100644 (file)
@@ -4034,10 +4034,9 @@ static int auto_attach(struct comedi_device *dev,
                return -ENODEV;
        dev->board_ptr = thisboard;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        retval = comedi_pci_enable(dev);
        if (retval)
index 2d3e920e598711a0cb0b2d6a08dc85b8363f97aa..c1f0aa59f66f1bdad9c0641443d6c89491231f48 100644 (file)
@@ -348,10 +348,9 @@ static int cb_pcidda_auto_attach(struct comedi_device *dev,
        dev->board_ptr = thisboard;
        dev->board_name = thisboard->name;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_pci_enable(dev);
        if (ret)
index 8b5c198862a1a44cf7806f70d85c6b57fb0c73cd..543f213c72919691aa563c1dbc7ec5db525231d0 100644 (file)
@@ -210,10 +210,9 @@ static int cb_pcimdas_auto_attach(struct comedi_device *dev,
        unsigned long iobase_8255;
        int ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_pci_enable(dev);
        if (ret)
index 406cba8cba88e83335e1bff5491133196e0e0cb6..b019566f6c55987a45081dd8a0a628df3478f1c0 100644 (file)
@@ -156,10 +156,9 @@ static int cb_pcimdda_auto_attach(struct comedi_device *dev,
        struct comedi_subdevice *s;
        int ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_pci_enable(dev);
        if (ret)
index 1a51866be6f7d8deeefbcb8d13d9c92ecbd68078..1952c62ad1fd18fc12244efc7d95c9de83ddacdb 100644 (file)
@@ -298,10 +298,9 @@ static int bonding_attach(struct comedi_device *dev,
        struct comedi_subdevice *s;
        int ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        /*
         * Setup our bonding from config params.. sets up our private struct..
index 772a8f5f0c1ceec33b6df1574ce3199c0fbd05c9..05d79cf4feffb2e0f4e7031ee6e45d300deaf03c 100644 (file)
@@ -279,10 +279,9 @@ static int parport_attach(struct comedi_device *dev,
        if (ret)
                return ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        s = &dev->subdevices[0];
        s->type = COMEDI_SUBD_DIO;
index 907e7a3822f5da6a733d7dc6fab8d63b55a9cc57..eb05f5e57ebc326d89f68c8c40d1a261ed2fb287 100644 (file)
@@ -379,10 +379,9 @@ static int waveform_attach(struct comedi_device *dev,
        int i;
        int ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        /* set default amplitude and period */
        if (amplitude <= 0)
index 44c912b48b6e27a773df0cd93580a8cf835761ae..f821b81cd3bec77858b0e6a960e97e636385340b 100644 (file)
@@ -683,10 +683,9 @@ static int daqboard2000_auto_attach(struct comedi_device *dev,
        dev->board_ptr = board;
        dev->board_name = board->name;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        result = comedi_pci_enable(dev);
        if (result)
index 885fb179c9b412648e33d493b0e4b8126db1eec0..24a3922ddd9aa31e82ce7ec1edd7257aac6d1a5f 100644 (file)
@@ -40,7 +40,6 @@ Command support does not exist, but could be added for this board.
 */
 
 #include <linux/delay.h>
-#include <linux/slab.h>
 
 #include "../comedidev.h"
 
@@ -78,10 +77,9 @@ static int das08_cs_auto_attach(struct comedi_device *dev,
                return ret;
        iobase = link->resource[0]->start;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        return das08_common_attach(dev, iobase);
 }
index 21a94389b8b20bb925faeb651b032dc01b746f15..50d27aa923dd437177d122a6c243e497b5b7271d 100644 (file)
@@ -177,10 +177,9 @@ static int das08_isa_attach(struct comedi_device *dev,
        struct das08_private_struct *devpriv;
        int ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_request_region(dev, it->options[0], thisboard->iosize);
        if (ret)
index 9c5d234e063f0a9b513e52cb3e76eea35a6b48ab..2786887173a4dc0fe92f686a37a70a0ac64c30bf 100644 (file)
@@ -59,10 +59,9 @@ static int das08_pci_auto_attach(struct comedi_device *dev,
        struct das08_private_struct *devpriv;
        int ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        /* The das08 driver needs the board_ptr */
        dev->board_ptr = &das08_pci_boards[0];
index dbec3ba995487553ee558ceabb7ed47fe356ab94..66be41db59adddeea93b7d168bb000f885407ae9 100644 (file)
@@ -74,7 +74,6 @@ www.measurementcomputing.com
 */
 
 #include <linux/pci.h>
-#include <linux/slab.h>
 #include <linux/interrupt.h>
 
 #include <asm/dma.h>
@@ -1102,10 +1101,9 @@ static int das16_attach(struct comedi_device *dev, struct comedi_devconfig *it)
                }
        }
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        if (board->size < 0x400) {
                ret = comedi_request_region(dev, it->options[0], board->size);
index 0b33808c3a7d91b6f1c53257c85114d72e613b2d..ee5e1561c835ebb39fd250c18d62ff6cd79657e5 100644 (file)
@@ -567,10 +567,9 @@ static int das16m1_attach(struct comedi_device *dev,
        int ret;
        unsigned int irq;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_request_region(dev, it->options[0], DAS16M1_SIZE);
        if (ret)
index 23b4a661eb1afbcad6b035f3adec15a525b46bf9..e6c852530acb03fbd241f3e26b7f61a01c396406 100644 (file)
@@ -1511,10 +1511,9 @@ static int das1800_attach(struct comedi_device *dev,
        int board;
        int ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_request_region(dev, it->options[0], DAS1800_SIZE);
        if (ret)
index f0530778bb3b376dd5b985c134eaf21fc1856854..8529c9f402a16b8408f43696fe944559759e16a6 100644 (file)
@@ -294,10 +294,9 @@ static int das6402_attach(struct comedi_device *dev,
 
        dev->irq = irq;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_alloc_subdevices(dev, 1);
        if (ret)
index 091cd911b38a852bd6a1af6dd2d581d36d7d56df..f3f4be5b3a5995c635ad6d54c1528378d91a3fd2 100644 (file)
@@ -700,10 +700,9 @@ static int das800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        int board;
        int ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_request_region(dev, it->options[0], DAS800_SIZE);
        if (ret)
index e29847d73b432897eecfe6e3362cd66b762c1c85..a8b2c64cafd9b6496a7cda2a1e90fa8ae853ab9c 100644 (file)
@@ -753,10 +753,9 @@ static int dmm32at_attach(struct comedi_device *dev,
                dev->irq = irq;
        }
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_alloc_subdevices(dev, 3);
        if (ret)
index 8f5006d70dafd479b60d8271cfff2c4e611fb4ee..2aa70d2b502d1989d5d76fe92a01e903291f10e3 100644 (file)
@@ -627,10 +627,9 @@ havetype:
        if (ret)
                goto out;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        dev->board_name = board->name;
 
index 5348cdae408a7e4045d8223a62d2ad7a0068a50d..bbae652aa8943c27f5b0e410af7e40857dc4f1a5 100644 (file)
@@ -450,10 +450,9 @@ static int dt2811_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (ret)
                return ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        switch (it->options[2]) {
        case 0:
index 87e9749c4be770f6522dcbb33604c55b18cc8d4f..a46a5b32405d020f2f47a7272a4208b7c60e60e0 100644 (file)
@@ -298,10 +298,9 @@ static int dt2814_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (ret)
                return ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        s = &dev->subdevices[0];
        dev->read_subdev = s;
index 0fcd4fe7acdc4967e6f7f3d01eeece86f7a9ea5e..e729271fcfe3400d50af1596cf8b134690dabf8c 100644 (file)
@@ -165,10 +165,9 @@ static int dt2815_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (ret)
                return ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        s = &dev->subdevices[0];
        /* ao subdevice */
index c1950e3b19a2b69f5f18adba431ec2b311897778..3d1ae5f3fa5f6f4fe23ba9f2267c501ba3e98139 100644 (file)
@@ -1188,10 +1188,9 @@ static int dt282x_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 #endif
        }
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = dt282x_grab_dma(dev, it->options[opt_dma1],
                              it->options[opt_dma2]);
index 01a2f889d5b023e227a1abc4bae259cacbe62457..c255ed1ec231884e2bfdefdd2c19d4878e39551f 100644 (file)
@@ -722,10 +722,9 @@ static int dt3000_auto_attach(struct comedi_device *dev,
        dev->board_ptr = this_board;
        dev->board_name = this_board->name;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_pci_enable(dev);
        if (ret < 0)
index 6c60949d919391b0255d7fc7c27827f1891a82d4..07aa828365e59cb471f205af4bd311ad0d7f98de 100644 (file)
@@ -41,7 +41,6 @@ for my needs.
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
-#include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/uaccess.h>
 #include <linux/usb.h>
@@ -781,10 +780,9 @@ static int dt9812_auto_attach(struct comedi_device *dev,
        bool is_unipolar;
        int ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        sema_init(&devpriv->sem, 1);
        usb_set_intfdata(intf, devpriv);
index e14dd3ae9ec6c5ccff9bffe9ccc476e8e17423b8..33398041b6641477596d41b677e16ab7d958e54e 100644 (file)
@@ -183,10 +183,9 @@ static int dyna_pci10xx_auto_attach(struct comedi_device *dev,
        struct comedi_subdevice *s;
        int ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_pci_enable(dev);
        if (ret)
index ff6f0bd7c8637a130e143ddb03afd95d7d45f78e..77646371d80ccb5e2c6aecb4932e9bf9fbf38f72 100644 (file)
@@ -118,10 +118,9 @@ static int fl512_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (ret)
                return ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_alloc_subdevices(dev, 2);
        if (ret)
index 2fceff93867bee453c9a1c61e6e7dc74e603dfca..f130327f88d3a41404255aaf98db5554b07153bc 100644 (file)
@@ -483,10 +483,9 @@ static int hpdi_auto_attach(struct comedi_device *dev,
        dev->board_ptr = thisboard;
        dev->board_name = thisboard->name;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        retval = comedi_pci_enable(dev);
        if (retval)
index a11e015dc03d3207a28a36e9cca0a07dc6e1bec8..ee40233e81b3c3bc9ef4d73d01595a7c5cc8a94b 100644 (file)
@@ -495,10 +495,9 @@ static int icp_multi_auto_attach(struct comedi_device *dev,
        struct comedi_subdevice *s;
        int ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_pci_enable(dev);
        if (ret)
index ee7537daf4736fc26cb5ff33988b1d09f688249b..0d4de7d1094dd56b31b493aa2888126abfcdf2bd 100644 (file)
@@ -203,10 +203,9 @@ static int pci20xxx_attach(struct comedi_device *dev,
        if (ret)
                return ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        devpriv->ioaddr = (void __iomem *)(unsigned long)it->options[0];
 
index 94609f4aa4c94fe11815f39bb0e95e29c2381bc7..a9817c980fbc016e6efc291da10ed221fe30337e 100644 (file)
@@ -638,10 +638,9 @@ static int jr3_pci_auto_attach(struct comedi_device *dev,
                return -EINVAL;
        }
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        init_timer(&devpriv->timer);
        switch (pcidev->device) {
index c2308fd24d6a26445012b5bd5b1ae77738832dbb..f84f0fbb6eaa2fd6a42fe99b92e3497d73266a63 100644 (file)
@@ -1544,10 +1544,9 @@ static int me4000_auto_attach(struct comedi_device *dev,
        dev->board_ptr = thisboard;
        dev->board_name = thisboard->name;
 
-       info = kzalloc(sizeof(*info), GFP_KERNEL);
+       info = comedi_alloc_devpriv(dev, sizeof(*info));
        if (!info)
                return -ENOMEM;
-       dev->private = info;
 
        result = comedi_pci_enable(dev);
        if (result)
index 7533ece3670e30aca9cf07d54ad6b6025a1ded4a..234332044310e43f70279ea80bba023a1a1baaa7 100644 (file)
@@ -490,10 +490,9 @@ static int me_auto_attach(struct comedi_device *dev,
        dev->board_ptr = board;
        dev->board_name = board->name;
 
-       dev_private = kzalloc(sizeof(*dev_private), GFP_KERNEL);
+       dev_private = comedi_alloc_devpriv(dev, sizeof(*dev_private));
        if (!dev_private)
                return -ENOMEM;
-       dev->private = dev_private;
 
        ret = comedi_pci_enable(dev);
        if (ret)
index 713842ad6ff67a9fc842e3c4f31d3a6e85eb37ed..f24657f304fde1bc8cc6394509fcf636d30149f8 100644 (file)
@@ -286,10 +286,9 @@ static int mpc624_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (ret)
                return ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        switch (it->options[1]) {
        case 0:
index 5ecd1b1666fbe35a3070a66c2de974f5551c3462..8db2aad5441e538dfcc56be0b2467dc5e9c253b2 100644 (file)
@@ -232,10 +232,9 @@ static int multiq3_attach(struct comedi_device *dev,
        if (ret)
                return ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        s = &dev->subdevices[0];
        /* ai subdevice */
index 903c2ef5dd9a670e84a3e50135ae373eaf5ccf34..2077d6ba6d3f2a87e6c0218924306e1e317e2911 100644 (file)
@@ -335,10 +335,9 @@ static int ni6527_auto_attach(struct comedi_device *dev,
        if (ret)
                return ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        devpriv->mite = mite_alloc(pcidev);
        if (!devpriv->mite)
index 42a78de4731642f61babf859bf113cb4817fd304..1bd830023118d9ecff64d1f80cad4963b922695a 100644 (file)
@@ -48,7 +48,6 @@ except maybe the 6514.
 
 #include <linux/pci.h>
 #include <linux/interrupt.h>
-#include <linux/slab.h>
 
 #include "../comedidev.h"
 
@@ -591,10 +590,9 @@ static int ni_65xx_auto_attach(struct comedi_device *dev,
        if (ret)
                return ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        devpriv->mite = mite_alloc(pcidev);
        if (!devpriv->mite)
index a9e000461ec7f180bb8f8870d512cc52c1039f1c..d90d4a09ba4c8f622efbfd9a585f160448a64d5d 100644 (file)
@@ -929,10 +929,9 @@ static int ni_660x_allocate_private(struct comedi_device *dev)
        struct ni_660x_private *devpriv;
        unsigned i;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        spin_lock_init(&devpriv->mite_channel_lock);
        spin_lock_init(&devpriv->interrupt_lock);
index 1a185b9c529f1f7a3a6b8b1b294862f89aee3b7a..4876f116ba9285f9fc4dabb48a419fa18e466134 100644 (file)
@@ -38,7 +38,6 @@ Commands are not supported.
 
 #include <linux/pci.h>
 #include <linux/interrupt.h>
-#include <linux/slab.h>
 
 #include "../comedidev.h"
 
@@ -205,10 +204,9 @@ static int ni_670x_auto_attach(struct comedi_device *dev,
        if (ret)
                return ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        devpriv->mite = mite_alloc(pcidev);
        if (!devpriv->mite)
index 7ea5aa32e9d2124e9a4ccc47eba9ae9ab39ce64a..82c5ca6863005dc8b312c91486093035363beb54 100644 (file)
@@ -719,10 +719,9 @@ static int a2150_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        int i;
        int ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_request_region(dev, it->options[0], A2150_SIZE);
        if (ret)
index e080053c697b8a98691115f2338209a4aa5afb34..639377a60c12930684caa54c7e3d9dce127f0172 100644 (file)
@@ -341,10 +341,9 @@ static int atao_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (ret)
                return ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_alloc_subdevices(dev, 4);
        if (ret)
index da7396f94297fe7620faec494f500a906c3df0cf..d91fbc8240c0e681e033d53ff170666274d6290e 100644 (file)
@@ -645,10 +645,9 @@ static int atmio16d_attach(struct comedi_device *dev,
        if (ret)
                return ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        /* reset the atmio16d hardware */
        reset_atmio16d(dev);
index 3c50e31ecc6070518895114c2769bee0d73dc124..12aa15b42887948d890f95f5d4290bcaf04ca848 100644 (file)
@@ -47,7 +47,6 @@ Manuals:      Register level: http://www.ni.com/pdf/manuals/340698.pdf
 
 #include <linux/ioport.h>
 #include <linux/interrupt.h>
-#include <linux/slab.h>
 
 #include "../comedidev.h"
 
index f161e70b3a0d343efefd3cae1bc9bba67fcf0d4e..4119dcfd4761736dfc9e97ba3d047e0972421642 100644 (file)
@@ -1697,10 +1697,9 @@ static int labpc_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        unsigned int dma_chan = it->options[2];
        int ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_request_region(dev, it->options[0], LABPC_SIZE);
        if (ret)
index ce67f4bbb1f5596060f471fb96e93d986dda8883..df1de784e90b086667cb08082578f6ca77fe9ac9 100644 (file)
@@ -56,7 +56,6 @@ NI manuals:
 #include "../comedidev.h"
 
 #include <linux/delay.h>
-#include <linux/slab.h>
 
 #include "8253.h"
 #include "8255.h"
@@ -96,10 +95,9 @@ static int labpc_auto_attach(struct comedi_device *dev,
        if (!link->irq)
                return -EINVAL;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        return labpc_common_attach(dev, link->irq, IRQF_SHARED);
 }
index 6c79237b2b5c624dadb7e9fb6c5adbdcdb3ce64d..203a7cef775025f65d99fc48035e066f477915a9 100644 (file)
@@ -30,7 +30,6 @@
  */
 
 #include <linux/interrupt.h>
-#include <linux/slab.h>
 #include <linux/pci.h>
 
 #include "../comedidev.h"
@@ -72,10 +71,9 @@ static int labpc_pci_auto_attach(struct comedi_device *dev,
        if (ret)
                return ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        devpriv->mite = mite_alloc(pcidev);
        if (!devpriv->mite)
index 3e9f544e67fc2247a2f8a46c16bf4105c3f38f49..458331d3fcb770a7c1b8ab13194762817500a484 100644 (file)
@@ -4363,10 +4363,9 @@ static int ni_alloc_private(struct comedi_device *dev)
 {
        struct ni_private *devpriv;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        spin_lock_init(&devpriv->window_lock);
        spin_lock_init(&devpriv->soft_reg_copy_lock);
index 5b2f72e102e10377bd62cd728dc6cb572e67c94b..3c5275b669fc289d7d33c6d0225721229c2cbc38 100644 (file)
@@ -1108,10 +1108,9 @@ static int nidio_auto_attach(struct comedi_device *dev,
        if (ret)
                return ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        spin_lock_init(&devpriv->mite_channel_lock);
 
index f2cf76d15d7838ec6f557ce83aa6afffc8218373..5b6fde08e582978125741f861cfa8d23fbb1c694 100644 (file)
@@ -44,6 +44,8 @@ TODO:
        Support use of both banks X and Y
 */
 
+#include <linux/slab.h>
+
 #include "ni_tio_internal.h"
 
 static uint64_t ni_tio_clock_period_ps(const struct ni_gpct *counter,
index 7abf3f74144e78e530474683cfc185bc60b9139b..f5ac58342a7c4be5c79595848686365d9716f037 100644 (file)
@@ -474,10 +474,9 @@ static int pcl711_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (ret)
                return ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        s = &dev->subdevices[0];
        /* AI subdevice */
index 893f012a1b7a5fc6b468a330b367a27528821238..9bd341fedced2bd5cf4acc99e46bcba6037193cb 100644 (file)
@@ -229,10 +229,9 @@ static int pcl726_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (ret)
                return ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        for (i = 0; i < 12; i++) {
                devpriv->bipolar[i] = 0;
index cd02786702c874a0a11b3068ba125f8babe9975e..699d4558c122167dc6bfce1e6cb008727f7e9e9a 100644 (file)
@@ -1110,10 +1110,9 @@ static int pcl812_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (ret)
                return ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        irq = 0;
        if (board->IRQbits != 0) {      /* board support IRQ */
index 91bd2071f5713c556d564aaf790eabdfda937f5b..02285976177ab5e3f97add3e7728113257fdbfff 100644 (file)
@@ -922,10 +922,9 @@ static int pcl816_attach(struct comedi_device *dev, struct comedi_devconfig *it)
                return -EIO;
        }
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        /* grab our IRQ */
        irq = 0;
index 91cb1bd6717fd986d111d6684b4aa315aa3a299d..55f10e754c7625294da7b35615b27a9b0677e5ef 100644 (file)
@@ -1227,10 +1227,9 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        unsigned long pages;
        struct comedi_subdevice *s;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        devpriv->io_range = board->io_range;
        if ((board->fifo) && (it->options[2] == -1)) {
index 5a9cd38e15f266ed9ce27b8682b4973cbdc8aeac..87cba62c6aed1eef70ae936df7ede0e27fe2ef13 100644 (file)
@@ -228,10 +228,9 @@ static int pcm3724_attach(struct comedi_device *dev,
        struct comedi_subdevice *s;
        int ret, i;
 
-       priv = kzalloc(sizeof(*priv), GFP_KERNEL);
+       priv = comedi_alloc_devpriv(dev, sizeof(*priv));
        if (!priv)
                return -ENOMEM;
-       dev->private = priv;
 
        ret = comedi_request_region(dev, it->options[0], PCM3724_SIZE);
        if (ret)
index 774a63dfe0402557674e3b274551cb0851173d39..2839241bb35aaac2010f886b71af84c8c4a4b67e 100644 (file)
@@ -138,10 +138,9 @@ static int pcmda12_attach(struct comedi_device *dev,
        if (ret)
                return ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        devpriv->simultaneous_xfer_mode = it->options[1];
 
index 9f76b1f59983564093f5beaaae4df332ef6bb9b2..feb83caef26f126de81a2a241df9d951b7084eaf 100644 (file)
@@ -1039,10 +1039,9 @@ static int pcmmio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (ret)
                return ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        for (asic = 0; asic < MAX_ASICS; ++asic) {
                devpriv->asics[asic].num = asic;
index c43b6334ceae88e209def266bb263c3ebed7ba7b..30f53fb5a0acffffb910ff9f215bedbd2ada4a1c 100644 (file)
@@ -609,10 +609,9 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (ret)
                return ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        for (asic = 0; asic < PCMUIO_MAX_ASICS; ++asic)
                spin_lock_init(&devpriv->asics[asic].spinlock);
index 005fbefae295fc4f0968728a956f06a916a2bfc4..e50dd09a20313a9f4e7202f6cd562f86c31ec0cc 100644 (file)
@@ -109,10 +109,9 @@ static int poc_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (ret)
                return ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        /* analog output subdevice */
        s = &dev->subdevices[0];
index e092ce87722e1af838fe74a43051c05f5250963f..478a97271a487b220c3d68a07b74df1f29c66369 100644 (file)
@@ -715,10 +715,9 @@ static int daqp_auto_attach(struct comedi_device *dev,
        struct comedi_subdevice *s;
        int ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        link->config_flags |= CONF_AUTO_SET_IO | CONF_ENABLE_IRQ;
        ret = comedi_pcmcia_enable(dev, NULL);
index 9b93a1fc4a599856e9957ee3fd3727d90b9da7dd..928f534ae4ec901c9e625bb530b1cdffcde9d075 100644 (file)
@@ -1338,10 +1338,9 @@ static int rtd_auto_attach(struct comedi_device *dev,
        dev->board_ptr = board;
        dev->board_name = board->name;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_pci_enable(dev);
        if (ret)
index f698c7fc57261bbcccee66e7a84aae07e1059f93..b95fce5d26fb73c47783dd3fe3a0ad2ff083ee17 100644 (file)
@@ -298,10 +298,9 @@ static int rti800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        inb(dev->iobase + RTI800_ADCHI);
        outb(0, dev->iobase + RTI800_CLRFLAGS);
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        devpriv->adc_2comp = (it->options[4] == 0);
        devpriv->dac_2comp[0] = (it->options[6] == 0);
index 9e7445055482a35e46fa661dff12375a080ce28c..664ad70b050194a7c409cf6351552c089e8ef1a8 100644 (file)
@@ -93,10 +93,9 @@ static int rti802_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (ret)
                return ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_alloc_subdevices(dev, 1);
        if (ret)
index e1587e58a732aa3e76fc22d57c3ad2aaf0f0ea07..24d21eef74f8490914bc0a024dddd5d7c5023641 100644 (file)
@@ -553,10 +553,9 @@ static int s526_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (ret)
                return ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_alloc_subdevices(dev, 4);
        if (ret)
index 48c4b70b736aad1163a6be02eceb7ba25cf1c688..f5ef91f39bbfad2bf96551669ab683f35461a72c 100644 (file)
@@ -2585,10 +2585,9 @@ static int s626_auto_attach(struct comedi_device *dev,
        struct comedi_subdevice *s;
        int ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        ret = comedi_pci_enable(dev);
        if (ret)
index d2756b83b62d13625d4a5ef775268fd0a228b330..a85e6bdcad0750905f32c1078b4310e9d364db50 100644 (file)
@@ -65,8 +65,6 @@
 #define FALSE   (0)
 #endif
 
-#include <linux/slab.h>
-
 #define S626_SIZE 0x0200
 #define DMABUF_SIZE                    4096    /*  4k pages */
 
index b4f5fe35b0fa18fb8ac5f633ee87d8904f233a7a..b6efe9b1d4d2dee4c6cee7bde0ec84583c5e47de 100644 (file)
@@ -719,10 +719,9 @@ static int serial2002_attach(struct comedi_device *dev,
        struct comedi_subdevice *s;
        int ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        devpriv->port = it->options[0];
        devpriv->speed = it->options[1];
index 06aee302bbc23c696d85b53161c64b028d6dfb7c..3fc7713af5ceb1149df69903822460d2890bb67f 100644 (file)
@@ -484,10 +484,9 @@ static int skel_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        /* dev->board_name = thisboard->name; */
 
        /* Allocate the private data */
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
 /*
  * Supported boards are usually either auto-attached via the
@@ -558,10 +557,9 @@ static int skel_auto_attach(struct comedi_device *dev,
        dev->board_name = thisboard->name;
 
        /* Allocate the private data */
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        /* Enable the PCI device. */
        ret = comedi_pci_enable(dev);
index c9201d821fbc3aa5a8f1eb4fc4e8f02d66a94ea0..806285bc6ca73c33dcbd003ed14c996d47b2ec1d 100644 (file)
@@ -42,7 +42,6 @@ Devices: [Fastwel] UNIOxx-5 (unioxx5),
 
 #include "../comedidev.h"
 #include <linux/ioport.h>
-#include <linux/slab.h>
 
 #define DRIVER_NAME "unioxx5"
 #define UNIOXX5_SIZE 0x10
index 27898c44e543f97ee200e89573b7a64089b9a014..9707dd1239c4c04957ea9d32977f0ce7e5f37ca5 100644 (file)
@@ -1061,10 +1061,9 @@ static int usbduxfast_auto_attach(struct comedi_device *dev,
                return -ENODEV;
        }
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        sema_init(&devpriv->sem, 1);
        usb_set_intfdata(intf, devpriv);
index 898c3c4504066c31af6a44ec87f37b7bfc484aa0..40eeb8c683062bd2bd749b6c241787e0da850981 100644 (file)
@@ -1677,10 +1677,9 @@ static int usbduxsigma_auto_attach(struct comedi_device *dev,
        struct usbduxsigma_private *devpriv;
        int ret;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        sema_init(&devpriv->sem, 1);
        usb_set_intfdata(intf, devpriv);
index 0ab04c0dd4102a3513302b848f6ca9f0b64aaa18..06efa16b9af2377a0370952815d701dc344d51c4 100644 (file)
@@ -875,10 +875,9 @@ static int vmk80xx_auto_attach(struct comedi_device *dev,
        dev->board_ptr = boardinfo;
        dev->board_name = boardinfo->name;
 
-       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
        if (!devpriv)
                return -ENOMEM;
-       dev->private = devpriv;
 
        devpriv->model = boardinfo->model;