From 76b7cddfd576331761e945a508254abad11039e9 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Thu, 15 Sep 2005 02:01:51 -0500 Subject: [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 Signed-off-by: Greg Kroah-Hartman --- drivers/input/misc/pcspkr.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'drivers/input/misc/pcspkr.c') 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 "); MODULE_DESCRIPTION("PC Speaker beeper driver"); MODULE_LICENSE("GPL"); -static char pcspkr_name[] = "PC Speaker"; -static char pcspkr_phys[] = "isa0061/input0"; -static struct input_dev pcspkr_dev; +static struct input_dev *pcspkr_dev; static DEFINE_SPINLOCK(i8253_beep_lock); @@ -68,27 +66,29 @@ static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int c static int __init pcspkr_init(void) { - pcspkr_dev.evbit[0] = BIT(EV_SND); - pcspkr_dev.sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE); - pcspkr_dev.event = pcspkr_event; + pcspkr_dev = input_allocate_device(); + if (!pcspkr_dev) + return -ENOMEM; - pcspkr_dev.name = pcspkr_name; - pcspkr_dev.phys = pcspkr_phys; - pcspkr_dev.id.bustype = BUS_ISA; - pcspkr_dev.id.vendor = 0x001f; - pcspkr_dev.id.product = 0x0001; - pcspkr_dev.id.version = 0x0100; + pcspkr_dev->name = "PC Speaker"; + pcspkr_dev->name = "isa0061/input0"; + pcspkr_dev->id.bustype = BUS_ISA; + pcspkr_dev->id.vendor = 0x001f; + pcspkr_dev->id.product = 0x0001; + pcspkr_dev->id.version = 0x0100; - input_register_device(&pcspkr_dev); + pcspkr_dev->evbit[0] = BIT(EV_SND); + pcspkr_dev->sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE); + pcspkr_dev->event = pcspkr_event; - printk(KERN_INFO "input: %s\n", pcspkr_name); + input_register_device(pcspkr_dev); return 0; } static void __exit pcspkr_exit(void) { - input_unregister_device(&pcspkr_dev); + input_unregister_device(pcspkr_dev); /* turn off the speaker */ pcspkr_event(NULL, EV_SND, SND_BELL, 0); } -- cgit v1.2.1