diff mbox

[v2] spi: topcliff-pch: don't hardcode PCI slot to get DMA device

Message ID 1406735430-18943-1-git-send-email-andriy.shevchenko@linux.intel.com (mailing list archive)
State Accepted
Commit a9082105b3ae682373e9aec2f2d87798f50e2a4f
Headers show

Commit Message

Andy Shevchenko July 30, 2014, 3:50 p.m. UTC
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 <andriy.shevchenko@linux.intel.com>
---
 drivers/spi/spi-topcliff-pch.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Mark Brown July 30, 2014, 11:04 p.m. UTC | #1
On Wed, Jul 30, 2014 at 06:50:30PM +0300, Andy Shevchenko wrote:
> The DMA is a function 0 of the multifunction device where SPI host is attached.
> Thus, we may avoid to hardcode PCI slot number.

Applied, thanks.
diff mbox

Patch

diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c
index af51d6a..0a87ec3 100644
--- a/drivers/spi/spi-topcliff-pch.c
+++ b/drivers/spi/spi-topcliff-pch.c
@@ -874,8 +874,8 @@  static void pch_spi_request_dma(struct pch_spi_data *data, int bpw)
 	dma_cap_set(DMA_SLAVE, mask);
 
 	/* Get DMA's dev information */
-	dma_dev = pci_get_bus_and_slot(data->board_dat->pdev->bus->number,
-				       PCI_DEVFN(12, 0));
+	dma_dev = pci_get_slot(data->board_dat->pdev->bus,
+			PCI_DEVFN(PCI_SLOT(data->board_dat->pdev->devfn), 0));
 
 	/* Set Tx DMA */
 	param = &dma->param_tx;