Commit f1c7e710 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Felipe Balbi

usb: dwc3: convert to pcim_enable_device()

This fixes a bug when dwc3_pci_register_phys() fails and leaves device enabled.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent b09e99ee
...@@ -110,7 +110,7 @@ static int dwc3_pci_probe(struct pci_dev *pci, ...@@ -110,7 +110,7 @@ static int dwc3_pci_probe(struct pci_dev *pci,
glue->dev = dev; glue->dev = dev;
ret = pci_enable_device(pci); ret = pcim_enable_device(pci);
if (ret) { if (ret) {
dev_err(dev, "failed to enable pci device\n"); dev_err(dev, "failed to enable pci device\n");
return -ENODEV; return -ENODEV;
...@@ -127,8 +127,7 @@ static int dwc3_pci_probe(struct pci_dev *pci, ...@@ -127,8 +127,7 @@ static int dwc3_pci_probe(struct pci_dev *pci,
dwc3 = platform_device_alloc("dwc3", PLATFORM_DEVID_AUTO); dwc3 = platform_device_alloc("dwc3", PLATFORM_DEVID_AUTO);
if (!dwc3) { if (!dwc3) {
dev_err(dev, "couldn't allocate dwc3 device\n"); dev_err(dev, "couldn't allocate dwc3 device\n");
ret = -ENOMEM; return -ENOMEM;
goto err1;
} }
memset(res, 0x00, sizeof(struct resource) * ARRAY_SIZE(res)); memset(res, 0x00, sizeof(struct resource) * ARRAY_SIZE(res));
...@@ -145,7 +144,7 @@ static int dwc3_pci_probe(struct pci_dev *pci, ...@@ -145,7 +144,7 @@ static int dwc3_pci_probe(struct pci_dev *pci,
ret = platform_device_add_resources(dwc3, res, ARRAY_SIZE(res)); ret = platform_device_add_resources(dwc3, res, ARRAY_SIZE(res));
if (ret) { if (ret) {
dev_err(dev, "couldn't add resources to dwc3 device\n"); dev_err(dev, "couldn't add resources to dwc3 device\n");
goto err1; return ret;
} }
pci_set_drvdata(pci, glue); pci_set_drvdata(pci, glue);
...@@ -167,9 +166,6 @@ static int dwc3_pci_probe(struct pci_dev *pci, ...@@ -167,9 +166,6 @@ static int dwc3_pci_probe(struct pci_dev *pci,
err3: err3:
platform_device_put(dwc3); platform_device_put(dwc3);
err1:
pci_disable_device(pci);
return ret; return ret;
} }
...@@ -180,7 +176,6 @@ static void dwc3_pci_remove(struct pci_dev *pci) ...@@ -180,7 +176,6 @@ static void dwc3_pci_remove(struct pci_dev *pci)
platform_device_unregister(glue->dwc3); platform_device_unregister(glue->dwc3);
platform_device_unregister(glue->usb2_phy); platform_device_unregister(glue->usb2_phy);
platform_device_unregister(glue->usb3_phy); platform_device_unregister(glue->usb3_phy);
pci_disable_device(pci);
} }
static const struct pci_device_id dwc3_pci_id_table[] = { static const struct pci_device_id dwc3_pci_id_table[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment