Skip to content
This repository has been archived by the owner on Apr 13, 2019. It is now read-only.

Commit

Permalink
dev->dma_ops can be NULL?
Browse files Browse the repository at this point in the history
  • Loading branch information
palmer-dabbelt committed Nov 8, 2017
1 parent 8c38a38 commit 160fa84
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/pci/host/pcie-xilinx.c
Expand Up @@ -211,7 +211,11 @@ static int xilinx_pcie_dma_supported(struct device *dev, u64 mask)
static int xilinx_pcie_add_dev(struct pci_bus *bus, struct pci_dev *dev)
{
struct xilinx_pcie_port *port = bus->sysdata;
dev->dev.dma_ops = &port->child_ops;
if (dev->dev.dma_ops != NULL) {
memcpy(&port->child_ops, dev->dev.dma_ops, sizeof(port->child_ops));
port->child_ops.dma_supported = xilinx_pcie_dma_supported;
dev->dev.dma_ops = &port->child_ops;
}
return 0;
}

Expand Down Expand Up @@ -684,10 +688,6 @@ static int xilinx_pcie_probe(struct platform_device *pdev)
bridge->map_irq = of_irq_parse_and_map_pci;
bridge->swizzle_irq = pci_common_swizzle;

// Setup DMA ops for child devices
memcpy(&port->child_ops, dev->dma_ops, sizeof(struct dma_map_ops));
port->child_ops.dma_supported = xilinx_pcie_dma_supported;

#ifdef CONFIG_PCI_MSI
xilinx_pcie_msi_chip.dev = dev;
bridge->msi = &xilinx_pcie_msi_chip;
Expand Down

0 comments on commit 160fa84

Please sign in to comment.