Browse Source

spi: rspi: Pass spi_master pointer to rspi_release_dma()

rspi_release_dma() doesn't need access to any fields in the driver private
data, except for the pointer to the SPI master object. Hence just pass the
needed pointer.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@linaro.org>
Geert Uytterhoeven 11 years ago
parent
commit
afcc98dec9
1 changed files with 7 additions and 7 deletions
  1. 7 7
      drivers/spi/spi-rspi.c

+ 7 - 7
drivers/spi/spi-rspi.c

@@ -926,19 +926,19 @@ static int rspi_request_dma(struct device *dev, struct spi_master *master,
 	return 0;
 	return 0;
 }
 }
 
 
-static void rspi_release_dma(struct rspi_data *rspi)
+static void rspi_release_dma(struct spi_master *master)
 {
 {
-	if (rspi->master->dma_tx)
-		dma_release_channel(rspi->master->dma_tx);
-	if (rspi->master->dma_rx)
-		dma_release_channel(rspi->master->dma_rx);
+	if (master->dma_tx)
+		dma_release_channel(master->dma_tx);
+	if (master->dma_rx)
+		dma_release_channel(master->dma_rx);
 }
 }
 
 
 static int rspi_remove(struct platform_device *pdev)
 static int rspi_remove(struct platform_device *pdev)
 {
 {
 	struct rspi_data *rspi = platform_get_drvdata(pdev);
 	struct rspi_data *rspi = platform_get_drvdata(pdev);
 
 
-	rspi_release_dma(rspi);
+	rspi_release_dma(rspi->master);
 	pm_runtime_disable(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
 
 
 	return 0;
 	return 0;
@@ -1140,7 +1140,7 @@ static int rspi_probe(struct platform_device *pdev)
 	return 0;
 	return 0;
 
 
 error3:
 error3:
-	rspi_release_dma(rspi);
+	rspi_release_dma(master);
 error2:
 error2:
 	pm_runtime_disable(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
 error1:
 error1: