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

PCI: sg2042: Fix a reference count issue in sg2042_pcie_remove()

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

authored by

Christophe JAILLET and committed by
Manivannan Sadhasivam
932ec9df 3a866087

-3
-3
drivers/pci/controller/cadence/pcie-sg2042.c
··· 74 74 static void sg2042_pcie_remove(struct platform_device *pdev) 75 75 { 76 76 struct cdns_pcie *pcie = platform_get_drvdata(pdev); 77 - struct device *dev = &pdev->dev; 78 77 struct cdns_pcie_rc *rc; 79 78 80 79 rc = container_of(pcie, struct cdns_pcie_rc, pcie); 81 80 cdns_pcie_host_disable(rc); 82 81 83 82 cdns_pcie_disable_phy(pcie); 84 - 85 - pm_runtime_disable(dev); 86 83 } 87 84 88 85 static int sg2042_pcie_suspend_noirq(struct device *dev)