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)
committerMark Brown <broonie@kernel.org>
Wed, 24 Jun 2015 11:25:20 +0000 (12:25 +0100)
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>
Cc: <stable@vger.kernel.org>

No differences found