Skip to content

Commit ca4582c

Browse files
zx2c4torvalds
authored andcommitted
Revert "mfd: syscon: Remove repetition of the regmap_get_val_endian()"
This reverts commit 72a9585. 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: 72a9585 ("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]>
1 parent 52826d3 commit ca4582c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/mfd/syscon.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_clk)
6666
goto err_map;
6767
}
6868

69+
/* Parse the device's DT node for an endianness specification */
70+
if (of_property_read_bool(np, "big-endian"))
71+
syscon_config.val_format_endian = REGMAP_ENDIAN_BIG;
72+
else if (of_property_read_bool(np, "little-endian"))
73+
syscon_config.val_format_endian = REGMAP_ENDIAN_LITTLE;
74+
else if (of_property_read_bool(np, "native-endian"))
75+
syscon_config.val_format_endian = REGMAP_ENDIAN_NATIVE;
76+
6977
/*
7078
* search for reg-io-width property in DT. If it is not provided,
7179
* default to 4 bytes. regmap_init_mmio will return an error if values

0 commit comments

Comments
 (0)