]> git.baikalelectronics.ru Git - uboot.git/commit
ARM: imx: imx8mp: fix enable_i2c_clk
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>
Wed, 22 Mar 2023 14:42:05 +0000 (15:42 +0100)
committerStefano Babic <sbabic@denx.de>
Thu, 30 Mar 2023 11:47:04 +0000 (13:47 +0200)
commite1fc824aca4d59ef3938d1f98da644793edb0c3b
tree3305bb49c8bfc6ce16073481c10f4af6829e28be
parent43665e69bb64894597461ae19f09f463f56f7338
ARM: imx: imx8mp: fix enable_i2c_clk

In order for i2c_num==4 and 5 to stay invalid for non-imx8mp SOCs, the
i2c_ccgr[] array must be sized by the number of initializers present,
not with a hard-coded 6 which would implicitly initialize the last two
elements with zeroes.

Also, the bounds check is off-by-one.

Fixes: c027e1f191a5 "ARM: imx: imx8mp: Enable support for i2c5 and i2c6 on i.MX8MP"
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
arch/arm/mach-imx/imx8m/clock_imx8mm.c