bus: imx-weim: fix valid range check
authorLucas Stach <l.stach@pengutronix.de>
Fri, 19 Jan 2024 18:50:26 +0000 (19:50 +0100)
committerShawn Guo <shawnguo@kernel.org>
Tue, 6 Feb 2024 06:10:47 +0000 (14:10 +0800)
When the range parsing was open-coded the number of u32 entries to
parse had to be a multiple of 4 and the driver checks this. With
the range parsing converted to the range parser the counting changes
from individual u32 entries to a complete range, so the check must
not reject counts not divisible by 4.

Fixes: 2a88e4792c6d ("bus: imx-weim: Remove open coded "ranges" parsing")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
drivers/bus/imx-weim.c

index 6b5da73c85417644b5885e534c39917e4e5496a3..837bf9d51c6ec93888cec97ecde0eb2a792339e2 100644 (file)
@@ -120,7 +120,7 @@ static int imx_weim_gpr_setup(struct platform_device *pdev)
                i++;
        }
 
-       if (i == 0 || i % 4)
+       if (i == 0)
                goto err;
 
        for (i = 0; i < ARRAY_SIZE(gprvals); i++) {