aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/dwc3-pci.c
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2012-10-29 13:09:53 -0400
committerFelipe Balbi <balbi@ti.com>2012-10-31 09:18:52 -0400
commit124dafde8f8174caf5cef1c3eaba001657d66f4f (patch)
tree6fc02aec00e90e333db788691b48910ddb38e34c /drivers/usb/dwc3/dwc3-pci.c
parent6f115e45a09846ae84154735e6215622e2e8e535 (diff)
usb: dwc3: remove custom unique id handling
The lockless implementation of the unique id is quite impressive (:P) but dirver's core can handle it, we can remove it and make our code a little smaller. Cc: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3/dwc3-pci.c')
-rw-r--r--drivers/usb/dwc3/dwc3-pci.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index 94f550e37f98..13962597f3fe 100644
--- a/drivers/usb/dwc3/dwc3-pci.c
+++ b/drivers/usb/dwc3/dwc3-pci.c
@@ -119,7 +119,6 @@ static int __devinit dwc3_pci_probe(struct pci_dev *pci,
119 struct platform_device *dwc3; 119 struct platform_device *dwc3;
120 struct dwc3_pci *glue; 120 struct dwc3_pci *glue;
121 int ret = -ENOMEM; 121 int ret = -ENOMEM;
122 int devid;
123 struct device *dev = &pci->dev; 122 struct device *dev = &pci->dev;
124 123
125 glue = devm_kzalloc(dev, sizeof(*glue), GFP_KERNEL); 124 glue = devm_kzalloc(dev, sizeof(*glue), GFP_KERNEL);
@@ -145,13 +144,7 @@ static int __devinit dwc3_pci_probe(struct pci_dev *pci,
145 return ret; 144 return ret;
146 } 145 }
147 146
148 devid = dwc3_get_device_id(); 147 dwc3 = platform_device_alloc("dwc3", PLATFORM_DEVID_AUTO);
149 if (devid < 0) {
150 ret = -ENOMEM;
151 goto err1;
152 }
153
154 dwc3 = platform_device_alloc("dwc3", devid);
155 if (!dwc3) { 148 if (!dwc3) {
156 dev_err(dev, "couldn't allocate dwc3 device\n"); 149 dev_err(dev, "couldn't allocate dwc3 device\n");
157 ret = -ENOMEM; 150 ret = -ENOMEM;
@@ -172,7 +165,7 @@ static int __devinit dwc3_pci_probe(struct pci_dev *pci,
172 ret = platform_device_add_resources(dwc3, res, ARRAY_SIZE(res)); 165 ret = platform_device_add_resources(dwc3, res, ARRAY_SIZE(res));
173 if (ret) { 166 if (ret) {
174 dev_err(dev, "couldn't add resources to dwc3 device\n"); 167 dev_err(dev, "couldn't add resources to dwc3 device\n");
175 goto err2; 168 goto err1;
176 } 169 }
177 170
178 pci_set_drvdata(pci, glue); 171 pci_set_drvdata(pci, glue);
@@ -195,10 +188,6 @@ static int __devinit dwc3_pci_probe(struct pci_dev *pci,
195err3: 188err3:
196 pci_set_drvdata(pci, NULL); 189 pci_set_drvdata(pci, NULL);
197 platform_device_put(dwc3); 190 platform_device_put(dwc3);
198
199err2:
200 dwc3_put_device_id(devid);
201
202err1: 191err1:
203 pci_disable_device(pci); 192 pci_disable_device(pci);
204 193
@@ -211,7 +200,6 @@ static void __devexit dwc3_pci_remove(struct pci_dev *pci)
211 200
212 platform_device_unregister(glue->usb2_phy); 201 platform_device_unregister(glue->usb2_phy);
213 platform_device_unregister(glue->usb3_phy); 202 platform_device_unregister(glue->usb3_phy);
214 dwc3_put_device_id(glue->dwc3->id);
215 platform_device_unregister(glue->dwc3); 203 platform_device_unregister(glue->dwc3);
216 pci_set_drvdata(pci, NULL); 204 pci_set_drvdata(pci, NULL);
217 pci_disable_device(pci); 205 pci_disable_device(pci);