aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-imx/imx8m/clock_imx8mm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/mach-imx/imx8m/clock_imx8mm.c b/arch/arm/mach-imx/imx8m/clock_imx8mm.c
index 32f8623f235..22e954b4624 100644
--- a/arch/arm/mach-imx/imx8m/clock_imx8mm.c
+++ b/arch/arm/mach-imx/imx8m/clock_imx8mm.c
@@ -37,14 +37,14 @@ void enable_ocotp_clk(unsigned char enable)
int enable_i2c_clk(unsigned char enable, unsigned i2c_num)
{
- u8 i2c_ccgr[6] = {
+ u8 i2c_ccgr[] = {
CCGR_I2C1, CCGR_I2C2, CCGR_I2C3, CCGR_I2C4,
#if (IS_ENABLED(CONFIG_IMX8MP))
CCGR_I2C5_8MP, CCGR_I2C6_8MP
#endif
};
- if (i2c_num > ARRAY_SIZE(i2c_ccgr))
+ if (i2c_num >= ARRAY_SIZE(i2c_ccgr))
return -EINVAL;
clock_enable(i2c_ccgr[i2c_num], !!enable);