Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 317116
b: refs/heads/master
c: d60d9f3
h: refs/heads/master
v: v3
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Jun 5, 2012
1 parent 21fb6a1 commit 093dd84
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 31 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4b5c0f106e7eb588e904184d9bc16427111c486f
refs/heads/master: d60d9f34d37775fa64695a22b405e58ac3cda39c
57 changes: 27 additions & 30 deletions trunk/drivers/staging/comedi/drivers/das08.c
Original file line number Diff line number Diff line change
Expand Up @@ -861,12 +861,13 @@ static int das08_counter_config(struct comedi_device *dev,

#ifdef DO_COMEDI_DRIVER_REGISTER
static int das08_attach(struct comedi_device *dev, struct comedi_devconfig *it);
static void das08_detach(struct comedi_device *dev);

static struct comedi_driver driver_das08 = {
.driver_name = DRV_NAME,
.module = THIS_MODULE,
.attach = das08_attach,
.detach = das08_common_detach,
.detach = das08_detach,
.board_name = &das08_boards[0].name,
.num_names = sizeof(das08_boards) / sizeof(struct das08_board_struct),
.offset = sizeof(struct das08_board_struct),
Expand All @@ -878,14 +879,6 @@ int das08_common_attach(struct comedi_device *dev, unsigned long iobase)
struct comedi_subdevice *s;
int ret;

/* allocate ioports for non-pcmcia, non-pci boards */
if ((thisboard->bustype != pcmcia) && (thisboard->bustype != pci)) {
printk(KERN_INFO " iobase 0x%lx\n", iobase);
if (!request_region(iobase, thisboard->iosize, DRV_NAME)) {
printk(KERN_ERR " I/O port conflict\n");
return -EIO;
}
}
dev->iobase = iobase;

dev->board_name = thisboard->name;
Expand Down Expand Up @@ -996,19 +989,15 @@ static int das08_attach(struct comedi_device *dev, struct comedi_devconfig *it)
{
int ret;
unsigned long iobase;
#if IS_ENABLED(CONFIG_COMEDI_DAS08_PCI)
unsigned long pci_iobase = 0;
struct pci_dev *pdev = NULL;
#endif

ret = alloc_private(dev, sizeof(struct das08_private_struct));
if (ret < 0)
return ret;

printk(KERN_INFO "comedi%d: das08: ", dev->minor);
#if IS_ENABLED(CONFIG_COMEDI_DAS08_PCI)
/* deal with a pci board */
if (thisboard->bustype == pci) {
if (IS_ENABLED(CONFIG_COMEDI_DAS08_PCI) && thisboard->bustype == pci) {
unsigned long pci_iobase = 0;
struct pci_dev *pdev = NULL;
if (it->options[0] || it->options[1]) {
printk("bus %i slot %i ",
it->options[0], it->options[1]);
Expand Down Expand Up @@ -1057,13 +1046,16 @@ static int das08_attach(struct comedi_device *dev, struct comedi_devconfig *it)
/* Enable local interrupt 1 and pci interrupt */
outw(INTR1_ENABLE | PCI_INTR_ENABLE, pci_iobase + INTCSR);
#endif
} else
#endif /* IS_ENABLED(CONFIG_COMEDI_DAS08_PCI) */
{
} else if (IS_ENABLED(CONFIG_COMEDI_DAS08_ISA) &&
(thisboard->bustype == isa || thisboard->bustype == pc104)) {
iobase = it->options[0];
}
printk(KERN_INFO "\n");

printk(KERN_INFO " iobase 0x%lx\n", iobase);
if (!request_region(iobase, thisboard->iosize, DRV_NAME)) {
printk(KERN_ERR " I/O port conflict\n");
return -EIO;
}
} else
return -EIO;
return das08_common_attach(dev, iobase);
}
#endif /* DO_COMEDI_DRIVER_REGISTER */
Expand All @@ -1072,22 +1064,27 @@ void das08_common_detach(struct comedi_device *dev)
{
if (dev->subdevices)
subdev_8255_cleanup(dev, dev->subdevices + 4);
if ((thisboard->bustype != pcmcia) && (thisboard->bustype != pci)) {
}
EXPORT_SYMBOL_GPL(das08_common_detach);

#ifdef DO_COMEDI_DRIVER_REGISTER
static void das08_detach(struct comedi_device *dev)
{
das08_common_detach(dev);
if (IS_ENABLED(CONFIG_COMEDI_DAS08_ISA) &&
(thisboard->bustype == isa || thisboard->bustype == pc104)) {
if (dev->iobase)
release_region(dev->iobase, thisboard->iosize);
}
#if IS_ENABLED(CONFIG_COMEDI_DAS08_PCI)
if (devpriv) {
if (devpriv->pdev) {
} else if (IS_ENABLED(CONFIG_COMEDI_DAS08_PCI) &&
thisboard->bustype == pci) {
if (devpriv && devpriv->pdev) {
if (devpriv->pci_iobase)
comedi_pci_disable(devpriv->pdev);

pci_dev_put(devpriv->pdev);
}
}
#endif
}
EXPORT_SYMBOL_GPL(das08_common_detach);
#endif /* DO_COMEDI_DRIVER_REGISTER */

#if IS_ENABLED(CONFIG_COMEDI_DAS08_PCI)
static int __devinit driver_das08_pci_probe(struct pci_dev *dev,
Expand Down

0 comments on commit 093dd84

Please sign in to comment.