]> Gentwo Git Trees - linux/.git/commitdiff
PCI: sg2042: Fix a reference count issue in sg2042_pcie_remove()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Mon, 29 Sep 2025 18:13:22 +0000 (20:13 +0200)
committerManivannan Sadhasivam <mani@kernel.org>
Mon, 20 Oct 2025 05:16:59 +0000 (10:46 +0530)
devm_pm_runtime_enable() is used in the probe, so pm_runtime_disable()
should not be called explicitly in the remove function.

Fixes: 1c72774df028 ("PCI: sg2042: Add Sophgo SG2042 PCIe driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Tested-by: Chen Wang <unicorn_wang@outlook.com> # on Pioneerbox.
Acked-by: Chen Wang <unicorn_wang@outlook.com>
Link: https://patch.msgid.link/242eca0ff6601de7966a53706e9950fbcb10aac8.1759169586.git.christophe.jaillet@wanadoo.fr
drivers/pci/controller/cadence/pcie-sg2042.c

index a077b28d489494bbfdea136f7a74cfe717c6731b..0c50c74d03eeb28b00b0ab3d6dd836557fa16ce0 100644 (file)
@@ -74,15 +74,12 @@ static int sg2042_pcie_probe(struct platform_device *pdev)
 static void sg2042_pcie_remove(struct platform_device *pdev)
 {
        struct cdns_pcie *pcie = platform_get_drvdata(pdev);
-       struct device *dev = &pdev->dev;
        struct cdns_pcie_rc *rc;
 
        rc = container_of(pcie, struct cdns_pcie_rc, pcie);
        cdns_pcie_host_disable(rc);
 
        cdns_pcie_disable_phy(pcie);
-
-       pm_runtime_disable(dev);
 }
 
 static int sg2042_pcie_suspend_noirq(struct device *dev)