]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
soc/tegra: pmc: Pass PMC context as debugfs data
authorThierry Reding <treding@nvidia.com>
Mon, 3 Feb 2025 13:47:15 +0000 (14:47 +0100)
committerThierry Reding <treding@nvidia.com>
Sun, 18 Jan 2026 07:48:29 +0000 (08:48 +0100)
Each debugfs file can have private data associated with it. Use this to
pass the PMC context instead of relying on a global variable.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/soc/tegra/pmc.c

index cd7c557c886b5c5887109baac806d1f5f465d884..f215396206f10e2f22aa0040798c117ee4c119c8 100644 (file)
@@ -1178,6 +1178,7 @@ static int tegra_pmc_power_off_handler(struct sys_off_data *data)
 
 static int powergate_show(struct seq_file *s, void *data)
 {
+       struct tegra_pmc *pmc = data;
        unsigned int i;
        int status;
 
@@ -3097,7 +3098,7 @@ 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, NULL, &powergate_fops);
+       debugfs_create_file("powergate", 0444, NULL, pmc, &powergate_fops);
 
        return 0;