[PATCH 13/15] mmc: bcm2835: Rearrange bcm2835_finish_request()

Stefan Wahren stefan.wahren at i2se.com
Tue Feb 7 12:45:52 PST 2017


This patch removes the unnecessary forward declaration for
bcm2835_finish_request().

Signed-off-by: Stefan Wahren <stefan.wahren at i2se.com>
---
 drivers/mmc/host/bcm2835.c |   57 ++++++++++++++++++++++----------------------
 1 file changed, 28 insertions(+), 29 deletions(-)

diff --git a/drivers/mmc/host/bcm2835.c b/drivers/mmc/host/bcm2835.c
index 4c4bc96..4051028 100644
--- a/drivers/mmc/host/bcm2835.c
+++ b/drivers/mmc/host/bcm2835.c
@@ -290,7 +290,6 @@ static void bcm2835_reset(struct mmc_host *mmc)
 
 static void bcm2835_finish_data(struct bcm2835_host *host);
 static void bcm2835_finish_command(struct bcm2835_host *host);
-static void bcm2835_finish_request(struct bcm2835_host *host);
 
 static void bcm2835_wait_transfer_complete(struct bcm2835_host *host)
 {
@@ -651,6 +650,34 @@ static u32 bcm2835_read_wait_sdcmd(struct bcm2835_host *host, u32 max_ms,
 	return value;
 }
 
+static void bcm2835_finish_request(struct bcm2835_host *host)
+{
+	struct dma_chan *terminate_chan = NULL;
+	struct mmc_request *mrq;
+
+	cancel_delayed_work(&host->timeout_work);
+
+	mrq = host->mrq;
+
+	host->mrq = NULL;
+	host->cmd = NULL;
+	host->data = NULL;
+
+	host->dma_desc = NULL;
+	terminate_chan = host->dma_chan;
+	host->dma_chan = NULL;
+
+	if (terminate_chan) {
+		int err = dmaengine_terminate_all(terminate_chan);
+
+		if (err)
+			dev_err(&host->pdev->dev,
+				"failed to terminate DMA (%d)\n", err);
+	}
+
+	mmc_request_done(host->mmc, mrq);
+}
+
 bool bcm2835_send_command(struct bcm2835_host *host, struct mmc_command *cmd)
 {
 	struct device *dev = &host->pdev->dev;
@@ -1251,34 +1278,6 @@ static void bcm2835_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 	.hw_reset = bcm2835_reset,
 };
 
-static void bcm2835_finish_request(struct bcm2835_host *host)
-{
-	struct dma_chan *terminate_chan = NULL;
-	struct mmc_request *mrq;
-
-	cancel_delayed_work(&host->timeout_work);
-
-	mrq = host->mrq;
-
-	host->mrq = NULL;
-	host->cmd = NULL;
-	host->data = NULL;
-
-	host->dma_desc = NULL;
-	terminate_chan = host->dma_chan;
-	host->dma_chan = NULL;
-
-	if (terminate_chan) {
-		int err = dmaengine_terminate_all(terminate_chan);
-
-		if (err)
-			dev_err(&host->pdev->dev,
-				"failed to terminate DMA (%d)\n", err);
-	}
-
-	mmc_request_done(host->mmc, mrq);
-}
-
 int bcm2835_add_host(struct bcm2835_host *host)
 {
 	struct mmc_host *mmc = host->mmc;
-- 
1.7.9.5




More information about the linux-rpi-kernel mailing list