From: Andy Shevchenko Date: Wed, 30 Jul 2014 15:59:52 +0000 (+0300) Subject: pch_uart: don't hardcode PCI slot to get DMA device X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8368d6a2b73900507ad7632b8057532d0c2ee07f;p=linux-beck.git 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. Signed-off-by: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c index 2f06e5a71396..ea4ffc2ebb2f 100644 --- a/drivers/tty/serial/pch_uart.c +++ b/drivers/tty/serial/pch_uart.c @@ -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;