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

staging: comedi: me4000: absorb get_registers() into its caller

The get_registers() function reads the pci base addresses used
in the driver. It's simple enough, just move the code into the
function that calls it.
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 9c943f4e
...@@ -215,7 +215,6 @@ static const struct me4000_board me4000_boards[] = { ...@@ -215,7 +215,6 @@ static const struct me4000_board me4000_boards[] = {
/*----------------------------------------------------------------------------- /*-----------------------------------------------------------------------------
Meilhaus function prototypes 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, static int init_board_info(struct comedi_device *dev,
struct pci_dev *pci_dev_p); struct pci_dev *pci_dev_p);
static int init_ao_context(struct comedi_device *dev); static int init_ao_context(struct comedi_device *dev);
...@@ -316,14 +315,22 @@ static int me4000_probe(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -316,14 +315,22 @@ static int me4000_probe(struct comedi_device *dev, struct comedi_devconfig *it)
return result; return result;
} }
/* Get the PCI base registers */ info->plx_regbase = pci_resource_start(pci_device, 1);
result = get_registers(dev, pci_device); if (!info->plx_regbase)
if (result) { return -ENODEV;
printk(KERN_ERR
"comedi%d: me4000: me4000_probe(): " info->me4000_regbase = pci_resource_start(pci_device, 2);
"Cannot get registers\n", dev->minor); if (!info->me4000_regbase)
return result; 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 */ /* Initialize board info */
result = init_board_info(dev, pci_device); result = init_board_info(dev, pci_device);
if (result) { if (result) {
...@@ -381,27 +388,6 @@ static int me4000_probe(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -381,27 +388,6 @@ static int me4000_probe(struct comedi_device *dev, struct comedi_devconfig *it)
return 0; 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) static int init_board_info(struct comedi_device *dev, struct pci_dev *pci_dev_p)
{ {
int result; int result;
......
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