mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 23:52:08 +02:00
Merge branch 'pci/controller/cadence-j721e'
- Add config guards to fix build error when sg2042 is a module but j721e is built-in (Siddharth Vadapalli) * pci/controller/cadence-j721e: PCI: j721e: Add config guards for Cadence Host and Endpoint library APIs
This commit is contained in:
commit
cb3ca56468
|
|
@ -620,9 +620,11 @@ static int j721e_pcie_probe(struct platform_device *pdev)
|
|||
gpiod_set_value_cansleep(pcie->reset_gpio, 1);
|
||||
}
|
||||
|
||||
ret = cdns_pcie_host_setup(rc);
|
||||
if (ret < 0)
|
||||
goto err_pcie_setup;
|
||||
if (IS_ENABLED(CONFIG_PCI_J721E_HOST)) {
|
||||
ret = cdns_pcie_host_setup(rc);
|
||||
if (ret < 0)
|
||||
goto err_pcie_setup;
|
||||
}
|
||||
|
||||
break;
|
||||
case PCI_MODE_EP:
|
||||
|
|
@ -632,9 +634,11 @@ static int j721e_pcie_probe(struct platform_device *pdev)
|
|||
goto err_get_sync;
|
||||
}
|
||||
|
||||
ret = cdns_pcie_ep_setup(ep);
|
||||
if (ret < 0)
|
||||
goto err_pcie_setup;
|
||||
if (IS_ENABLED(CONFIG_PCI_J721E_EP)) {
|
||||
ret = cdns_pcie_ep_setup(ep);
|
||||
if (ret < 0)
|
||||
goto err_pcie_setup;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -659,10 +663,11 @@ static void j721e_pcie_remove(struct platform_device *pdev)
|
|||
struct cdns_pcie_ep *ep;
|
||||
struct cdns_pcie_rc *rc;
|
||||
|
||||
if (pcie->mode == PCI_MODE_RC) {
|
||||
if (IS_ENABLED(CONFIG_PCI_J721E_HOST) &&
|
||||
pcie->mode == PCI_MODE_RC) {
|
||||
rc = container_of(cdns_pcie, struct cdns_pcie_rc, pcie);
|
||||
cdns_pcie_host_disable(rc);
|
||||
} else {
|
||||
} else if (IS_ENABLED(CONFIG_PCI_J721E_EP)) {
|
||||
ep = container_of(cdns_pcie, struct cdns_pcie_ep, pcie);
|
||||
cdns_pcie_ep_disable(ep);
|
||||
}
|
||||
|
|
@ -728,10 +733,12 @@ static int j721e_pcie_resume_noirq(struct device *dev)
|
|||
gpiod_set_value_cansleep(pcie->reset_gpio, 1);
|
||||
}
|
||||
|
||||
ret = cdns_pcie_host_link_setup(rc);
|
||||
if (ret < 0) {
|
||||
clk_disable_unprepare(pcie->refclk);
|
||||
return ret;
|
||||
if (IS_ENABLED(CONFIG_PCI_J721E_HOST)) {
|
||||
ret = cdns_pcie_host_link_setup(rc);
|
||||
if (ret < 0) {
|
||||
clk_disable_unprepare(pcie->refclk);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -741,10 +748,12 @@ static int j721e_pcie_resume_noirq(struct device *dev)
|
|||
for (enum cdns_pcie_rp_bar bar = RP_BAR0; bar <= RP_NO_BAR; bar++)
|
||||
rc->avail_ib_bar[bar] = true;
|
||||
|
||||
ret = cdns_pcie_host_init(rc);
|
||||
if (ret) {
|
||||
clk_disable_unprepare(pcie->refclk);
|
||||
return ret;
|
||||
if (IS_ENABLED(CONFIG_PCI_J721E_HOST)) {
|
||||
ret = cdns_pcie_host_init(rc);
|
||||
if (ret) {
|
||||
clk_disable_unprepare(pcie->refclk);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user