diff options
author | Dmitry Torokhov <dtor_core@ameritech.net> | 2005-09-15 03:01:52 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-10-28 12:52:53 -0400 |
commit | 17dd3f0f7aa729a042af5d3318ff9b3e7781b45b (patch) | |
tree | 261580f0229e6365f044cd26925dfb2735e0754d /drivers/input/joystick/iforce/iforce-serio.c | |
parent | 0259567ad60df13a55583b84d2cddb5526705907 (diff) |
[PATCH] drivers/input/joystick: convert to dynamic input_dev allocation
Input: convert drivers/input/joystick 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/joystick/iforce/iforce-serio.c')
-rw-r--r-- | drivers/input/joystick/iforce/iforce-serio.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/input/joystick/iforce/iforce-serio.c b/drivers/input/joystick/iforce/iforce-serio.c index 11f51905cba..64a78c51548 100644 --- a/drivers/input/joystick/iforce/iforce-serio.c +++ b/drivers/input/joystick/iforce/iforce-serio.c | |||
@@ -131,11 +131,10 @@ static int iforce_serio_connect(struct serio *serio, struct serio_driver *drv) | |||
131 | struct iforce *iforce; | 131 | struct iforce *iforce; |
132 | int err; | 132 | int err; |
133 | 133 | ||
134 | if (!(iforce = kmalloc(sizeof(struct iforce), GFP_KERNEL))) | 134 | iforce = kzalloc(sizeof(struct iforce), GFP_KERNEL); |
135 | if (!iforce) | ||
135 | return -ENOMEM; | 136 | return -ENOMEM; |
136 | 137 | ||
137 | memset(iforce, 0, sizeof(struct iforce)); | ||
138 | |||
139 | iforce->bus = IFORCE_232; | 138 | iforce->bus = IFORCE_232; |
140 | iforce->serio = serio; | 139 | iforce->serio = serio; |
141 | 140 | ||
@@ -148,7 +147,8 @@ static int iforce_serio_connect(struct serio *serio, struct serio_driver *drv) | |||
148 | return err; | 147 | return err; |
149 | } | 148 | } |
150 | 149 | ||
151 | if (iforce_init_device(iforce)) { | 150 | err = iforce_init_device(iforce); |
151 | if (err) { | ||
152 | serio_close(serio); | 152 | serio_close(serio); |
153 | serio_set_drvdata(serio, NULL); | 153 | serio_set_drvdata(serio, NULL); |
154 | kfree(iforce); | 154 | kfree(iforce); |
@@ -162,7 +162,7 @@ static void iforce_serio_disconnect(struct serio *serio) | |||
162 | { | 162 | { |
163 | struct iforce *iforce = serio_get_drvdata(serio); | 163 | struct iforce *iforce = serio_get_drvdata(serio); |
164 | 164 | ||
165 | input_unregister_device(&iforce->dev); | 165 | input_unregister_device(iforce->dev); |
166 | serio_close(serio); | 166 | serio_close(serio); |
167 | serio_set_drvdata(serio, NULL); | 167 | serio_set_drvdata(serio, NULL); |
168 | kfree(iforce); | 168 | kfree(iforce); |