Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c24b2602 authored by Marc Pignat's avatar Marc Pignat Committed by Linus Torvalds
Browse files

spi: use simplified spi_sync() calling convention



Given the patch which simplifies the spi_sync calling convention, this one
updates the callers of that routine which tried using it according to the
previous specification.  (Most didn't.)

Signed-off-by: default avatarMarc Pignat <marc.pignat@hevs.ch>
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 9b938b74
Loading
Loading
Loading
Loading
+6 −7
Original line number Original line Diff line number Diff line
@@ -267,13 +267,12 @@ static int ads7846_read12_ser(struct device *dev, unsigned command)
	ts->irq_disabled = 0;
	ts->irq_disabled = 0;
	enable_irq(spi->irq);
	enable_irq(spi->irq);


	if (req->msg.status)
	if (status == 0) {
		status = req->msg.status;

		/* on-wire is a must-ignore bit, a BE12 value, then padding */
		/* on-wire is a must-ignore bit, a BE12 value, then padding */
		sample = be16_to_cpu(req->sample);
		sample = be16_to_cpu(req->sample);
		sample = sample >> 3;
		sample = sample >> 3;
		sample &= 0x0fff;
		sample &= 0x0fff;
	}


	kfree(req);
	kfree(req);
	return status ? status : sample;
	return status ? status : sample;
+0 −10
Original line number Original line Diff line number Diff line
@@ -176,8 +176,6 @@ mmc_spi_readbytes(struct mmc_spi_host *host, unsigned len)
				DMA_FROM_DEVICE);
				DMA_FROM_DEVICE);


	status = spi_sync(host->spi, &host->readback);
	status = spi_sync(host->spi, &host->readback);
	if (status == 0)
		status = host->readback.status;


	if (host->dma_dev)
	if (host->dma_dev)
		dma_sync_single_for_cpu(host->dma_dev,
		dma_sync_single_for_cpu(host->dma_dev,
@@ -480,8 +478,6 @@ mmc_spi_command_send(struct mmc_spi_host *host,
				DMA_BIDIRECTIONAL);
				DMA_BIDIRECTIONAL);
	}
	}
	status = spi_sync(host->spi, &host->m);
	status = spi_sync(host->spi, &host->m);
	if (status == 0)
		status = host->m.status;


	if (host->dma_dev)
	if (host->dma_dev)
		dma_sync_single_for_cpu(host->dma_dev,
		dma_sync_single_for_cpu(host->dma_dev,
@@ -624,8 +620,6 @@ mmc_spi_writeblock(struct mmc_spi_host *host, struct spi_transfer *t)
				DMA_BIDIRECTIONAL);
				DMA_BIDIRECTIONAL);


	status = spi_sync(spi, &host->m);
	status = spi_sync(spi, &host->m);
	if (status == 0)
		status = host->m.status;


	if (status != 0) {
	if (status != 0) {
		dev_dbg(&spi->dev, "write error (%d)\n", status);
		dev_dbg(&spi->dev, "write error (%d)\n", status);
@@ -726,8 +720,6 @@ mmc_spi_readblock(struct mmc_spi_host *host, struct spi_transfer *t)
		}
		}


		status = spi_sync(spi, &host->m);
		status = spi_sync(spi, &host->m);
		if (status == 0)
			status = host->m.status;


		if (host->dma_dev) {
		if (host->dma_dev) {
			dma_sync_single_for_cpu(host->dma_dev,
			dma_sync_single_for_cpu(host->dma_dev,
@@ -905,8 +897,6 @@ mmc_spi_data_do(struct mmc_spi_host *host, struct mmc_command *cmd,
					DMA_BIDIRECTIONAL);
					DMA_BIDIRECTIONAL);


		tmp = spi_sync(spi, &host->m);
		tmp = spi_sync(spi, &host->m);
		if (tmp == 0)
			tmp = host->m.status;


		if (host->dma_dev)
		if (host->dma_dev)
			dma_sync_single_for_cpu(host->dma_dev,
			dma_sync_single_for_cpu(host->dma_dev,
+3 −9
Original line number Original line Diff line number Diff line
@@ -89,13 +89,9 @@ static int max6902_get_reg(struct device *dev, unsigned char address,


	/* do the i/o */
	/* do the i/o */
	status = spi_sync(spi, &message);
	status = spi_sync(spi, &message);
	if (status == 0)
		status = message.status;
	else
		return status;


	if (status == 0)
		*data = chip->rx_buf[1];
		*data = chip->rx_buf[1];

	return status;
	return status;
}
}


@@ -125,9 +121,7 @@ static int max6902_get_datetime(struct device *dev, struct rtc_time *dt)


	/* do the i/o */
	/* do the i/o */
	status = spi_sync(spi, &message);
	status = spi_sync(spi, &message);
	if (status == 0)
	if (status)
		status = message.status;
	else
		return status;
		return status;


	/* The chip sends data in this order:
	/* The chip sends data in this order: