Commit 6ccff65a authored by Ulf Hansson's avatar Ulf Hansson
Browse files

mmc: sdricoh_cs: Drop redundant in-parameter to sdricoh_query_status()



The in-parameter timeout is always set to TRANSFER_TIMEOUT by the callers
of sdricoh_query_status(), hence let's drop it.

Cc: Sascha Sommer <saschasommer@freenet.de>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Link: https://lore.kernel.org/r/20200414161413.3036-12-ulf.hansson@linaro.org
parent 4b4c7dae
Loading
Loading
Loading
Loading
+7 −8
Original line number Original line Diff line number Diff line
@@ -123,11 +123,13 @@ static inline unsigned int sdricoh_readb(struct sdricoh_host *host,
	return value;
	return value;
}
}


static int sdricoh_query_status(struct sdricoh_host *host, unsigned int wanted,
static int sdricoh_query_status(struct sdricoh_host *host, unsigned int wanted)
				unsigned int timeout){
{
	unsigned int loop;
	unsigned int loop;
	unsigned int status = 0;
	unsigned int status = 0;
	unsigned int timeout = TRANSFER_TIMEOUT;
	struct device *dev = host->dev;
	struct device *dev = host->dev;

	for (loop = 0; loop < timeout; loop++) {
	for (loop = 0; loop < timeout; loop++) {
		status = sdricoh_readl(host, R21C_STATUS);
		status = sdricoh_readl(host, R21C_STATUS);
		sdricoh_writel(host, R2E4_STATUS_RESP, status);
		sdricoh_writel(host, R2E4_STATUS_RESP, status);
@@ -215,8 +217,7 @@ static int sdricoh_blockio(struct sdricoh_host *host, int read,
	u32 data = 0;
	u32 data = 0;
	/* wait until the data is available */
	/* wait until the data is available */
	if (read) {
	if (read) {
		if (sdricoh_query_status(host, STATUS_READY_TO_READ,
		if (sdricoh_query_status(host, STATUS_READY_TO_READ))
						TRANSFER_TIMEOUT))
			return -ETIMEDOUT;
			return -ETIMEDOUT;
		sdricoh_writel(host, R21C_STATUS, 0x18);
		sdricoh_writel(host, R21C_STATUS, 0x18);
		/* read data */
		/* read data */
@@ -232,8 +233,7 @@ static int sdricoh_blockio(struct sdricoh_host *host, int read,
			}
			}
		}
		}
	} else {
	} else {
		if (sdricoh_query_status(host, STATUS_READY_TO_WRITE,
		if (sdricoh_query_status(host, STATUS_READY_TO_WRITE))
						TRANSFER_TIMEOUT))
			return -ETIMEDOUT;
			return -ETIMEDOUT;
		sdricoh_writel(host, R21C_STATUS, 0x18);
		sdricoh_writel(host, R21C_STATUS, 0x18);
		/* write data */
		/* write data */
@@ -323,8 +323,7 @@ static void sdricoh_request(struct mmc_host *mmc, struct mmc_request *mrq)


		sdricoh_writel(host, R208_DATAIO, 1);
		sdricoh_writel(host, R208_DATAIO, 1);


		if (sdricoh_query_status(host, STATUS_TRANSFER_FINISHED,
		if (sdricoh_query_status(host, STATUS_TRANSFER_FINISHED)) {
					TRANSFER_TIMEOUT)) {
			dev_err(dev, "sdricoh_request: transfer end error\n");
			dev_err(dev, "sdricoh_request: transfer end error\n");
			cmd->error = -EINVAL;
			cmd->error = -EINVAL;
		}
		}