soc/tegra: pmc: Use contextual data instead of global variable

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

Signed-off-by: Thierry Reding <treding@nvidia.com>
This commit is contained in:
Thierry Reding 2025-02-03 18:17:37 +01:00
parent e6d96073af
commit f59dbd0c93

View 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);
}