Commit b89e9c87 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mark Brown

spi: dw-mid: remove redundant dmac member

Instead of using that member we prefer to use dma_dev which represents actual
struct device of the DMA device.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent ea092455
...@@ -39,12 +39,13 @@ static bool mid_spi_dma_chan_filter(struct dma_chan *chan, void *param) ...@@ -39,12 +39,13 @@ static bool mid_spi_dma_chan_filter(struct dma_chan *chan, void *param)
{ {
struct dw_spi *dws = param; struct dw_spi *dws = param;
return dws->dmac && (&dws->dmac->dev == chan->device->dev); return dws->dma_dev == chan->device->dev;
} }
static int mid_spi_dma_init(struct dw_spi *dws) static int mid_spi_dma_init(struct dw_spi *dws)
{ {
struct mid_dma *dw_dma = dws->dma_priv; struct mid_dma *dw_dma = dws->dma_priv;
struct pci_dev *dma_dev;
struct intel_mid_dma_slave *rxs, *txs; struct intel_mid_dma_slave *rxs, *txs;
dma_cap_mask_t mask; dma_cap_mask_t mask;
...@@ -52,7 +53,11 @@ static int mid_spi_dma_init(struct dw_spi *dws) ...@@ -52,7 +53,11 @@ static int mid_spi_dma_init(struct dw_spi *dws)
* Get pci device for DMA controller, currently it could only * Get pci device for DMA controller, currently it could only
* be the DMA controller of Medfield * be the DMA controller of Medfield
*/ */
dws->dmac = pci_get_device(PCI_VENDOR_ID_INTEL, 0x0827, NULL); dma_dev = pci_get_device(PCI_VENDOR_ID_INTEL, 0x0827, NULL);
if (!dma_dev)
return -ENODEV;
dws->dma_dev = &dma_dev->dev;
dma_cap_zero(mask); dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask); dma_cap_set(DMA_SLAVE, mask);
...@@ -81,8 +86,7 @@ static int mid_spi_dma_init(struct dw_spi *dws) ...@@ -81,8 +86,7 @@ static int mid_spi_dma_init(struct dw_spi *dws)
free_rxchan: free_rxchan:
dma_release_channel(dws->rxchan); dma_release_channel(dws->rxchan);
err_exit: err_exit:
return -1; return -EBUSY;
} }
static void mid_spi_dma_exit(struct dw_spi *dws) static void mid_spi_dma_exit(struct dw_spi *dws)
......
...@@ -140,7 +140,6 @@ struct dw_spi { ...@@ -140,7 +140,6 @@ struct dw_spi {
dma_addr_t dma_addr; /* phy address of the Data register */ dma_addr_t dma_addr; /* phy address of the Data register */
struct dw_spi_dma_ops *dma_ops; struct dw_spi_dma_ops *dma_ops;
void *dma_priv; /* platform relate info */ void *dma_priv; /* platform relate info */
struct pci_dev *dmac;
/* Bus interface info */ /* Bus interface info */
void *priv; void *priv;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment