aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/touchscreen/ads7846.c13
-rw-r--r--drivers/mmc/host/mmc_spi.c10
-rw-r--r--drivers/rtc/rtc-max6902.c12
3 files changed, 9 insertions, 26 deletions
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index f59aecf5ec15..fd9c5d51870a 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -267,13 +267,12 @@ static int ads7846_read12_ser(struct device *dev, unsigned command)
267 ts->irq_disabled = 0; 267 ts->irq_disabled = 0;
268 enable_irq(spi->irq); 268 enable_irq(spi->irq);
269 269
270 if (req->msg.status) 270 if (status == 0) {
271 status = req->msg.status; 271 /* on-wire is a must-ignore bit, a BE12 value, then padding */
272 272 sample = be16_to_cpu(req->sample);
273 /* on-wire is a must-ignore bit, a BE12 value, then padding */ 273 sample = sample >> 3;
274 sample = be16_to_cpu(req->sample); 274 sample &= 0x0fff;
275 sample = sample >> 3; 275 }
276 sample &= 0x0fff;
277 276
278 kfree(req); 277 kfree(req);
279 return status ? status : sample; 278 return status ? status : sample;
diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c
index a6469218f194..365024b83d3d 100644
--- a/drivers/mmc/host/mmc_spi.c
+++ b/drivers/mmc/host/mmc_spi.c
@@ -176,8 +176,6 @@ mmc_spi_readbytes(struct mmc_spi_host *host, unsigned len)
176 DMA_FROM_DEVICE); 176 DMA_FROM_DEVICE);
177 177
178 status = spi_sync(host->spi, &host->readback); 178 status = spi_sync(host->spi, &host->readback);
179 if (status == 0)
180 status = host->readback.status;
181 179
182 if (host->dma_dev) 180 if (host->dma_dev)
183 dma_sync_single_for_cpu(host->dma_dev, 181 dma_sync_single_for_cpu(host->dma_dev,
@@ -480,8 +478,6 @@ mmc_spi_command_send(struct mmc_spi_host *host,
480 DMA_BIDIRECTIONAL); 478 DMA_BIDIRECTIONAL);
481 } 479 }
482 status = spi_sync(host->spi, &host->m); 480 status = spi_sync(host->spi, &host->m);
483 if (status == 0)
484 status = host->m.status;
485 481
486 if (host->dma_dev) 482 if (host->dma_dev)
487 dma_sync_single_for_cpu(host->dma_dev, 483 dma_sync_single_for_cpu(host->dma_dev,
@@ -624,8 +620,6 @@ mmc_spi_writeblock(struct mmc_spi_host *host, struct spi_transfer *t)
624 DMA_BIDIRECTIONAL); 620 DMA_BIDIRECTIONAL);
625 621
626 status = spi_sync(spi, &host->m); 622 status = spi_sync(spi, &host->m);
627 if (status == 0)
628 status = host->m.status;
629 623
630 if (status != 0) { 624 if (status != 0) {
631 dev_dbg(&spi->dev, "write error (%d)\n", status); 625 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)
726 } 720 }
727 721
728 status = spi_sync(spi, &host->m); 722 status = spi_sync(spi, &host->m);
729 if (status == 0)
730 status = host->m.status;
731 723
732 if (host->dma_dev) { 724 if (host->dma_dev) {
733 dma_sync_single_for_cpu(host->dma_dev, 725 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,
905 DMA_BIDIRECTIONAL); 897 DMA_BIDIRECTIONAL);
906 898
907 tmp = spi_sync(spi, &host->m); 899 tmp = spi_sync(spi, &host->m);
908 if (tmp == 0)
909 tmp = host->m.status;
910 900
911 if (host->dma_dev) 901 if (host->dma_dev)
912 dma_sync_single_for_cpu(host->dma_dev, 902 dma_sync_single_for_cpu(host->dma_dev,
diff --git a/drivers/rtc/rtc-max6902.c b/drivers/rtc/rtc-max6902.c
index 3e183cfee10f..1f956dc5d56e 100644
--- a/drivers/rtc/rtc-max6902.c
+++ b/drivers/rtc/rtc-max6902.c
@@ -89,13 +89,9 @@ static int max6902_get_reg(struct device *dev, unsigned char address,
89 89
90 /* do the i/o */ 90 /* do the i/o */
91 status = spi_sync(spi, &message); 91 status = spi_sync(spi, &message);
92 if (status == 0)
93 status = message.status;
94 else
95 return status;
96
97 *data = chip->rx_buf[1];
98 92
93 if (status == 0)
94 *data = chip->rx_buf[1];
99 return status; 95 return status;
100} 96}
101 97
@@ -125,9 +121,7 @@ static int max6902_get_datetime(struct device *dev, struct rtc_time *dt)
125 121
126 /* do the i/o */ 122 /* do the i/o */
127 status = spi_sync(spi, &message); 123 status = spi_sync(spi, &message);
128 if (status == 0) 124 if (status)
129 status = message.status;
130 else
131 return status; 125 return status;
132 126
133 /* The chip sends data in this order: 127 /* The chip sends data in this order: