Skip to contentSkip to conversation

soc/tegra: pmc: Populate powergate debugfs only when needed

PATCH Applied Jon Hunter 2 participants 2 messages May 22 – May 28 Tegra architecture support

lore
Share & tools
lore

Jon Hunter

author maintainer
#0 lore raw

PATCH 1/1 soc/tegra: pmc: Populate powergate debugfs only when needed

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.

---
 drivers/soc/tegra/pmc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/soc/tegra/pmc.c +2 -1
index 2ee6539d796a..3f9771dd22a5 100644
@@ -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;
 
Signature · 1 line
2.43.0
maintainer Applied
#1 lore raw

From: Thierry Reding <[email protected]>

Quoted 4 lines · 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.

Applied, thanks!

[1/1] soc/tegra: pmc: Populate powergate debugfs only when needed

      commit: e106029fc8749ff20bbe8c1c9bf6c4570ab8681d

Best regards,

Signature · 1 line
Thierry Reding <[email protected]>