From: Bharat Nihalani <bnihalani@xxxxxxxxxx> The kernel command line parameter debugfs=off can be used to dynamically disable debugfs support at boot time. However, the Tegra PMC driver will always attempt to register debugfs entries if CONFIG_DEBUG_FS is enabled. Therefore, if CONFIG_DEBUG_FS is enabled but the user sets debugfs=off, then probing the PMC driver will fail. Fix this by using the function debugfs_initialized() to check if debugfs support is enabled before calling any debugfs functions in the Tegra PMC driver. Note that if CONFIG_DEBUG_FS is not defined debugfs_initialized() will return false. Signed-off-by: Bharat Nihalani <bnihalani@xxxxxxxxxx> Signed-off-by: Kartik <kkartik@xxxxxxxxxx> Co-developed-by: Jon Hunter <jonathanh@xxxxxxxxxx> Signed-off-by: Jon Hunter <jonathanh@xxxxxxxxxx> --- drivers/soc/tegra/pmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c index 5d17799524c9..12e852a8a609 100644 --- a/drivers/soc/tegra/pmc.c +++ b/drivers/soc/tegra/pmc.c @@ -3026,7 +3026,7 @@ static int tegra_pmc_probe(struct platform_device *pdev) tegra_pmc_reset_sysfs_init(pmc); - if (IS_ENABLED(CONFIG_DEBUG_FS)) { + if (debugfs_initialized()) { err = tegra_powergate_debugfs_init(); if (err < 0) goto cleanup_sysfs; -- 2.34.1