Skip to content

Commit

Permalink
usb: dwc3: pci: Switch to devm_acpi_dev_add_driver_gpios()
Browse files Browse the repository at this point in the history
Switch to use managed variant of acpi_dev_add_driver_gpios() to simplify
error path and fix potentially wrong assignment if ->probe() fails.

While here, add a debug message in case assignment fails to allow user
see the cause of a potential issue.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Andy Shevchenko authored and Linus Walleij committed Mar 23, 2017
1 parent 96530b3 commit 4a56e41
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/usb/dwc3/dwc3-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,10 @@ static int dwc3_pci_quirks(struct dwc3_pci *dwc)
if (pdev->device == PCI_DEVICE_ID_INTEL_BYT) {
struct gpio_desc *gpio;

acpi_dev_add_driver_gpios(ACPI_COMPANION(&pdev->dev),
ret = devm_acpi_dev_add_driver_gpios(&pdev->dev,
acpi_dwc3_byt_gpios);
if (ret)
dev_dbg(&pdev->dev, "failed to add mapping table\n");

/*
* These GPIOs will turn on the USB2 PHY. Note that we have to
Expand Down Expand Up @@ -242,7 +244,6 @@ static void dwc3_pci_remove(struct pci_dev *pci)

device_init_wakeup(&pci->dev, false);
pm_runtime_get(&pci->dev);
acpi_dev_remove_driver_gpios(ACPI_COMPANION(&pci->dev));
platform_device_unregister(dwc->dwc3);
}

Expand Down

0 comments on commit 4a56e41

Please sign in to comment.