Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 58477
b: refs/heads/master
c: 6125a40
h: refs/heads/master
i:
  58475: f4e3c7f
v: v3
  • Loading branch information
Rene van Paassen authored and Dmitry Torokhov committed Jul 10, 2007
1 parent 34807b6 commit 4f74b5e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 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: 1a54f49e8989462cfc9cab0c377b2d4e60e5b70a
refs/heads/master: 6125a400354c4a02b9dad0e5d8128f9dc08cfd51
28 changes: 22 additions & 6 deletions trunk/drivers/input/tablet/aiptek.c
Original file line number Diff line number Diff line change
Expand Up @@ -1670,17 +1670,23 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)

aiptek = kzalloc(sizeof(struct aiptek), GFP_KERNEL);
inputdev = input_allocate_device();
if (!aiptek || !inputdev)
if (!aiptek || !inputdev) {
warn("aiptek: cannot allocate memory or input device");
goto fail1;
}

aiptek->data = usb_buffer_alloc(usbdev, AIPTEK_PACKET_LENGTH,
GFP_ATOMIC, &aiptek->data_dma);
if (!aiptek->data)
if (!aiptek->data) {
warn("aiptek: cannot allocate usb buffer");
goto fail1;
}

aiptek->urb = usb_alloc_urb(0, GFP_KERNEL);
if (!aiptek->urb)
if (!aiptek->urb) {
warn("aiptek: cannot allocate urb");
goto fail2;
}

aiptek->inputdev = inputdev;
aiptek->usbdev = usbdev;
Expand Down Expand Up @@ -1807,22 +1813,32 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
}
}

/* Murphy says that some day someone will have a tablet that fails the
above test. That's you, Frederic Rodrigo */
if (i == ARRAY_SIZE(speeds)) {
info("input: Aiptek tried all speeds, no sane response");
goto fail2;
}

/* Associate this driver's struct with the usb interface.
*/
usb_set_intfdata(intf, aiptek);

/* Set up the sysfs files
*/
err = sysfs_create_group(&intf->dev.kobj, &aiptek_attribute_group);
if (err)
if (err) {
warn("aiptek: cannot create sysfs group err: %d", err);
goto fail3;
}

/* Register the tablet as an Input Device
*/
err = input_register_device(aiptek->inputdev);
if (err)
if (err) {
warn("aiptek: input_register_device returned err: %d", err);
goto fail4;

}
return 0;

fail4: sysfs_remove_group(&intf->dev.kobj, &aiptek_attribute_group);
Expand Down

0 comments on commit 4f74b5e

Please sign in to comment.