1 From 1e41dc0ee2f3807328db95e4f87ff1333245190f Mon Sep 17 00:00:00 2001
2 From: Florian Fainelli <florian@openwrt.org>
3 Date: Fri, 20 Apr 2012 15:37:34 +0200
4 Subject: [PATCH] spi/bcm63xx: don't use the stopping state
6 We do not need to use a flag to indicate if the master driver is stopping
7 it is sufficient to perform spi master unregistering in the platform
8 driver's remove function.
10 Signed-off-by: Florian Fainelli <florian@openwrt.org>
11 Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
13 drivers/spi/spi-bcm63xx.c | 13 ++-----------
14 1 file changed, 2 insertions(+), 11 deletions(-)
16 --- a/drivers/spi/spi-bcm63xx.c
17 +++ b/drivers/spi/spi-bcm63xx.c
19 #define DRV_VER "0.1.2"
24 struct completion done;
27 @@ -161,9 +159,6 @@ static int bcm63xx_spi_setup(struct spi_
29 bs = spi_master_get_devdata(spi->master);
34 if (!spi->bits_per_word)
35 spi->bits_per_word = 8;
37 @@ -410,10 +405,8 @@ static int __devinit bcm63xx_spi_probe(s
38 master->unprepare_transfer_hardware = bcm63xx_spi_unprepare_transfer;
39 master->transfer_one_message = bcm63xx_spi_transfer_one;
40 bs->speed_hz = pdata->speed_hz;
42 bs->tx_io = (u8 *)(bs->regs + bcm63xx_spireg(SPI_MSG_DATA));
43 bs->rx_io = (const u8 *)(bs->regs + bcm63xx_spireg(SPI_RX_DATA));
44 - spin_lock_init(&bs->lock);
46 /* Initialize hardware */
48 @@ -447,18 +440,16 @@ static int __devexit bcm63xx_spi_remove(
49 struct spi_master *master = platform_get_drvdata(pdev);
50 struct bcm63xx_spi *bs = spi_master_get_devdata(master);
52 + spi_unregister_master(master);
55 bcm_spi_writeb(bs, 0, SPI_INT_MASK);
56 - spin_lock(&bs->lock);
63 - spin_unlock(&bs->lock);
64 platform_set_drvdata(pdev, 0);
65 - spi_unregister_master(master);