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/m68kspkr.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/m68kspkr.c')
-rw-r--r-- | drivers/input/misc/m68kspkr.c | 36 |
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>"); | |||
24 | MODULE_DESCRIPTION("m68k beeper driver"); | 24 | MODULE_DESCRIPTION("m68k beeper driver"); |
25 | MODULE_LICENSE("GPL"); | 25 | MODULE_LICENSE("GPL"); |
26 | 26 | ||
27 | static char m68kspkr_name[] = "m68k beeper"; | 27 | static struct input_dev *m68kspkr_dev; |
28 | static char m68kspkr_phys[] = "m68k/generic"; | ||
29 | static struct input_dev m68kspkr_dev; | ||
30 | 28 | ||
31 | static int m68kspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) | 29 | static 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 | ||
52 | static int __init m68kspkr_init(void) | 50 | static 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 | ||
77 | static void __exit m68kspkr_exit(void) | 77 | static void __exit m68kspkr_exit(void) |
78 | { | 78 | { |
79 | input_unregister_device(&m68kspkr_dev); | 79 | input_unregister_device(m68kspkr_dev); |
80 | } | 80 | } |
81 | 81 | ||
82 | module_init(m68kspkr_init); | 82 | module_init(m68kspkr_init); |