summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3
diff options
context:
space:
mode:
authorFelipe Balbi <felipe.balbi@linux.intel.com>2016-11-16 13:16:22 +0200
committerFelipe Balbi <felipe.balbi@linux.intel.com>2016-11-18 13:54:52 +0200
commit36daf3aa399c08e7cdf499f5562888325f19f92f (patch)
treec1eb238ccb42afe016aee3a720bad616bbcb2a96 /drivers/usb/dwc3
parent28632b44d129cd2dc677475197a01cced307cfc5 (diff)
downloadtalos-obmc-linux-36daf3aa399c08e7cdf499f5562888325f19f92f.tar.gz
talos-obmc-linux-36daf3aa399c08e7cdf499f5562888325f19f92f.zip
usb: dwc3: pci: avoid build warning
dwc3_pci_dsm() is only needed if (PM || PM_SLEEP), we should make sure it's not defined if neither of those is defined. This fixes a randconfig build warning. Acked-by: Arnd Bergmann <arnd@arndb.de> Reported-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r--drivers/usb/dwc3/dwc3-pci.c50
1 files changed, 26 insertions, 24 deletions
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index 8c39ec6522fd..2b0e34ddaae8 100644
--- a/drivers/usb/dwc3/dwc3-pci.c
+++ b/drivers/usb/dwc3/dwc3-pci.c
@@ -166,30 +166,6 @@ static int dwc3_pci_quirks(struct dwc3_pci *dwc)
return 0;
}
-static int dwc3_pci_dsm(struct dwc3_pci *dwc, int param)
-{
- union acpi_object *obj;
- union acpi_object tmp;
- union acpi_object argv4 = ACPI_INIT_DSM_ARGV4(1, &tmp);
-
- if (!dwc->has_dsm_for_pm)
- return 0;
-
- tmp.type = ACPI_TYPE_INTEGER;
- tmp.integer.value = param;
-
- obj = acpi_evaluate_dsm(ACPI_HANDLE(&dwc->pci->dev), dwc->uuid,
- 1, PCI_INTEL_BXT_FUNC_PMU_PWR, &argv4);
- if (!obj) {
- dev_err(&dwc->pci->dev, "failed to evaluate _DSM\n");
- return -EIO;
- }
-
- ACPI_FREE(obj);
-
- return 0;
-}
-
static int dwc3_pci_probe(struct pci_dev *pci,
const struct pci_device_id *id)
{
@@ -293,6 +269,32 @@ static const struct pci_device_id dwc3_pci_id_table[] = {
};
MODULE_DEVICE_TABLE(pci, dwc3_pci_id_table);
+#if defined(CONFIG_PM) || defined(CONFIG_PM_SLEEP)
+static int dwc3_pci_dsm(struct dwc3_pci *dwc, int param)
+{
+ union acpi_object *obj;
+ union acpi_object tmp;
+ union acpi_object argv4 = ACPI_INIT_DSM_ARGV4(1, &tmp);
+
+ if (!dwc->has_dsm_for_pm)
+ return 0;
+
+ tmp.type = ACPI_TYPE_INTEGER;
+ tmp.integer.value = param;
+
+ obj = acpi_evaluate_dsm(ACPI_HANDLE(&dwc->pci->dev), dwc->uuid,
+ 1, PCI_INTEL_BXT_FUNC_PMU_PWR, &argv4);
+ if (!obj) {
+ dev_err(&dwc->pci->dev, "failed to evaluate _DSM\n");
+ return -EIO;
+ }
+
+ ACPI_FREE(obj);
+
+ return 0;
+}
+#endif /* CONFIG_PM || CONFIG_PM_SLEEP */
+
#ifdef CONFIG_PM
static int dwc3_pci_runtime_suspend(struct device *dev)
{
OpenPOWER on IntegriCloud