]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
soc/tegra: pmc: Use contextual data instead of global variable
authorThierry Reding <treding@nvidia.com>
Mon, 3 Feb 2025 17:17:37 +0000 (18:17 +0100)
committerThierry Reding <treding@nvidia.com>
Sun, 18 Jan 2026 07:48:28 +0000 (08:48 +0100)
Pass the driver-specific data via the syscore struct and use it in the
syscore ops.

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

index 407fa840814c33d816aa0f2c4bd8ac7552e66bec..2f283fc1c6c56d2d278fda44b4a75e0173b892ad 100644 (file)
@@ -3192,6 +3192,7 @@ static void wke_clear_wake_status(struct tegra_pmc *pmc)
 
 static void tegra186_pmc_wake_syscore_resume(void *data)
 {
+       struct tegra_pmc *pmc = data;
        unsigned int i;
        u32 mask;
 
@@ -3206,6 +3207,7 @@ static void tegra186_pmc_wake_syscore_resume(void *data)
 
 static int tegra186_pmc_wake_syscore_suspend(void *data)
 {
+       struct tegra_pmc *pmc = data;
        unsigned int i;
 
        /* Check if there are unhandled wake IRQs */
@@ -3214,6 +3216,7 @@ static int tegra186_pmc_wake_syscore_suspend(void *data)
                        dev_warn(pmc->dev,
                                 "Unhandled wake IRQs pending vector[%u]: 0x%x\n",
                                 i, pmc->wake_status[i]);
+
        wke_read_sw_wake_status(pmc);
 
        /* flip the wakeup trigger for dual-edge triggered pads
@@ -3887,6 +3890,7 @@ static const struct tegra_pmc_regs tegra186_pmc_regs = {
 static void tegra186_pmc_init(struct tegra_pmc *pmc)
 {
        pmc->syscore.ops = &tegra186_pmc_wake_syscore_ops;
+       pmc->syscore.data = pmc;
        register_syscore(&pmc->syscore);
 }