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

Commit 15c3de4e authored by Dong Aisheng's avatar Dong Aisheng Committed by Shawn Guo
Browse files

soc: imx: gpc: fix domain_index sanity check issue



ARRAY_SIZE(imx_gpc_domains) represents all power domains supported
by different SoCs. Driver should use SoC specific of_id_data->num_domains
instead to do power domain index sanity check.
e.g. MX6Q supports two power domains while MX6SL supports three.

Fixes: 721cabf6 ("soc: imx: move PGC handling to a new GPC driver")
Acked-by: default avatarLucas Stach <l.stach@pengutronix.de>
Signed-off-by: default avatarDong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: default avatarShawn Guo <shawnguo@kernel.org>
parent 3a317f52
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -413,7 +413,7 @@ static int imx_gpc_probe(struct platform_device *pdev)
				of_node_put(np);
				of_node_put(np);
				return ret;
				return ret;
			}
			}
			if (domain_index >= ARRAY_SIZE(imx_gpc_domains))
			if (domain_index >= of_id_data->num_domains)
				continue;
				continue;


			domain = &imx_gpc_domains[domain_index];
			domain = &imx_gpc_domains[domain_index];