[PATCH 1/6] mmc: bcm2835: replace pio_limit with define

Stefan Wahren stefan.wahren at i2se.com
Sat Feb 11 14:48:31 PST 2017


Since the pio_limit never changes we better use a define.

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

diff --git a/drivers/mmc/host/bcm2835.c b/drivers/mmc/host/bcm2835.c
index 20bc571..1704082 100644
--- a/drivers/mmc/host/bcm2835.c
+++ b/drivers/mmc/host/bcm2835.c
@@ -150,6 +150,8 @@
 #define FIFO_WRITE_THRESHOLD	4
 #define SDDATA_FIFO_PIO_BURST	8
 
+#define PIO_THRESHOLD	1  /* Maximum block count for PIO (0 = always DMA) */
+
 struct bcm2835_host {
 	spinlock_t		lock;
 	struct mutex		mutex;
@@ -196,8 +198,6 @@ struct bcm2835_host {
 	struct page		*drain_page;
 	u32			drain_offset;
 	bool			use_dma;
-
-	u32	pio_limit;	/* Maximum block count for PIO (0 = DMA) */
 };
 
 static void bcm2835_dumpcmd(struct bcm2835_host *host, struct mmc_command *cmd,
@@ -1202,8 +1202,7 @@ static void bcm2835_request(struct mmc_host *mmc, struct mmc_request *mrq)
 		return;
 	}
 
-	if (host->use_dma && mrq->data &&
-	    (mrq->data->blocks > host->pio_limit))
+	if (host->use_dma && mrq->data && (mrq->data->blocks > PIO_THRESHOLD))
 		bcm2835_prepare_dma(host, mrq->data);
 
 	mutex_lock(&host->mutex);
@@ -1361,8 +1360,8 @@ int bcm2835_add_host(struct bcm2835_host *host)
 	}
 
 	pio_limit_string[0] = '\0';
-	if (host->use_dma && (host->pio_limit > 0))
-		sprintf(pio_limit_string, " (>%d)", host->pio_limit);
+	if (host->use_dma && (PIO_THRESHOLD > 0))
+		sprintf(pio_limit_string, " (>%d)", PIO_THRESHOLD);
 	dev_info(dev, "loaded - DMA %s%s\n",
 		 host->use_dma ? "enabled" : "disabled", pio_limit_string);
 
@@ -1388,7 +1387,6 @@ static int bcm2835_probe(struct platform_device *pdev)
 	host = mmc_priv(mmc);
 	host->mmc = mmc;
 	host->pdev = pdev;
-	host->pio_limit = 1;
 	spin_lock_init(&host->lock);
 
 	iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-- 
1.7.9.5




More information about the linux-rpi-kernel mailing list