]> Git Repo - linux.git/commitdiff
Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()"
authorJason A. Donenfeld <[email protected]>
Sat, 8 Oct 2022 15:47:00 +0000 (09:47 -0600)
committerLinus Torvalds <[email protected]>
Sun, 23 Oct 2022 19:04:56 +0000 (12:04 -0700)
This reverts commit 72a95859728a7866522e6633818bebc1c2519b17.

It broke reboots on big-endian MIPS and MIPS64 malta QEMU instances,
which use the syscon driver.  Little-endian is not effected, which means
likely it's important to handle regmap_get_val_endian() in this function
after all.

Fixes: 72a95859728a ("mfd: syscon: Remove repetition of the regmap_get_val_endian()")
Reviewed-by: Andy Shevchenko <[email protected]>
Cc: Lee Jones <[email protected]>
Signed-off-by: Jason A. Donenfeld <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/mfd/syscon.c

index 9489e80e905a0f269f50ebb21e6a4add04567cc4..bdb2ce7ff03b9d086b6ec0c95d0055cb4eb68635 100644 (file)
@@ -66,6 +66,14 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_clk)
                goto err_map;
        }
 
+       /* Parse the device's DT node for an endianness specification */
+       if (of_property_read_bool(np, "big-endian"))
+               syscon_config.val_format_endian = REGMAP_ENDIAN_BIG;
+       else if (of_property_read_bool(np, "little-endian"))
+               syscon_config.val_format_endian = REGMAP_ENDIAN_LITTLE;
+       else if (of_property_read_bool(np, "native-endian"))
+               syscon_config.val_format_endian = REGMAP_ENDIAN_NATIVE;
+
        /*
         * search for reg-io-width property in DT. If it is not provided,
         * default to 4 bytes. regmap_init_mmio will return an error if values
This page took 0.057136 seconds and 4 git commands to generate.