Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 324953
b: refs/heads/master
c: d5cd01f
h: refs/heads/master
i:
  324951: ca46203
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Sep 8, 2012
1 parent cd15124 commit 54753dc
Show file tree
Hide file tree
Showing 2 changed files with 17 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: 9c943f4ed479d58a2814239815e45fc0b61f4116
refs/heads/master: d5cd01fee1c6ccd363eb6b0d40143173ffa23ef5
46 changes: 16 additions & 30 deletions trunk/drivers/staging/comedi/drivers/me4000.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ static const struct me4000_board me4000_boards[] = {
/*-----------------------------------------------------------------------------
Meilhaus function prototypes
---------------------------------------------------------------------------*/
static int get_registers(struct comedi_device *dev, struct pci_dev *pci_dev_p);
static int init_board_info(struct comedi_device *dev,
struct pci_dev *pci_dev_p);
static int init_ao_context(struct comedi_device *dev);
Expand Down Expand Up @@ -316,14 +315,22 @@ static int me4000_probe(struct comedi_device *dev, struct comedi_devconfig *it)
return result;
}

/* Get the PCI base registers */
result = get_registers(dev, pci_device);
if (result) {
printk(KERN_ERR
"comedi%d: me4000: me4000_probe(): "
"Cannot get registers\n", dev->minor);
return result;
}
info->plx_regbase = pci_resource_start(pci_device, 1);
if (!info->plx_regbase)
return -ENODEV;

info->me4000_regbase = pci_resource_start(pci_device, 2);
if (!info->me4000_regbase)
return -ENODEV;

info->timer_regbase = pci_resource_start(pci_device, 3);
if (!info->timer_regbase)
return -ENODEV;

info->program_regbase = pci_resource_start(pci_device, 5);
if (!info->program_regbase)
return -ENODEV;

/* Initialize board info */
result = init_board_info(dev, pci_device);
if (result) {
Expand Down Expand Up @@ -381,27 +388,6 @@ static int me4000_probe(struct comedi_device *dev, struct comedi_devconfig *it)
return 0;
}

static int get_registers(struct comedi_device *dev, struct pci_dev *pci_dev_p)
{
info->plx_regbase = pci_resource_start(pci_dev_p, 1);
if (!info->plx_regbase)
return -ENODEV;

info->me4000_regbase = pci_resource_start(pci_dev_p, 2);
if (!info->me4000_regbase)
return -ENODEV;

info->timer_regbase = pci_resource_start(pci_dev_p, 3);
if (!info->timer_regbase)
return -ENODEV;

info->program_regbase = pci_resource_start(pci_dev_p, 5);
if (!info->program_regbase)
return -ENODEV;

return 0;
}

static int init_board_info(struct comedi_device *dev, struct pci_dev *pci_dev_p)
{
int result;
Expand Down

0 comments on commit 54753dc

Please sign in to comment.