aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc/m68kspkr.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/misc/m68kspkr.c')
-rw-r--r--drivers/input/misc/m68kspkr.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/input/misc/m68kspkr.c b/drivers/input/misc/m68kspkr.c
index 64abdd98d482..04489ad7702a 100644
--- a/drivers/input/misc/m68kspkr.c
+++ b/drivers/input/misc/m68kspkr.c
@@ -24,9 +24,7 @@ MODULE_AUTHOR("Richard Zidlicky <rz@linux-m68k.org>");
24MODULE_DESCRIPTION("m68k beeper driver"); 24MODULE_DESCRIPTION("m68k beeper driver");
25MODULE_LICENSE("GPL"); 25MODULE_LICENSE("GPL");
26 26
27static char m68kspkr_name[] = "m68k beeper"; 27static struct input_dev *m68kspkr_dev;
28static char m68kspkr_phys[] = "m68k/generic";
29static struct input_dev m68kspkr_dev;
30 28
31static int m68kspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) 29static int m68kspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
32{ 30{
@@ -51,32 +49,34 @@ static int m68kspkr_event(struct input_dev *dev, unsigned int type, unsigned int
51 49
52static int __init m68kspkr_init(void) 50static int __init m68kspkr_init(void)
53{ 51{
54 if (!mach_beep){ 52 if (!mach_beep) {
55 printk("%s: no lowlevel beep support\n", m68kspkr_name); 53 printk(KERN_INFO "m68kspkr: no lowlevel beep support\n");
56 return -1; 54 return -ENODEV;
57 } 55 }
58 56
59 m68kspkr_dev.evbit[0] = BIT(EV_SND); 57 m68kspkr_dev = input_allocate_device();
60 m68kspkr_dev.sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE); 58 if (!m68kspkr_dev)
61 m68kspkr_dev.event = m68kspkr_event; 59 return -ENOMEM;
62 60
63 m68kspkr_dev.name = m68kspkr_name; 61 m68kspkr_dev->name = "m68k beeper";
64 m68kspkr_dev.phys = m68kspkr_phys; 62 m68kspkr_dev->phys = "m68k/generic";
65 m68kspkr_dev.id.bustype = BUS_HOST; 63 m68kspkr_dev->id.bustype = BUS_HOST;
66 m68kspkr_dev.id.vendor = 0x001f; 64 m68kspkr_dev->id.vendor = 0x001f;
67 m68kspkr_dev.id.product = 0x0001; 65 m68kspkr_dev->id.product = 0x0001;
68 m68kspkr_dev.id.version = 0x0100; 66 m68kspkr_dev->id.version = 0x0100;
69 67
70 input_register_device(&m68kspkr_dev); 68 m68kspkr_dev->evbit[0] = BIT(EV_SND);
69 m68kspkr_dev->sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE);
70 m68kspkr_dev->event = m68kspkr_event;
71 71
72 printk(KERN_INFO "input: %s\n", m68kspkr_name); 72 input_register_device(m68kspkr_dev);
73 73
74 return 0; 74 return 0;
75} 75}
76 76
77static void __exit m68kspkr_exit(void) 77static void __exit m68kspkr_exit(void)
78{ 78{
79 input_unregister_device(&m68kspkr_dev); 79 input_unregister_device(m68kspkr_dev);
80} 80}
81 81
82module_init(m68kspkr_init); 82module_init(m68kspkr_init);