OSDN Git Service

gpio: Fix wrong rounding in gpio-menz127
authorNadav Amit <namit@vmware.com>
Mon, 4 Jun 2018 13:58:14 +0000 (06:58 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Oct 2018 23:59:15 +0000 (16:59 -0700)
commitaf4b12c54b3be0d46bffdba1debb811270784110
treedbdd3bbbd05dce35126ec8114e56df9b6869ff46
parent8463cd689be0bf1d27a34ef00a8ffe63c1d89c02
gpio: Fix wrong rounding in gpio-menz127

[ Upstream commit 7279d9917560bbd0d82813d6bf00490a82c06783 ]

men_z127_debounce() tries to round up and down, but uses functions which
are only suitable when the divider is a power of two, which is not the
case. Use the appropriate ones.

Found by static check. Compile tested.

Fixes: f436bc2726c64 ("gpio: add driver for MEN 16Z127 GPIO controller")
Signed-off-by: Nadav Amit <namit@vmware.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpio/gpio-menz127.c