summaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/files/drivers
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-01-11 09:14:17 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-01-11 09:14:17 +0000
commit7bb349bc59a592fb76d5635f0ee2c649ffc010fc (patch)
tree5f917c4911262965b0e62ea9f15767874ef32e63 /target/linux/ar71xx/files/drivers
parentddfc10f66842ecbc1f4b04b2828f273f4f0b7509 (diff)
ar71xx: pb44_spi: call pb44_spi_{en,dis}able from probe/remove
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@29709 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/files/drivers')
-rw-r--r--target/linux/ar71xx/files/drivers/spi/pb44_spi.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/target/linux/ar71xx/files/drivers/spi/pb44_spi.c b/target/linux/ar71xx/files/drivers/spi/pb44_spi.c
index 61c22f5b3..01b5f1cc2 100644
--- a/target/linux/ar71xx/files/drivers/spi/pb44_spi.c
+++ b/target/linux/ar71xx/files/drivers/spi/pb44_spi.c
@@ -110,8 +110,6 @@ static int pb44_spi_setup_cs(struct spi_device *spi)
{
struct ar71xx_spi *sp = spidev_to_sp(spi);
- pb44_spi_enable(sp);
-
if (spi->chip_select) {
unsigned long gpio = (unsigned long) spi->controller_data;
int status = 0;
@@ -138,14 +136,10 @@ static int pb44_spi_setup_cs(struct spi_device *spi)
static void pb44_spi_cleanup_cs(struct spi_device *spi)
{
- struct ar71xx_spi *sp = spidev_to_sp(spi);
-
if (spi->chip_select) {
unsigned long gpio = (unsigned long) spi->controller_data;
gpio_free(gpio);
}
-
- pb44_spi_disable(sp);
}
static int pb44_spi_setup(struct spi_device *spi)
@@ -256,10 +250,13 @@ static int pb44_spi_probe(struct platform_device *pdev)
goto err1;
}
+ pb44_spi_enable(sp);
+
ret = spi_bitbang_start(&sp->bitbang);
if (!ret)
return 0;
+ pb44_spi_disable(sp);
iounmap(sp->base);
err1:
platform_set_drvdata(pdev, NULL);
@@ -273,6 +270,7 @@ static int pb44_spi_remove(struct platform_device *pdev)
struct ar71xx_spi *sp = platform_get_drvdata(pdev);
spi_bitbang_stop(&sp->bitbang);
+ pb44_spi_disable(sp);
iounmap(sp->base);
platform_set_drvdata(pdev, NULL);
spi_master_put(sp->bitbang.master);