diff options
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-bcm2835.c | 2 | ||||
-rw-r--r-- | drivers/spi/spi-bcm63xx.c | 2 | ||||
-rw-r--r-- | drivers/spi/spi-mpc512x-psc.c | 2 | ||||
-rw-r--r-- | drivers/spi/spi-mxs.c | 2 | ||||
-rw-r--r-- | drivers/spi/spi-pxa2xx.c | 5 | ||||
-rw-r--r-- | drivers/spi/spi-rspi.c | 3 | ||||
-rw-r--r-- | drivers/spi/spi-ti-qspi.c | 23 | ||||
-rw-r--r-- | drivers/spi/spi-txx9.c | 2 | ||||
-rw-r--r-- | drivers/spi/spi.c | 2 |
9 files changed, 31 insertions, 12 deletions
diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c index 3ed666fe840a..9025edd7dc45 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c | |||
@@ -377,7 +377,7 @@ out_master_put: | |||
377 | 377 | ||
378 | static int bcm2835_spi_remove(struct platform_device *pdev) | 378 | static int bcm2835_spi_remove(struct platform_device *pdev) |
379 | { | 379 | { |
380 | struct spi_master *master = spi_master_get(platform_get_drvdata(pdev)); | 380 | struct spi_master *master = platform_get_drvdata(pdev); |
381 | struct bcm2835_spi *bs = spi_master_get_devdata(master); | 381 | struct bcm2835_spi *bs = spi_master_get_devdata(master); |
382 | 382 | ||
383 | free_irq(bs->irq, master); | 383 | free_irq(bs->irq, master); |
diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c index 80d56b214eb5..469ecd876358 100644 --- a/drivers/spi/spi-bcm63xx.c +++ b/drivers/spi/spi-bcm63xx.c | |||
@@ -435,7 +435,7 @@ out: | |||
435 | 435 | ||
436 | static int bcm63xx_spi_remove(struct platform_device *pdev) | 436 | static int bcm63xx_spi_remove(struct platform_device *pdev) |
437 | { | 437 | { |
438 | struct spi_master *master = spi_master_get(platform_get_drvdata(pdev)); | 438 | struct spi_master *master = platform_get_drvdata(pdev); |
439 | struct bcm63xx_spi *bs = spi_master_get_devdata(master); | 439 | struct bcm63xx_spi *bs = spi_master_get_devdata(master); |
440 | 440 | ||
441 | /* reset spi block */ | 441 | /* reset spi block */ |
diff --git a/drivers/spi/spi-mpc512x-psc.c b/drivers/spi/spi-mpc512x-psc.c index 9602bbd8d7ea..87676587d783 100644 --- a/drivers/spi/spi-mpc512x-psc.c +++ b/drivers/spi/spi-mpc512x-psc.c | |||
@@ -557,7 +557,7 @@ free_master: | |||
557 | 557 | ||
558 | static int mpc512x_psc_spi_do_remove(struct device *dev) | 558 | static int mpc512x_psc_spi_do_remove(struct device *dev) |
559 | { | 559 | { |
560 | struct spi_master *master = spi_master_get(dev_get_drvdata(dev)); | 560 | struct spi_master *master = dev_get_drvdata(dev); |
561 | struct mpc512x_psc_spi *mps = spi_master_get_devdata(master); | 561 | struct mpc512x_psc_spi *mps = spi_master_get_devdata(master); |
562 | 562 | ||
563 | clk_disable_unprepare(mps->clk_mclk); | 563 | clk_disable_unprepare(mps->clk_mclk); |
diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c index 73afb56c08cc..3adebfa22e3d 100644 --- a/drivers/spi/spi-mxs.c +++ b/drivers/spi/spi-mxs.c | |||
@@ -565,7 +565,7 @@ static int mxs_spi_remove(struct platform_device *pdev) | |||
565 | struct mxs_spi *spi; | 565 | struct mxs_spi *spi; |
566 | struct mxs_ssp *ssp; | 566 | struct mxs_ssp *ssp; |
567 | 567 | ||
568 | master = spi_master_get(platform_get_drvdata(pdev)); | 568 | master = platform_get_drvdata(pdev); |
569 | spi = spi_master_get_devdata(master); | 569 | spi = spi_master_get_devdata(master); |
570 | ssp = &spi->ssp; | 570 | ssp = &spi->ssp; |
571 | 571 | ||
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index cb0e1f1137ad..7765b1999537 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c | |||
@@ -1073,6 +1073,8 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev) | |||
1073 | static struct acpi_device_id pxa2xx_spi_acpi_match[] = { | 1073 | static struct acpi_device_id pxa2xx_spi_acpi_match[] = { |
1074 | { "INT33C0", 0 }, | 1074 | { "INT33C0", 0 }, |
1075 | { "INT33C1", 0 }, | 1075 | { "INT33C1", 0 }, |
1076 | { "INT3430", 0 }, | ||
1077 | { "INT3431", 0 }, | ||
1076 | { "80860F0E", 0 }, | 1078 | { "80860F0E", 0 }, |
1077 | { }, | 1079 | { }, |
1078 | }; | 1080 | }; |
@@ -1291,6 +1293,9 @@ static int pxa2xx_spi_resume(struct device *dev) | |||
1291 | /* Enable the SSP clock */ | 1293 | /* Enable the SSP clock */ |
1292 | clk_prepare_enable(ssp->clk); | 1294 | clk_prepare_enable(ssp->clk); |
1293 | 1295 | ||
1296 | /* Restore LPSS private register bits */ | ||
1297 | lpss_ssp_setup(drv_data); | ||
1298 | |||
1294 | /* Start the queue running */ | 1299 | /* Start the queue running */ |
1295 | status = spi_master_resume(drv_data->master); | 1300 | status = spi_master_resume(drv_data->master); |
1296 | if (status != 0) { | 1301 | if (status != 0) { |
diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c index 58449ad4ad0d..9e829cee7357 100644 --- a/drivers/spi/spi-rspi.c +++ b/drivers/spi/spi-rspi.c | |||
@@ -885,14 +885,13 @@ static void rspi_release_dma(struct rspi_data *rspi) | |||
885 | 885 | ||
886 | static int rspi_remove(struct platform_device *pdev) | 886 | static int rspi_remove(struct platform_device *pdev) |
887 | { | 887 | { |
888 | struct rspi_data *rspi = spi_master_get(platform_get_drvdata(pdev)); | 888 | struct rspi_data *rspi = platform_get_drvdata(pdev); |
889 | 889 | ||
890 | spi_unregister_master(rspi->master); | 890 | spi_unregister_master(rspi->master); |
891 | rspi_release_dma(rspi); | 891 | rspi_release_dma(rspi); |
892 | free_irq(platform_get_irq(pdev, 0), rspi); | 892 | free_irq(platform_get_irq(pdev, 0), rspi); |
893 | clk_put(rspi->clk); | 893 | clk_put(rspi->clk); |
894 | iounmap(rspi->addr); | 894 | iounmap(rspi->addr); |
895 | spi_master_put(rspi->master); | ||
896 | 895 | ||
897 | return 0; | 896 | return 0; |
898 | } | 897 | } |
diff --git a/drivers/spi/spi-ti-qspi.c b/drivers/spi/spi-ti-qspi.c index 0b71270fbf67..4396bd448540 100644 --- a/drivers/spi/spi-ti-qspi.c +++ b/drivers/spi/spi-ti-qspi.c | |||
@@ -161,7 +161,7 @@ static int ti_qspi_setup(struct spi_device *spi) | |||
161 | qspi->spi_max_frequency, clk_div); | 161 | qspi->spi_max_frequency, clk_div); |
162 | 162 | ||
163 | ret = pm_runtime_get_sync(qspi->dev); | 163 | ret = pm_runtime_get_sync(qspi->dev); |
164 | if (ret) { | 164 | if (ret < 0) { |
165 | dev_err(qspi->dev, "pm_runtime_get_sync() failed\n"); | 165 | dev_err(qspi->dev, "pm_runtime_get_sync() failed\n"); |
166 | return ret; | 166 | return ret; |
167 | } | 167 | } |
@@ -459,11 +459,10 @@ static int ti_qspi_probe(struct platform_device *pdev) | |||
459 | if (!of_property_read_u32(np, "num-cs", &num_cs)) | 459 | if (!of_property_read_u32(np, "num-cs", &num_cs)) |
460 | master->num_chipselect = num_cs; | 460 | master->num_chipselect = num_cs; |
461 | 461 | ||
462 | platform_set_drvdata(pdev, master); | ||
463 | |||
464 | qspi = spi_master_get_devdata(master); | 462 | qspi = spi_master_get_devdata(master); |
465 | qspi->master = master; | 463 | qspi->master = master; |
466 | qspi->dev = &pdev->dev; | 464 | qspi->dev = &pdev->dev; |
465 | platform_set_drvdata(pdev, qspi); | ||
467 | 466 | ||
468 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 467 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
469 | 468 | ||
@@ -517,10 +516,26 @@ free_master: | |||
517 | 516 | ||
518 | static int ti_qspi_remove(struct platform_device *pdev) | 517 | static int ti_qspi_remove(struct platform_device *pdev) |
519 | { | 518 | { |
520 | struct ti_qspi *qspi = platform_get_drvdata(pdev); | 519 | struct spi_master *master; |
520 | struct ti_qspi *qspi; | ||
521 | int ret; | ||
522 | |||
523 | master = platform_get_drvdata(pdev); | ||
524 | qspi = spi_master_get_devdata(master); | ||
525 | |||
526 | ret = pm_runtime_get_sync(qspi->dev); | ||
527 | if (ret < 0) { | ||
528 | dev_err(qspi->dev, "pm_runtime_get_sync() failed\n"); | ||
529 | return ret; | ||
530 | } | ||
521 | 531 | ||
522 | ti_qspi_write(qspi, QSPI_WC_INT_DISABLE, QSPI_INTR_ENABLE_CLEAR_REG); | 532 | ti_qspi_write(qspi, QSPI_WC_INT_DISABLE, QSPI_INTR_ENABLE_CLEAR_REG); |
523 | 533 | ||
534 | pm_runtime_put(qspi->dev); | ||
535 | pm_runtime_disable(&pdev->dev); | ||
536 | |||
537 | spi_unregister_master(master); | ||
538 | |||
524 | return 0; | 539 | return 0; |
525 | } | 540 | } |
526 | 541 | ||
diff --git a/drivers/spi/spi-txx9.c b/drivers/spi/spi-txx9.c index 637cce2b8bdd..18c9bb2b5f39 100644 --- a/drivers/spi/spi-txx9.c +++ b/drivers/spi/spi-txx9.c | |||
@@ -425,7 +425,7 @@ exit: | |||
425 | 425 | ||
426 | static int txx9spi_remove(struct platform_device *dev) | 426 | static int txx9spi_remove(struct platform_device *dev) |
427 | { | 427 | { |
428 | struct spi_master *master = spi_master_get(platform_get_drvdata(dev)); | 428 | struct spi_master *master = platform_get_drvdata(dev); |
429 | struct txx9spi *c = spi_master_get_devdata(master); | 429 | struct txx9spi *c = spi_master_get_devdata(master); |
430 | 430 | ||
431 | destroy_workqueue(c->workqueue); | 431 | destroy_workqueue(c->workqueue); |
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 18cc625d887f..349ebba4b199 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c | |||
@@ -1415,7 +1415,7 @@ int devm_spi_register_master(struct device *dev, struct spi_master *master) | |||
1415 | return -ENOMEM; | 1415 | return -ENOMEM; |
1416 | 1416 | ||
1417 | ret = spi_register_master(master); | 1417 | ret = spi_register_master(master); |
1418 | if (ret != 0) { | 1418 | if (!ret) { |
1419 | *ptr = master; | 1419 | *ptr = master; |
1420 | devres_add(dev, ptr); | 1420 | devres_add(dev, ptr); |
1421 | } else { | 1421 | } else { |