Input: pmic8xxx-pwrkey - set sane default for debounce time
authorStephen Boyd <sboyd@codeaurora.org>
Wed, 14 May 2014 18:58:55 +0000 (11:58 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 14 May 2014 23:40:08 +0000 (16:40 -0700)
commit70a26071f8552a0f193cf442f424decfe0f2e569
treed6002f935f3727ad52fd7928a46c87a71c6d0d7f
parent61616ed0ce2ed581df89be5d917f8d7e9fc3074f
Input: pmic8xxx-pwrkey - set sane default for debounce time

If the debounce time is 0 our usage of ilog2() later on in this driver will
cause undefined behavior. If CONFIG_OF=n this fact is evident to the
compiler, and it emits a call to ____ilog2_NaN() which doesn't exist. Fix
this by setting a sane default for debounce and failing to probe if
debounce is 0 in the DT.

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/misc/pmic8xxx-pwrkey.c