Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 337236
b: refs/heads/master
c: ef0653a
h: refs/heads/master
v: v3
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Oct 24, 2012
1 parent ff4e07d commit 9f4d41e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 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: 71b3e9e8dc218133417d3c167632a61f9fed3651
refs/heads/master: ef0653ac20e739aba476ee63ca2a618a3a26857d
13 changes: 10 additions & 3 deletions trunk/drivers/staging/comedi/drivers/amplc_dio200.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ struct dio200_board {
enum dio200_bustype bustype;
enum dio200_model model;
enum dio200_layout_idx layout;
unsigned char mainbar;
};

static const struct dio200_board dio200_boards[] = {
Expand Down Expand Up @@ -350,13 +351,15 @@ static const struct dio200_board dio200_boards[] = {
.bustype = pci_bustype,
.model = pci215_model,
.layout = pc215_layout,
.mainbar = 2,
},
{
.name = "pci272",
.devid = PCI_DEVICE_ID_AMPLICON_PCI272,
.bustype = pci_bustype,
.model = pci272_model,
.layout = pc272_layout,
.mainbar = 2,
},
#endif
};
Expand Down Expand Up @@ -1573,8 +1576,10 @@ static int dio200_attach(struct comedi_device *dev, struct comedi_devconfig *it)
static int __devinit dio200_attach_pci(struct comedi_device *dev,
struct pci_dev *pci_dev)
{
const struct dio200_board *thisboard;
struct dio200_private *devpriv;
resource_size_t base;
unsigned int bar;
int ret;

if (!DO_PCI)
Expand All @@ -1593,15 +1598,17 @@ static int __devinit dio200_attach_pci(struct comedi_device *dev,
dev_err(dev->class_dev, "BUG! cannot determine board type!\n");
return -EINVAL;
}
thisboard = comedi_board(dev);
ret = comedi_pci_enable(pci_dev, DIO200_DRIVER_NAME);
if (ret < 0) {
dev_err(dev->class_dev,
"error! cannot enable PCI device and request regions!\n");
return ret;
}
base = pci_resource_start(pci_dev, 2);
if ((pci_resource_flags(pci_dev, 2) & IORESOURCE_MEM) != 0) {
resource_size_t len = pci_resource_len(pci_dev, 2);
bar = thisboard->mainbar;
base = pci_resource_start(pci_dev, bar);
if ((pci_resource_flags(pci_dev, bar) & IORESOURCE_MEM) != 0) {
resource_size_t len = pci_resource_len(pci_dev, bar);
devpriv->io.u.membase = ioremap_nocache(base, len);
if (!devpriv->io.u.membase) {
dev_err(dev->class_dev,
Expand Down

0 comments on commit 9f4d41e

Please sign in to comment.