diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-05-03 03:27:12 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-05-13 10:00:30 -0400 |
commit | 89e8773075bae055090db518bf2085c0d40ca9d5 (patch) | |
tree | 2e9901341601b318692488c86c95428570a16849 /drivers/spi | |
parent | f722406faae2d073cc1d01063d1123c35425939e (diff) |
spi: remove unnecessary platform_set_drvdata()
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>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-altera.c | 2 | ||||
-rw-r--r-- | drivers/spi/spi-ath79.c | 2 | ||||
-rw-r--r-- | drivers/spi/spi-au1550.c | 2 | ||||
-rw-r--r-- | drivers/spi/spi-bcm63xx.c | 3 | ||||
-rw-r--r-- | drivers/spi/spi-bfin-sport.c | 3 | ||||
-rw-r--r-- | drivers/spi/spi-bfin5xx.c | 3 | ||||
-rw-r--r-- | drivers/spi/spi-clps711x.c | 2 | ||||
-rw-r--r-- | drivers/spi/spi-coldfire-qspi.c | 1 | ||||
-rw-r--r-- | drivers/spi/spi-dw-mmio.c | 2 | ||||
-rw-r--r-- | drivers/spi/spi-ep93xx.c | 2 | ||||
-rw-r--r-- | drivers/spi/spi-gpio.c | 2 | ||||
-rw-r--r-- | drivers/spi/spi-imx.c | 3 | ||||
-rw-r--r-- | drivers/spi/spi-oc-tiny.c | 2 | ||||
-rw-r--r-- | drivers/spi/spi-pxa2xx.c | 3 | ||||
-rw-r--r-- | drivers/spi/spi-s3c64xx.c | 2 |
15 files changed, 0 insertions, 34 deletions
diff --git a/drivers/spi/spi-altera.c b/drivers/spi/spi-altera.c index a537f8dffc09..81b9adb6e766 100644 --- a/drivers/spi/spi-altera.c +++ b/drivers/spi/spi-altera.c | |||
@@ -285,7 +285,6 @@ static int altera_spi_probe(struct platform_device *pdev) | |||
285 | exit_busy: | 285 | exit_busy: |
286 | err = -EBUSY; | 286 | err = -EBUSY; |
287 | exit: | 287 | exit: |
288 | platform_set_drvdata(pdev, NULL); | ||
289 | spi_master_put(master); | 288 | spi_master_put(master); |
290 | return err; | 289 | return err; |
291 | } | 290 | } |
@@ -296,7 +295,6 @@ static int altera_spi_remove(struct platform_device *dev) | |||
296 | struct spi_master *master = hw->bitbang.master; | 295 | struct spi_master *master = hw->bitbang.master; |
297 | 296 | ||
298 | spi_bitbang_stop(&hw->bitbang); | 297 | spi_bitbang_stop(&hw->bitbang); |
299 | platform_set_drvdata(dev, NULL); | ||
300 | spi_master_put(master); | 298 | spi_master_put(master); |
301 | return 0; | 299 | return 0; |
302 | } | 300 | } |
diff --git a/drivers/spi/spi-ath79.c b/drivers/spi/spi-ath79.c index e504b7636058..6f6d45548050 100644 --- a/drivers/spi/spi-ath79.c +++ b/drivers/spi/spi-ath79.c | |||
@@ -287,7 +287,6 @@ err_clk_put: | |||
287 | err_unmap: | 287 | err_unmap: |
288 | iounmap(sp->base); | 288 | iounmap(sp->base); |
289 | err_put_master: | 289 | err_put_master: |
290 | platform_set_drvdata(pdev, NULL); | ||
291 | spi_master_put(sp->bitbang.master); | 290 | spi_master_put(sp->bitbang.master); |
292 | 291 | ||
293 | return ret; | 292 | return ret; |
@@ -302,7 +301,6 @@ static int ath79_spi_remove(struct platform_device *pdev) | |||
302 | clk_disable(sp->clk); | 301 | clk_disable(sp->clk); |
303 | clk_put(sp->clk); | 302 | clk_put(sp->clk); |
304 | iounmap(sp->base); | 303 | iounmap(sp->base); |
305 | platform_set_drvdata(pdev, NULL); | ||
306 | spi_master_put(sp->bitbang.master); | 304 | spi_master_put(sp->bitbang.master); |
307 | 305 | ||
308 | return 0; | 306 | return 0; |
diff --git a/drivers/spi/spi-au1550.c b/drivers/spi/spi-au1550.c index 44dd34b6ad09..39560f45ba1d 100644 --- a/drivers/spi/spi-au1550.c +++ b/drivers/spi/spi-au1550.c | |||
@@ -987,8 +987,6 @@ static int au1550_spi_remove(struct platform_device *pdev) | |||
987 | au1xxx_dbdma_chan_free(hw->dma_tx_ch); | 987 | au1xxx_dbdma_chan_free(hw->dma_tx_ch); |
988 | } | 988 | } |
989 | 989 | ||
990 | platform_set_drvdata(pdev, NULL); | ||
991 | |||
992 | spi_master_put(hw->master); | 990 | spi_master_put(hw->master); |
993 | return 0; | 991 | return 0; |
994 | } | 992 | } |
diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c index a4ec5f4ec817..099d0839bbd4 100644 --- a/drivers/spi/spi-bcm63xx.c +++ b/drivers/spi/spi-bcm63xx.c | |||
@@ -469,7 +469,6 @@ static int bcm63xx_spi_probe(struct platform_device *pdev) | |||
469 | out_clk_disable: | 469 | out_clk_disable: |
470 | clk_disable_unprepare(clk); | 470 | clk_disable_unprepare(clk); |
471 | out_err: | 471 | out_err: |
472 | platform_set_drvdata(pdev, NULL); | ||
473 | spi_master_put(master); | 472 | spi_master_put(master); |
474 | out_clk: | 473 | out_clk: |
475 | clk_put(clk); | 474 | clk_put(clk); |
@@ -491,8 +490,6 @@ static int bcm63xx_spi_remove(struct platform_device *pdev) | |||
491 | clk_disable_unprepare(bs->clk); | 490 | clk_disable_unprepare(bs->clk); |
492 | clk_put(bs->clk); | 491 | clk_put(bs->clk); |
493 | 492 | ||
494 | platform_set_drvdata(pdev, 0); | ||
495 | |||
496 | spi_master_put(master); | 493 | spi_master_put(master); |
497 | 494 | ||
498 | return 0; | 495 | return 0; |
diff --git a/drivers/spi/spi-bfin-sport.c b/drivers/spi/spi-bfin-sport.c index 39b0d1711b4e..6d04c80559bb 100644 --- a/drivers/spi/spi-bfin-sport.c +++ b/drivers/spi/spi-bfin-sport.c | |||
@@ -882,9 +882,6 @@ static int bfin_sport_spi_remove(struct platform_device *pdev) | |||
882 | 882 | ||
883 | peripheral_free_list(drv_data->pin_req); | 883 | peripheral_free_list(drv_data->pin_req); |
884 | 884 | ||
885 | /* Prevent double remove */ | ||
886 | platform_set_drvdata(pdev, NULL); | ||
887 | |||
888 | return 0; | 885 | return 0; |
889 | } | 886 | } |
890 | 887 | ||
diff --git a/drivers/spi/spi-bfin5xx.c b/drivers/spi/spi-bfin5xx.c index 317f564c899c..68ca4449e36f 100644 --- a/drivers/spi/spi-bfin5xx.c +++ b/drivers/spi/spi-bfin5xx.c | |||
@@ -1418,9 +1418,6 @@ static int bfin_spi_remove(struct platform_device *pdev) | |||
1418 | 1418 | ||
1419 | peripheral_free_list(drv_data->pin_req); | 1419 | peripheral_free_list(drv_data->pin_req); |
1420 | 1420 | ||
1421 | /* Prevent double remove */ | ||
1422 | platform_set_drvdata(pdev, NULL); | ||
1423 | |||
1424 | return 0; | 1421 | return 0; |
1425 | } | 1422 | } |
1426 | 1423 | ||
diff --git a/drivers/spi/spi-clps711x.c b/drivers/spi/spi-clps711x.c index a11cbf02691a..6859a0294c51 100644 --- a/drivers/spi/spi-clps711x.c +++ b/drivers/spi/spi-clps711x.c | |||
@@ -254,7 +254,6 @@ err_out: | |||
254 | if (gpio_is_valid(hw->chipselect[i])) | 254 | if (gpio_is_valid(hw->chipselect[i])) |
255 | gpio_free(hw->chipselect[i]); | 255 | gpio_free(hw->chipselect[i]); |
256 | 256 | ||
257 | platform_set_drvdata(pdev, NULL); | ||
258 | spi_master_put(master); | 257 | spi_master_put(master); |
259 | kfree(master); | 258 | kfree(master); |
260 | 259 | ||
@@ -274,7 +273,6 @@ static int spi_clps711x_remove(struct platform_device *pdev) | |||
274 | gpio_free(hw->chipselect[i]); | 273 | gpio_free(hw->chipselect[i]); |
275 | 274 | ||
276 | devm_clk_put(&pdev->dev, hw->spi_clk); | 275 | devm_clk_put(&pdev->dev, hw->spi_clk); |
277 | platform_set_drvdata(pdev, NULL); | ||
278 | spi_unregister_master(master); | 276 | spi_unregister_master(master); |
279 | kfree(master); | 277 | kfree(master); |
280 | 278 | ||
diff --git a/drivers/spi/spi-coldfire-qspi.c b/drivers/spi/spi-coldfire-qspi.c index 7b5cc9e4e94d..3f1766003e68 100644 --- a/drivers/spi/spi-coldfire-qspi.c +++ b/drivers/spi/spi-coldfire-qspi.c | |||
@@ -524,7 +524,6 @@ static int mcfqspi_remove(struct platform_device *pdev) | |||
524 | /* disable the hardware (set the baud rate to 0) */ | 524 | /* disable the hardware (set the baud rate to 0) */ |
525 | mcfqspi_wr_qmr(mcfqspi, MCFQSPI_QMR_MSTR); | 525 | mcfqspi_wr_qmr(mcfqspi, MCFQSPI_QMR_MSTR); |
526 | 526 | ||
527 | platform_set_drvdata(pdev, NULL); | ||
528 | mcfqspi_cs_teardown(mcfqspi); | 527 | mcfqspi_cs_teardown(mcfqspi); |
529 | clk_disable(mcfqspi->clk); | 528 | clk_disable(mcfqspi->clk); |
530 | clk_put(mcfqspi->clk); | 529 | clk_put(mcfqspi->clk); |
diff --git a/drivers/spi/spi-dw-mmio.c b/drivers/spi/spi-dw-mmio.c index 4a6d5c9057a4..4aa8be865cc0 100644 --- a/drivers/spi/spi-dw-mmio.c +++ b/drivers/spi/spi-dw-mmio.c | |||
@@ -111,8 +111,6 @@ static int dw_spi_mmio_remove(struct platform_device *pdev) | |||
111 | struct dw_spi_mmio *dwsmmio = platform_get_drvdata(pdev); | 111 | struct dw_spi_mmio *dwsmmio = platform_get_drvdata(pdev); |
112 | struct resource *mem; | 112 | struct resource *mem; |
113 | 113 | ||
114 | platform_set_drvdata(pdev, NULL); | ||
115 | |||
116 | clk_disable(dwsmmio->clk); | 114 | clk_disable(dwsmmio->clk); |
117 | clk_put(dwsmmio->clk); | 115 | clk_put(dwsmmio->clk); |
118 | dwsmmio->clk = NULL; | 116 | dwsmmio->clk = NULL; |
diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c index d7bac60253c9..8d4f2a6aab90 100644 --- a/drivers/spi/spi-ep93xx.c +++ b/drivers/spi/spi-ep93xx.c | |||
@@ -1132,7 +1132,6 @@ fail_put_clock: | |||
1132 | clk_put(espi->clk); | 1132 | clk_put(espi->clk); |
1133 | fail_release_master: | 1133 | fail_release_master: |
1134 | spi_master_put(master); | 1134 | spi_master_put(master); |
1135 | platform_set_drvdata(pdev, NULL); | ||
1136 | 1135 | ||
1137 | return error; | 1136 | return error; |
1138 | } | 1137 | } |
@@ -1167,7 +1166,6 @@ static int ep93xx_spi_remove(struct platform_device *pdev) | |||
1167 | 1166 | ||
1168 | ep93xx_spi_release_dma(espi); | 1167 | ep93xx_spi_release_dma(espi); |
1169 | clk_put(espi->clk); | 1168 | clk_put(espi->clk); |
1170 | platform_set_drvdata(pdev, NULL); | ||
1171 | 1169 | ||
1172 | spi_unregister_master(master); | 1170 | spi_unregister_master(master); |
1173 | return 0; | 1171 | return 0; |
diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c index 0021fc4c45bc..9672c7b87889 100644 --- a/drivers/spi/spi-gpio.c +++ b/drivers/spi/spi-gpio.c | |||
@@ -514,8 +514,6 @@ static int spi_gpio_remove(struct platform_device *pdev) | |||
514 | status = spi_bitbang_stop(&spi_gpio->bitbang); | 514 | status = spi_bitbang_stop(&spi_gpio->bitbang); |
515 | spi_master_put(spi_gpio->bitbang.master); | 515 | spi_master_put(spi_gpio->bitbang.master); |
516 | 516 | ||
517 | platform_set_drvdata(pdev, NULL); | ||
518 | |||
519 | if (SPI_MISO_GPIO != SPI_GPIO_NO_MISO) | 517 | if (SPI_MISO_GPIO != SPI_GPIO_NO_MISO) |
520 | gpio_free(SPI_MISO_GPIO); | 518 | gpio_free(SPI_MISO_GPIO); |
521 | if (SPI_MOSI_GPIO != SPI_GPIO_NO_MOSI) | 519 | if (SPI_MOSI_GPIO != SPI_GPIO_NO_MOSI) |
diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index 0befeeb522f4..f4d7cacbab3b 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c | |||
@@ -902,7 +902,6 @@ out_gpio_free: | |||
902 | } | 902 | } |
903 | spi_master_put(master); | 903 | spi_master_put(master); |
904 | kfree(master); | 904 | kfree(master); |
905 | platform_set_drvdata(pdev, NULL); | ||
906 | return ret; | 905 | return ret; |
907 | } | 906 | } |
908 | 907 | ||
@@ -929,8 +928,6 @@ static int spi_imx_remove(struct platform_device *pdev) | |||
929 | 928 | ||
930 | release_mem_region(res->start, resource_size(res)); | 929 | release_mem_region(res->start, resource_size(res)); |
931 | 930 | ||
932 | platform_set_drvdata(pdev, NULL); | ||
933 | |||
934 | return 0; | 931 | return 0; |
935 | } | 932 | } |
936 | 933 | ||
diff --git a/drivers/spi/spi-oc-tiny.c b/drivers/spi/spi-oc-tiny.c index e60a776ed2d4..58deb79d046b 100644 --- a/drivers/spi/spi-oc-tiny.c +++ b/drivers/spi/spi-oc-tiny.c | |||
@@ -368,7 +368,6 @@ exit_gpio: | |||
368 | exit_busy: | 368 | exit_busy: |
369 | err = -EBUSY; | 369 | err = -EBUSY; |
370 | exit: | 370 | exit: |
371 | platform_set_drvdata(pdev, NULL); | ||
372 | spi_master_put(master); | 371 | spi_master_put(master); |
373 | return err; | 372 | return err; |
374 | } | 373 | } |
@@ -382,7 +381,6 @@ static int tiny_spi_remove(struct platform_device *pdev) | |||
382 | spi_bitbang_stop(&hw->bitbang); | 381 | spi_bitbang_stop(&hw->bitbang); |
383 | for (i = 0; i < hw->gpio_cs_count; i++) | 382 | for (i = 0; i < hw->gpio_cs_count; i++) |
384 | gpio_free(hw->gpio_cs[i]); | 383 | gpio_free(hw->gpio_cs[i]); |
385 | platform_set_drvdata(pdev, NULL); | ||
386 | spi_master_put(master); | 384 | spi_master_put(master); |
387 | return 0; | 385 | return 0; |
388 | } | 386 | } |
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index f5d84d6f8222..5a7fa2cd1efe 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c | |||
@@ -1299,9 +1299,6 @@ static int pxa2xx_spi_remove(struct platform_device *pdev) | |||
1299 | /* Disconnect from the SPI framework */ | 1299 | /* Disconnect from the SPI framework */ |
1300 | spi_unregister_master(drv_data->master); | 1300 | spi_unregister_master(drv_data->master); |
1301 | 1301 | ||
1302 | /* Prevent double remove */ | ||
1303 | platform_set_drvdata(pdev, NULL); | ||
1304 | |||
1305 | return 0; | 1302 | return 0; |
1306 | } | 1303 | } |
1307 | 1304 | ||
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 5000586cb98d..5f3759d9b8f9 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c | |||
@@ -1399,7 +1399,6 @@ err3: | |||
1399 | err2: | 1399 | err2: |
1400 | clk_disable_unprepare(sdd->clk); | 1400 | clk_disable_unprepare(sdd->clk); |
1401 | err0: | 1401 | err0: |
1402 | platform_set_drvdata(pdev, NULL); | ||
1403 | spi_master_put(master); | 1402 | spi_master_put(master); |
1404 | 1403 | ||
1405 | return ret; | 1404 | return ret; |
@@ -1420,7 +1419,6 @@ static int s3c64xx_spi_remove(struct platform_device *pdev) | |||
1420 | 1419 | ||
1421 | clk_disable_unprepare(sdd->clk); | 1420 | clk_disable_unprepare(sdd->clk); |
1422 | 1421 | ||
1423 | platform_set_drvdata(pdev, NULL); | ||
1424 | spi_master_put(master); | 1422 | spi_master_put(master); |
1425 | 1423 | ||
1426 | return 0; | 1424 | return 0; |