tegra_bootloader_debug: use runtime debugfs check

When kernel command line debugfs=off is specified instead of
disabling CONFIG_DEBUG_FS in defconfig to disable Debug-FS,
debugfs functions like debugfs_create_dir will fail.

Use function debugfs_initialized() to check if debugfs
functionality is enabled before calling any debugfs functions.

This allows us to by-pass debugfs initialization if debugfs
is not enabled.

Bug 3896536

Change-Id: I18182f2e5f8a6b466286980907b2019961ff7e39
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2864651
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Bharat Nihalani
2023-02-28 07:00:26 +00:00
committed by mobile promotions
parent d831cd1882
commit ae8499fa84

View File

@@ -311,6 +311,7 @@ static int __init tegra_bootloader_debuginit(void)
void __iomem *ptr_bl_debug_data_start = NULL;
void __iomem *ptr_bl_boot_cfg_start = NULL;
if (debugfs_initialized()) {
bl_debug_node = debugfs_create_dir(dir_name, NULL);
if (IS_ERR_OR_NULL(bl_debug_node)) {
@@ -395,7 +396,9 @@ static int __init tegra_bootloader_debuginit(void)
(unsigned int)tegra_bl_bcp_start);
goto out_err;
}
tegra_bl_mapped_boot_cfg_start = (__force void *)ptr_bl_boot_cfg_start;
tegra_bl_mapped_boot_cfg_start =
(__force void *)ptr_bl_boot_cfg_start;
}
}
}
#endif /* CONFIG_DEBUG_FS */