i2c: mpc: use proper binding for transfer timeouts
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Thu, 29 Feb 2024 10:58:12 +0000 (11:58 +0100)
committerAndi Shyti <andi.shyti@kernel.org>
Mon, 4 Mar 2024 22:36:30 +0000 (23:36 +0100)
"i2c-scl-clk-low-timeout-us" is wrongly used here because it describes
maximum clock stretching not maximum transfer time. Additionally, it is
deprecated because of issues. Move this driver to the correct binding.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
drivers/i2c/busses/i2c-mpc.c

index e4e4995ab22430e0cdb50b19167feb3d638bb92a..0b4de9e569baa491956802c1b1d33fd7187b3d66 100644 (file)
@@ -844,14 +844,14 @@ static int fsl_i2c_probe(struct platform_device *op)
                        mpc_i2c_setup_8xxx(op->dev.of_node, i2c, clock);
        }
 
-       /*
-        * "fsl,timeout" has been marked as deprecated and, to maintain
-        * backward compatibility, we will only look for it if
-        * "i2c-scl-clk-low-timeout-us" is not present.
-        */
+       /* Sadly, we have to support two deprecated bindings here */
        result = of_property_read_u32(op->dev.of_node,
-                                     "i2c-scl-clk-low-timeout-us",
+                                     "i2c-transfer-timeout-us",
                                      &mpc_ops.timeout);
+       if (result == -EINVAL)
+               result = of_property_read_u32(op->dev.of_node,
+                                             "i2c-scl-clk-low-timeout-us",
+                                             &mpc_ops.timeout);
        if (result == -EINVAL)
                result = of_property_read_u32(op->dev.of_node,
                                              "fsl,timeout", &mpc_ops.timeout);