[PATCH v3 7/7] soc/tegra: pmc: Use contextual data instead of global variable

From: Thierry Reding

Date: Wed Oct 29 2025 - 12:33:59 EST


From: Thierry Reding <treding@xxxxxxxxxx>

Pass the driver-specific data via the syscore struct and use it in the
syscore ops.

Signed-off-by: Thierry Reding <treding@xxxxxxxxxx>
---
Changes in v3:
- adjust for API changes and update commit message

drivers/soc/tegra/pmc.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
index f57e5a4b4d96..6e0ae0ede263 100644
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -3150,6 +3150,7 @@ static void tegra186_pmc_process_wake_events(struct tegra_pmc *pmc, unsigned int

static void tegra186_pmc_wake_syscore_resume(void *data)
{
+ struct tegra_pmc *pmc = data;
u32 status, mask;
unsigned int i;

@@ -3163,6 +3164,8 @@ static void tegra186_pmc_wake_syscore_resume(void *data)

static int tegra186_pmc_wake_syscore_suspend(void *data)
{
+ struct tegra_pmc *pmc = data;
+
wke_read_sw_wake_status(pmc);

/* flip the wakeup trigger for dual-edge triggered pads
@@ -3836,6 +3839,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);
}

--
2.51.0