usb: dwc3: pci: Set the swnode from inside dwc3_pci_quirks()

The quirk handling may need to set some different properties
which means using a different swnode, move the setting of the swnode
to inside dwc3_pci_quirks() so that the quirk handling can choose
a different swnode.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20220213130524.18748-4-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Hans de Goede 2022-02-13 14:05:18 +01:00 коммит произвёл Greg Kroah-Hartman
Родитель d016cbe4d7
Коммит e285cb4039
1 изменённых файлов: 4 добавлений и 7 удалений

Просмотреть файл

@ -173,7 +173,8 @@ static const struct software_node dwc3_pci_amd_mr_swnode = {
.properties = dwc3_pci_mr_properties,
};
static int dwc3_pci_quirks(struct dwc3_pci *dwc)
static int dwc3_pci_quirks(struct dwc3_pci *dwc,
const struct software_node *swnode)
{
struct pci_dev *pdev = dwc->pci;
@ -230,7 +231,7 @@ static int dwc3_pci_quirks(struct dwc3_pci *dwc)
}
}
return 0;
return device_add_software_node(&dwc->dwc3->dev, swnode);
}
#ifdef CONFIG_PM
@ -295,11 +296,7 @@ static int dwc3_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
dwc->dwc3->dev.parent = dev;
ACPI_COMPANION_SET(&dwc->dwc3->dev, ACPI_COMPANION(dev));
ret = device_add_software_node(&dwc->dwc3->dev, (void *)id->driver_data);
if (ret < 0)
goto err;
ret = dwc3_pci_quirks(dwc);
ret = dwc3_pci_quirks(dwc, (void *)id->driver_data);
if (ret)
goto err;