diff options
author | Dmitry Torokhov <dtor_core@ameritech.net> | 2005-09-15 03:01:44 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-10-28 12:52:52 -0400 |
commit | 2e5b636bb5f8dacbb91d08544e2c41ebcad5dace (patch) | |
tree | 059a2078d7b11713cad4675a9d8a062337957102 /drivers/input/mouse/maplemouse.c | |
parent | d19fbe8a763634395d4bef40fc88cdb61c4a6274 (diff) |
[PATCH] drivers/input/mouse: convert to dynamic input_dev allocation
Input: convert drivers/input/mouse 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/mouse/maplemouse.c')
-rw-r--r-- | drivers/input/mouse/maplemouse.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/input/mouse/maplemouse.c b/drivers/input/mouse/maplemouse.c index e90c60cbbf05..b5b34fe4fee8 100644 --- a/drivers/input/mouse/maplemouse.c +++ b/drivers/input/mouse/maplemouse.c | |||
@@ -41,13 +41,12 @@ static int dc_mouse_connect(struct maple_device *dev) | |||
41 | unsigned long data = be32_to_cpu(dev->devinfo.function_data[0]); | 41 | unsigned long data = be32_to_cpu(dev->devinfo.function_data[0]); |
42 | struct input_dev *input_dev; | 42 | struct input_dev *input_dev; |
43 | 43 | ||
44 | if (!(input_dev = kmalloc(sizeof(struct input_dev), GFP_KERNEL))) | 44 | dev->private_data = input_dev = input_allocate_device(); |
45 | return -1; | 45 | if (!input_dev) |
46 | return -ENOMEM; | ||
46 | 47 | ||
47 | dev->private_data = input_dev; | 48 | dev->private_data = input_dev; |
48 | 49 | ||
49 | memset(input_dev, 0, sizeof(struct dc_mouse)); | ||
50 | init_input_dev(input_dev); | ||
51 | input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); | 50 | input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REL); |
52 | input_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); | 51 | input_dev->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_RIGHT) | BIT(BTN_MIDDLE); |
53 | input_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y) | BIT(REL_WHEEL); | 52 | input_dev->relbit[0] = BIT(REL_X) | BIT(REL_Y) | BIT(REL_WHEEL); |
@@ -59,8 +58,6 @@ static int dc_mouse_connect(struct maple_device *dev) | |||
59 | 58 | ||
60 | maple_getcond_callback(dev, dc_mouse_callback, 1, MAPLE_FUNC_MOUSE); | 59 | maple_getcond_callback(dev, dc_mouse_callback, 1, MAPLE_FUNC_MOUSE); |
61 | 60 | ||
62 | printk(KERN_INFO "input: mouse(0x%lx): %s\n", data, input_dev->name); | ||
63 | |||
64 | return 0; | 61 | return 0; |
65 | } | 62 | } |
66 | 63 | ||
@@ -70,7 +67,6 @@ static void dc_mouse_disconnect(struct maple_device *dev) | |||
70 | struct input_dev *input_dev = dev->private_data; | 67 | struct input_dev *input_dev = dev->private_data; |
71 | 68 | ||
72 | input_unregister_device(input_dev); | 69 | input_unregister_device(input_dev); |
73 | kfree(input_dev); | ||
74 | } | 70 | } |
75 | 71 | ||
76 | 72 | ||