diff options
Diffstat (limited to 'drivers/input/tablet/aiptek.c')
-rw-r--r-- | drivers/input/tablet/aiptek.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c index 8c62afea5a52..7fb15af33c49 100644 --- a/drivers/input/tablet/aiptek.c +++ b/drivers/input/tablet/aiptek.c | |||
@@ -1670,17 +1670,23 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
1670 | 1670 | ||
1671 | aiptek = kzalloc(sizeof(struct aiptek), GFP_KERNEL); | 1671 | aiptek = kzalloc(sizeof(struct aiptek), GFP_KERNEL); |
1672 | inputdev = input_allocate_device(); | 1672 | inputdev = input_allocate_device(); |
1673 | if (!aiptek || !inputdev) | 1673 | if (!aiptek || !inputdev) { |
1674 | warn("aiptek: cannot allocate memory or input device"); | ||
1674 | goto fail1; | 1675 | goto fail1; |
1676 | } | ||
1675 | 1677 | ||
1676 | aiptek->data = usb_buffer_alloc(usbdev, AIPTEK_PACKET_LENGTH, | 1678 | aiptek->data = usb_buffer_alloc(usbdev, AIPTEK_PACKET_LENGTH, |
1677 | GFP_ATOMIC, &aiptek->data_dma); | 1679 | GFP_ATOMIC, &aiptek->data_dma); |
1678 | if (!aiptek->data) | 1680 | if (!aiptek->data) { |
1681 | warn("aiptek: cannot allocate usb buffer"); | ||
1679 | goto fail1; | 1682 | goto fail1; |
1683 | } | ||
1680 | 1684 | ||
1681 | aiptek->urb = usb_alloc_urb(0, GFP_KERNEL); | 1685 | aiptek->urb = usb_alloc_urb(0, GFP_KERNEL); |
1682 | if (!aiptek->urb) | 1686 | if (!aiptek->urb) { |
1687 | warn("aiptek: cannot allocate urb"); | ||
1683 | goto fail2; | 1688 | goto fail2; |
1689 | } | ||
1684 | 1690 | ||
1685 | aiptek->inputdev = inputdev; | 1691 | aiptek->inputdev = inputdev; |
1686 | aiptek->usbdev = usbdev; | 1692 | aiptek->usbdev = usbdev; |
@@ -1807,6 +1813,13 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
1807 | } | 1813 | } |
1808 | } | 1814 | } |
1809 | 1815 | ||
1816 | /* Murphy says that some day someone will have a tablet that fails the | ||
1817 | above test. That's you, Frederic Rodrigo */ | ||
1818 | if (i == ARRAY_SIZE(speeds)) { | ||
1819 | info("input: Aiptek tried all speeds, no sane response"); | ||
1820 | goto fail2; | ||
1821 | } | ||
1822 | |||
1810 | /* Associate this driver's struct with the usb interface. | 1823 | /* Associate this driver's struct with the usb interface. |
1811 | */ | 1824 | */ |
1812 | usb_set_intfdata(intf, aiptek); | 1825 | usb_set_intfdata(intf, aiptek); |
@@ -1814,15 +1827,18 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
1814 | /* Set up the sysfs files | 1827 | /* Set up the sysfs files |
1815 | */ | 1828 | */ |
1816 | err = sysfs_create_group(&intf->dev.kobj, &aiptek_attribute_group); | 1829 | err = sysfs_create_group(&intf->dev.kobj, &aiptek_attribute_group); |
1817 | if (err) | 1830 | if (err) { |
1831 | warn("aiptek: cannot create sysfs group err: %d", err); | ||
1818 | goto fail3; | 1832 | goto fail3; |
1833 | } | ||
1819 | 1834 | ||
1820 | /* Register the tablet as an Input Device | 1835 | /* Register the tablet as an Input Device |
1821 | */ | 1836 | */ |
1822 | err = input_register_device(aiptek->inputdev); | 1837 | err = input_register_device(aiptek->inputdev); |
1823 | if (err) | 1838 | if (err) { |
1839 | warn("aiptek: input_register_device returned err: %d", err); | ||
1824 | goto fail4; | 1840 | goto fail4; |
1825 | 1841 | } | |
1826 | return 0; | 1842 | return 0; |
1827 | 1843 | ||
1828 | fail4: sysfs_remove_group(&intf->dev.kobj, &aiptek_attribute_group); | 1844 | fail4: sysfs_remove_group(&intf->dev.kobj, &aiptek_attribute_group); |