Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19298
b: refs/heads/master
c: 4d462b9
h: refs/heads/master
v: v3
  • Loading branch information
Dmitry Torokhov committed Jan 30, 2006
1 parent a0d8fcc commit dec7ed4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ab52cd66ae4c3e097811b6c370de7fc057959419
refs/heads/master: 4d462b9e2372f9f5a885f8b7e1597fe7412347fd
15 changes: 11 additions & 4 deletions trunk/drivers/input/joystick/tmdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,13 @@ static int tmdc_setup_port(struct tmdc *tmdc, int idx, unsigned char *data)
struct tmdc_port *port;
struct input_dev *input_dev;
int i, j, b = 0;
int err;

tmdc->port[idx] = port = kzalloc(sizeof (struct tmdc_port), GFP_KERNEL);
input_dev = input_allocate_device();
if (!port || !input_dev) {
kfree(port);
input_free_device(input_dev);
return -ENOMEM;
err = -ENOMEM;
goto fail;
}

port->mode = data[TMDC_BYTE_ID];
Expand Down Expand Up @@ -347,9 +347,15 @@ static int tmdc_setup_port(struct tmdc *tmdc, int idx, unsigned char *data)
b += port->btnc[i];
}

input_register_device(port->dev);
err = input_register_device(port->dev);
if (err)
goto fail;

return 0;

fail: input_free_device(input_dev);
kfree(port);
return err;
}

/*
Expand Down Expand Up @@ -424,6 +430,7 @@ static void tmdc_disconnect(struct gameport *gameport)
static struct gameport_driver tmdc_drv = {
.driver = {
.name = "tmdc",
.owner = THIS_MODULE,
},
.description = DRIVER_DESC,
.connect = tmdc_connect,
Expand Down

0 comments on commit dec7ed4

Please sign in to comment.