spi: remove unnecessary platform_set_drvdata()
authorJingoo Han <jg1.han@samsung.com>
Fri, 3 May 2013 07:27:12 +0000 (16:27 +0900)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 13 May 2013 14:00:30 +0000 (18:00 +0400)
The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15 files changed:
drivers/spi/spi-altera.c
drivers/spi/spi-ath79.c
drivers/spi/spi-au1550.c
drivers/spi/spi-bcm63xx.c
drivers/spi/spi-bfin-sport.c
drivers/spi/spi-bfin5xx.c
drivers/spi/spi-clps711x.c
drivers/spi/spi-coldfire-qspi.c
drivers/spi/spi-dw-mmio.c
drivers/spi/spi-ep93xx.c
drivers/spi/spi-gpio.c
drivers/spi/spi-imx.c
drivers/spi/spi-oc-tiny.c
drivers/spi/spi-pxa2xx.c
drivers/spi/spi-s3c64xx.c

index a537f8dffc095b56e4658e2a7c703ba3a809428c..81b9adb6e766bdae0b0f6c9de4836ecfaffc490a 100644 (file)
@@ -285,7 +285,6 @@ static int altera_spi_probe(struct platform_device *pdev)
 exit_busy:
        err = -EBUSY;
 exit:
-       platform_set_drvdata(pdev, NULL);
        spi_master_put(master);
        return err;
 }
@@ -296,7 +295,6 @@ static int altera_spi_remove(struct platform_device *dev)
        struct spi_master *master = hw->bitbang.master;
 
        spi_bitbang_stop(&hw->bitbang);
-       platform_set_drvdata(dev, NULL);
        spi_master_put(master);
        return 0;
 }
index e504b7636058b4aa31789c26a1be8752a531456b..6f6d4554805034235fd6863dbee7b0f45ac8c887 100644 (file)
@@ -287,7 +287,6 @@ err_clk_put:
 err_unmap:
        iounmap(sp->base);
 err_put_master:
-       platform_set_drvdata(pdev, NULL);
        spi_master_put(sp->bitbang.master);
 
        return ret;
@@ -302,7 +301,6 @@ static int ath79_spi_remove(struct platform_device *pdev)
        clk_disable(sp->clk);
        clk_put(sp->clk);
        iounmap(sp->base);
-       platform_set_drvdata(pdev, NULL);
        spi_master_put(sp->bitbang.master);
 
        return 0;
index 44dd34b6ad09f796a8eb660c35dd87c4d350c4fc..39560f45ba1db71b242153da66edfa859a195563 100644 (file)
@@ -987,8 +987,6 @@ static int au1550_spi_remove(struct platform_device *pdev)
                au1xxx_dbdma_chan_free(hw->dma_tx_ch);
        }
 
-       platform_set_drvdata(pdev, NULL);
-
        spi_master_put(hw->master);
        return 0;
 }
index a4ec5f4ec8175ef16d4746c2f34a533ac3f5697a..099d0839bbd4c0829543fa0c2efb2ad68375ec9f 100644 (file)
@@ -469,7 +469,6 @@ static int bcm63xx_spi_probe(struct platform_device *pdev)
 out_clk_disable:
        clk_disable_unprepare(clk);
 out_err:
-       platform_set_drvdata(pdev, NULL);
        spi_master_put(master);
 out_clk:
        clk_put(clk);
@@ -491,8 +490,6 @@ static int bcm63xx_spi_remove(struct platform_device *pdev)
        clk_disable_unprepare(bs->clk);
        clk_put(bs->clk);
 
-       platform_set_drvdata(pdev, 0);
-
        spi_master_put(master);
 
        return 0;
index 39b0d1711b4e952fddcad68affd04ee103cdb47e..6d04c80559bbae2b1f95e15e402cafe643018127 100644 (file)
@@ -882,9 +882,6 @@ static int bfin_sport_spi_remove(struct platform_device *pdev)
 
        peripheral_free_list(drv_data->pin_req);
 
-       /* Prevent double remove */
-       platform_set_drvdata(pdev, NULL);
-
        return 0;
 }
 
index 317f564c899c3ba93e0ee558b094ea5e4c8d0743..68ca4449e36f53af956b7279fecdcd75d42ffc23 100644 (file)
@@ -1418,9 +1418,6 @@ static int bfin_spi_remove(struct platform_device *pdev)
 
        peripheral_free_list(drv_data->pin_req);
 
-       /* Prevent double remove */
-       platform_set_drvdata(pdev, NULL);
-
        return 0;
 }
 
index a11cbf02691a88564ea8b8b33331453a7163b72a..6859a0294c51ce0f80b4839cf9941fa58776ea72 100644 (file)
@@ -254,7 +254,6 @@ err_out:
                if (gpio_is_valid(hw->chipselect[i]))
                        gpio_free(hw->chipselect[i]);
 
-       platform_set_drvdata(pdev, NULL);
        spi_master_put(master);
        kfree(master);
 
@@ -274,7 +273,6 @@ static int spi_clps711x_remove(struct platform_device *pdev)
                        gpio_free(hw->chipselect[i]);
 
        devm_clk_put(&pdev->dev, hw->spi_clk);
-       platform_set_drvdata(pdev, NULL);
        spi_unregister_master(master);
        kfree(master);
 
index 7b5cc9e4e94d6a355962fca0afe05d3a3837339b..3f1766003e68521dade2ea7a14710422933526cb 100644 (file)
@@ -524,7 +524,6 @@ static int mcfqspi_remove(struct platform_device *pdev)
        /* disable the hardware (set the baud rate to 0) */
        mcfqspi_wr_qmr(mcfqspi, MCFQSPI_QMR_MSTR);
 
-       platform_set_drvdata(pdev, NULL);
        mcfqspi_cs_teardown(mcfqspi);
        clk_disable(mcfqspi->clk);
        clk_put(mcfqspi->clk);
index 4a6d5c9057a4428f61fb5937a01b40bec9b90ec0..4aa8be865cc06ae81d1145161086a89c9846723e 100644 (file)
@@ -111,8 +111,6 @@ static int dw_spi_mmio_remove(struct platform_device *pdev)
        struct dw_spi_mmio *dwsmmio = platform_get_drvdata(pdev);
        struct resource *mem;
 
-       platform_set_drvdata(pdev, NULL);
-
        clk_disable(dwsmmio->clk);
        clk_put(dwsmmio->clk);
        dwsmmio->clk = NULL;
index d7bac60253c9c92cd2b542b9a17e8bd9d4088291..8d4f2a6aab90c1b0db48658ad3194e777cf9cfa0 100644 (file)
@@ -1132,7 +1132,6 @@ fail_put_clock:
        clk_put(espi->clk);
 fail_release_master:
        spi_master_put(master);
-       platform_set_drvdata(pdev, NULL);
 
        return error;
 }
@@ -1167,7 +1166,6 @@ static int ep93xx_spi_remove(struct platform_device *pdev)
 
        ep93xx_spi_release_dma(espi);
        clk_put(espi->clk);
-       platform_set_drvdata(pdev, NULL);
 
        spi_unregister_master(master);
        return 0;
index 0021fc4c45bc2f4c9bb0e676bc6cab2fc3b5f02d..9672c7b87889389eabc81fd446c645bd7609e2fb 100644 (file)
@@ -514,8 +514,6 @@ static int spi_gpio_remove(struct platform_device *pdev)
        status = spi_bitbang_stop(&spi_gpio->bitbang);
        spi_master_put(spi_gpio->bitbang.master);
 
-       platform_set_drvdata(pdev, NULL);
-
        if (SPI_MISO_GPIO != SPI_GPIO_NO_MISO)
                gpio_free(SPI_MISO_GPIO);
        if (SPI_MOSI_GPIO != SPI_GPIO_NO_MOSI)
index 0befeeb522f47ab633b1d54b76cf780902d2ae2b..f4d7cacbab3bd038c9310c189feb2523c84278c0 100644 (file)
@@ -902,7 +902,6 @@ out_gpio_free:
        }
        spi_master_put(master);
        kfree(master);
-       platform_set_drvdata(pdev, NULL);
        return ret;
 }
 
@@ -929,8 +928,6 @@ static int spi_imx_remove(struct platform_device *pdev)
 
        release_mem_region(res->start, resource_size(res));
 
-       platform_set_drvdata(pdev, NULL);
-
        return 0;
 }
 
index e60a776ed2d498f7f4574172b7638e37c0d75ef0..58deb79d046be444cbb0392e4f17583e8d99ee8d 100644 (file)
@@ -368,7 +368,6 @@ exit_gpio:
 exit_busy:
        err = -EBUSY;
 exit:
-       platform_set_drvdata(pdev, NULL);
        spi_master_put(master);
        return err;
 }
@@ -382,7 +381,6 @@ static int tiny_spi_remove(struct platform_device *pdev)
        spi_bitbang_stop(&hw->bitbang);
        for (i = 0; i < hw->gpio_cs_count; i++)
                gpio_free(hw->gpio_cs[i]);
-       platform_set_drvdata(pdev, NULL);
        spi_master_put(master);
        return 0;
 }
index f5d84d6f8222c4afc261f738daa695da332a46df..5a7fa2cd1efe7013fc945239d77ddd4d815d13a5 100644 (file)
@@ -1299,9 +1299,6 @@ static int pxa2xx_spi_remove(struct platform_device *pdev)
        /* Disconnect from the SPI framework */
        spi_unregister_master(drv_data->master);
 
-       /* Prevent double remove */
-       platform_set_drvdata(pdev, NULL);
-
        return 0;
 }
 
index 5000586cb98da2331b0cbe1c31ec26b0f6f40eb4..5f3759d9b8f955c0415e985e564408138800d8bd 100644 (file)
@@ -1399,7 +1399,6 @@ err3:
 err2:
        clk_disable_unprepare(sdd->clk);
 err0:
-       platform_set_drvdata(pdev, NULL);
        spi_master_put(master);
 
        return ret;
@@ -1420,7 +1419,6 @@ static int s3c64xx_spi_remove(struct platform_device *pdev)
 
        clk_disable_unprepare(sdd->clk);
 
-       platform_set_drvdata(pdev, NULL);
        spi_master_put(master);
 
        return 0;