Input: twl4030-pwrbutton - use input_set_capability() helper
authorSebastian Reichel <sebastian.reichel@collabora.co.uk>
Fri, 28 Apr 2017 17:27:37 +0000 (10:27 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 1 May 2017 16:29:08 +0000 (09:29 -0700)
Cleanup driver slightly by using input_set_capability() instead
of manually setting the required bits.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/misc/twl4030-pwrbutton.c

index 7c4504c31b0748250dbac66dae69e9a87b0c2fb8..1c13005b228fa79d1538eafd92a125a0abbb2bb4 100644 (file)
@@ -64,8 +64,7 @@ static int twl4030_pwrbutton_probe(struct platform_device *pdev)
                return -ENOMEM;
        }
 
-       pwr->evbit[0] = BIT_MASK(EV_KEY);
-       pwr->keybit[BIT_WORD(KEY_POWER)] = BIT_MASK(KEY_POWER);
+       input_set_capability(pwr, EV_KEY, KEY_POWER);
        pwr->name = "twl4030_pwrbutton";
        pwr->phys = "twl4030_pwrbutton/input0";
        pwr->dev.parent = &pdev->dev;