diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/spi/spi_imx.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/spi/spi_imx.c b/drivers/spi/spi_imx.c index 1b17f443dee7..8ffa48ce570c 100644 --- a/drivers/spi/spi_imx.c +++ b/drivers/spi/spi_imx.c | |||
@@ -516,11 +516,12 @@ static int __init spi_imx_probe(struct platform_device *pdev) | |||
516 | continue; | 516 | continue; |
517 | ret = gpio_request(spi_imx->chipselect[i], DRIVER_NAME); | 517 | ret = gpio_request(spi_imx->chipselect[i], DRIVER_NAME); |
518 | if (ret) { | 518 | if (ret) { |
519 | i--; | 519 | while (i > 0) { |
520 | while (i > 0) | 520 | i--; |
521 | if (spi_imx->chipselect[i] >= 0) | 521 | if (spi_imx->chipselect[i] >= 0) |
522 | gpio_free(spi_imx->chipselect[i--]); | 522 | gpio_free(spi_imx->chipselect[i]); |
523 | dev_err(&pdev->dev, "can't get cs gpios"); | 523 | } |
524 | dev_err(&pdev->dev, "can't get cs gpios\n"); | ||
524 | goto out_master_put; | 525 | goto out_master_put; |
525 | } | 526 | } |
526 | } | 527 | } |