diff options
Diffstat (limited to 'drivers/spi/spi-gpio.c')
-rw-r--r-- | drivers/spi/spi-gpio.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c index 68b69fec13a9..3fb09f981980 100644 --- a/drivers/spi/spi-gpio.c +++ b/drivers/spi/spi-gpio.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/platform_device.h> | 23 | #include <linux/platform_device.h> |
24 | #include <linux/gpio.h> | 24 | #include <linux/gpio.h> |
25 | #include <linux/of.h> | ||
25 | #include <linux/of_device.h> | 26 | #include <linux/of_device.h> |
26 | #include <linux/of_gpio.h> | 27 | #include <linux/of_gpio.h> |
27 | 28 | ||
@@ -467,7 +468,7 @@ static int spi_gpio_probe(struct platform_device *pdev) | |||
467 | } | 468 | } |
468 | #endif | 469 | #endif |
469 | 470 | ||
470 | spi_gpio->bitbang.master = spi_master_get(master); | 471 | spi_gpio->bitbang.master = master; |
471 | spi_gpio->bitbang.chipselect = spi_gpio_chipselect; | 472 | spi_gpio->bitbang.chipselect = spi_gpio_chipselect; |
472 | 473 | ||
473 | if ((master_flags & (SPI_MASTER_NO_TX | SPI_MASTER_NO_RX)) == 0) { | 474 | if ((master_flags & (SPI_MASTER_NO_TX | SPI_MASTER_NO_RX)) == 0) { |
@@ -486,7 +487,6 @@ static int spi_gpio_probe(struct platform_device *pdev) | |||
486 | 487 | ||
487 | status = spi_bitbang_start(&spi_gpio->bitbang); | 488 | status = spi_bitbang_start(&spi_gpio->bitbang); |
488 | if (status < 0) { | 489 | if (status < 0) { |
489 | spi_master_put(spi_gpio->bitbang.master); | ||
490 | gpio_free: | 490 | gpio_free: |
491 | if (SPI_MISO_GPIO != SPI_GPIO_NO_MISO) | 491 | if (SPI_MISO_GPIO != SPI_GPIO_NO_MISO) |
492 | gpio_free(SPI_MISO_GPIO); | 492 | gpio_free(SPI_MISO_GPIO); |
@@ -510,13 +510,13 @@ static int spi_gpio_remove(struct platform_device *pdev) | |||
510 | 510 | ||
511 | /* stop() unregisters child devices too */ | 511 | /* stop() unregisters child devices too */ |
512 | status = spi_bitbang_stop(&spi_gpio->bitbang); | 512 | status = spi_bitbang_stop(&spi_gpio->bitbang); |
513 | spi_master_put(spi_gpio->bitbang.master); | ||
514 | 513 | ||
515 | if (SPI_MISO_GPIO != SPI_GPIO_NO_MISO) | 514 | if (SPI_MISO_GPIO != SPI_GPIO_NO_MISO) |
516 | gpio_free(SPI_MISO_GPIO); | 515 | gpio_free(SPI_MISO_GPIO); |
517 | if (SPI_MOSI_GPIO != SPI_GPIO_NO_MOSI) | 516 | if (SPI_MOSI_GPIO != SPI_GPIO_NO_MOSI) |
518 | gpio_free(SPI_MOSI_GPIO); | 517 | gpio_free(SPI_MOSI_GPIO); |
519 | gpio_free(SPI_SCK_GPIO); | 518 | gpio_free(SPI_SCK_GPIO); |
519 | spi_master_put(spi_gpio->bitbang.master); | ||
520 | 520 | ||
521 | return status; | 521 | return status; |
522 | } | 522 | } |