Merge 3.7-rc3 into staging-next
[deliverable/linux.git] / drivers / staging / comedi / drivers / amplc_pc236.c
index 4e4f3c15df87e9db99528806b15ba48c54a558c2..8b7e16ee1135d467ac6369a895dbd853835839e8 100644 (file)
@@ -66,7 +66,6 @@ unused.
 #define DO_PCI IS_ENABLED(CONFIG_COMEDI_AMPLC_PC236_PCI)
 
 /* PCI236 PCI configuration register information */
-#define PCI_VENDOR_ID_AMPLICON 0x14dc
 #define PCI_DEVICE_ID_AMPLICON_PCI236 0x0009
 #define PCI_DEVICE_ID_INVALID 0xffff
 
@@ -505,14 +504,16 @@ static int pc236_pci_common_attach(struct comedi_device *dev,
 static int pc236_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 {
        const struct pc236_board *thisboard = comedi_board(dev);
+       struct pc236_private *devpriv;
        int ret;
 
        dev_info(dev->class_dev, PC236_DRIVER_NAME ": attach\n");
-       ret = alloc_private(dev, sizeof(struct pc236_private));
-       if (ret < 0) {
-               dev_err(dev->class_dev, "error! out of memory!\n");
-               return ret;
-       }
+
+       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       if (!devpriv)
+               return -ENOMEM;
+       dev->private = devpriv;
+
        /* Process options according to bus type. */
        if (is_isa_board(thisboard)) {
                unsigned long iobase = it->options[0];
@@ -543,18 +544,19 @@ static int pc236_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 static int __devinit pc236_attach_pci(struct comedi_device *dev,
                                      struct pci_dev *pci_dev)
 {
-       int ret;
+       struct pc236_private *devpriv;
 
        if (!DO_PCI)
                return -EINVAL;
 
        dev_info(dev->class_dev, PC236_DRIVER_NAME ": attach pci %s\n",
                 pci_name(pci_dev));
-       ret = alloc_private(dev, sizeof(struct pc236_private));
-       if (ret < 0) {
-               dev_err(dev->class_dev, "error! out of memory!\n");
-               return ret;
-       }
+
+       devpriv = kzalloc(sizeof(*devpriv), GFP_KERNEL);
+       if (!devpriv)
+               return -ENOMEM;
+       dev->private = devpriv;
+
        dev->board_ptr = pc236_find_pci_board(pci_dev);
        if (dev->board_ptr == NULL) {
                dev_err(dev->class_dev, "BUG! cannot determine board type!\n");
This page took 0.03006 seconds and 5 git commands to generate.