Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

spi: cadence: Probe and unbind fixes

Several fixes from Johan for issues with unbind and error handling in
probe.

+13 -2
+13 -2
drivers/spi/spi-cadence.c
··· 741 741 /* Set to default valid value */ 742 742 ctlr->max_speed_hz = xspi->clk_rate / 4; 743 743 xspi->speed_hz = ctlr->max_speed_hz; 744 - pm_runtime_put_autosuspend(&pdev->dev); 745 744 } else { 746 745 ctlr->mode_bits |= SPI_NO_CS; 747 746 ctlr->target_abort = cdns_target_abort; ··· 751 752 goto clk_dis_all; 752 753 } 753 754 755 + if (!spi_controller_is_target(ctlr)) 756 + pm_runtime_put_autosuspend(&pdev->dev); 757 + 754 758 return ret; 755 759 756 760 clk_dis_all: 757 761 if (!spi_controller_is_target(ctlr)) { 758 762 pm_runtime_disable(&pdev->dev); 759 763 pm_runtime_set_suspended(&pdev->dev); 764 + pm_runtime_put_noidle(&pdev->dev); 765 + pm_runtime_dont_use_autosuspend(&pdev->dev); 760 766 } 761 767 remove_ctlr: 762 768 spi_controller_put(ctlr); ··· 780 776 { 781 777 struct spi_controller *ctlr = platform_get_drvdata(pdev); 782 778 struct cdns_spi *xspi = spi_controller_get_devdata(ctlr); 779 + int ret = 0; 780 + 781 + if (!spi_controller_is_target(ctlr)) 782 + ret = pm_runtime_get_sync(&pdev->dev); 783 783 784 784 spi_controller_get(ctlr); 785 785 786 786 spi_unregister_controller(ctlr); 787 787 788 - cdns_spi_write(xspi, CDNS_SPI_ER, CDNS_SPI_ER_DISABLE); 788 + if (ret >= 0) 789 + cdns_spi_write(xspi, CDNS_SPI_ER, CDNS_SPI_ER_DISABLE); 789 790 790 791 if (!spi_controller_is_target(ctlr)) { 791 792 pm_runtime_disable(&pdev->dev); 792 793 pm_runtime_set_suspended(&pdev->dev); 794 + pm_runtime_put_noidle(&pdev->dev); 795 + pm_runtime_dont_use_autosuspend(&pdev->dev); 793 796 } 794 797 795 798 spi_controller_put(ctlr);