Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 403db2d2 authored by Jon Hunter's avatar Jon Hunter Committed by Thierry Reding
Browse files

soc/tegra: pmc: Ensure powergate is available when powering on



The function tegra_power_sequence_power_up() is a public function used
to power on a partition. When this function is called, we do not check
to see if the partition being powered up is valid/available. Fix this
by checking to see that the partition is valid/available.

Signed-off-by: default avatarJon Hunter <jonathanh@nvidia.com>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent 05cfb988
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -549,6 +549,9 @@ int tegra_powergate_sequence_power_up(unsigned int id, struct clk *clk,
	struct tegra_powergate pg;
	int err;

	if (!tegra_powergate_is_available(id))
		return -EINVAL;

	pg.id = id;
	pg.clks = &clk;
	pg.num_clks = 1;