OSDN Git Service

regulator: max77686: fix gpio_enabled shift wrapping bug
authorJoe Perches <joe@perches.com>
Mon, 18 May 2015 17:01:03 +0000 (10:01 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Jul 2015 17:10:13 +0000 (10:10 -0700)
commit90562490995b74c370a2152ba571229e9c8666ea
tree7eb48fa04e819ceccfc1e0b6b2e0250d081116ca
parenta615d483d22b2c3f0b413d74b6f3e6e4f2726acd
regulator: max77686: fix gpio_enabled shift wrapping bug

commit c53403a37cf083ce85da720f18918f73580d0064 upstream.

The code should handle more than 32 bits here because "id"
can be a value up to MAX77686_REGULATORS (currently 34).

Convert the gpio_enabled type to DECLARE_BITMAP and use
test_bit/set_bit.

Fixes: 3307e9025d29 ("regulator: max77686: Add GPIO control")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Joe Perches <joe@perches.com>
Reviewed-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/max77686.c