linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] soc/tegra: pmc: Use debugfs_initialized()
@ 2023-06-06 15:36 Jon Hunter
  2023-06-06 15:36 ` [PATCH 2/3] soc/tegra: pmc: Add AON SW Wake support for Tegra234 Jon Hunter
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jon Hunter @ 2023-06-06 15:36 UTC (permalink / raw)
  To: Thierry Reding
  Cc: linux-tegra, Petlozu Pravareshwar, Bharat Nihalani, Kartik,
	Jon Hunter

From: Bharat Nihalani <bnihalani@nvidia.com>

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@nvidia.com>
Signed-off-by: Kartik <kkartik@nvidia.com>
Co-developed-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-06-08 16:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-06 15:36 [PATCH 1/3] soc/tegra: pmc: Use debugfs_initialized() Jon Hunter
2023-06-06 15:36 ` [PATCH 2/3] soc/tegra: pmc: Add AON SW Wake support for Tegra234 Jon Hunter
2023-06-06 15:36 ` [PATCH 3/3] soc/tegra: fuse: Fix Tegra234 fuse size Jon Hunter
2023-06-08 16:33 ` [PATCH 1/3] soc/tegra: pmc: Use debugfs_initialized() Thierry Reding
2023-06-08 16:36 ` (subset) " Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).