summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-dw-mid.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2014-09-12 15:12:00 +0300
committerMark Brown <broonie@kernel.org>2014-09-13 17:01:57 +0100
commitb89e9c87dd3b118f0b953d349e5bede1505e3bc5 (patch)
tree05c8929d83e4218de5b54bf28cce60f39b2eba10 /drivers/spi/spi-dw-mid.c
parentea092455d713d28c0b74a2ebe022524025d97491 (diff)
downloadop-kernel-dev-b89e9c87dd3b118f0b953d349e5bede1505e3bc5.zip
op-kernel-dev-b89e9c87dd3b118f0b953d349e5bede1505e3bc5.tar.gz
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-dw-mid.c')
-rw-r--r--drivers/spi/spi-dw-mid.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/spi/spi-dw-mid.c b/drivers/spi/spi-dw-mid.c
index deba3c4..9ae2eaa 100644
--- a/drivers/spi/spi-dw-mid.c
+++ b/drivers/spi/spi-dw-mid.c
@@ -39,12 +39,13 @@ static bool mid_spi_dma_chan_filter(struct dma_chan *chan, void *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)
{
struct mid_dma *dw_dma = dws->dma_priv;
+ struct pci_dev *dma_dev;
struct intel_mid_dma_slave *rxs, *txs;
dma_cap_mask_t mask;
@@ -52,7 +53,11 @@ static int mid_spi_dma_init(struct dw_spi *dws)
* Get pci device for DMA controller, currently it could only
* 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_set(DMA_SLAVE, mask);
@@ -81,8 +86,7 @@ static int mid_spi_dma_init(struct dw_spi *dws)
free_rxchan:
dma_release_channel(dws->rxchan);
err_exit:
- return -1;
-
+ return -EBUSY;
}
static void mid_spi_dma_exit(struct dw_spi *dws)
OpenPOWER on IntegriCloud