Signed-off-by: David E. Box <[email protected]>
---
 arch/x86/Kconfig           | 6 ++++++
 arch/x86/kernel/iosf_mbi.c | 8 ++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 2db4b1d..3afcac3 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -494,6 +494,12 @@ config IOSF_MBI
          You should say Y if you are running a kernel on one of these
          platforms.
 
+config IOSF_MBI_DEBUG
+       bool "Enable debugfs access to IOSF"
+       depends on IOSF_MBI && DEBUG_FS
+       ---help---
+         Select this option to enable iosf sideband debugging through debugfs.
+
 config X86_RDC321X
        bool "RDC R-321x SoC"
        depends on X86_32
diff --git a/arch/x86/kernel/iosf_mbi.c b/arch/x86/kernel/iosf_mbi.c
index e01f741..f884ddc 100644
--- a/arch/x86/kernel/iosf_mbi.c
+++ b/arch/x86/kernel/iosf_mbi.c
@@ -190,7 +190,7 @@ bool iosf_mbi_available(void)
 }
 EXPORT_SYMBOL(iosf_mbi_available);
 
-/********************** debugfs begin ****************************/
+#if (IS_ENABLED(CONFIG_IOSF_MBI_DEBUG))
 static u32     dbg_mdr;
 static u32     dbg_mcr;
 static u32     dbg_mcrx;
@@ -257,7 +257,7 @@ static void iosf_sideband_debug_init(void)
 cleanup:
        debugfs_remove_recursive(d);
 }
-/********************** debugfs end ****************************/
+#endif /* CONFIG_IOSF_MBI_DEBUG */
 
 static int iosf_mbi_probe(struct pci_dev *pdev,
                          const struct pci_device_id *unused)
@@ -290,13 +290,17 @@ static struct pci_driver iosf_mbi_pci_driver = {
 
 static int __init iosf_mbi_init(void)
 {
+#if IS_ENABLED(CONFIG_IOSF_MBI_DEBUG)
        iosf_sideband_debug_init();
+#endif
        return pci_register_driver(&iosf_mbi_pci_driver);
 }
 
 static void __exit iosf_mbi_exit(void)
 {
+#if IS_ENABLED(CONFIG_IOSF_MBI_DEBUG)
        debugfs_remove_recursive(iosf_dbg);
+#endif
 
        pci_unregister_driver(&iosf_mbi_pci_driver);
        if (mbi_pdev) {
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to