diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2017-03-22 16:08:07 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-03-23 13:39:13 +0100 |
commit | 4a56e413b50c11df35e6c6909312ce7418848b37 (patch) | |
tree | 0450e50790fd6d3e4ce6bcf8e760d440e36f59ec /drivers/usb/dwc3/dwc3-pci.c | |
parent | 96530b3777a7852222ca5ffa5eb20afed1be13bf (diff) | |
download | linux-4a56e413b50c11df35e6c6909312ce7418848b37.tar.gz linux-4a56e413b50c11df35e6c6909312ce7418848b37.tar.bz2 linux-4a56e413b50c11df35e6c6909312ce7418848b37.zip |
usb: dwc3: pci: Switch to devm_acpi_dev_add_driver_gpios()
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>
Diffstat (limited to 'drivers/usb/dwc3/dwc3-pci.c')
-rw-r--r-- | drivers/usb/dwc3/dwc3-pci.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c index cce0a220b6b0..a15ec71d0423 100644 --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c @@ -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 @@ -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); } |