diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2013-06-13 11:00:02 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-17 16:47:25 -0400 |
commit | 8b2379b49a9b7476b8421a6a404de30cd304cca1 (patch) | |
tree | ab8d46cd8fceb2d9047cc571bdbf6c8524661f68 /drivers | |
parent | 54b448e5e4d2215974b959a97ead55bb9218904c (diff) |
usb: chipidea: move to pcim_* functions
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/chipidea/ci13xxx_pci.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/usb/chipidea/ci13xxx_pci.c b/drivers/usb/chipidea/ci13xxx_pci.c index 59fab90ee731..7cf549561b07 100644 --- a/drivers/usb/chipidea/ci13xxx_pci.c +++ b/drivers/usb/chipidea/ci13xxx_pci.c | |||
@@ -61,14 +61,13 @@ static int ci13xxx_pci_probe(struct pci_dev *pdev, | |||
61 | return -ENODEV; | 61 | return -ENODEV; |
62 | } | 62 | } |
63 | 63 | ||
64 | retval = pci_enable_device(pdev); | 64 | retval = pcim_enable_device(pdev); |
65 | if (retval) | 65 | if (retval) |
66 | goto done; | 66 | return retval; |
67 | 67 | ||
68 | if (!pdev->irq) { | 68 | if (!pdev->irq) { |
69 | dev_err(&pdev->dev, "No IRQ, check BIOS/PCI setup!"); | 69 | dev_err(&pdev->dev, "No IRQ, check BIOS/PCI setup!"); |
70 | retval = -ENODEV; | 70 | return -ENODEV; |
71 | goto disable_device; | ||
72 | } | 71 | } |
73 | 72 | ||
74 | pci_set_master(pdev); | 73 | pci_set_master(pdev); |
@@ -84,18 +83,12 @@ static int ci13xxx_pci_probe(struct pci_dev *pdev, | |||
84 | plat_ci = ci13xxx_add_device(&pdev->dev, res, nres, platdata); | 83 | plat_ci = ci13xxx_add_device(&pdev->dev, res, nres, platdata); |
85 | if (IS_ERR(plat_ci)) { | 84 | if (IS_ERR(plat_ci)) { |
86 | dev_err(&pdev->dev, "ci13xxx_add_device failed!\n"); | 85 | dev_err(&pdev->dev, "ci13xxx_add_device failed!\n"); |
87 | retval = PTR_ERR(plat_ci); | 86 | return PTR_ERR(plat_ci); |
88 | goto disable_device; | ||
89 | } | 87 | } |
90 | 88 | ||
91 | pci_set_drvdata(pdev, plat_ci); | 89 | pci_set_drvdata(pdev, plat_ci); |
92 | 90 | ||
93 | return 0; | 91 | return 0; |
94 | |||
95 | disable_device: | ||
96 | pci_disable_device(pdev); | ||
97 | done: | ||
98 | return retval; | ||
99 | } | 92 | } |
100 | 93 | ||
101 | /** | 94 | /** |
@@ -111,7 +104,6 @@ static void ci13xxx_pci_remove(struct pci_dev *pdev) | |||
111 | struct platform_device *plat_ci = pci_get_drvdata(pdev); | 104 | struct platform_device *plat_ci = pci_get_drvdata(pdev); |
112 | 105 | ||
113 | ci13xxx_remove_device(plat_ci); | 106 | ci13xxx_remove_device(plat_ci); |
114 | pci_disable_device(pdev); | ||
115 | } | 107 | } |
116 | 108 | ||
117 | /** | 109 | /** |