Skip to contentSkip to conversation

pch_uart: don't hardcode PCI slot to get DMA device

PATCH New Andy Shevchenko 1 participant 1 message Jul 30, 2014 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pch_uart: don't hardcode PCI slot to get DMA device

The DMA is a function 0 of the multifunction device where SPI host is attached. Thus, we may avoid to hardcode PCI slot number.

---
 drivers/tty/serial/pch_uart.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/tty/serial/pch_uart.c +4 -3
index 2f06e5a..ea4ffc2 100644
@@ -736,9 +736,10 @@ static void pch_request_dma(struct uart_port *port)
 	dma_cap_zero(mask);
 	dma_cap_set(DMA_SLAVE, mask);
 
-	dma_dev = pci_get_bus_and_slot(priv->pdev->bus->number,
-				       PCI_DEVFN(0xa, 0)); /* Get DMA's dev
-								information */
+	/* Get DMA's dev information */
+	dma_dev = pci_get_slot(priv->pdev->bus,
+			PCI_DEVFN(PCI_SLOT(priv->pdev->devfn), 0));
+
 	/* Set Tx DMA */
 	param = &priv->param_tx;
 	param->dma_dev = &dma_dev->dev;
Signature · 1 line
2.0.1