mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 19:56:18 +00:00
Input: aiptek - put sensible warnings in probe
Added warnings to the points where the tablet probe may fail Signed-off-by: Rene van Paassen <rene.vanpaassen@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
parent
1a54f49e89
commit
6125a40035
1 changed files with 22 additions and 6 deletions
|
@ -1670,17 +1670,23 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
|
||||||
|
|
||||||
aiptek = kzalloc(sizeof(struct aiptek), GFP_KERNEL);
|
aiptek = kzalloc(sizeof(struct aiptek), GFP_KERNEL);
|
||||||
inputdev = input_allocate_device();
|
inputdev = input_allocate_device();
|
||||||
if (!aiptek || !inputdev)
|
if (!aiptek || !inputdev) {
|
||||||
|
warn("aiptek: cannot allocate memory or input device");
|
||||||
goto fail1;
|
goto fail1;
|
||||||
|
}
|
||||||
|
|
||||||
aiptek->data = usb_buffer_alloc(usbdev, AIPTEK_PACKET_LENGTH,
|
aiptek->data = usb_buffer_alloc(usbdev, AIPTEK_PACKET_LENGTH,
|
||||||
GFP_ATOMIC, &aiptek->data_dma);
|
GFP_ATOMIC, &aiptek->data_dma);
|
||||||
if (!aiptek->data)
|
if (!aiptek->data) {
|
||||||
|
warn("aiptek: cannot allocate usb buffer");
|
||||||
goto fail1;
|
goto fail1;
|
||||||
|
}
|
||||||
|
|
||||||
aiptek->urb = usb_alloc_urb(0, GFP_KERNEL);
|
aiptek->urb = usb_alloc_urb(0, GFP_KERNEL);
|
||||||
if (!aiptek->urb)
|
if (!aiptek->urb) {
|
||||||
|
warn("aiptek: cannot allocate urb");
|
||||||
goto fail2;
|
goto fail2;
|
||||||
|
}
|
||||||
|
|
||||||
aiptek->inputdev = inputdev;
|
aiptek->inputdev = inputdev;
|
||||||
aiptek->usbdev = usbdev;
|
aiptek->usbdev = usbdev;
|
||||||
|
@ -1807,6 +1813,13 @@ 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.
|
/* Associate this driver's struct with the usb interface.
|
||||||
*/
|
*/
|
||||||
usb_set_intfdata(intf, aiptek);
|
usb_set_intfdata(intf, aiptek);
|
||||||
|
@ -1814,15 +1827,18 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
|
||||||
/* Set up the sysfs files
|
/* Set up the sysfs files
|
||||||
*/
|
*/
|
||||||
err = sysfs_create_group(&intf->dev.kobj, &aiptek_attribute_group);
|
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;
|
goto fail3;
|
||||||
|
}
|
||||||
|
|
||||||
/* Register the tablet as an Input Device
|
/* Register the tablet as an Input Device
|
||||||
*/
|
*/
|
||||||
err = input_register_device(aiptek->inputdev);
|
err = input_register_device(aiptek->inputdev);
|
||||||
if (err)
|
if (err) {
|
||||||
|
warn("aiptek: input_register_device returned err: %d", err);
|
||||||
goto fail4;
|
goto fail4;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail4: sysfs_remove_group(&intf->dev.kobj, &aiptek_attribute_group);
|
fail4: sysfs_remove_group(&intf->dev.kobj, &aiptek_attribute_group);
|
||||||
|
|
Loading…
Reference in a new issue