Skip to content

Commit

Permalink
staging: comedi: s626: remove unneeded local variable in attach_pci()
Browse files Browse the repository at this point in the history
The 'result' variable is only used to check the return from
comedi_pci_enable(). Just reuse the 'ret' variable.

Also, remove the kernel noise and use the error code from
comedi_pci_enable() instead of returning -ENODEV.

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>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Sep 26, 2012
1 parent 7c843aa commit 41f821d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/staging/comedi/drivers/s626.c
Original file line number Diff line number Diff line change
Expand Up @@ -2445,7 +2445,6 @@ static int s626_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
/* uint16_t StartVal; */
/* uint16_t index; */
/* unsigned int data[16]; */
int result;
int i;
int ret;
resource_size_t resourceStart;
Expand All @@ -2458,11 +2457,9 @@ static int s626_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev)
if (alloc_private(dev, sizeof(struct s626_private)) < 0)
return -ENOMEM;

result = comedi_pci_enable(pcidev, dev->board_name);
if (result < 0) {
printk(KERN_ERR "s626_attach: comedi_pci_enable fails\n");
return -ENODEV;
}
ret = comedi_pci_enable(pcidev, dev->board_name);
if (ret)
return ret;
devpriv->got_regions = 1;

resourceStart = pci_resource_start(pcidev, 0);
Expand Down

0 comments on commit 41f821d

Please sign in to comment.