linux-stable/drivers/base/regmap
Javier Martinez Canillas ba1b53feb8 regmap: Fix DT endianess parsing logic
Commit d647c19951 ("regmap: add DT endianness binding support.")
added support to parse the device endianness from the device tree
but unfortunately the added logic doesn't have the same semantics
than the old code. This leads to a NULL dereference pointer error
when these properties are not provided by the Device Tree:

Unable to handle kernel NULL pointer dereference at virtual address 00000044
pgd = c0004000
[00000044] *pgd=00000000
Internal error: Oops: 5 [#1] PREEMPT SMP ARM
Modules linked in:
CPU: 5 PID: 1 Comm: swapper/0 Not tainted 3.17.0-rc1-next-20140818ccu #671
task: ea412800 ti: ea484000 task.ti: ea484000
PC is at regmap_update_bits+0xc/0x5c

The problem is that platforms that rely on the default value now
gets different values due two related issues in the current code:

a) It only parses the endianness from DT for the regmap registers
   and not for the regmap values but it checks unconditionally in
   both cases if the resulting endiannes is REGMAP_ENDIAN_NATIVE.

b) REGMAP_ENDIAN_NATIVE is not even a valid DT property according
   to the regmap DT binding documentation so it shouldn't be set.

Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-08-18 11:39:27 -05:00
..
internal.h regmap: Implementation for regmap_multi_reg_write 2014-03-10 17:09:32 +00:00
Kconfig regmap: add SPMI support 2013-10-28 12:51:43 -07:00
Makefile regmap: add SPMI support 2013-10-28 12:51:43 -07:00
regcache-flat.c regmap: flat: Add flat cache type 2013-01-02 10:58:53 +00:00
regcache-lzo.c regmap: cache: Pass the map rather than the word size when updating values 2013-03-04 10:30:27 +08:00
regcache-rbtree.c regmap: rbtree: improve 64bits memory alignment 2014-04-14 16:59:48 +01:00
regcache.c Merge remote-tracking branches 'regmap/topic/cache', 'regmap/topic/irq', 'regmap/topic/lock', 'regmap/topic/mmio', 'regmap/topic/nodev', 'regmap/topic/parse-val' and 'regmap/topic/patch' into regmap-next 2014-03-28 11:50:43 +00:00
regmap-debugfs.c regmap: debugfs: "registers" & "access" for single register maps 2014-02-03 12:16:24 +00:00
regmap-i2c.c regmap: add DT endianness binding support. 2014-08-16 16:56:23 -05:00
regmap-irq.c regmap: irq: Fix possible ZERO_SIZE_PTR pointer dereferencing error. 2014-05-26 16:37:04 +01:00
regmap-mmio.c Merge remote-tracking branches 'regmap/topic/irq', 'regmap/topic/le', 'regmap/topic/mmio' and 'regmap/topic/rbtree' into regmap-next 2014-06-02 17:07:39 +01:00
regmap-spi.c regmap: add DT endianness binding support. 2014-08-16 16:56:23 -05:00
regmap-spmi.c regmap: spmi: support base and extended register spaces 2014-02-15 11:55:28 -08:00
regmap.c regmap: Fix DT endianess parsing logic 2014-08-18 11:39:27 -05:00