Skip to content

Commit f59dbd0

Browse files
committed
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>
1 parent e6d9607 commit f59dbd0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/soc/tegra/pmc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3192,6 +3192,7 @@ static void wke_clear_wake_status(struct tegra_pmc *pmc)
31923192

31933193
static void tegra186_pmc_wake_syscore_resume(void *data)
31943194
{
3195+
struct tegra_pmc *pmc = data;
31953196
unsigned int i;
31963197
u32 mask;
31973198

@@ -3206,6 +3207,7 @@ static void tegra186_pmc_wake_syscore_resume(void *data)
32063207

32073208
static int tegra186_pmc_wake_syscore_suspend(void *data)
32083209
{
3210+
struct tegra_pmc *pmc = data;
32093211
unsigned int i;
32103212

32113213
/* Check if there are unhandled wake IRQs */
@@ -3214,6 +3216,7 @@ static int tegra186_pmc_wake_syscore_suspend(void *data)
32143216
dev_warn(pmc->dev,
32153217
"Unhandled wake IRQs pending vector[%u]: 0x%x\n",
32163218
i, pmc->wake_status[i]);
3219+
32173220
wke_read_sw_wake_status(pmc);
32183221

32193222
/* flip the wakeup trigger for dual-edge triggered pads
@@ -3887,6 +3890,7 @@ static const struct tegra_pmc_regs tegra186_pmc_regs = {
38873890
static void tegra186_pmc_init(struct tegra_pmc *pmc)
38883891
{
38893892
pmc->syscore.ops = &tegra186_pmc_wake_syscore_ops;
3893+
pmc->syscore.data = pmc;
38903894
register_syscore(&pmc->syscore);
38913895
}
38923896

0 commit comments

Comments
 (0)