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

staging: comedi: me_daq: cleanup ioremap of PCI bar 2

PCI bar 2 is the main i/o address for this driver. Currently the
pci_resource_len of the bar is stored in the private data but
it is never used.

Remove 'me_regbase_size' from the private data. Also, remove the
local variables used for the pci_resource_start and _len. Just
pass the values directly to the ioremap().

Remove the kernel noise when the ioremap fails.
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 736b605c
...@@ -224,7 +224,6 @@ static const struct me_board me_boards[] = { ...@@ -224,7 +224,6 @@ static const struct me_board me_boards[] = {
struct me_private_data { struct me_private_data {
void __iomem *plx_regbase; /* PLX configuration base address */ void __iomem *plx_regbase; /* PLX configuration base address */
void __iomem *me_regbase; /* Base address of the Meilhaus card */ void __iomem *me_regbase; /* Base address of the Meilhaus card */
unsigned long me_regbase_size; /* Size of Meilhaus space */
unsigned short control_1; /* Mirror of CONTROL_1 register */ unsigned short control_1; /* Mirror of CONTROL_1 register */
unsigned short control_2; /* Mirror of CONTROL_2 register */ unsigned short control_2; /* Mirror of CONTROL_2 register */
...@@ -638,8 +637,6 @@ static int me_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev) ...@@ -638,8 +637,6 @@ static int me_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
struct me_private_data *dev_private; struct me_private_data *dev_private;
struct comedi_subdevice *s; struct comedi_subdevice *s;
resource_size_t plx_regbase_tmp; resource_size_t plx_regbase_tmp;
resource_size_t me_regbase_tmp;
unsigned long me_regbase_size_tmp;
resource_size_t swap_regbase_tmp; resource_size_t swap_regbase_tmp;
unsigned long swap_regbase_size_tmp; unsigned long swap_regbase_size_tmp;
resource_size_t regbase_tmp; resource_size_t regbase_tmp;
...@@ -712,16 +709,10 @@ static int me_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev) ...@@ -712,16 +709,10 @@ static int me_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
} }
/*--------------------------------------------- Workaround end -----*/ /*--------------------------------------------- Workaround end -----*/
/* Read Meilhaus register base address [PCI_BASE_ADDRESS #2]. */ dev_private->me_regbase = ioremap(pci_resource_start(pcidev, 2),
pci_resource_len(pcidev, 2));
me_regbase_tmp = pci_resource_start(pcidev, 2); if (!dev_private->me_regbase)
me_regbase_size_tmp = pci_resource_len(pcidev, 2);
dev_private->me_regbase_size = me_regbase_size_tmp;
dev_private->me_regbase = ioremap(me_regbase_tmp, me_regbase_size_tmp);
if (!dev_private->me_regbase) {
dev_err(dev->class_dev, "Failed to remap I/O memory\n");
return -ENOMEM; return -ENOMEM;
}
/* Download firmware and reset card */ /* Download firmware and reset card */
if (board->device_id == ME2600_DEVICE_ID) { if (board->device_id == ME2600_DEVICE_ID) {
......
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