aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/tablet/wacom_sys.c
diff options
context:
space:
mode:
authorBastian Blank <waldi@debian.org>2010-02-11 02:06:23 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-02-11 02:31:37 -0500
commitb036f6fb3aa23a52d90da5fc57e0803f08292e82 (patch)
tree714b969a2dc7101c4a2574c48cb5ddd239dad47f /drivers/input/tablet/wacom_sys.c
parent5deeac99fe1146532eb7c64f9adb17d17628d751 (diff)
Input: wacom - get features from driver info
Get the features information from the driver info of the usb device id structure provided by the caller. The device ids and feature structs are strong coupled using indices. Signed-off-by: Bastian Blank <waldi@debian.org> Tested-by: Jason Childs <oblivian@users.sourceforge.net> Acked-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/tablet/wacom_sys.c')
-rw-r--r--drivers/input/tablet/wacom_sys.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 072f33b3b2b0..be4b76f264a7 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -530,10 +530,13 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
530 struct usb_endpoint_descriptor *endpoint; 530 struct usb_endpoint_descriptor *endpoint;
531 struct wacom *wacom; 531 struct wacom *wacom;
532 struct wacom_wac *wacom_wac; 532 struct wacom_wac *wacom_wac;
533 struct wacom_features *features; 533 struct wacom_features *features = (void *)id->driver_info;
534 struct input_dev *input_dev; 534 struct input_dev *input_dev;
535 int error = -ENOMEM; 535 int error = -ENOMEM;
536 536
537 if (!features)
538 return -EINVAL;
539
537 wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL); 540 wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL);
538 wacom_wac = kzalloc(sizeof(struct wacom_wac), GFP_KERNEL); 541 wacom_wac = kzalloc(sizeof(struct wacom_wac), GFP_KERNEL);
539 input_dev = input_allocate_device(); 542 input_dev = input_allocate_device();
@@ -555,7 +558,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
555 usb_make_path(dev, wacom->phys, sizeof(wacom->phys)); 558 usb_make_path(dev, wacom->phys, sizeof(wacom->phys));
556 strlcat(wacom->phys, "/input0", sizeof(wacom->phys)); 559 strlcat(wacom->phys, "/input0", sizeof(wacom->phys));
557 560
558 wacom_wac->features = features = get_wacom_feature(id); 561 wacom_wac->features = features;
559 BUG_ON(features->pktlen > WACOM_PKGLEN_MAX); 562 BUG_ON(features->pktlen > WACOM_PKGLEN_MAX);
560 563
561 input_dev->name = wacom_wac->features->name; 564 input_dev->name = wacom_wac->features->name;
@@ -663,6 +666,7 @@ static int wacom_reset_resume(struct usb_interface *intf)
663 666
664static struct usb_driver wacom_driver = { 667static struct usb_driver wacom_driver = {
665 .name = "wacom", 668 .name = "wacom",
669 .id_table = wacom_ids,
666 .probe = wacom_probe, 670 .probe = wacom_probe,
667 .disconnect = wacom_disconnect, 671 .disconnect = wacom_disconnect,
668 .suspend = wacom_suspend, 672 .suspend = wacom_suspend,
@@ -674,7 +678,7 @@ static struct usb_driver wacom_driver = {
674static int __init wacom_init(void) 678static int __init wacom_init(void)
675{ 679{
676 int result; 680 int result;
677 wacom_driver.id_table = get_device_table(); 681
678 result = usb_register(&wacom_driver); 682 result = usb_register(&wacom_driver);
679 if (result == 0) 683 if (result == 0)
680 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" 684 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"