Input: pwm-beeper - use input_set_capability()
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 6 Jan 2017 17:54:14 +0000 (09:54 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sun, 22 Jan 2017 08:23:18 +0000 (00:23 -0800)
Instead of manipulating capability bits directly, let's use
input_set_capability() API.

Reviewed-by: Thierry Reding <thierry.reding@gmail.com>
Tested-by: David Lechner <david@lechnology.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/misc/pwm-beeper.c

index f8b163b..58a60b4 100644 (file)
@@ -131,8 +131,8 @@ static int pwm_beeper_probe(struct platform_device *pdev)
        beeper->input->id.product = 0x0001;
        beeper->input->id.version = 0x0100;
 
-       beeper->input->evbit[0] = BIT(EV_SND);
-       beeper->input->sndbit[0] = BIT(SND_TONE) | BIT(SND_BELL);
+       input_set_capability(beeper->input, EV_SND, SND_TONE);
+       input_set_capability(beeper->input, EV_SND, SND_BELL);
 
        beeper->input->event = pwm_beeper_event;
        beeper->input->close = pwm_beeper_close;