Commit 6bdae560 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: dyna_pci10xx: remove the 'start_stop_sem' mutex

The comedi core already has a mutex protecting the attach/detach
of the comedi drivers.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5d30e519
...@@ -45,8 +45,6 @@ ...@@ -45,8 +45,6 @@
#define READ_TIMEOUT 50 #define READ_TIMEOUT 50
static DEFINE_MUTEX(start_stop_sem);
static const struct comedi_lrange range_pci1050_ai = { 3, { static const struct comedi_lrange range_pci1050_ai = { 3, {
BIP_RANGE(10), BIP_RANGE(10),
BIP_RANGE(5), BIP_RANGE(5),
...@@ -267,20 +265,15 @@ static int dyna_pci10xx_attach(struct comedi_device *dev, ...@@ -267,20 +265,15 @@ static int dyna_pci10xx_attach(struct comedi_device *dev,
struct comedi_subdevice *s; struct comedi_subdevice *s;
int ret; int ret;
mutex_lock(&start_stop_sem);
if (alloc_private(dev, sizeof(struct dyna_pci10xx_private)) < 0) { if (alloc_private(dev, sizeof(struct dyna_pci10xx_private)) < 0) {
printk(KERN_ERR "comedi: dyna_pci10xx: " printk(KERN_ERR "comedi: dyna_pci10xx: "
"failed to allocate memory!\n"); "failed to allocate memory!\n");
mutex_unlock(&start_stop_sem);
return -ENOMEM; return -ENOMEM;
} }
pcidev = dyna_pci10xx_find_pci_dev(dev, it); pcidev = dyna_pci10xx_find_pci_dev(dev, it);
if (!pcidev) { if (!pcidev)
mutex_unlock(&start_stop_sem);
return -EIO; return -EIO;
}
devpriv->pci_dev = pcidev; devpriv->pci_dev = pcidev;
dev->board_name = thisboard->name; dev->board_name = thisboard->name;
...@@ -289,7 +282,6 @@ static int dyna_pci10xx_attach(struct comedi_device *dev, ...@@ -289,7 +282,6 @@ static int dyna_pci10xx_attach(struct comedi_device *dev,
if (comedi_pci_enable(pcidev, DRV_NAME)) { if (comedi_pci_enable(pcidev, DRV_NAME)) {
printk(KERN_ERR "comedi: dyna_pci10xx: " printk(KERN_ERR "comedi: dyna_pci10xx: "
"failed to enable PCI device and request regions!"); "failed to enable PCI device and request regions!");
mutex_unlock(&start_stop_sem);
return -EIO; return -EIO;
} }
...@@ -306,10 +298,8 @@ static int dyna_pci10xx_attach(struct comedi_device *dev, ...@@ -306,10 +298,8 @@ static int dyna_pci10xx_attach(struct comedi_device *dev,
devpriv->BADR5 = pci_resource_start(pcidev, 5); devpriv->BADR5 = pci_resource_start(pcidev, 5);
ret = comedi_alloc_subdevices(dev, 4); ret = comedi_alloc_subdevices(dev, 4);
if (ret) { if (ret)
mutex_unlock(&start_stop_sem);
return ret; return ret;
}
/* analog input */ /* analog input */
s = dev->subdevices + 0; s = dev->subdevices + 0;
...@@ -353,7 +343,6 @@ static int dyna_pci10xx_attach(struct comedi_device *dev, ...@@ -353,7 +343,6 @@ static int dyna_pci10xx_attach(struct comedi_device *dev,
s->insn_bits = dyna_pci10xx_do_insn_bits; s->insn_bits = dyna_pci10xx_do_insn_bits;
devpriv->valid = 1; devpriv->valid = 1;
mutex_unlock(&start_stop_sem);
printk(KERN_INFO "comedi: dyna_pci10xx: %s - device setup completed!\n", printk(KERN_INFO "comedi: dyna_pci10xx: %s - device setup completed!\n",
thisboard->name); thisboard->name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment