From: Thierry Reding Date: Mon, 3 Feb 2025 17:17:37 +0000 (+0100) Subject: soc/tegra: pmc: Use contextual data instead of global variable X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f59dbd0c9388321336b0f5c57644fd8b0ee94aa9;p=thirdparty%2Fkernel%2Flinux.git 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 --- diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c index 407fa840814c3..2f283fc1c6c56 100644 --- a/drivers/soc/tegra/pmc.c +++ b/drivers/soc/tegra/pmc.c @@ -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); }