PCI: Fix OF logic in pci_dma_configure()
This patch fixes a bug introduced by previous commit, which incorrectly checkes the of_node of the end-point device. Instead, it should check the of_node of the host bridge. Fixes: 50230713b639 ("PCI: OF: Move of_pci_dma_configure() to pci_dma_configure()") Reported-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
committed by
Rafael J. Wysocki
parent
29dbe1f0af
commit
768acd64d6
@ -1646,8 +1646,8 @@ static void pci_dma_configure(struct pci_dev *dev)
|
|||||||
{
|
{
|
||||||
struct device *bridge = pci_get_host_bridge_device(dev);
|
struct device *bridge = pci_get_host_bridge_device(dev);
|
||||||
|
|
||||||
if (IS_ENABLED(CONFIG_OF) && dev->dev.of_node) {
|
if (IS_ENABLED(CONFIG_OF) &&
|
||||||
if (bridge->parent)
|
bridge->parent && bridge->parent->of_node) {
|
||||||
of_dma_configure(&dev->dev, bridge->parent->of_node);
|
of_dma_configure(&dev->dev, bridge->parent->of_node);
|
||||||
} else if (has_acpi_companion(bridge)) {
|
} else if (has_acpi_companion(bridge)) {
|
||||||
struct acpi_device *adev = to_acpi_device_node(bridge->fwnode);
|
struct acpi_device *adev = to_acpi_device_node(bridge->fwnode);
|
||||||
|
Reference in New Issue
Block a user