@@ -424,7 +424,9 @@ int dw_pcie_host_init(struct pcie_port *pp)
return 0;
err_free_msi:
- if (pp->has_msi_ctrl)
+ if (pp->ops->msi_host_deinit)
+ pp->ops->msi_host_deinit(pp);
+ else if (pp->has_msi_ctrl)
dw_pcie_free_msi(pp);
return ret;
}
@@ -434,7 +436,9 @@ void dw_pcie_host_deinit(struct pcie_port *pp)
{
pci_stop_root_bus(pp->bridge->bus);
pci_remove_root_bus(pp->bridge->bus);
- if (pp->has_msi_ctrl)
+ if (pp->ops->msi_host_deinit)
+ pp->ops->msi_host_deinit(pp);
+ else if (pp->has_msi_ctrl)
dw_pcie_free_msi(pp);
}
EXPORT_SYMBOL_GPL(dw_pcie_host_deinit);
@@ -175,6 +175,7 @@ enum dw_pcie_device_mode {
struct dw_pcie_host_ops {
int (*host_init)(struct pcie_port *pp);
int (*msi_host_init)(struct pcie_port *pp);
+ void (*msi_host_deinit)(struct pcie_port *pp);
};
struct pcie_port {
Add msi_host_deinit() callback as a counterpart to msi_host_init(). It will tear down MSI support in case host has to run host-specific ops. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> --- drivers/pci/controller/dwc/pcie-designware-host.c | 8 ++++++-- drivers/pci/controller/dwc/pcie-designware.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-)