Skip to content

Commit e1fd5ad

Browse files
committed
soc/tegra: pmc: Do not rely on global variable
The reset action for changing the suspend mode back on failure can take a context-specific data argument that can be set to the PMC context in order to avoid relying on a global variable. Signed-off-by: Thierry Reding <treding@nvidia.com>
1 parent 2e944c5 commit e1fd5ad

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/soc/tegra/pmc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2944,6 +2944,8 @@ static int tegra_pmc_regmap_init(struct tegra_pmc *pmc)
29442944

29452945
static void tegra_pmc_reset_suspend_mode(void *data)
29462946
{
2947+
struct tegra_pmc *pmc = data;
2948+
29472949
pmc->suspend_mode = TEGRA_SUSPEND_NOT_READY;
29482950
}
29492951

@@ -2966,7 +2968,7 @@ static int tegra_pmc_probe(struct platform_device *pdev)
29662968
return err;
29672969

29682970
err = devm_add_action_or_reset(&pdev->dev, tegra_pmc_reset_suspend_mode,
2969-
NULL);
2971+
pmc);
29702972
if (err)
29712973
return err;
29722974

0 commit comments

Comments
 (0)