diff options
Diffstat (limited to 'drivers/pci/controller/dwc/pcie-designware-host.c')
| -rw-r--r-- | drivers/pci/controller/dwc/pcie-designware-host.c | 19 | 
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c index d1d9b8344ec9..f4755f3a03be 100644 --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -335,6 +335,16 @@ int dw_pcie_host_init(struct pcie_port *pp)  	if (pci->link_gen < 1)  		pci->link_gen = of_pci_get_max_link_speed(np); +	/* Set default bus ops */ +	bridge->ops = &dw_pcie_ops; +	bridge->child_ops = &dw_child_pcie_ops; + +	if (pp->ops->host_init) { +		ret = pp->ops->host_init(pp); +		if (ret) +			return ret; +	} +  	if (pci_msi_enabled()) {  		pp->has_msi_ctrl = !(pp->ops->msi_host_init ||  				     of_property_read_bool(np, "msi-parent") || @@ -388,15 +398,6 @@ int dw_pcie_host_init(struct pcie_port *pp)  		}  	} -	/* Set default bus ops */ -	bridge->ops = &dw_pcie_ops; -	bridge->child_ops = &dw_child_pcie_ops; - -	if (pp->ops->host_init) { -		ret = pp->ops->host_init(pp); -		if (ret) -			goto err_free_msi; -	}  	dw_pcie_iatu_detect(pci);  	dw_pcie_setup_rc(pp);  | 
