public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Convert dmasound_awacs to dynamic input_dev allocation
@ 2005-11-01  2:03 Ian Wienand
  2005-11-01  3:17 ` Dmitry Torokhov
  0 siblings, 1 reply; 10+ messages in thread
From: Ian Wienand @ 2005-11-01  2:03 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1626 bytes --]

Hi,

This patch converts sound/oss/dmasound/dmasound_awacs.c to use dynamic
input_dev allocation, stopping an oops on boot with the latest
kernels.

Thanks,

-i

Signed-off-by: Ian Wienand <ianw@gelato.unsw.edu.au>

---
diff --git a/sound/oss/dmasound/dmasound_awacs.c b/sound/oss/dmasound/dmasound_awacs.c
--- a/sound/oss/dmasound/dmasound_awacs.c
+++ b/sound/oss/dmasound/dmasound_awacs.c
@@ -2805,16 +2805,7 @@ __init setup_beep(void)
 	return 0 ;
 }
 
-static struct input_dev awacs_beep_dev = {
-	.evbit		= { BIT(EV_SND) },
-	.sndbit		= { BIT(SND_BELL) | BIT(SND_TONE) },
-	.event		= awacs_beep_event,
-	.name		= "dmasound beeper",
-	.phys		= "macio/input0", /* what the heck is this?? */
-	.id		= {
-		.bustype	= BUS_HOST,
-	},
-};
+static struct input_dev *awacs_beep_dev;
 
 int __init dmasound_awacs_init(void)
 {
@@ -3140,14 +3131,22 @@ printk("dmasound_pmac: Awacs/Screamer Co
 	 * XXX: we should handle errors here, but that would mean
 	 * rewriting the whole init code.  later..
 	 */
-	input_register_device(&awacs_beep_dev);
+	awacs_beep_dev = input_allocate_device();
+	awacs_beep_dev->name = "dmasound beeper";
+	awacs_beep_dev->phys = "macio/input0";
+	awacs_beep_dev->id.bustype = BUS_HOST;
+	awacs_beep_dev->event = awacs_beep_event;
+	awacs_beep_dev->sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE);
+	awacs_beep_dev->evbit[0] = BIT(EV_SND);
+
+	input_register_device(awacs_beep_dev);
 
 	return dmasound_init();
 }
 
 static void __exit dmasound_awacs_cleanup(void)
 {
-	input_unregister_device(&awacs_beep_dev);
+	input_unregister_device(awacs_beep_dev);
 
 	switch (awacs_revision) {
 		case AWACS_TUMBLER:

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-11-01 13:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-01  2:03 [PATCH] Convert dmasound_awacs to dynamic input_dev allocation Ian Wienand
2005-11-01  3:17 ` Dmitry Torokhov
2005-11-01  3:59   ` Ian Wienand
2005-11-01  5:14     ` Dmitry Torokhov
2005-11-01  5:50       ` Ian Wienand
2005-11-01  5:55         ` Dmitry Torokhov
2005-11-01  6:04           ` Ian Wienand
2005-11-01  6:14             ` Dmitry Torokhov
2005-11-01 10:33               ` Ian Wienand
2005-11-01 13:03                 ` Pekka Enberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox