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>
Thu, 4 Oct 2018 00:00:53 +0000 (17:00 -0700)
commitde6ccdbd77345349b0134590a71dfcee5e4da791
tree7313ecdf04de879fadd9072831d5c020943b3130
parent5bcbbadf6ac54568019720be6d434bf7020fe3ed
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