power: supply: max17042_battery: fix model download bug.
authorSven Van Asbroeck <thesven73@gmail.com>
Fri, 12 Aug 2016 13:10:27 +0000 (09:10 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Sep 2016 08:12:48 +0000 (10:12 +0200)
commit1a659cc00489659a654dffb66ff9b76b3b9f102d
tree6afbfb3960c8e0889780dad47805c058a5910165
parented3bab5299d8f82cfae121e8cda2a3a7083f396b
power: supply: max17042_battery: fix model download bug.

commit 5381cfb6f0422da24cfa9da35b0433c0415830e0 upstream.

The device's model download function returns the model data as
an array of u32s, which is later compared to the reference
model data. However, since the latter is an array of u16s,
the comparison does not happen correctly, and model verification
fails. This in turn breaks the POR initialization sequence.

Fixes: 39e7213edc4f3 ("max17042_battery: Support regmap to access device's registers")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sven Van Asbroeck <TheSven73@googlemail.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/power/max17042_battery.c