]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
usb: chipidea: move to pcim_* functions
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 13 Jun 2013 15:00:02 +0000 (18:00 +0300)
committerJason Liu <r64343@freescale.com>
Wed, 30 Oct 2013 01:54:12 +0000 (09:54 +0800)
This patch makes error path cleaner and probe function tidier.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/chipidea/ci13xxx_pci.c

index 15cef1e242a26649d42d83c67024edce4a60b393..559b01cdca8920564ac0330bb558d6375fdf8f31 100644 (file)
@@ -61,14 +61,13 @@ static int ci13xxx_pci_probe(struct pci_dev *pdev,
                return -ENODEV;
        }
 
-       retval = pci_enable_device(pdev);
+       retval = pcim_enable_device(pdev);
        if (retval)
-               goto done;
+               return retval;
 
        if (!pdev->irq) {
                dev_err(&pdev->dev, "No IRQ, check BIOS/PCI setup!");
-               retval = -ENODEV;
-               goto disable_device;
+               return -ENODEV;
        }
 
        pci_set_power_state(pdev, PCI_D0);
@@ -85,18 +84,12 @@ static int ci13xxx_pci_probe(struct pci_dev *pdev,
        plat_ci = ci13xxx_add_device(&pdev->dev, res, nres, platdata);
        if (IS_ERR(plat_ci)) {
                dev_err(&pdev->dev, "ci13xxx_add_device failed!\n");
-               retval = PTR_ERR(plat_ci);
-               goto disable_device;
+               return PTR_ERR(plat_ci);
        }
 
        pci_set_drvdata(pdev, plat_ci);
 
        return 0;
-
- disable_device:
-       pci_disable_device(pdev);
- done:
-       return retval;
 }
 
 /**
@@ -112,7 +105,6 @@ static void ci13xxx_pci_remove(struct pci_dev *pdev)
        struct platform_device *plat_ci = pci_get_drvdata(pdev);
 
        ci13xxx_remove_device(plat_ci);
-       pci_disable_device(pdev);
 }
 
 /**