Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 364133
b: refs/heads/master
c: fed9fd2
h: refs/heads/master
i:
  364131: 1336004
v: v3
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Apr 12, 2013
1 parent f0d02e5 commit f7bca0b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 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: aee351b28ccc7b966a14c8a8e146c6b74d4717cc
refs/heads/master: fed9fd2cc6ac2b01f928bef3ce62a9d8058f514d
15 changes: 5 additions & 10 deletions trunk/drivers/staging/comedi/drivers/8255_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ enum pci_8255_boardid {
struct pci_8255_boardinfo {
const char *name;
int dio_badr;
int is_mmio;
int n_8255;
};

Expand Down Expand Up @@ -123,43 +122,36 @@ static const struct pci_8255_boardinfo pci_8255_boards[] = {
[BOARD_NI_PCIDIO96] = {
.name = "ni_pci-dio-96",
.dio_badr = 1,
.is_mmio = 1,
.n_8255 = 4,
},
[BOARD_NI_PCIDIO96B] = {
.name = "ni_pci-dio-96b",
.dio_badr = 1,
.is_mmio = 1,
.n_8255 = 4,
},
[BOARD_NI_PXI6508] = {
.name = "ni_pxi-6508",
.dio_badr = 1,
.is_mmio = 1,
.n_8255 = 4,
},
[BOARD_NI_PCI6503] = {
.name = "ni_pci-6503",
.dio_badr = 1,
.is_mmio = 1,
.n_8255 = 1,
},
[BOARD_NI_PCI6503B] = {
.name = "ni_pci-6503b",
.dio_badr = 1,
.is_mmio = 1,
.n_8255 = 1,
},
[BOARD_NI_PCI6503X] = {
.name = "ni_pci-6503x",
.dio_badr = 1,
.is_mmio = 1,
.n_8255 = 1,
},
[BOARD_NI_PXI_6503] = {
.name = "ni_pxi-6503",
.dio_badr = 1,
.is_mmio = 1,
.n_8255 = 1,
},
};
Expand Down Expand Up @@ -187,6 +179,7 @@ static int pci_8255_auto_attach(struct comedi_device *dev,
const struct pci_8255_boardinfo *board = NULL;
struct pci_8255_private *devpriv;
struct comedi_subdevice *s;
bool is_mmio;
int ret;
int i;

Expand All @@ -206,7 +199,9 @@ static int pci_8255_auto_attach(struct comedi_device *dev,
if (ret)
return ret;

if (board->is_mmio) {
is_mmio = (pci_resource_flags(pcidev, board->dio_badr) &
IORESOURCE_MEM) != 0;
if (is_mmio) {
devpriv->mmio_base = pci_ioremap_bar(pcidev, board->dio_badr);
if (!devpriv->mmio_base)
return -ENOMEM;
Expand All @@ -227,7 +222,7 @@ static int pci_8255_auto_attach(struct comedi_device *dev,
unsigned long iobase;

s = &dev->subdevices[i];
if (board->is_mmio) {
if (is_mmio) {
iobase = (unsigned long)(devpriv->mmio_base + (i * 4));
ret = subdev_8255_init(dev, s, pci_8255_mmio, iobase);
} else {
Expand Down

0 comments on commit f7bca0b

Please sign in to comment.