summaryrefslogtreecommitdiffstats
path: root/drivers/soc/imx
diff options
context:
space:
mode:
authorDong Aisheng <aisheng.dong@nxp.com>2017-03-23 05:53:20 +0100
committerShawn Guo <shawnguo@kernel.org>2017-03-24 06:42:01 +0100
commit15c3de4e188b567ab60dbff674002a7f4380af6a (patch)
tree2ce26206620aef46a3bb42cf97d5c9bdbc19d58c /drivers/soc/imx
parentsoc: imx: gpc: fix the wrong using of regmap cache (diff)
downloadlinux-15c3de4e188b567ab60dbff674002a7f4380af6a.tar.xz
linux-15c3de4e188b567ab60dbff674002a7f4380af6a.zip
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: 721cabf6c660 ("soc: imx: move PGC handling to a new GPC driver") Acked-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Diffstat (limited to 'drivers/soc/imx')
-rw-r--r--drivers/soc/imx/gpc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/soc/imx/gpc.c b/drivers/soc/imx/gpc.c
index 7e6a672bf5f4..ba6e7ab2c240 100644
--- a/drivers/soc/imx/gpc.c
+++ b/drivers/soc/imx/gpc.c
@@ -413,7 +413,7 @@ static int imx_gpc_probe(struct platform_device *pdev)
of_node_put(np);
return ret;
}
- if (domain_index >= ARRAY_SIZE(imx_gpc_domains))
+ if (domain_index >= of_id_data->num_domains)
continue;
domain = &imx_gpc_domains[domain_index];