aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc/pcspkr.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2017-09-04 09:22:54 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2017-09-04 09:22:54 -0700
commita6cbfa1e6d38c4b3ab0ce7e3aea4bb4e744f24b8 (patch)
tree8960e571a398b5d32e72bdb9c89ce965daa870ab /drivers/input/misc/pcspkr.c
parentInput: xpad - fix PowerA init quirk for some gamepad models (diff)
parentInput: byd - make array seq static, reduces object code size (diff)
downloadlinux-dev-a6cbfa1e6d38c4b3ab0ce7e3aea4bb4e744f24b8.tar.xz
linux-dev-a6cbfa1e6d38c4b3ab0ce7e3aea4bb4e744f24b8.zip
Merge branch 'next' into for-linus
Prepare input updates for 4.14 merge window.
Diffstat (limited to 'drivers/input/misc/pcspkr.c')
-rw-r--r--drivers/input/misc/pcspkr.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/input/misc/pcspkr.c b/drivers/input/misc/pcspkr.c
index 72b1fc3ab910..56ddba21de84 100644
--- a/drivers/input/misc/pcspkr.c
+++ b/drivers/input/misc/pcspkr.c
@@ -18,25 +18,30 @@
#include <linux/input.h>
#include <linux/platform_device.h>
#include <linux/timex.h>
-#include <asm/io.h>
+#include <linux/io.h>
MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
MODULE_DESCRIPTION("PC Speaker beeper driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:pcspkr");
-static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
+static int pcspkr_event(struct input_dev *dev, unsigned int type,
+ unsigned int code, int value)
{
unsigned int count = 0;
unsigned long flags;
if (type != EV_SND)
- return -1;
+ return -EINVAL;
switch (code) {
- case SND_BELL: if (value) value = 1000;
- case SND_TONE: break;
- default: return -1;
+ case SND_BELL:
+ if (value)
+ value = 1000;
+ case SND_TONE:
+ break;
+ default:
+ return -EINVAL;
}
if (value > 20 && value < 32767)