diff options
author | Dmitry Torokhov <dtor_core@ameritech.net> | 2005-09-15 03:01:51 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-10-28 12:52:53 -0400 |
commit | 76b7cddfd576331761e945a508254abad11039e9 (patch) | |
tree | 83872a999a710df1de5ded7acf966dd2a4221121 /drivers/input/misc/pcspkr.c | |
parent | 88789672424375882166df86adde9dd77ead630e (diff) |
[PATCH] Input: convert driver/input/misc to dynamic input_dev allocation
Input: convert driver/input/misc to dynamic input_dev allocation
This is required for input_dev sysfs integration
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/input/misc/pcspkr.c')
-rw-r--r-- | drivers/input/misc/pcspkr.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/input/misc/pcspkr.c b/drivers/input/misc/pcspkr.c index 3013194f462b..e34633c37fdd 100644 --- a/drivers/input/misc/pcspkr.c +++ b/drivers/input/misc/pcspkr.c | |||
@@ -23,9 +23,7 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); | |||
23 | MODULE_DESCRIPTION("PC Speaker beeper driver"); | 23 | MODULE_DESCRIPTION("PC Speaker beeper driver"); |
24 | MODULE_LICENSE("GPL"); | 24 | MODULE_LICENSE("GPL"); |
25 | 25 | ||
26 | static char pcspkr_name[] = "PC Speaker"; | 26 | static struct input_dev *pcspkr_dev; |
27 | static char pcspkr_phys[] = "isa0061/input0"; | ||
28 | static struct input_dev pcspkr_dev; | ||
29 | 27 | ||
30 | static DEFINE_SPINLOCK(i8253_beep_lock); | 28 | static DEFINE_SPINLOCK(i8253_beep_lock); |
31 | 29 | ||
@@ -68,27 +66,29 @@ static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int c | |||
68 | 66 | ||
69 | static int __init pcspkr_init(void) | 67 | static int __init pcspkr_init(void) |
70 | { | 68 | { |
71 | pcspkr_dev.evbit[0] = BIT(EV_SND); | 69 | pcspkr_dev = input_allocate_device(); |
72 | pcspkr_dev.sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE); | 70 | if (!pcspkr_dev) |
73 | pcspkr_dev.event = pcspkr_event; | 71 | return -ENOMEM; |
74 | 72 | ||
75 | pcspkr_dev.name = pcspkr_name; | 73 | pcspkr_dev->name = "PC Speaker"; |
76 | pcspkr_dev.phys = pcspkr_phys; | 74 | pcspkr_dev->name = "isa0061/input0"; |
77 | pcspkr_dev.id.bustype = BUS_ISA; | 75 | pcspkr_dev->id.bustype = BUS_ISA; |
78 | pcspkr_dev.id.vendor = 0x001f; | 76 | pcspkr_dev->id.vendor = 0x001f; |
79 | pcspkr_dev.id.product = 0x0001; | 77 | pcspkr_dev->id.product = 0x0001; |
80 | pcspkr_dev.id.version = 0x0100; | 78 | pcspkr_dev->id.version = 0x0100; |
81 | 79 | ||
82 | input_register_device(&pcspkr_dev); | 80 | pcspkr_dev->evbit[0] = BIT(EV_SND); |
81 | pcspkr_dev->sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE); | ||
82 | pcspkr_dev->event = pcspkr_event; | ||
83 | 83 | ||
84 | printk(KERN_INFO "input: %s\n", pcspkr_name); | 84 | input_register_device(pcspkr_dev); |
85 | 85 | ||
86 | return 0; | 86 | return 0; |
87 | } | 87 | } |
88 | 88 | ||
89 | static void __exit pcspkr_exit(void) | 89 | static void __exit pcspkr_exit(void) |
90 | { | 90 | { |
91 | input_unregister_device(&pcspkr_dev); | 91 | input_unregister_device(pcspkr_dev); |
92 | /* turn off the speaker */ | 92 | /* turn off the speaker */ |
93 | pcspkr_event(NULL, EV_SND, SND_BELL, 0); | 93 | pcspkr_event(NULL, EV_SND, SND_BELL, 0); |
94 | } | 94 | } |