]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: comedi: cb_pcidas: move the "find pci" dev_printk messages
authorH Hartley Sweeten <hartleys@visionengravers.com>
Wed, 27 Jun 2012 01:01:51 +0000 (18:01 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Jul 2012 22:23:53 +0000 (15:23 -0700)
Move the dev_printk messages associated with the "find pci device"
from the *attach function into the *find_pci_device function.

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>
drivers/staging/comedi/drivers/cb_pcidas.c

index a2901bb50e010b3d14d96c5ab67f84a23b8c6c24..9f883dd77b34c3c319a373704ef3bea8b57f64cc 100644 (file)
@@ -1537,10 +1537,15 @@ static struct pci_dev *cb_pcidas_find_pci_device(struct comedi_device *dev,
                                        continue;
                                }
                        }
+                       dev_dbg(dev->class_dev,
+                               "Found %s on bus %i, slot %i\n",
+                               thisboard->name,
+                               pcidev->bus->number, PCI_SLOT(pcidev->devfn));
                        dev->board_ptr = thisboard;
                        return pcidev;
                }
        }
+       dev_err(dev->class_dev, "No supported card found\n");
        return NULL;
 }
 
@@ -1558,15 +1563,9 @@ static int cb_pcidas_attach(struct comedi_device *dev,
        devpriv = dev->private;
 
        devpriv->pci_dev = cb_pcidas_find_pci_device(dev, it);
-       if (!devpriv->pci_dev) {
-               dev_err(dev->class_dev, "No supported card found\n");
+       if (!devpriv->pci_dev)
                return -EIO;
-       }
-
        thisboard = comedi_board(dev);
-       dev_dbg(dev->class_dev, "Found %s on bus %i, slot %i\n",
-               thisboard->name, devpriv->pci_dev->bus->number,
-               PCI_SLOT(devpriv->pci_dev->devfn));
 
        if (comedi_pci_enable(devpriv->pci_dev, "cb_pcidas")) {
                dev_err(dev->class_dev,