aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-roccat-kone.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-12-09 22:29:03 -0500
committerJiri Kosina <jkosina@suse.cz>2010-12-10 09:10:38 -0500
commit4291ee305e9bb0699504a66f0e2b7aefcf0512a5 (patch)
tree3996b77eb64d4f3b76a0799f30a5b2ba6cbc9ddb /drivers/hid/hid-roccat-kone.c
parent5bea7660bba973dc5e8e9d92b11fb1dd5b524ebf (diff)
HID: Add and use hid_<level>: dev_<level> equivalents
Neaten current uses of dev_<level> by adding and using hid specific hid_<level> macros. Convert existing uses of dev_<level> uses to hid_<level>. Convert hid-pidff printk uses to hid_<level>. Remove err_hid and use hid_err instead. Add missing newlines to logging messages where necessary. Coalesce format strings. Add and use pr_fmt(fmt) KBUILD_MODNAME ": " fmt Other miscellaneous changes: Add const struct hid_device * argument to hid-core functions extract() and implement() so hid_<level> can be used by them. Fix bad indentation in hid-core hid_input_field function that calls extract() function above. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-roccat-kone.c')
-rw-r--r--drivers/hid/hid-roccat-kone.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/hid/hid-roccat-kone.c b/drivers/hid/hid-roccat-kone.c
index f77695762cb5..73199de2e37f 100644
--- a/drivers/hid/hid-roccat-kone.c
+++ b/drivers/hid/hid-roccat-kone.c
@@ -90,8 +90,7 @@ static int kone_check_write(struct usb_device *usb_dev)
90 kfree(data); 90 kfree(data);
91 return 0; 91 return 0;
92 } else { /* unknown answer */ 92 } else { /* unknown answer */
93 dev_err(&usb_dev->dev, "got retval %d when checking write\n", 93 hid_err(usb_dev, "got retval %d when checking write\n", *data);
94 *data);
95 kfree(data); 94 kfree(data);
96 return -EIO; 95 return -EIO;
97 } 96 }
@@ -556,7 +555,7 @@ static ssize_t kone_sysfs_set_tcu(struct device *dev,
556 555
557 retval = kone_set_settings(usb_dev, &kone->settings); 556 retval = kone_set_settings(usb_dev, &kone->settings);
558 if (retval) { 557 if (retval) {
559 dev_err(&usb_dev->dev, "couldn't set tcu state\n"); 558 hid_err(usb_dev, "couldn't set tcu state\n");
560 /* 559 /*
561 * try to reread valid settings into buffer overwriting 560 * try to reread valid settings into buffer overwriting
562 * first error code 561 * first error code
@@ -570,7 +569,7 @@ static ssize_t kone_sysfs_set_tcu(struct device *dev,
570 569
571 retval = size; 570 retval = size;
572exit_no_settings: 571exit_no_settings:
573 dev_err(&usb_dev->dev, "couldn't read settings\n"); 572 hid_err(usb_dev, "couldn't read settings\n");
574exit_unlock: 573exit_unlock:
575 mutex_unlock(&kone->kone_lock); 574 mutex_unlock(&kone->kone_lock);
576 return retval; 575 return retval;
@@ -818,21 +817,20 @@ static int kone_init_specials(struct hid_device *hdev)
818 817
819 kone = kzalloc(sizeof(*kone), GFP_KERNEL); 818 kone = kzalloc(sizeof(*kone), GFP_KERNEL);
820 if (!kone) { 819 if (!kone) {
821 dev_err(&hdev->dev, "can't alloc device descriptor\n"); 820 hid_err(hdev, "can't alloc device descriptor\n");
822 return -ENOMEM; 821 return -ENOMEM;
823 } 822 }
824 hid_set_drvdata(hdev, kone); 823 hid_set_drvdata(hdev, kone);
825 824
826 retval = kone_init_kone_device_struct(usb_dev, kone); 825 retval = kone_init_kone_device_struct(usb_dev, kone);
827 if (retval) { 826 if (retval) {
828 dev_err(&hdev->dev, 827 hid_err(hdev, "couldn't init struct kone_device\n");
829 "couldn't init struct kone_device\n");
830 goto exit_free; 828 goto exit_free;
831 } 829 }
832 830
833 retval = roccat_connect(hdev); 831 retval = roccat_connect(hdev);
834 if (retval < 0) { 832 if (retval < 0) {
835 dev_err(&hdev->dev, "couldn't init char dev\n"); 833 hid_err(hdev, "couldn't init char dev\n");
836 /* be tolerant about not getting chrdev */ 834 /* be tolerant about not getting chrdev */
837 } else { 835 } else {
838 kone->roccat_claimed = 1; 836 kone->roccat_claimed = 1;
@@ -841,7 +839,7 @@ static int kone_init_specials(struct hid_device *hdev)
841 839
842 retval = kone_create_sysfs_attributes(intf); 840 retval = kone_create_sysfs_attributes(intf);
843 if (retval) { 841 if (retval) {
844 dev_err(&hdev->dev, "cannot create sysfs files\n"); 842 hid_err(hdev, "cannot create sysfs files\n");
845 goto exit_free; 843 goto exit_free;
846 } 844 }
847 } else { 845 } else {
@@ -876,19 +874,19 @@ static int kone_probe(struct hid_device *hdev, const struct hid_device_id *id)
876 874
877 retval = hid_parse(hdev); 875 retval = hid_parse(hdev);
878 if (retval) { 876 if (retval) {
879 dev_err(&hdev->dev, "parse failed\n"); 877 hid_err(hdev, "parse failed\n");
880 goto exit; 878 goto exit;
881 } 879 }
882 880
883 retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT); 881 retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
884 if (retval) { 882 if (retval) {
885 dev_err(&hdev->dev, "hw start failed\n"); 883 hid_err(hdev, "hw start failed\n");
886 goto exit; 884 goto exit;
887 } 885 }
888 886
889 retval = kone_init_specials(hdev); 887 retval = kone_init_specials(hdev);
890 if (retval) { 888 if (retval) {
891 dev_err(&hdev->dev, "couldn't install mouse\n"); 889 hid_err(hdev, "couldn't install mouse\n");
892 goto exit_stop; 890 goto exit_stop;
893 } 891 }
894 892