diff --git a/drivers/platform/msm/Kconfig b/drivers/platform/msm/Kconfig index 273ed10ecd3b..9db0e0df006b 100644 --- a/drivers/platform/msm/Kconfig +++ b/drivers/platform/msm/Kconfig @@ -199,7 +199,7 @@ config MSM_11AD config IPA_EMULATION bool "IPA on X86 Linux (IPA emulation support)" - depends on X86 && IPA3 + depends on X86 && IPA3 && IPA_UT help This options is used only when building the X86 version of the IPA/GSI driver. On this mode, IPA driver will be probed diff --git a/drivers/platform/msm/ipa/ipa_api.c b/drivers/platform/msm/ipa/ipa_api.c index 4d297700c7b9..cf24bd95f3ae 100644 --- a/drivers/platform/msm/ipa/ipa_api.c +++ b/drivers/platform/msm/ipa/ipa_api.c @@ -98,8 +98,6 @@ #if defined(CONFIG_IPA_EMULATION) static bool running_emulation = true; -#elif defined(CONFIG_PCI) -static bool running_emulation; #endif static enum ipa_hw_type ipa_api_hw_type; @@ -3196,7 +3194,7 @@ static const struct pci_error_handlers ipa_pci_err_handler = { .resume = ipa_pci_io_resume, }; -static struct pci_driver ipa_pci_driver = { +static struct pci_driver ipa_pci_driver __maybe_unused = { .name = ipa_pci_driver_name, .id_table = ipa_pci_tbl, .probe = ipa_pci_probe, @@ -3848,16 +3846,20 @@ static int ipa_pci_probe( if (result && result != -EPROBE_DEFER) pr_err("ipa: ipa3_pci_drv_probe failed\n"); +#if defined(CONFIG_IPA_EMULATION) if (running_emulation) ipa_ut_module_init(); +#endif return result; } static void ipa_pci_remove(struct pci_dev *pci_dev) { +#if defined(CONFIG_IPA_EMULATION) if (running_emulation) ipa_ut_module_exit(); +#endif } static void ipa_pci_shutdown(struct pci_dev *pci_dev) @@ -3883,7 +3885,7 @@ static void ipa_pci_io_resume(struct pci_dev *pci_dev) static int __init ipa_module_init(void) { pr_debug("IPA module init\n"); -#ifdef CONFIG_PCI +#if defined(CONFIG_PCI) && defined(CONFIG_IPA_EMULATION) if (running_emulation) { /* Register as a PCI device driver */ return pci_register_driver(&ipa_pci_driver);