Linux Tegra architecture development
 help / color / mirror / Atom feed
* [PATCH] soc/tegra: pmc: Populate powergate debugfs only when needed
@ 2026-05-22 15:58 Jon Hunter
  2026-05-28 20:38 ` Thierry Reding
  0 siblings, 1 reply; 2+ messages in thread
From: Jon Hunter @ 2026-05-22 15:58 UTC (permalink / raw)
  To: Thierry Reding; +Cc: linux-tegra, Jon Hunter

The 'powergate' debugfs node is used to show the state of the powergates
but for some devices the 'num_powergates' is 0 and so it displays
nothing. Therefore, only populate this debugfs entry for devices where
num_powergates is greater than 0.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 drivers/soc/tegra/pmc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
index 2ee6539d796a..3f9771dd22a5 100644
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -3284,7 +3284,8 @@ static int tegra_pmc_probe(struct platform_device *pdev)
 	if (pmc->soc->set_wake_filters)
 		pmc->soc->set_wake_filters(pmc);
 
-	debugfs_create_file("powergate", 0444, NULL, pmc, &powergate_fops);
+	if (pmc->soc->num_powergates)
+		debugfs_create_file("powergate", 0444, NULL, pmc, &powergate_fops);
 
 	return 0;
 
-- 
2.43.0


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

end of thread, other threads:[~2026-05-28 20:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-22 15:58 [PATCH] soc/tegra: pmc: Populate powergate debugfs only when needed Jon Hunter
2026-05-28 20:38 ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox