usb: dwc3: pci: make build-in device properties available
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>
Fri, 22 Apr 2016 08:17:37 +0000 (11:17 +0300)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Thu, 28 Apr 2016 06:01:59 +0000 (09:01 +0300)
Setting the ACPI companion before calling dwc3_pci_quirks.
The ACPI companion will be set unconditionally as the
primary fwnode, overriding any previously set primary
fwnode. This will make sure that any build-in properties
added to the platform device will be added as the secondary
fwnode in cases where also ACPI companion exists.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc3/dwc3-pci.c

index adc1e8a624cb036d8fdb7ceee8d87d153a472eb4..e444e9a1a0c8e525dcad1b47460b5a7d7ff95841 100644 (file)
@@ -170,13 +170,14 @@ static int dwc3_pci_probe(struct pci_dev *pci,
        }
 
        pci_set_drvdata(pci, dwc3);
-       ret = dwc3_pci_quirks(pci);
-       if (ret)
-               goto err;
 
        dwc3->dev.parent = dev;
        ACPI_COMPANION_SET(&dwc3->dev, ACPI_COMPANION(dev));
 
+       ret = dwc3_pci_quirks(pci);
+       if (ret)
+               goto err;
+
        ret = platform_device_add(dwc3);
        if (ret) {
                dev_err(dev, "failed to register dwc3 device\n");