diff options
-rw-r--r-- | drivers/spi/spi_bitbang.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/spi/spi_bitbang.c b/drivers/spi/spi_bitbang.c index 5265330a528f..8b55724d5f39 100644 --- a/drivers/spi/spi_bitbang.c +++ b/drivers/spi/spi_bitbang.c | |||
@@ -259,7 +259,6 @@ static void bitbang_work(struct work_struct *work) | |||
259 | struct spi_bitbang *bitbang = | 259 | struct spi_bitbang *bitbang = |
260 | container_of(work, struct spi_bitbang, work); | 260 | container_of(work, struct spi_bitbang, work); |
261 | unsigned long flags; | 261 | unsigned long flags; |
262 | int do_setup = -1; | ||
263 | int (*setup_transfer)(struct spi_device *, | 262 | int (*setup_transfer)(struct spi_device *, |
264 | struct spi_transfer *); | 263 | struct spi_transfer *); |
265 | 264 | ||
@@ -275,6 +274,7 @@ static void bitbang_work(struct work_struct *work) | |||
275 | unsigned tmp; | 274 | unsigned tmp; |
276 | unsigned cs_change; | 275 | unsigned cs_change; |
277 | int status; | 276 | int status; |
277 | int do_setup = -1; | ||
278 | 278 | ||
279 | m = container_of(bitbang->queue.next, struct spi_message, | 279 | m = container_of(bitbang->queue.next, struct spi_message, |
280 | queue); | 280 | queue); |
@@ -307,6 +307,8 @@ static void bitbang_work(struct work_struct *work) | |||
307 | status = setup_transfer(spi, t); | 307 | status = setup_transfer(spi, t); |
308 | if (status < 0) | 308 | if (status < 0) |
309 | break; | 309 | break; |
310 | if (do_setup == -1) | ||
311 | do_setup = 0; | ||
310 | } | 312 | } |
311 | 313 | ||
312 | /* set up default clock polarity, and activate chip; | 314 | /* set up default clock polarity, and activate chip; |
@@ -367,11 +369,6 @@ static void bitbang_work(struct work_struct *work) | |||
367 | m->status = status; | 369 | m->status = status; |
368 | m->complete(m->context); | 370 | m->complete(m->context); |
369 | 371 | ||
370 | /* restore speed and wordsize if it was overridden */ | ||
371 | if (do_setup == 1) | ||
372 | setup_transfer(spi, NULL); | ||
373 | do_setup = 0; | ||
374 | |||
375 | /* normally deactivate chipselect ... unless no error and | 372 | /* normally deactivate chipselect ... unless no error and |
376 | * cs_change has hinted that the next message will probably | 373 | * cs_change has hinted that the next message will probably |
377 | * be for this chip too. | 374 | * be for this chip too. |