]> www.infradead.org Git - users/jedix/linux-maple.git/commit
regulator: s2mps11: Fix GPIO suspend enable shift wrapping bug
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>
Wed, 24 Jun 2015 10:48:43 +0000 (19:48 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Aug 2015 19:21:56 +0000 (12:21 -0700)
commite4cadcc1c4595b336d7f9f9b1fb51c5afdf9a6f5
tree161cdf8cf917c8205b2d74d281f2c88400f9a0c6
parent1fbb15f220a6740327764b3775566771a4746fe6
regulator: s2mps11: Fix GPIO suspend enable shift wrapping bug

commit 32c848e33ace75fce388cceff76223d12b46eaa3 upstream.

Status of enabling suspend mode for regulator was stored in bitmap-like
long integer.

However since adding support for S2MPU02 the number of regulators
exceeded 32 so on devices with more than 32 regulators (S2MPU02 and
S2MPS13) overflow happens when shifting the bit. This could lead to
enabling suspend mode for completely different regulator than intended
or to switching different regulator to other mode (e.g. from always
enabled to controlled by PWRHOLD pin). Both cases could result in larger
energy usage and issues when suspending to RAM.

Fixes: 00e2573d2c10 ("regulator: s2mps11: Add support S2MPU02 regulator device")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/regulator/s2mps11.c