PCI: rockchip: dw: Add unregister_gpio_hotplug_slot

1.Call register/unregister in pair;
2.Only enable gpio_php when driver built in.

Change-Id: Ib7326a76333a5916842a8e3f15b7fa329b4dde77
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
This commit is contained in:
Jon Lin
2025-08-19 16:38:51 +08:00
committed by Tao Huang
parent a2dced0829
commit e57fa106fe

View File

@@ -1700,7 +1700,7 @@ static int rk_pcie_really_probe(void *p)
if (ret && !rk_pcie->slot_pluggable)
goto deinit_irq_and_wq;
if (rk_pcie->slot_pluggable) {
if (IS_BUILTIN(CONFIG_PCIE_DW_ROCKCHIP) && rk_pcie->slot_pluggable) {
rk_pcie->hp_slot.plat_ops = &rk_pcie_gpio_hp_plat_ops;
rk_pcie->hp_slot.np = rk_pcie->pci->dev->of_node;
rk_pcie->hp_slot.slot_nr = rk_pcie->pci->pp.bridge->busnr;
@@ -1817,6 +1817,9 @@ static int rk_pcie_remove(struct platform_device *pdev)
irq_domain_remove(rk_pcie->irq_domain);
}
if (IS_BUILTIN(CONFIG_PCIE_DW_ROCKCHIP) && rk_pcie->slot_pluggable)
unregister_gpio_hotplug_slot(&rk_pcie->hp_slot);
device_init_wakeup(dev, false);
rk_pcie_host_unconfig(rk_pcie);