From: Dmitry Torokhov <dtor_core@ameritech.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@osdl.org>, Vojtech Pavlik <vojtech@ucw.cz>
Subject: [patch 1/7] dmasound_awacs: convert to dynamic input allocation
Date: Wed, 02 Nov 2005 23:21:22 -0500 [thread overview]
Message-ID: <20051103042818.129317000.dtor_core@ameritech.net> (raw)
In-Reply-To: <20051103042121.394220000.dtor_core@ameritech.net>
[-- Attachment #1: input-dynalloc-dmasound.patch --]
[-- Type: text/plain, Size: 2200 bytes --]
From: Ian Wienand <ianw@gelato.unsw.edu.au>
Input: convert dmasound_awacs (OSS) to dynamic input allocation
Signed-off-by: Ian Wienand <ianw@gelato.unsw.edu.au>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
sound/oss/dmasound/dmasound_awacs.c | 31 +++++++++++++++++++------------
1 files changed, 19 insertions(+), 12 deletions(-)
Index: work/sound/oss/dmasound/dmasound_awacs.c
===================================================================
--- work.orig/sound/oss/dmasound/dmasound_awacs.c
+++ work/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)
{
@@ -2907,6 +2898,22 @@ printk("dmasound_pmac: couldn't find a C
return -ENODEV;
}
+ awacs_beep_dev = input_allocate_device();
+ if (!awacs_beep_dev) {
+ release_OF_resource(io, 0);
+ release_OF_resource(io, 1);
+ release_OF_resource(io, 2);
+ printk(KERN_ERR "dmasound: can't allocate input device !\n");
+ return -ENOMEM;
+ }
+
+ 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);
+
/* all OF versions I've seen use this value */
if (i2s_node)
i2s = ioremap(io->addrs[0].address, 0x1000);
@@ -3140,14 +3147,14 @@ 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);
+ 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:
next prev parent reply other threads:[~2005-11-03 4:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-03 4:21 [patch 0/7] Another input update Dmitry Torokhov
2005-11-03 4:21 ` Dmitry Torokhov [this message]
2005-11-03 4:21 ` [patch 2/7] locomokbd: convert to dynamic input allocation Dmitry Torokhov
2005-11-03 4:21 ` [patch 3/7] Do not register statically allocated input devices Dmitry Torokhov
2005-11-03 4:21 ` [patch 4/7] Fix input device deregistration Dmitry Torokhov
2005-11-03 4:21 ` [patch 5/7] locomokbd: fix wrong bustype Dmitry Torokhov
2005-11-03 4:21 ` [patch 6/7] logips2pp: add MX3100 signature Dmitry Torokhov
2005-11-03 4:21 ` [patch 7/7] lkkbd: misc fixes Dmitry Torokhov
2005-11-07 17:28 ` [patch 0/7] Another input update Dmitry Torokhov
2005-11-07 18:31 ` Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051103042818.129317000.dtor_core@ameritech.net \
--to=dtor_core@ameritech.net \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
--cc=vojtech@ucw.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®