]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
soc/tegra: pmc: Do not rely on global variable
authorThierry Reding <treding@nvidia.com>
Mon, 3 Feb 2025 13:55:03 +0000 (14:55 +0100)
committerThierry Reding <treding@nvidia.com>
Sun, 18 Jan 2026 07:48:30 +0000 (08:48 +0100)
The reset action for changing the suspend mode back on failure can take
a context-specific data argument that can be set to the PMC context in
order to avoid relying on a global variable.

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

index 9cfa7c3d5cae6467634a49ec36fa2b84bd1038bf..750fe29f4cf59b07270ac17db5271202e287c6c1 100644 (file)
@@ -2944,6 +2944,8 @@ static int tegra_pmc_regmap_init(struct tegra_pmc *pmc)
 
 static void tegra_pmc_reset_suspend_mode(void *data)
 {
+       struct tegra_pmc *pmc = data;
+
        pmc->suspend_mode = TEGRA_SUSPEND_NOT_READY;
 }
 
@@ -2966,7 +2968,7 @@ static int tegra_pmc_probe(struct platform_device *pdev)
                return err;
 
        err = devm_add_action_or_reset(&pdev->dev, tegra_pmc_reset_suspend_mode,
-                                      NULL);
+                                      pmc);
        if (err)
                return err;