summaryrefslogtreecommitdiffstats
path: root/drivers/input/joystick/sidewinder.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-01-31 21:18:17 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-31 21:18:17 -0800
commitd20e6336ea4250e51081e4b2924b9ef4dfa45909 (patch)
tree96c22694bec10912d40a3700a945157597dd901b /drivers/input/joystick/sidewinder.c
parentfa3c791d85aa9a363dd72dd834b73b79252ef44e (diff)
parent6dea93477c3377cf4199fd37cc3fb11071987ae4 (diff)
downloadop-kernel-dev-d20e6336ea4250e51081e4b2924b9ef4dfa45909.zip
op-kernel-dev-d20e6336ea4250e51081e4b2924b9ef4dfa45909.tar.gz
Merge master.kernel.org:/pub/scm/linux/kernel/git/dtor/input
Diffstat (limited to 'drivers/input/joystick/sidewinder.c')
-rw-r--r--drivers/input/joystick/sidewinder.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/input/joystick/sidewinder.c b/drivers/input/joystick/sidewinder.c
index 78dd163..2b2ec10 100644
--- a/drivers/input/joystick/sidewinder.c
+++ b/drivers/input/joystick/sidewinder.c
@@ -736,7 +736,7 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv)
sprintf(sw->name, "Microsoft SideWinder %s", sw_name[sw->type]);
sprintf(sw->phys[i], "%s/input%d", gameport->phys, i);
- input_dev = input_allocate_device();
+ sw->dev[i] = input_dev = input_allocate_device();
if (!input_dev) {
err = -ENOMEM;
goto fail3;
@@ -771,12 +771,15 @@ static int sw_connect(struct gameport *gameport, struct gameport_driver *drv)
dbg("%s%s [%d-bit id %d data %d]\n", sw->name, comment, m, l, k);
- input_register_device(sw->dev[i]);
+ err = input_register_device(sw->dev[i]);
+ if (err)
+ goto fail4;
}
return 0;
- fail3: while (--i >= 0)
+ fail4: input_free_device(sw->dev[i]);
+ fail3: while (--i >= 0)
input_unregister_device(sw->dev[i]);
fail2: gameport_close(gameport);
fail1: gameport_set_drvdata(gameport, NULL);
@@ -801,6 +804,7 @@ static void sw_disconnect(struct gameport *gameport)
static struct gameport_driver sw_drv = {
.driver = {
.name = "sidewinder",
+ .owner = THIS_MODULE,
},
.description = DRIVER_DESC,
.connect = sw_connect,
OpenPOWER on IntegriCloud