summaryrefslogtreecommitdiffstats
path: root/kernel/drivers/input/misc/gpio-beeper.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/drivers/input/misc/gpio-beeper.c')
-rw-r--r--kernel/drivers/input/misc/gpio-beeper.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/kernel/drivers/input/misc/gpio-beeper.c b/kernel/drivers/input/misc/gpio-beeper.c
index 4817c5f0c..16272fffe 100644
--- a/kernel/drivers/input/misc/gpio-beeper.c
+++ b/kernel/drivers/input/misc/gpio-beeper.c
@@ -66,13 +66,12 @@ static int gpio_beeper_probe(struct platform_device *pdev)
{
struct gpio_beeper *beep;
struct input_dev *input;
- int err;
beep = devm_kzalloc(&pdev->dev, sizeof(*beep), GFP_KERNEL);
if (!beep)
return -ENOMEM;
- beep->desc = devm_gpiod_get(&pdev->dev, NULL);
+ beep->desc = devm_gpiod_get(&pdev->dev, NULL, GPIOD_OUT_LOW);
if (IS_ERR(beep->desc))
return PTR_ERR(beep->desc);
@@ -92,10 +91,6 @@ static int gpio_beeper_probe(struct platform_device *pdev)
input_set_capability(input, EV_SND, SND_BELL);
- err = gpiod_direction_output(beep->desc, 0);
- if (err)
- return err;
-
input_set_drvdata(input, beep);
return input_register_device(input);