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

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

+25 -16
+25 -16
drivers/pci/controller/cadence/pci-j721e.c
··· 620 620 gpiod_set_value_cansleep(pcie->reset_gpio, 1); 621 621 } 622 622 623 - ret = cdns_pcie_host_setup(rc); 624 - if (ret < 0) 625 - goto err_pcie_setup; 623 + if (IS_ENABLED(CONFIG_PCI_J721E_HOST)) { 624 + ret = cdns_pcie_host_setup(rc); 625 + if (ret < 0) 626 + goto err_pcie_setup; 627 + } 626 628 627 629 break; 628 630 case PCI_MODE_EP: ··· 634 632 goto err_get_sync; 635 633 } 636 634 637 - ret = cdns_pcie_ep_setup(ep); 638 - if (ret < 0) 639 - goto err_pcie_setup; 635 + if (IS_ENABLED(CONFIG_PCI_J721E_EP)) { 636 + ret = cdns_pcie_ep_setup(ep); 637 + if (ret < 0) 638 + goto err_pcie_setup; 639 + } 640 640 641 641 break; 642 642 } ··· 663 659 struct cdns_pcie_ep *ep; 664 660 struct cdns_pcie_rc *rc; 665 661 666 - if (pcie->mode == PCI_MODE_RC) { 662 + if (IS_ENABLED(CONFIG_PCI_J721E_HOST) && 663 + pcie->mode == PCI_MODE_RC) { 667 664 rc = container_of(cdns_pcie, struct cdns_pcie_rc, pcie); 668 665 cdns_pcie_host_disable(rc); 669 - } else { 666 + } else if (IS_ENABLED(CONFIG_PCI_J721E_EP)) { 670 667 ep = container_of(cdns_pcie, struct cdns_pcie_ep, pcie); 671 668 cdns_pcie_ep_disable(ep); 672 669 } ··· 733 728 gpiod_set_value_cansleep(pcie->reset_gpio, 1); 734 729 } 735 730 736 - ret = cdns_pcie_host_link_setup(rc); 737 - if (ret < 0) { 738 - clk_disable_unprepare(pcie->refclk); 739 - return ret; 731 + if (IS_ENABLED(CONFIG_PCI_J721E_HOST)) { 732 + ret = cdns_pcie_host_link_setup(rc); 733 + if (ret < 0) { 734 + clk_disable_unprepare(pcie->refclk); 735 + return ret; 736 + } 740 737 } 741 738 742 739 /* ··· 748 741 for (enum cdns_pcie_rp_bar bar = RP_BAR0; bar <= RP_NO_BAR; bar++) 749 742 rc->avail_ib_bar[bar] = true; 750 743 751 - ret = cdns_pcie_host_init(rc); 752 - if (ret) { 753 - clk_disable_unprepare(pcie->refclk); 754 - return ret; 744 + if (IS_ENABLED(CONFIG_PCI_J721E_HOST)) { 745 + ret = cdns_pcie_host_init(rc); 746 + if (ret) { 747 + clk_disable_unprepare(pcie->refclk); 748 + return ret; 749 + } 755 750 } 756 751 } 757 752