staging: comedi: me_daq: replace 'result' and 'error' with 'ret'
Two local variables are used in me_attach_pci() to check for errors when calling other functions, 'result' and 'error'. Remove both of them and just use a common 'ret' variable. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
52c4cbe94c
commit
4bb153b4e4
@@ -640,7 +640,7 @@ static int me_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
|
|||||||
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;
|
||||||
int result, error;
|
int ret;
|
||||||
|
|
||||||
board = me_find_boardinfo(dev, pcidev);
|
board = me_find_boardinfo(dev, pcidev);
|
||||||
if (!board)
|
if (!board)
|
||||||
@@ -687,23 +687,23 @@ static int me_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
|
|||||||
plx_regbase_tmp = swap_regbase_tmp;
|
plx_regbase_tmp = swap_regbase_tmp;
|
||||||
swap_regbase_tmp = regbase_tmp;
|
swap_regbase_tmp = regbase_tmp;
|
||||||
|
|
||||||
result = pci_write_config_dword(pcidev,
|
ret = pci_write_config_dword(pcidev,
|
||||||
PCI_BASE_ADDRESS_0,
|
PCI_BASE_ADDRESS_0,
|
||||||
plx_regbase_tmp);
|
plx_regbase_tmp);
|
||||||
if (result != PCIBIOS_SUCCESSFUL)
|
if (ret != PCIBIOS_SUCCESSFUL)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
result = pci_write_config_dword(pcidev,
|
ret = pci_write_config_dword(pcidev,
|
||||||
PCI_BASE_ADDRESS_5,
|
PCI_BASE_ADDRESS_5,
|
||||||
swap_regbase_tmp);
|
swap_regbase_tmp);
|
||||||
if (result != PCIBIOS_SUCCESSFUL)
|
if (ret != PCIBIOS_SUCCESSFUL)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
} else {
|
} else {
|
||||||
plx_regbase_tmp -= 0x80;
|
plx_regbase_tmp -= 0x80;
|
||||||
result = pci_write_config_dword(pcidev,
|
ret = pci_write_config_dword(pcidev,
|
||||||
PCI_BASE_ADDRESS_0,
|
PCI_BASE_ADDRESS_0,
|
||||||
plx_regbase_tmp);
|
plx_regbase_tmp);
|
||||||
if (result != PCIBIOS_SUCCESSFUL)
|
if (ret != PCIBIOS_SUCCESSFUL)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -716,15 +716,15 @@ static int me_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
|
|||||||
|
|
||||||
/* Download firmware and reset card */
|
/* Download firmware and reset card */
|
||||||
if (board->device_id == ME2600_DEVICE_ID) {
|
if (board->device_id == ME2600_DEVICE_ID) {
|
||||||
result = me2600_upload_firmware(dev);
|
ret = me2600_upload_firmware(dev);
|
||||||
if (result < 0)
|
if (ret < 0)
|
||||||
return result;
|
return ret;
|
||||||
}
|
}
|
||||||
me_reset(dev);
|
me_reset(dev);
|
||||||
|
|
||||||
error = comedi_alloc_subdevices(dev, 3);
|
ret = comedi_alloc_subdevices(dev, 3);
|
||||||
if (error)
|
if (ret)
|
||||||
return error;
|
return ret;
|
||||||
|
|
||||||
s = &dev->subdevices[0];
|
s = &dev->subdevices[0];
|
||||||
s->type = COMEDI_SUBD_AI;
|
s->type = COMEDI_SUBD_AI;
|
||||||
|
Reference in New Issue
Block a user