Johan Hovold <johan@kernel.org> says: This series fixes some runtime PM related issues in the orion driver. Included is also a related clean up.
Unified · Split
| @@ -648,8 +648,8 @@ static int orion_spi_probe(struct platform_device *pdev) · 647 unmodified lines | ||
| 648 | 648 | struct orion_spi *spi; |
| 649 | 649 | struct resource *r; |
| 650 | 650 | unsigned long tclk_hz; |
| 651 | − int status = 0; | |
| 652 | 651 | struct device_node *np; |
| 652 | + int status; | |
| 653 | 653 | |
| 654 | 654 | host = spi_alloc_host(&pdev->dev, sizeof(*spi)); |
| 655 | 655 | if (host == NULL) { |
| @@ -774,6 +774,7 @@ static int orion_spi_probe(struct platform_device *pdev) · 118 unmodified lines | ||
| 774 | 774 | pm_runtime_set_active(&pdev->dev); |
| 775 | 775 | pm_runtime_use_autosuspend(&pdev->dev); |
| 776 | 776 | pm_runtime_set_autosuspend_delay(&pdev->dev, SPI_AUTOSUSPEND_TIMEOUT); |
| 777 | + pm_runtime_get_noresume(&pdev->dev); | |
| 777 | 778 | pm_runtime_enable(&pdev->dev); |
| 778 | 779 | |
| 779 | 780 | status = orion_spi_reset(spi); |
| @@ -784,10 +785,15 @@ static int orion_spi_probe(struct platform_device *pdev) · 4 unmodified lines | ||
| 784 | 785 | if (status < 0) |
| 785 | 786 | goto out_rel_pm; |
| 786 | 787 | |
| 787 | − return status; | |
| 788 | + pm_runtime_put_autosuspend(&pdev->dev); | |
| 789 | + | |
| 790 | + return 0; | |
| 788 | 791 | |
| 789 | 792 | out_rel_pm: |
| 790 | 793 | pm_runtime_disable(&pdev->dev); |
| 794 | + pm_runtime_put_noidle(&pdev->dev); | |
| 795 | + pm_runtime_set_suspended(&pdev->dev); | |
| 796 | + pm_runtime_dont_use_autosuspend(&pdev->dev); | |
| 791 | 797 | out_rel_axi_clk: |
| 792 | 798 | clk_disable_unprepare(spi->axi_clk); |
| 793 | 799 | out: |
| @@ -811,6 +817,9 @@ static void orion_spi_remove(struct platform_device *pdev) · 17 unmodified lines | ||
| 811 | 817 | spi_controller_put(host); |
| 812 | 818 | |
| 813 | 819 | pm_runtime_disable(&pdev->dev); |
| 820 | + pm_runtime_put_noidle(&pdev->dev); | |
| 821 | + pm_runtime_set_suspended(&pdev->dev); | |
| 822 | + pm_runtime_dont_use_autosuspend(&pdev->dev); | |
| 814 | 823 | } |
| 815 | 824 | |
| 816 | 825 | MODULE_ALIAS("platform:" DRIVER_NAME); |