Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1632833

[PATCH 2/2] Input: twl4030-pwrbutton: Use input_set_capability() helper

From Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Newsgroups linux.kernel
Subject [PATCH 2/2] Input: twl4030-pwrbutton: Use input_set_capability() helper
Date 2017-04-28 14:30 +0200
Message-ID <tBdc6-7bX-13@gated-at.bofh.it> (permalink)
References <tBdc6-7bX-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 drivers/input/misc/twl4030-pwrbutton.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/input/misc/twl4030-pwrbutton.c b/drivers/input/misc/twl4030-pwrbutton.c
index 7c4504c31b07..1c13005b228f 100644
--- a/drivers/input/misc/twl4030-pwrbutton.c
+++ b/drivers/input/misc/twl4030-pwrbutton.c
@@ -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;
-- 
2.11.0

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 2/2] Input: twl4030-pwrbutton: Use input_set_capability() helper Sebastian Reichel <sebastian.reichel@collabora.co.uk> - 2017-04-28 14:30 +0200
  Re: [PATCH 2/2] Input: twl4030-pwrbutton: Use input_set_capability()  helper Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-04-28 19:30 +0200

csiph-web