diff options
author | Joe Perches <joe@perches.com> | 2010-12-09 22:29:03 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2010-12-10 09:10:38 -0500 |
commit | 4291ee305e9bb0699504a66f0e2b7aefcf0512a5 (patch) | |
tree | 3996b77eb64d4f3b76a0799f30a5b2ba6cbc9ddb /drivers/hid | |
parent | 5bea7660bba973dc5e8e9d92b11fb1dd5b524ebf (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')
50 files changed, 372 insertions, 393 deletions
diff --git a/drivers/hid/hid-3m-pct.c b/drivers/hid/hid-3m-pct.c index 02d8cd3b1b1b..4546c123eb77 100644 --- a/drivers/hid/hid-3m-pct.c +++ b/drivers/hid/hid-3m-pct.c | |||
@@ -274,7 +274,7 @@ static int mmm_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
274 | 274 | ||
275 | md = kzalloc(sizeof(struct mmm_data), GFP_KERNEL); | 275 | md = kzalloc(sizeof(struct mmm_data), GFP_KERNEL); |
276 | if (!md) { | 276 | if (!md) { |
277 | dev_err(&hdev->dev, "cannot allocate 3M data\n"); | 277 | hid_err(hdev, "cannot allocate 3M data\n"); |
278 | return -ENOMEM; | 278 | return -ENOMEM; |
279 | } | 279 | } |
280 | hid_set_drvdata(hdev, md); | 280 | hid_set_drvdata(hdev, md); |
diff --git a/drivers/hid/hid-a4tech.c b/drivers/hid/hid-a4tech.c index 1666c1684e79..902d1dfeb1b5 100644 --- a/drivers/hid/hid-a4tech.c +++ b/drivers/hid/hid-a4tech.c | |||
@@ -93,7 +93,7 @@ static int a4_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
93 | 93 | ||
94 | a4 = kzalloc(sizeof(*a4), GFP_KERNEL); | 94 | a4 = kzalloc(sizeof(*a4), GFP_KERNEL); |
95 | if (a4 == NULL) { | 95 | if (a4 == NULL) { |
96 | dev_err(&hdev->dev, "can't alloc device descriptor\n"); | 96 | hid_err(hdev, "can't alloc device descriptor\n"); |
97 | ret = -ENOMEM; | 97 | ret = -ENOMEM; |
98 | goto err_free; | 98 | goto err_free; |
99 | } | 99 | } |
@@ -104,13 +104,13 @@ static int a4_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
104 | 104 | ||
105 | ret = hid_parse(hdev); | 105 | ret = hid_parse(hdev); |
106 | if (ret) { | 106 | if (ret) { |
107 | dev_err(&hdev->dev, "parse failed\n"); | 107 | hid_err(hdev, "parse failed\n"); |
108 | goto err_free; | 108 | goto err_free; |
109 | } | 109 | } |
110 | 110 | ||
111 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); | 111 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); |
112 | if (ret) { | 112 | if (ret) { |
113 | dev_err(&hdev->dev, "hw start failed\n"); | 113 | hid_err(hdev, "hw start failed\n"); |
114 | goto err_free; | 114 | goto err_free; |
115 | } | 115 | } |
116 | 116 | ||
diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c index 8aa71750a23c..61aa71233392 100644 --- a/drivers/hid/hid-apple.c +++ b/drivers/hid/hid-apple.c | |||
@@ -16,6 +16,8 @@ | |||
16 | * any later version. | 16 | * any later version. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
20 | |||
19 | #include <linux/device.h> | 21 | #include <linux/device.h> |
20 | #include <linux/hid.h> | 22 | #include <linux/hid.h> |
21 | #include <linux/module.h> | 23 | #include <linux/module.h> |
@@ -280,8 +282,8 @@ static __u8 *apple_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
280 | 282 | ||
281 | if ((asc->quirks & APPLE_RDESC_JIS) && *rsize >= 60 && | 283 | if ((asc->quirks & APPLE_RDESC_JIS) && *rsize >= 60 && |
282 | rdesc[53] == 0x65 && rdesc[59] == 0x65) { | 284 | rdesc[53] == 0x65 && rdesc[59] == 0x65) { |
283 | dev_info(&hdev->dev, "fixing up MacBook JIS keyboard report " | 285 | hid_info(hdev, |
284 | "descriptor\n"); | 286 | "fixing up MacBook JIS keyboard report descriptor\n"); |
285 | rdesc[53] = rdesc[59] = 0xe7; | 287 | rdesc[53] = rdesc[59] = 0xe7; |
286 | } | 288 | } |
287 | return rdesc; | 289 | return rdesc; |
@@ -351,7 +353,7 @@ static int apple_probe(struct hid_device *hdev, | |||
351 | 353 | ||
352 | asc = kzalloc(sizeof(*asc), GFP_KERNEL); | 354 | asc = kzalloc(sizeof(*asc), GFP_KERNEL); |
353 | if (asc == NULL) { | 355 | if (asc == NULL) { |
354 | dev_err(&hdev->dev, "can't alloc apple descriptor\n"); | 356 | hid_err(hdev, "can't alloc apple descriptor\n"); |
355 | return -ENOMEM; | 357 | return -ENOMEM; |
356 | } | 358 | } |
357 | 359 | ||
@@ -361,7 +363,7 @@ static int apple_probe(struct hid_device *hdev, | |||
361 | 363 | ||
362 | ret = hid_parse(hdev); | 364 | ret = hid_parse(hdev); |
363 | if (ret) { | 365 | if (ret) { |
364 | dev_err(&hdev->dev, "parse failed\n"); | 366 | hid_err(hdev, "parse failed\n"); |
365 | goto err_free; | 367 | goto err_free; |
366 | } | 368 | } |
367 | 369 | ||
@@ -372,7 +374,7 @@ static int apple_probe(struct hid_device *hdev, | |||
372 | 374 | ||
373 | ret = hid_hw_start(hdev, connect_mask); | 375 | ret = hid_hw_start(hdev, connect_mask); |
374 | if (ret) { | 376 | if (ret) { |
375 | dev_err(&hdev->dev, "hw start failed\n"); | 377 | hid_err(hdev, "hw start failed\n"); |
376 | goto err_free; | 378 | goto err_free; |
377 | } | 379 | } |
378 | 380 | ||
@@ -512,7 +514,7 @@ static int __init apple_init(void) | |||
512 | 514 | ||
513 | ret = hid_register_driver(&apple_driver); | 515 | ret = hid_register_driver(&apple_driver); |
514 | if (ret) | 516 | if (ret) |
515 | printk(KERN_ERR "can't register apple driver\n"); | 517 | pr_err("can't register apple driver\n"); |
516 | 518 | ||
517 | return ret; | 519 | return ret; |
518 | } | 520 | } |
diff --git a/drivers/hid/hid-axff.c b/drivers/hid/hid-axff.c index f42ee140738a..e5b961d6ff22 100644 --- a/drivers/hid/hid-axff.c +++ b/drivers/hid/hid-axff.c | |||
@@ -73,14 +73,14 @@ static int axff_init(struct hid_device *hid) | |||
73 | int error; | 73 | int error; |
74 | 74 | ||
75 | if (list_empty(report_list)) { | 75 | if (list_empty(report_list)) { |
76 | dev_err(&hid->dev, "no output reports found\n"); | 76 | hid_err(hid, "no output reports found\n"); |
77 | return -ENODEV; | 77 | return -ENODEV; |
78 | } | 78 | } |
79 | 79 | ||
80 | report = list_first_entry(report_list, struct hid_report, list); | 80 | report = list_first_entry(report_list, struct hid_report, list); |
81 | 81 | ||
82 | if (report->maxfield < 4) { | 82 | if (report->maxfield < 4) { |
83 | dev_err(&hid->dev, "no fields in the report: %d\n", report->maxfield); | 83 | hid_err(hid, "no fields in the report: %d\n", report->maxfield); |
84 | return -ENODEV; | 84 | return -ENODEV; |
85 | } | 85 | } |
86 | 86 | ||
@@ -101,7 +101,7 @@ static int axff_init(struct hid_device *hid) | |||
101 | axff->report->field[3]->value[0] = 0x00; | 101 | axff->report->field[3]->value[0] = 0x00; |
102 | usbhid_submit_report(hid, axff->report, USB_DIR_OUT); | 102 | usbhid_submit_report(hid, axff->report, USB_DIR_OUT); |
103 | 103 | ||
104 | dev_info(&hid->dev, "Force Feedback for ACRUX game controllers by Sergei Kolzun<x0r@dv-life.ru>\n"); | 104 | hid_info(hid, "Force Feedback for ACRUX game controllers by Sergei Kolzun<x0r@dv-life.ru>\n"); |
105 | 105 | ||
106 | return 0; | 106 | return 0; |
107 | 107 | ||
@@ -114,17 +114,17 @@ static int ax_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
114 | { | 114 | { |
115 | int error; | 115 | int error; |
116 | 116 | ||
117 | dev_dbg(&hdev->dev, "ACRUX HID hardware probe..."); | 117 | dev_dbg(&hdev->dev, "ACRUX HID hardware probe...\n"); |
118 | 118 | ||
119 | error = hid_parse(hdev); | 119 | error = hid_parse(hdev); |
120 | if (error) { | 120 | if (error) { |
121 | dev_err(&hdev->dev, "parse failed\n"); | 121 | hid_err(hdev, "parse failed\n"); |
122 | return error; | 122 | return error; |
123 | } | 123 | } |
124 | 124 | ||
125 | error = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); | 125 | error = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); |
126 | if (error) { | 126 | if (error) { |
127 | dev_err(&hdev->dev, "hw start failed\n"); | 127 | hid_err(hdev, "hw start failed\n"); |
128 | return error; | 128 | return error; |
129 | } | 129 | } |
130 | 130 | ||
@@ -134,7 +134,7 @@ static int ax_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
134 | * Do not fail device initialization completely as device | 134 | * Do not fail device initialization completely as device |
135 | * may still be partially operable, just warn. | 135 | * may still be partially operable, just warn. |
136 | */ | 136 | */ |
137 | dev_warn(&hdev->dev, | 137 | hid_warn(hdev, |
138 | "Failed to enable force feedback support, error: %d\n", | 138 | "Failed to enable force feedback support, error: %d\n", |
139 | error); | 139 | error); |
140 | } | 140 | } |
diff --git a/drivers/hid/hid-belkin.c b/drivers/hid/hid-belkin.c index 4ce7aa3a519f..a1a765a5b08a 100644 --- a/drivers/hid/hid-belkin.c +++ b/drivers/hid/hid-belkin.c | |||
@@ -56,14 +56,14 @@ static int belkin_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
56 | 56 | ||
57 | ret = hid_parse(hdev); | 57 | ret = hid_parse(hdev); |
58 | if (ret) { | 58 | if (ret) { |
59 | dev_err(&hdev->dev, "parse failed\n"); | 59 | hid_err(hdev, "parse failed\n"); |
60 | goto err_free; | 60 | goto err_free; |
61 | } | 61 | } |
62 | 62 | ||
63 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT | | 63 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT | |
64 | ((quirks & BELKIN_HIDDEV) ? HID_CONNECT_HIDDEV_FORCE : 0)); | 64 | ((quirks & BELKIN_HIDDEV) ? HID_CONNECT_HIDDEV_FORCE : 0)); |
65 | if (ret) { | 65 | if (ret) { |
66 | dev_err(&hdev->dev, "hw start failed\n"); | 66 | hid_err(hdev, "hw start failed\n"); |
67 | goto err_free; | 67 | goto err_free; |
68 | } | 68 | } |
69 | 69 | ||
diff --git a/drivers/hid/hid-cando.c b/drivers/hid/hid-cando.c index 5925bdcd417d..375b50929a50 100644 --- a/drivers/hid/hid-cando.c +++ b/drivers/hid/hid-cando.c | |||
@@ -207,7 +207,7 @@ static int cando_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
207 | 207 | ||
208 | td = kmalloc(sizeof(struct cando_data), GFP_KERNEL); | 208 | td = kmalloc(sizeof(struct cando_data), GFP_KERNEL); |
209 | if (!td) { | 209 | if (!td) { |
210 | dev_err(&hdev->dev, "cannot allocate Cando Touch data\n"); | 210 | hid_err(hdev, "cannot allocate Cando Touch data\n"); |
211 | return -ENOMEM; | 211 | return -ENOMEM; |
212 | } | 212 | } |
213 | hid_set_drvdata(hdev, td); | 213 | hid_set_drvdata(hdev, td); |
diff --git a/drivers/hid/hid-cherry.c b/drivers/hid/hid-cherry.c index e880086c2311..888ece68a47c 100644 --- a/drivers/hid/hid-cherry.c +++ b/drivers/hid/hid-cherry.c | |||
@@ -30,8 +30,7 @@ static __u8 *ch_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
30 | unsigned int *rsize) | 30 | unsigned int *rsize) |
31 | { | 31 | { |
32 | if (*rsize >= 17 && rdesc[11] == 0x3c && rdesc[12] == 0x02) { | 32 | if (*rsize >= 17 && rdesc[11] == 0x3c && rdesc[12] == 0x02) { |
33 | dev_info(&hdev->dev, "fixing up Cherry Cymotion report " | 33 | hid_info(hdev, "fixing up Cherry Cymotion report descriptor\n"); |
34 | "descriptor\n"); | ||
35 | rdesc[11] = rdesc[16] = 0xff; | 34 | rdesc[11] = rdesc[16] = 0xff; |
36 | rdesc[12] = rdesc[17] = 0x03; | 35 | rdesc[12] = rdesc[17] = 0x03; |
37 | } | 36 | } |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 396f8c7e0076..1fd5e331fa8d 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -14,6 +14,8 @@ | |||
14 | * any later version. | 14 | * any later version. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
18 | |||
17 | #include <linux/module.h> | 19 | #include <linux/module.h> |
18 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
19 | #include <linux/init.h> | 21 | #include <linux/init.h> |
@@ -672,7 +674,8 @@ int hid_parse_report(struct hid_device *device, __u8 *start, | |||
672 | 674 | ||
673 | if (dispatch_type[item.type](parser, &item)) { | 675 | if (dispatch_type[item.type](parser, &item)) { |
674 | dbg_hid("item %u %u %u %u parsing failed\n", | 676 | dbg_hid("item %u %u %u %u parsing failed\n", |
675 | item.format, (unsigned)item.size, (unsigned)item.type, (unsigned)item.tag); | 677 | item.format, (unsigned)item.size, |
678 | (unsigned)item.type, (unsigned)item.tag); | ||
676 | goto err; | 679 | goto err; |
677 | } | 680 | } |
678 | 681 | ||
@@ -737,13 +740,14 @@ static u32 s32ton(__s32 value, unsigned n) | |||
737 | * Search linux-kernel and linux-usb-devel archives for "hid-core extract". | 740 | * Search linux-kernel and linux-usb-devel archives for "hid-core extract". |
738 | */ | 741 | */ |
739 | 742 | ||
740 | static __inline__ __u32 extract(__u8 *report, unsigned offset, unsigned n) | 743 | static __inline__ __u32 extract(const struct hid_device *hid, __u8 *report, |
744 | unsigned offset, unsigned n) | ||
741 | { | 745 | { |
742 | u64 x; | 746 | u64 x; |
743 | 747 | ||
744 | if (n > 32) | 748 | if (n > 32) |
745 | printk(KERN_WARNING "HID: extract() called with n (%d) > 32! (%s)\n", | 749 | hid_warn(hid, "extract() called with n (%d) > 32! (%s)\n", |
746 | n, current->comm); | 750 | n, current->comm); |
747 | 751 | ||
748 | report += offset >> 3; /* adjust byte index */ | 752 | report += offset >> 3; /* adjust byte index */ |
749 | offset &= 7; /* now only need bit offset into one byte */ | 753 | offset &= 7; /* now only need bit offset into one byte */ |
@@ -760,18 +764,19 @@ static __inline__ __u32 extract(__u8 *report, unsigned offset, unsigned n) | |||
760 | * endianness of register values by considering a register | 764 | * endianness of register values by considering a register |
761 | * a "cached" copy of the little endiad bit stream. | 765 | * a "cached" copy of the little endiad bit stream. |
762 | */ | 766 | */ |
763 | static __inline__ void implement(__u8 *report, unsigned offset, unsigned n, __u32 value) | 767 | static __inline__ void implement(const struct hid_device *hid, __u8 *report, |
768 | unsigned offset, unsigned n, __u32 value) | ||
764 | { | 769 | { |
765 | u64 x; | 770 | u64 x; |
766 | u64 m = (1ULL << n) - 1; | 771 | u64 m = (1ULL << n) - 1; |
767 | 772 | ||
768 | if (n > 32) | 773 | if (n > 32) |
769 | printk(KERN_WARNING "HID: implement() called with n (%d) > 32! (%s)\n", | 774 | hid_warn(hid, "%s() called with n (%d) > 32! (%s)\n", |
770 | n, current->comm); | 775 | __func__, n, current->comm); |
771 | 776 | ||
772 | if (value > m) | 777 | if (value > m) |
773 | printk(KERN_WARNING "HID: implement() called with too large value %d! (%s)\n", | 778 | hid_warn(hid, "%s() called with too large value %d! (%s)\n", |
774 | value, current->comm); | 779 | __func__, value, current->comm); |
775 | WARN_ON(value > m); | 780 | WARN_ON(value > m); |
776 | value &= m; | 781 | value &= m; |
777 | 782 | ||
@@ -892,13 +897,16 @@ static void hid_input_field(struct hid_device *hid, struct hid_field *field, | |||
892 | 897 | ||
893 | for (n = 0; n < count; n++) { | 898 | for (n = 0; n < count; n++) { |
894 | 899 | ||
895 | value[n] = min < 0 ? snto32(extract(data, offset + n * size, size), size) : | 900 | value[n] = min < 0 ? |
896 | extract(data, offset + n * size, size); | 901 | snto32(extract(hid, data, offset + n * size, size), |
902 | size) : | ||
903 | extract(hid, data, offset + n * size, size); | ||
897 | 904 | ||
898 | if (!(field->flags & HID_MAIN_ITEM_VARIABLE) /* Ignore report if ErrorRollOver */ | 905 | /* Ignore report if ErrorRollOver */ |
899 | && value[n] >= min && value[n] <= max | 906 | if (!(field->flags & HID_MAIN_ITEM_VARIABLE) && |
900 | && field->usage[value[n] - min].hid == HID_UP_KEYBOARD + 1) | 907 | value[n] >= min && value[n] <= max && |
901 | goto exit; | 908 | field->usage[value[n] - min].hid == HID_UP_KEYBOARD + 1) |
909 | goto exit; | ||
902 | } | 910 | } |
903 | 911 | ||
904 | for (n = 0; n < count; n++) { | 912 | for (n = 0; n < count; n++) { |
@@ -928,7 +936,8 @@ exit: | |||
928 | * Output the field into the report. | 936 | * Output the field into the report. |
929 | */ | 937 | */ |
930 | 938 | ||
931 | static void hid_output_field(struct hid_field *field, __u8 *data) | 939 | static void hid_output_field(const struct hid_device *hid, |
940 | struct hid_field *field, __u8 *data) | ||
932 | { | 941 | { |
933 | unsigned count = field->report_count; | 942 | unsigned count = field->report_count; |
934 | unsigned offset = field->report_offset; | 943 | unsigned offset = field->report_offset; |
@@ -937,9 +946,11 @@ static void hid_output_field(struct hid_field *field, __u8 *data) | |||
937 | 946 | ||
938 | for (n = 0; n < count; n++) { | 947 | for (n = 0; n < count; n++) { |
939 | if (field->logical_minimum < 0) /* signed values */ | 948 | if (field->logical_minimum < 0) /* signed values */ |
940 | implement(data, offset + n * size, size, s32ton(field->value[n], size)); | 949 | implement(hid, data, offset + n * size, size, |
950 | s32ton(field->value[n], size)); | ||
941 | else /* unsigned values */ | 951 | else /* unsigned values */ |
942 | implement(data, offset + n * size, size, field->value[n]); | 952 | implement(hid, data, offset + n * size, size, |
953 | field->value[n]); | ||
943 | } | 954 | } |
944 | } | 955 | } |
945 | 956 | ||
@@ -956,7 +967,7 @@ void hid_output_report(struct hid_report *report, __u8 *data) | |||
956 | 967 | ||
957 | memset(data, 0, ((report->size - 1) >> 3) + 1); | 968 | memset(data, 0, ((report->size - 1) >> 3) + 1); |
958 | for (n = 0; n < report->maxfield; n++) | 969 | for (n = 0; n < report->maxfield; n++) |
959 | hid_output_field(report->field[n], data); | 970 | hid_output_field(report->device, report->field[n], data); |
960 | } | 971 | } |
961 | EXPORT_SYMBOL_GPL(hid_output_report); | 972 | EXPORT_SYMBOL_GPL(hid_output_report); |
962 | 973 | ||
@@ -1169,8 +1180,7 @@ int hid_connect(struct hid_device *hdev, unsigned int connect_mask) | |||
1169 | hdev->claimed |= HID_CLAIMED_HIDRAW; | 1180 | hdev->claimed |= HID_CLAIMED_HIDRAW; |
1170 | 1181 | ||
1171 | if (!hdev->claimed) { | 1182 | if (!hdev->claimed) { |
1172 | dev_err(&hdev->dev, "claimed by neither input, hiddev nor " | 1183 | hid_err(hdev, "claimed by neither input, hiddev nor hidraw\n"); |
1173 | "hidraw\n"); | ||
1174 | return -ENODEV; | 1184 | return -ENODEV; |
1175 | } | 1185 | } |
1176 | 1186 | ||
@@ -1210,9 +1220,9 @@ int hid_connect(struct hid_device *hdev, unsigned int connect_mask) | |||
1210 | bus = "<UNKNOWN>"; | 1220 | bus = "<UNKNOWN>"; |
1211 | } | 1221 | } |
1212 | 1222 | ||
1213 | dev_info(&hdev->dev, "%s: %s HID v%x.%02x %s [%s] on %s\n", | 1223 | hid_info(hdev, "%s: %s HID v%x.%02x %s [%s] on %s\n", |
1214 | buf, bus, hdev->version >> 8, hdev->version & 0xff, | 1224 | buf, bus, hdev->version >> 8, hdev->version & 0xff, |
1215 | type, hdev->name, hdev->phys); | 1225 | type, hdev->name, hdev->phys); |
1216 | 1226 | ||
1217 | return 0; | 1227 | return 0; |
1218 | } | 1228 | } |
@@ -1956,12 +1966,12 @@ static int __init hid_init(void) | |||
1956 | int ret; | 1966 | int ret; |
1957 | 1967 | ||
1958 | if (hid_debug) | 1968 | if (hid_debug) |
1959 | printk(KERN_WARNING "HID: hid_debug is now used solely for parser and driver debugging.\n" | 1969 | pr_warn("hid_debug is now used solely for parser and driver debugging.\n" |
1960 | "HID: debugfs is now used for inspecting the device (report descriptor, reports)\n"); | 1970 | "debugfs is now used for inspecting the device (report descriptor, reports)\n"); |
1961 | 1971 | ||
1962 | ret = bus_register(&hid_bus_type); | 1972 | ret = bus_register(&hid_bus_type); |
1963 | if (ret) { | 1973 | if (ret) { |
1964 | printk(KERN_ERR "HID: can't register hid bus\n"); | 1974 | pr_err("can't register hid bus\n"); |
1965 | goto err; | 1975 | goto err; |
1966 | } | 1976 | } |
1967 | 1977 | ||
diff --git a/drivers/hid/hid-cypress.c b/drivers/hid/hid-cypress.c index 4cd0e2345991..2f0be4c66af7 100644 --- a/drivers/hid/hid-cypress.c +++ b/drivers/hid/hid-cypress.c | |||
@@ -107,13 +107,13 @@ static int cp_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
107 | 107 | ||
108 | ret = hid_parse(hdev); | 108 | ret = hid_parse(hdev); |
109 | if (ret) { | 109 | if (ret) { |
110 | dev_err(&hdev->dev, "parse failed\n"); | 110 | hid_err(hdev, "parse failed\n"); |
111 | goto err_free; | 111 | goto err_free; |
112 | } | 112 | } |
113 | 113 | ||
114 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); | 114 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); |
115 | if (ret) { | 115 | if (ret) { |
116 | dev_err(&hdev->dev, "hw start failed\n"); | 116 | hid_err(hdev, "hw start failed\n"); |
117 | goto err_free; | 117 | goto err_free; |
118 | } | 118 | } |
119 | 119 | ||
diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index 75c5e23d09d2..555382fc7417 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c | |||
@@ -26,6 +26,8 @@ | |||
26 | * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic | 26 | * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
30 | |||
29 | #include <linux/debugfs.h> | 31 | #include <linux/debugfs.h> |
30 | #include <linux/seq_file.h> | 32 | #include <linux/seq_file.h> |
31 | #include <linux/sched.h> | 33 | #include <linux/sched.h> |
@@ -393,7 +395,7 @@ char *hid_resolv_usage(unsigned usage, struct seq_file *f) { | |||
393 | 395 | ||
394 | buf = resolv_usage_page(usage >> 16, f); | 396 | buf = resolv_usage_page(usage >> 16, f); |
395 | if (IS_ERR(buf)) { | 397 | if (IS_ERR(buf)) { |
396 | printk(KERN_ERR "error allocating HID debug buffer\n"); | 398 | pr_err("error allocating HID debug buffer\n"); |
397 | return NULL; | 399 | return NULL; |
398 | } | 400 | } |
399 | 401 | ||
diff --git a/drivers/hid/hid-drff.c b/drivers/hid/hid-drff.c index 968b04f9b796..afcf3d67eb02 100644 --- a/drivers/hid/hid-drff.c +++ b/drivers/hid/hid-drff.c | |||
@@ -96,18 +96,18 @@ static int drff_init(struct hid_device *hid) | |||
96 | int error; | 96 | int error; |
97 | 97 | ||
98 | if (list_empty(report_list)) { | 98 | if (list_empty(report_list)) { |
99 | dev_err(&hid->dev, "no output reports found\n"); | 99 | hid_err(hid, "no output reports found\n"); |
100 | return -ENODEV; | 100 | return -ENODEV; |
101 | } | 101 | } |
102 | 102 | ||
103 | report = list_first_entry(report_list, struct hid_report, list); | 103 | report = list_first_entry(report_list, struct hid_report, list); |
104 | if (report->maxfield < 1) { | 104 | if (report->maxfield < 1) { |
105 | dev_err(&hid->dev, "no fields in the report\n"); | 105 | hid_err(hid, "no fields in the report\n"); |
106 | return -ENODEV; | 106 | return -ENODEV; |
107 | } | 107 | } |
108 | 108 | ||
109 | if (report->field[0]->report_count < 7) { | 109 | if (report->field[0]->report_count < 7) { |
110 | dev_err(&hid->dev, "not enough values in the field\n"); | 110 | hid_err(hid, "not enough values in the field\n"); |
111 | return -ENODEV; | 111 | return -ENODEV; |
112 | } | 112 | } |
113 | 113 | ||
@@ -133,8 +133,8 @@ static int drff_init(struct hid_device *hid) | |||
133 | drff->report->field[0]->value[6] = 0x00; | 133 | drff->report->field[0]->value[6] = 0x00; |
134 | usbhid_submit_report(hid, drff->report, USB_DIR_OUT); | 134 | usbhid_submit_report(hid, drff->report, USB_DIR_OUT); |
135 | 135 | ||
136 | dev_info(&hid->dev, "Force Feedback for DragonRise Inc. game " | 136 | hid_info(hid, "Force Feedback for DragonRise Inc. " |
137 | "controllers by Richard Walmsley <richwalm@gmail.com>\n"); | 137 | "game controllers by Richard Walmsley <richwalm@gmail.com>\n"); |
138 | 138 | ||
139 | return 0; | 139 | return 0; |
140 | } | 140 | } |
@@ -153,13 +153,13 @@ static int dr_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
153 | 153 | ||
154 | ret = hid_parse(hdev); | 154 | ret = hid_parse(hdev); |
155 | if (ret) { | 155 | if (ret) { |
156 | dev_err(&hdev->dev, "parse failed\n"); | 156 | hid_err(hdev, "parse failed\n"); |
157 | goto err; | 157 | goto err; |
158 | } | 158 | } |
159 | 159 | ||
160 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); | 160 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); |
161 | if (ret) { | 161 | if (ret) { |
162 | dev_err(&hdev->dev, "hw start failed\n"); | 162 | hid_err(hdev, "hw start failed\n"); |
163 | goto err; | 163 | goto err; |
164 | } | 164 | } |
165 | 165 | ||
diff --git a/drivers/hid/hid-egalax.c b/drivers/hid/hid-egalax.c index 54b017ad258d..bbab6cff3518 100644 --- a/drivers/hid/hid-egalax.c +++ b/drivers/hid/hid-egalax.c | |||
@@ -223,7 +223,7 @@ static int egalax_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
223 | 223 | ||
224 | td = kmalloc(sizeof(struct egalax_data), GFP_KERNEL); | 224 | td = kmalloc(sizeof(struct egalax_data), GFP_KERNEL); |
225 | if (!td) { | 225 | if (!td) { |
226 | dev_err(&hdev->dev, "cannot allocate eGalax data\n"); | 226 | hid_err(hdev, "cannot allocate eGalax data\n"); |
227 | return -ENOMEM; | 227 | return -ENOMEM; |
228 | } | 228 | } |
229 | hid_set_drvdata(hdev, td); | 229 | hid_set_drvdata(hdev, td); |
diff --git a/drivers/hid/hid-elecom.c b/drivers/hid/hid-elecom.c index 6e31f305397d..79d0c61e7214 100644 --- a/drivers/hid/hid-elecom.c +++ b/drivers/hid/hid-elecom.c | |||
@@ -24,8 +24,7 @@ static __u8 *elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
24 | unsigned int *rsize) | 24 | unsigned int *rsize) |
25 | { | 25 | { |
26 | if (*rsize >= 48 && rdesc[46] == 0x05 && rdesc[47] == 0x0c) { | 26 | if (*rsize >= 48 && rdesc[46] == 0x05 && rdesc[47] == 0x0c) { |
27 | dev_info(&hdev->dev, "Fixing up Elecom BM084 " | 27 | hid_info(hdev, "Fixing up Elecom BM084 report descriptor\n"); |
28 | "report descriptor.\n"); | ||
29 | rdesc[47] = 0x00; | 28 | rdesc[47] = 0x00; |
30 | } | 29 | } |
31 | return rdesc; | 30 | return rdesc; |
diff --git a/drivers/hid/hid-emsff.c b/drivers/hid/hid-emsff.c index c61b192d7cff..81877c67caea 100644 --- a/drivers/hid/hid-emsff.c +++ b/drivers/hid/hid-emsff.c | |||
@@ -68,18 +68,18 @@ static int emsff_init(struct hid_device *hid) | |||
68 | int error; | 68 | int error; |
69 | 69 | ||
70 | if (list_empty(report_list)) { | 70 | if (list_empty(report_list)) { |
71 | dev_err(&hid->dev, "no output reports found\n"); | 71 | hid_err(hid, "no output reports found\n"); |
72 | return -ENODEV; | 72 | return -ENODEV; |
73 | } | 73 | } |
74 | 74 | ||
75 | report = list_first_entry(report_list, struct hid_report, list); | 75 | report = list_first_entry(report_list, struct hid_report, list); |
76 | if (report->maxfield < 1) { | 76 | if (report->maxfield < 1) { |
77 | dev_err(&hid->dev, "no fields in the report\n"); | 77 | hid_err(hid, "no fields in the report\n"); |
78 | return -ENODEV; | 78 | return -ENODEV; |
79 | } | 79 | } |
80 | 80 | ||
81 | if (report->field[0]->report_count < 7) { | 81 | if (report->field[0]->report_count < 7) { |
82 | dev_err(&hid->dev, "not enough values in the field\n"); | 82 | hid_err(hid, "not enough values in the field\n"); |
83 | return -ENODEV; | 83 | return -ENODEV; |
84 | } | 84 | } |
85 | 85 | ||
@@ -105,8 +105,7 @@ static int emsff_init(struct hid_device *hid) | |||
105 | emsff->report->field[0]->value[6] = 0x00; | 105 | emsff->report->field[0]->value[6] = 0x00; |
106 | usbhid_submit_report(hid, emsff->report, USB_DIR_OUT); | 106 | usbhid_submit_report(hid, emsff->report, USB_DIR_OUT); |
107 | 107 | ||
108 | dev_info(&hid->dev, "force feedback for EMS based devices by " | 108 | hid_info(hid, "force feedback for EMS based devices by Ignaz Forster <ignaz.forster@gmx.de>\n"); |
109 | "Ignaz Forster <ignaz.forster@gmx.de>\n"); | ||
110 | 109 | ||
111 | return 0; | 110 | return 0; |
112 | } | 111 | } |
@@ -117,13 +116,13 @@ static int ems_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
117 | 116 | ||
118 | ret = hid_parse(hdev); | 117 | ret = hid_parse(hdev); |
119 | if (ret) { | 118 | if (ret) { |
120 | dev_err(&hdev->dev, "parse failed\n"); | 119 | hid_err(hdev, "parse failed\n"); |
121 | goto err; | 120 | goto err; |
122 | } | 121 | } |
123 | 122 | ||
124 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); | 123 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); |
125 | if (ret) { | 124 | if (ret) { |
126 | dev_err(&hdev->dev, "hw start failed\n"); | 125 | hid_err(hdev, "hw start failed\n"); |
127 | goto err; | 126 | goto err; |
128 | } | 127 | } |
129 | 128 | ||
diff --git a/drivers/hid/hid-gaff.c b/drivers/hid/hid-gaff.c index 88dfcf49a5d7..279ba530003c 100644 --- a/drivers/hid/hid-gaff.c +++ b/drivers/hid/hid-gaff.c | |||
@@ -87,7 +87,7 @@ static int gaff_init(struct hid_device *hid) | |||
87 | int error; | 87 | int error; |
88 | 88 | ||
89 | if (list_empty(report_list)) { | 89 | if (list_empty(report_list)) { |
90 | dev_err(&hid->dev, "no output reports found\n"); | 90 | hid_err(hid, "no output reports found\n"); |
91 | return -ENODEV; | 91 | return -ENODEV; |
92 | } | 92 | } |
93 | 93 | ||
@@ -95,12 +95,12 @@ static int gaff_init(struct hid_device *hid) | |||
95 | 95 | ||
96 | report = list_entry(report_ptr, struct hid_report, list); | 96 | report = list_entry(report_ptr, struct hid_report, list); |
97 | if (report->maxfield < 1) { | 97 | if (report->maxfield < 1) { |
98 | dev_err(&hid->dev, "no fields in the report\n"); | 98 | hid_err(hid, "no fields in the report\n"); |
99 | return -ENODEV; | 99 | return -ENODEV; |
100 | } | 100 | } |
101 | 101 | ||
102 | if (report->field[0]->report_count < 6) { | 102 | if (report->field[0]->report_count < 6) { |
103 | dev_err(&hid->dev, "not enough values in the field\n"); | 103 | hid_err(hid, "not enough values in the field\n"); |
104 | return -ENODEV; | 104 | return -ENODEV; |
105 | } | 105 | } |
106 | 106 | ||
@@ -128,8 +128,7 @@ static int gaff_init(struct hid_device *hid) | |||
128 | 128 | ||
129 | usbhid_submit_report(hid, gaff->report, USB_DIR_OUT); | 129 | usbhid_submit_report(hid, gaff->report, USB_DIR_OUT); |
130 | 130 | ||
131 | dev_info(&hid->dev, "Force Feedback for GreenAsia 0x12" | 131 | hid_info(hid, "Force Feedback for GreenAsia 0x12 devices by Lukasz Lubojanski <lukasz@lubojanski.info>\n"); |
132 | " devices by Lukasz Lubojanski <lukasz@lubojanski.info>\n"); | ||
133 | 132 | ||
134 | return 0; | 133 | return 0; |
135 | } | 134 | } |
@@ -148,13 +147,13 @@ static int ga_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
148 | 147 | ||
149 | ret = hid_parse(hdev); | 148 | ret = hid_parse(hdev); |
150 | if (ret) { | 149 | if (ret) { |
151 | dev_err(&hdev->dev, "parse failed\n"); | 150 | hid_err(hdev, "parse failed\n"); |
152 | goto err; | 151 | goto err; |
153 | } | 152 | } |
154 | 153 | ||
155 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); | 154 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); |
156 | if (ret) { | 155 | if (ret) { |
157 | dev_err(&hdev->dev, "hw start failed\n"); | 156 | hid_err(hdev, "hw start failed\n"); |
158 | goto err; | 157 | goto err; |
159 | } | 158 | } |
160 | 159 | ||
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index b718f7144ce1..a1a2206714fc 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c | |||
@@ -826,7 +826,7 @@ int hidinput_connect(struct hid_device *hid, unsigned int force) | |||
826 | if (!hidinput || !input_dev) { | 826 | if (!hidinput || !input_dev) { |
827 | kfree(hidinput); | 827 | kfree(hidinput); |
828 | input_free_device(input_dev); | 828 | input_free_device(input_dev); |
829 | err_hid("Out of memory during hid input probe"); | 829 | hid_err(hid, "Out of memory during hid input probe\n"); |
830 | goto out_unwind; | 830 | goto out_unwind; |
831 | } | 831 | } |
832 | 832 | ||
diff --git a/drivers/hid/hid-kye.c b/drivers/hid/hid-kye.c index 817247ee006c..f2ba9efc3a53 100644 --- a/drivers/hid/hid-kye.c +++ b/drivers/hid/hid-kye.c | |||
@@ -32,8 +32,8 @@ static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
32 | rdesc[65] == 0x29 && rdesc[66] == 0x0f && | 32 | rdesc[65] == 0x29 && rdesc[66] == 0x0f && |
33 | rdesc[71] == 0x75 && rdesc[72] == 0x08 && | 33 | rdesc[71] == 0x75 && rdesc[72] == 0x08 && |
34 | rdesc[73] == 0x95 && rdesc[74] == 0x01) { | 34 | rdesc[73] == 0x95 && rdesc[74] == 0x01) { |
35 | dev_info(&hdev->dev, "fixing up Kye/Genius Ergo Mouse report " | 35 | hid_info(hdev, |
36 | "descriptor\n"); | 36 | "fixing up Kye/Genius Ergo Mouse report descriptor\n"); |
37 | rdesc[62] = 0x09; | 37 | rdesc[62] = 0x09; |
38 | rdesc[64] = 0x04; | 38 | rdesc[64] = 0x04; |
39 | rdesc[66] = 0x07; | 39 | rdesc[66] = 0x07; |
diff --git a/drivers/hid/hid-lg.c b/drivers/hid/hid-lg.c index b629fba5a057..aef4104da141 100644 --- a/drivers/hid/hid-lg.c +++ b/drivers/hid/hid-lg.c | |||
@@ -53,23 +53,22 @@ static __u8 *lg_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
53 | 53 | ||
54 | if ((quirks & LG_RDESC) && *rsize >= 90 && rdesc[83] == 0x26 && | 54 | if ((quirks & LG_RDESC) && *rsize >= 90 && rdesc[83] == 0x26 && |
55 | rdesc[84] == 0x8c && rdesc[85] == 0x02) { | 55 | rdesc[84] == 0x8c && rdesc[85] == 0x02) { |
56 | dev_info(&hdev->dev, "fixing up Logitech keyboard report " | 56 | hid_info(hdev, |
57 | "descriptor\n"); | 57 | "fixing up Logitech keyboard report descriptor\n"); |
58 | rdesc[84] = rdesc[89] = 0x4d; | 58 | rdesc[84] = rdesc[89] = 0x4d; |
59 | rdesc[85] = rdesc[90] = 0x10; | 59 | rdesc[85] = rdesc[90] = 0x10; |
60 | } | 60 | } |
61 | if ((quirks & LG_RDESC_REL_ABS) && *rsize >= 50 && | 61 | if ((quirks & LG_RDESC_REL_ABS) && *rsize >= 50 && |
62 | rdesc[32] == 0x81 && rdesc[33] == 0x06 && | 62 | rdesc[32] == 0x81 && rdesc[33] == 0x06 && |
63 | rdesc[49] == 0x81 && rdesc[50] == 0x06) { | 63 | rdesc[49] == 0x81 && rdesc[50] == 0x06) { |
64 | dev_info(&hdev->dev, "fixing up rel/abs in Logitech " | 64 | hid_info(hdev, |
65 | "report descriptor\n"); | 65 | "fixing up rel/abs in Logitech report descriptor\n"); |
66 | rdesc[33] = rdesc[50] = 0x02; | 66 | rdesc[33] = rdesc[50] = 0x02; |
67 | } | 67 | } |
68 | if ((quirks & LG_FF4) && *rsize >= 101 && | 68 | if ((quirks & LG_FF4) && *rsize >= 101 && |
69 | rdesc[41] == 0x95 && rdesc[42] == 0x0B && | 69 | rdesc[41] == 0x95 && rdesc[42] == 0x0B && |
70 | rdesc[47] == 0x05 && rdesc[48] == 0x09) { | 70 | rdesc[47] == 0x05 && rdesc[48] == 0x09) { |
71 | dev_info(&hdev->dev, "fixing up Logitech Speed Force Wireless " | 71 | hid_info(hdev, "fixing up Logitech Speed Force Wireless button descriptor\n"); |
72 | "button descriptor\n"); | ||
73 | rdesc[41] = 0x05; | 72 | rdesc[41] = 0x05; |
74 | rdesc[42] = 0x09; | 73 | rdesc[42] = 0x09; |
75 | rdesc[47] = 0x95; | 74 | rdesc[47] = 0x95; |
@@ -288,7 +287,7 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
288 | 287 | ||
289 | ret = hid_parse(hdev); | 288 | ret = hid_parse(hdev); |
290 | if (ret) { | 289 | if (ret) { |
291 | dev_err(&hdev->dev, "parse failed\n"); | 290 | hid_err(hdev, "parse failed\n"); |
292 | goto err_free; | 291 | goto err_free; |
293 | } | 292 | } |
294 | 293 | ||
@@ -297,7 +296,7 @@ static int lg_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
297 | 296 | ||
298 | ret = hid_hw_start(hdev, connect_mask); | 297 | ret = hid_hw_start(hdev, connect_mask); |
299 | if (ret) { | 298 | if (ret) { |
300 | dev_err(&hdev->dev, "hw start failed\n"); | 299 | hid_err(hdev, "hw start failed\n"); |
301 | goto err_free; | 300 | goto err_free; |
302 | } | 301 | } |
303 | 302 | ||
diff --git a/drivers/hid/hid-lg2ff.c b/drivers/hid/hid-lg2ff.c index 4258253c36b3..3c31bc650e5d 100644 --- a/drivers/hid/hid-lg2ff.c +++ b/drivers/hid/hid-lg2ff.c | |||
@@ -72,18 +72,18 @@ int lg2ff_init(struct hid_device *hid) | |||
72 | int error; | 72 | int error; |
73 | 73 | ||
74 | if (list_empty(report_list)) { | 74 | if (list_empty(report_list)) { |
75 | dev_err(&hid->dev, "no output report found\n"); | 75 | hid_err(hid, "no output report found\n"); |
76 | return -ENODEV; | 76 | return -ENODEV; |
77 | } | 77 | } |
78 | 78 | ||
79 | report = list_entry(report_list->next, struct hid_report, list); | 79 | report = list_entry(report_list->next, struct hid_report, list); |
80 | 80 | ||
81 | if (report->maxfield < 1) { | 81 | if (report->maxfield < 1) { |
82 | dev_err(&hid->dev, "output report is empty\n"); | 82 | hid_err(hid, "output report is empty\n"); |
83 | return -ENODEV; | 83 | return -ENODEV; |
84 | } | 84 | } |
85 | if (report->field[0]->report_count < 7) { | 85 | if (report->field[0]->report_count < 7) { |
86 | dev_err(&hid->dev, "not enough values in the field\n"); | 86 | hid_err(hid, "not enough values in the field\n"); |
87 | return -ENODEV; | 87 | return -ENODEV; |
88 | } | 88 | } |
89 | 89 | ||
@@ -110,8 +110,7 @@ int lg2ff_init(struct hid_device *hid) | |||
110 | 110 | ||
111 | usbhid_submit_report(hid, report, USB_DIR_OUT); | 111 | usbhid_submit_report(hid, report, USB_DIR_OUT); |
112 | 112 | ||
113 | dev_info(&hid->dev, "Force feedback for Logitech RumblePad/Rumblepad 2 by " | 113 | hid_info(hid, "Force feedback for Logitech RumblePad/Rumblepad 2 by Anssi Hannula <anssi.hannula@gmail.com>\n"); |
114 | "Anssi Hannula <anssi.hannula@gmail.com>\n"); | ||
115 | 114 | ||
116 | return 0; | 115 | return 0; |
117 | } | 116 | } |
diff --git a/drivers/hid/hid-lg3ff.c b/drivers/hid/hid-lg3ff.c index 4002832ee4af..f98644c26c1d 100644 --- a/drivers/hid/hid-lg3ff.c +++ b/drivers/hid/hid-lg3ff.c | |||
@@ -141,20 +141,20 @@ int lg3ff_init(struct hid_device *hid) | |||
141 | 141 | ||
142 | /* Find the report to use */ | 142 | /* Find the report to use */ |
143 | if (list_empty(report_list)) { | 143 | if (list_empty(report_list)) { |
144 | err_hid("No output report found"); | 144 | hid_err(hid, "No output report found\n"); |
145 | return -1; | 145 | return -1; |
146 | } | 146 | } |
147 | 147 | ||
148 | /* Check that the report looks ok */ | 148 | /* Check that the report looks ok */ |
149 | report = list_entry(report_list->next, struct hid_report, list); | 149 | report = list_entry(report_list->next, struct hid_report, list); |
150 | if (!report) { | 150 | if (!report) { |
151 | err_hid("NULL output report"); | 151 | hid_err(hid, "NULL output report\n"); |
152 | return -1; | 152 | return -1; |
153 | } | 153 | } |
154 | 154 | ||
155 | field = report->field[0]; | 155 | field = report->field[0]; |
156 | if (!field) { | 156 | if (!field) { |
157 | err_hid("NULL field"); | 157 | hid_err(hid, "NULL field\n"); |
158 | return -1; | 158 | return -1; |
159 | } | 159 | } |
160 | 160 | ||
@@ -169,8 +169,7 @@ int lg3ff_init(struct hid_device *hid) | |||
169 | if (test_bit(FF_AUTOCENTER, dev->ffbit)) | 169 | if (test_bit(FF_AUTOCENTER, dev->ffbit)) |
170 | dev->ff->set_autocenter = hid_lg3ff_set_autocenter; | 170 | dev->ff->set_autocenter = hid_lg3ff_set_autocenter; |
171 | 171 | ||
172 | dev_info(&hid->dev, "Force feedback for Logitech Flight System G940 by " | 172 | hid_info(hid, "Force feedback for Logitech Flight System G940 by Gary Stein <LordCnidarian@gmail.com>\n"); |
173 | "Gary Stein <LordCnidarian@gmail.com>\n"); | ||
174 | return 0; | 173 | return 0; |
175 | } | 174 | } |
176 | 175 | ||
diff --git a/drivers/hid/hid-lg4ff.c b/drivers/hid/hid-lg4ff.c index 7eef5a2ce948..fa550c8e1d1b 100644 --- a/drivers/hid/hid-lg4ff.c +++ b/drivers/hid/hid-lg4ff.c | |||
@@ -101,20 +101,20 @@ int lg4ff_init(struct hid_device *hid) | |||
101 | 101 | ||
102 | /* Find the report to use */ | 102 | /* Find the report to use */ |
103 | if (list_empty(report_list)) { | 103 | if (list_empty(report_list)) { |
104 | err_hid("No output report found"); | 104 | hid_err(hid, "No output report found\n"); |
105 | return -1; | 105 | return -1; |
106 | } | 106 | } |
107 | 107 | ||
108 | /* Check that the report looks ok */ | 108 | /* Check that the report looks ok */ |
109 | report = list_entry(report_list->next, struct hid_report, list); | 109 | report = list_entry(report_list->next, struct hid_report, list); |
110 | if (!report) { | 110 | if (!report) { |
111 | err_hid("NULL output report"); | 111 | hid_err(hid, "NULL output report\n"); |
112 | return -1; | 112 | return -1; |
113 | } | 113 | } |
114 | 114 | ||
115 | field = report->field[0]; | 115 | field = report->field[0]; |
116 | if (!field) { | 116 | if (!field) { |
117 | err_hid("NULL field"); | 117 | hid_err(hid, "NULL field\n"); |
118 | return -1; | 118 | return -1; |
119 | } | 119 | } |
120 | 120 | ||
@@ -129,8 +129,7 @@ int lg4ff_init(struct hid_device *hid) | |||
129 | if (test_bit(FF_AUTOCENTER, dev->ffbit)) | 129 | if (test_bit(FF_AUTOCENTER, dev->ffbit)) |
130 | dev->ff->set_autocenter = hid_lg4ff_set_autocenter; | 130 | dev->ff->set_autocenter = hid_lg4ff_set_autocenter; |
131 | 131 | ||
132 | dev_info(&hid->dev, "Force feedback for Logitech Speed Force Wireless by " | 132 | hid_info(hid, "Force feedback for Logitech Speed Force Wireless by Simon Wood <simon@mungewell.org>\n"); |
133 | "Simon Wood <simon@mungewell.org>\n"); | ||
134 | return 0; | 133 | return 0; |
135 | } | 134 | } |
136 | 135 | ||
diff --git a/drivers/hid/hid-lgff.c b/drivers/hid/hid-lgff.c index 61142b76a9b1..90d0ef2c92be 100644 --- a/drivers/hid/hid-lgff.c +++ b/drivers/hid/hid-lgff.c | |||
@@ -27,6 +27,8 @@ | |||
27 | * e-mail - mail your message to <johann.deneux@it.uu.se> | 27 | * e-mail - mail your message to <johann.deneux@it.uu.se> |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
31 | |||
30 | #include <linux/input.h> | 32 | #include <linux/input.h> |
31 | #include <linux/usb.h> | 33 | #include <linux/usb.h> |
32 | #include <linux/hid.h> | 34 | #include <linux/hid.h> |
@@ -146,7 +148,7 @@ int lgff_init(struct hid_device* hid) | |||
146 | 148 | ||
147 | /* Find the report to use */ | 149 | /* Find the report to use */ |
148 | if (list_empty(report_list)) { | 150 | if (list_empty(report_list)) { |
149 | err_hid("No output report found"); | 151 | hid_err(hid, "No output report found\n"); |
150 | return -1; | 152 | return -1; |
151 | } | 153 | } |
152 | 154 | ||
@@ -154,7 +156,7 @@ int lgff_init(struct hid_device* hid) | |||
154 | report = list_entry(report_list->next, struct hid_report, list); | 156 | report = list_entry(report_list->next, struct hid_report, list); |
155 | field = report->field[0]; | 157 | field = report->field[0]; |
156 | if (!field) { | 158 | if (!field) { |
157 | err_hid("NULL field"); | 159 | hid_err(hid, "NULL field\n"); |
158 | return -1; | 160 | return -1; |
159 | } | 161 | } |
160 | 162 | ||
@@ -176,7 +178,7 @@ int lgff_init(struct hid_device* hid) | |||
176 | if ( test_bit(FF_AUTOCENTER, dev->ffbit) ) | 178 | if ( test_bit(FF_AUTOCENTER, dev->ffbit) ) |
177 | dev->ff->set_autocenter = hid_lgff_set_autocenter; | 179 | dev->ff->set_autocenter = hid_lgff_set_autocenter; |
178 | 180 | ||
179 | printk(KERN_INFO "Force feedback for Logitech force feedback devices by Johann Deneux <johann.deneux@it.uu.se>\n"); | 181 | pr_info("Force feedback for Logitech force feedback devices by Johann Deneux <johann.deneux@it.uu.se>\n"); |
180 | 182 | ||
181 | return 0; | 183 | return 0; |
182 | } | 184 | } |
diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c index e6dc15171664..11306b3d9c56 100644 --- a/drivers/hid/hid-magicmouse.c +++ b/drivers/hid/hid-magicmouse.c | |||
@@ -12,6 +12,8 @@ | |||
12 | * any later version. | 12 | * any later version. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
16 | |||
15 | #include <linux/device.h> | 17 | #include <linux/device.h> |
16 | #include <linux/hid.h> | 18 | #include <linux/hid.h> |
17 | #include <linux/module.h> | 19 | #include <linux/module.h> |
@@ -446,7 +448,7 @@ static int magicmouse_probe(struct hid_device *hdev, | |||
446 | 448 | ||
447 | msc = kzalloc(sizeof(*msc), GFP_KERNEL); | 449 | msc = kzalloc(sizeof(*msc), GFP_KERNEL); |
448 | if (msc == NULL) { | 450 | if (msc == NULL) { |
449 | dev_err(&hdev->dev, "can't alloc magicmouse descriptor\n"); | 451 | hid_err(hdev, "can't alloc magicmouse descriptor\n"); |
450 | return -ENOMEM; | 452 | return -ENOMEM; |
451 | } | 453 | } |
452 | 454 | ||
@@ -459,13 +461,13 @@ static int magicmouse_probe(struct hid_device *hdev, | |||
459 | 461 | ||
460 | ret = hid_parse(hdev); | 462 | ret = hid_parse(hdev); |
461 | if (ret) { | 463 | if (ret) { |
462 | dev_err(&hdev->dev, "magicmouse hid parse failed\n"); | 464 | hid_err(hdev, "magicmouse hid parse failed\n"); |
463 | goto err_free; | 465 | goto err_free; |
464 | } | 466 | } |
465 | 467 | ||
466 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); | 468 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); |
467 | if (ret) { | 469 | if (ret) { |
468 | dev_err(&hdev->dev, "magicmouse hw start failed\n"); | 470 | hid_err(hdev, "magicmouse hw start failed\n"); |
469 | goto err_free; | 471 | goto err_free; |
470 | } | 472 | } |
471 | 473 | ||
@@ -486,7 +488,7 @@ static int magicmouse_probe(struct hid_device *hdev, | |||
486 | } | 488 | } |
487 | 489 | ||
488 | if (!report) { | 490 | if (!report) { |
489 | dev_err(&hdev->dev, "unable to register touch report\n"); | 491 | hid_err(hdev, "unable to register touch report\n"); |
490 | ret = -ENOMEM; | 492 | ret = -ENOMEM; |
491 | goto err_stop_hw; | 493 | goto err_stop_hw; |
492 | } | 494 | } |
@@ -495,8 +497,7 @@ static int magicmouse_probe(struct hid_device *hdev, | |||
495 | ret = hdev->hid_output_raw_report(hdev, feature, sizeof(feature), | 497 | ret = hdev->hid_output_raw_report(hdev, feature, sizeof(feature), |
496 | HID_FEATURE_REPORT); | 498 | HID_FEATURE_REPORT); |
497 | if (ret != sizeof(feature)) { | 499 | if (ret != sizeof(feature)) { |
498 | dev_err(&hdev->dev, "unable to request touch data (%d)\n", | 500 | hid_err(hdev, "unable to request touch data (%d)\n", ret); |
499 | ret); | ||
500 | goto err_stop_hw; | 501 | goto err_stop_hw; |
501 | } | 502 | } |
502 | 503 | ||
@@ -540,7 +541,7 @@ static int __init magicmouse_init(void) | |||
540 | 541 | ||
541 | ret = hid_register_driver(&magicmouse_driver); | 542 | ret = hid_register_driver(&magicmouse_driver); |
542 | if (ret) | 543 | if (ret) |
543 | printk(KERN_ERR "can't register magicmouse driver\n"); | 544 | pr_err("can't register magicmouse driver\n"); |
544 | 545 | ||
545 | return ret; | 546 | return ret; |
546 | } | 547 | } |
diff --git a/drivers/hid/hid-microsoft.c b/drivers/hid/hid-microsoft.c index dc618c33d0a2..0f6fc54dc196 100644 --- a/drivers/hid/hid-microsoft.c +++ b/drivers/hid/hid-microsoft.c | |||
@@ -40,8 +40,7 @@ static __u8 *ms_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
40 | 40 | ||
41 | if ((quirks & MS_RDESC) && *rsize == 571 && rdesc[557] == 0x19 && | 41 | if ((quirks & MS_RDESC) && *rsize == 571 && rdesc[557] == 0x19 && |
42 | rdesc[559] == 0x29) { | 42 | rdesc[559] == 0x29) { |
43 | dev_info(&hdev->dev, "fixing up Microsoft Wireless Receiver " | 43 | hid_info(hdev, "fixing up Microsoft Wireless Receiver Model 1028 report descriptor\n"); |
44 | "Model 1028 report descriptor\n"); | ||
45 | rdesc[557] = 0x35; | 44 | rdesc[557] = 0x35; |
46 | rdesc[559] = 0x45; | 45 | rdesc[559] = 0x45; |
47 | } | 46 | } |
@@ -155,14 +154,14 @@ static int ms_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
155 | 154 | ||
156 | ret = hid_parse(hdev); | 155 | ret = hid_parse(hdev); |
157 | if (ret) { | 156 | if (ret) { |
158 | dev_err(&hdev->dev, "parse failed\n"); | 157 | hid_err(hdev, "parse failed\n"); |
159 | goto err_free; | 158 | goto err_free; |
160 | } | 159 | } |
161 | 160 | ||
162 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT | ((quirks & MS_HIDINPUT) ? | 161 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT | ((quirks & MS_HIDINPUT) ? |
163 | HID_CONNECT_HIDINPUT_FORCE : 0)); | 162 | HID_CONNECT_HIDINPUT_FORCE : 0)); |
164 | if (ret) { | 163 | if (ret) { |
165 | dev_err(&hdev->dev, "hw start failed\n"); | 164 | hid_err(hdev, "hw start failed\n"); |
166 | goto err_free; | 165 | goto err_free; |
167 | } | 166 | } |
168 | 167 | ||
diff --git a/drivers/hid/hid-monterey.c b/drivers/hid/hid-monterey.c index c95c31e2d869..dedf757781ae 100644 --- a/drivers/hid/hid-monterey.c +++ b/drivers/hid/hid-monterey.c | |||
@@ -26,8 +26,7 @@ static __u8 *mr_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
26 | unsigned int *rsize) | 26 | unsigned int *rsize) |
27 | { | 27 | { |
28 | if (*rsize >= 30 && rdesc[29] == 0x05 && rdesc[30] == 0x09) { | 28 | if (*rsize >= 30 && rdesc[29] == 0x05 && rdesc[30] == 0x09) { |
29 | dev_info(&hdev->dev, "fixing up button/consumer in HID report " | 29 | hid_info(hdev, "fixing up button/consumer in HID report descriptor\n"); |
30 | "descriptor\n"); | ||
31 | rdesc[30] = 0x0c; | 30 | rdesc[30] = 0x0c; |
32 | } | 31 | } |
33 | return rdesc; | 32 | return rdesc; |
diff --git a/drivers/hid/hid-mosart.c b/drivers/hid/hid-mosart.c index ac5421d568f1..0668685380d5 100644 --- a/drivers/hid/hid-mosart.c +++ b/drivers/hid/hid-mosart.c | |||
@@ -199,7 +199,7 @@ static int mosart_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
199 | 199 | ||
200 | td = kmalloc(sizeof(struct mosart_data), GFP_KERNEL); | 200 | td = kmalloc(sizeof(struct mosart_data), GFP_KERNEL); |
201 | if (!td) { | 201 | if (!td) { |
202 | dev_err(&hdev->dev, "cannot allocate MosArt data\n"); | 202 | hid_err(hdev, "cannot allocate MosArt data\n"); |
203 | return -ENOMEM; | 203 | return -ENOMEM; |
204 | } | 204 | } |
205 | td->valid = false; | 205 | td->valid = false; |
diff --git a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c index 69169efa1e16..beb403421e72 100644 --- a/drivers/hid/hid-ntrig.c +++ b/drivers/hid/hid-ntrig.c | |||
@@ -130,8 +130,7 @@ static void ntrig_report_version(struct hid_device *hdev) | |||
130 | if (ret == 8) { | 130 | if (ret == 8) { |
131 | ret = ntrig_version_string(&data[2], buf); | 131 | ret = ntrig_version_string(&data[2], buf); |
132 | 132 | ||
133 | dev_info(&hdev->dev, | 133 | hid_info(hdev, "Firmware version: %s (%02x%02x %02x%02x)\n", |
134 | "Firmware version: %s (%02x%02x %02x%02x)\n", | ||
135 | buf, data[2], data[3], data[4], data[5]); | 134 | buf, data[2], data[3], data[4], data[5]); |
136 | } | 135 | } |
137 | 136 | ||
@@ -831,7 +830,7 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
831 | 830 | ||
832 | nd = kmalloc(sizeof(struct ntrig_data), GFP_KERNEL); | 831 | nd = kmalloc(sizeof(struct ntrig_data), GFP_KERNEL); |
833 | if (!nd) { | 832 | if (!nd) { |
834 | dev_err(&hdev->dev, "cannot allocate N-Trig data\n"); | 833 | hid_err(hdev, "cannot allocate N-Trig data\n"); |
835 | return -ENOMEM; | 834 | return -ENOMEM; |
836 | } | 835 | } |
837 | 836 | ||
@@ -850,13 +849,13 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
850 | 849 | ||
851 | ret = hid_parse(hdev); | 850 | ret = hid_parse(hdev); |
852 | if (ret) { | 851 | if (ret) { |
853 | dev_err(&hdev->dev, "parse failed\n"); | 852 | hid_err(hdev, "parse failed\n"); |
854 | goto err_free; | 853 | goto err_free; |
855 | } | 854 | } |
856 | 855 | ||
857 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); | 856 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); |
858 | if (ret) { | 857 | if (ret) { |
859 | dev_err(&hdev->dev, "hw start failed\n"); | 858 | hid_err(hdev, "hw start failed\n"); |
860 | goto err_free; | 859 | goto err_free; |
861 | } | 860 | } |
862 | 861 | ||
diff --git a/drivers/hid/hid-ortek.c b/drivers/hid/hid-ortek.c index 2e79716dca31..e90edfc63051 100644 --- a/drivers/hid/hid-ortek.c +++ b/drivers/hid/hid-ortek.c | |||
@@ -23,8 +23,7 @@ static __u8 *ortek_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
23 | unsigned int *rsize) | 23 | unsigned int *rsize) |
24 | { | 24 | { |
25 | if (*rsize >= 56 && rdesc[54] == 0x25 && rdesc[55] == 0x01) { | 25 | if (*rsize >= 56 && rdesc[54] == 0x25 && rdesc[55] == 0x01) { |
26 | dev_info(&hdev->dev, "Fixing up Ortek WKB-2000 " | 26 | hid_info(hdev, "Fixing up Ortek WKB-2000 report descriptor\n"); |
27 | "report descriptor.\n"); | ||
28 | rdesc[55] = 0x92; | 27 | rdesc[55] = 0x92; |
29 | } | 28 | } |
30 | return rdesc; | 29 | return rdesc; |
diff --git a/drivers/hid/hid-petalynx.c b/drivers/hid/hid-petalynx.c index 308d6ae48a3e..f1ea3ff8a98d 100644 --- a/drivers/hid/hid-petalynx.c +++ b/drivers/hid/hid-petalynx.c | |||
@@ -29,8 +29,7 @@ static __u8 *pl_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
29 | if (*rsize >= 60 && rdesc[39] == 0x2a && rdesc[40] == 0xf5 && | 29 | if (*rsize >= 60 && rdesc[39] == 0x2a && rdesc[40] == 0xf5 && |
30 | rdesc[41] == 0x00 && rdesc[59] == 0x26 && | 30 | rdesc[41] == 0x00 && rdesc[59] == 0x26 && |
31 | rdesc[60] == 0xf9 && rdesc[61] == 0x00) { | 31 | rdesc[60] == 0xf9 && rdesc[61] == 0x00) { |
32 | dev_info(&hdev->dev, "fixing up Petalynx Maxter Remote report " | 32 | hid_info(hdev, "fixing up Petalynx Maxter Remote report descriptor\n"); |
33 | "descriptor\n"); | ||
34 | rdesc[60] = 0xfa; | 33 | rdesc[60] = 0xfa; |
35 | rdesc[40] = 0xfa; | 34 | rdesc[40] = 0xfa; |
36 | } | 35 | } |
@@ -77,13 +76,13 @@ static int pl_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
77 | 76 | ||
78 | ret = hid_parse(hdev); | 77 | ret = hid_parse(hdev); |
79 | if (ret) { | 78 | if (ret) { |
80 | dev_err(&hdev->dev, "parse failed\n"); | 79 | hid_err(hdev, "parse failed\n"); |
81 | goto err_free; | 80 | goto err_free; |
82 | } | 81 | } |
83 | 82 | ||
84 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); | 83 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); |
85 | if (ret) { | 84 | if (ret) { |
86 | dev_err(&hdev->dev, "hw start failed\n"); | 85 | hid_err(hdev, "hw start failed\n"); |
87 | goto err_free; | 86 | goto err_free; |
88 | } | 87 | } |
89 | 88 | ||
diff --git a/drivers/hid/hid-picolcd.c b/drivers/hid/hid-picolcd.c index 38565fee7bf1..e4ce47156106 100644 --- a/drivers/hid/hid-picolcd.c +++ b/drivers/hid/hid-picolcd.c | |||
@@ -253,7 +253,7 @@ static struct hid_report *picolcd_report(int id, struct hid_device *hdev, int di | |||
253 | if (report->id == id) | 253 | if (report->id == id) |
254 | return report; | 254 | return report; |
255 | } | 255 | } |
256 | dev_warn(&hdev->dev, "No report with id 0x%x found\n", id); | 256 | hid_warn(hdev, "No report with id 0x%x found\n", id); |
257 | return NULL; | 257 | return NULL; |
258 | } | 258 | } |
259 | 259 | ||
@@ -1329,7 +1329,7 @@ static int picolcd_check_version(struct hid_device *hdev) | |||
1329 | 1329 | ||
1330 | verinfo = picolcd_send_and_wait(hdev, REPORT_VERSION, NULL, 0); | 1330 | verinfo = picolcd_send_and_wait(hdev, REPORT_VERSION, NULL, 0); |
1331 | if (!verinfo) { | 1331 | if (!verinfo) { |
1332 | dev_err(&hdev->dev, "no version response from PicoLCD"); | 1332 | hid_err(hdev, "no version response from PicoLCD\n"); |
1333 | return -ENODEV; | 1333 | return -ENODEV; |
1334 | } | 1334 | } |
1335 | 1335 | ||
@@ -1337,14 +1337,14 @@ static int picolcd_check_version(struct hid_device *hdev) | |||
1337 | data->version[0] = verinfo->raw_data[1]; | 1337 | data->version[0] = verinfo->raw_data[1]; |
1338 | data->version[1] = verinfo->raw_data[0]; | 1338 | data->version[1] = verinfo->raw_data[0]; |
1339 | if (data->status & PICOLCD_BOOTLOADER) { | 1339 | if (data->status & PICOLCD_BOOTLOADER) { |
1340 | dev_info(&hdev->dev, "PicoLCD, bootloader version %d.%d\n", | 1340 | hid_info(hdev, "PicoLCD, bootloader version %d.%d\n", |
1341 | verinfo->raw_data[1], verinfo->raw_data[0]); | 1341 | verinfo->raw_data[1], verinfo->raw_data[0]); |
1342 | } else { | 1342 | } else { |
1343 | dev_info(&hdev->dev, "PicoLCD, firmware version %d.%d\n", | 1343 | hid_info(hdev, "PicoLCD, firmware version %d.%d\n", |
1344 | verinfo->raw_data[1], verinfo->raw_data[0]); | 1344 | verinfo->raw_data[1], verinfo->raw_data[0]); |
1345 | } | 1345 | } |
1346 | } else { | 1346 | } else { |
1347 | dev_err(&hdev->dev, "confused, got unexpected version response from PicoLCD\n"); | 1347 | hid_err(hdev, "confused, got unexpected version response from PicoLCD\n"); |
1348 | ret = -EINVAL; | 1348 | ret = -EINVAL; |
1349 | } | 1349 | } |
1350 | kfree(verinfo); | 1350 | kfree(verinfo); |
@@ -2328,8 +2328,7 @@ static void picolcd_init_devfs(struct picolcd_data *data, | |||
2328 | (flash_w ? S_IWUSR : 0) | (flash_r ? S_IRUSR : 0), | 2328 | (flash_w ? S_IWUSR : 0) | (flash_r ? S_IRUSR : 0), |
2329 | hdev->debug_dir, data, &picolcd_debug_flash_fops); | 2329 | hdev->debug_dir, data, &picolcd_debug_flash_fops); |
2330 | } else if (flash_r || flash_w) | 2330 | } else if (flash_r || flash_w) |
2331 | dev_warn(&hdev->dev, "Unexpected FLASH access reports, " | 2331 | hid_warn(hdev, "Unexpected FLASH access reports, please submit rdesc for review\n"); |
2332 | "please submit rdesc for review\n"); | ||
2333 | } | 2332 | } |
2334 | 2333 | ||
2335 | static void picolcd_exit_devfs(struct picolcd_data *data) | 2334 | static void picolcd_exit_devfs(struct picolcd_data *data) |
@@ -2457,13 +2456,13 @@ static int picolcd_init_keys(struct picolcd_data *data, | |||
2457 | return -ENODEV; | 2456 | return -ENODEV; |
2458 | if (report->maxfield != 1 || report->field[0]->report_count != 2 || | 2457 | if (report->maxfield != 1 || report->field[0]->report_count != 2 || |
2459 | report->field[0]->report_size != 8) { | 2458 | report->field[0]->report_size != 8) { |
2460 | dev_err(&hdev->dev, "unsupported KEY_STATE report"); | 2459 | hid_err(hdev, "unsupported KEY_STATE report\n"); |
2461 | return -EINVAL; | 2460 | return -EINVAL; |
2462 | } | 2461 | } |
2463 | 2462 | ||
2464 | idev = input_allocate_device(); | 2463 | idev = input_allocate_device(); |
2465 | if (idev == NULL) { | 2464 | if (idev == NULL) { |
2466 | dev_err(&hdev->dev, "failed to allocate input device"); | 2465 | hid_err(hdev, "failed to allocate input device\n"); |
2467 | return -ENOMEM; | 2466 | return -ENOMEM; |
2468 | } | 2467 | } |
2469 | input_set_drvdata(idev, hdev); | 2468 | input_set_drvdata(idev, hdev); |
@@ -2485,7 +2484,7 @@ static int picolcd_init_keys(struct picolcd_data *data, | |||
2485 | input_set_capability(idev, EV_KEY, data->keycode[i]); | 2484 | input_set_capability(idev, EV_KEY, data->keycode[i]); |
2486 | error = input_register_device(idev); | 2485 | error = input_register_device(idev); |
2487 | if (error) { | 2486 | if (error) { |
2488 | dev_err(&hdev->dev, "error registering the input device"); | 2487 | hid_err(hdev, "error registering the input device\n"); |
2489 | input_free_device(idev); | 2488 | input_free_device(idev); |
2490 | return error; | 2489 | return error; |
2491 | } | 2490 | } |
@@ -2522,9 +2521,8 @@ static int picolcd_probe_lcd(struct hid_device *hdev, struct picolcd_data *data) | |||
2522 | return error; | 2521 | return error; |
2523 | 2522 | ||
2524 | if (data->version[0] != 0 && data->version[1] != 3) | 2523 | if (data->version[0] != 0 && data->version[1] != 3) |
2525 | dev_info(&hdev->dev, "Device with untested firmware revision, " | 2524 | hid_info(hdev, "Device with untested firmware revision, please submit /sys/kernel/debug/hid/%s/rdesc for this device.\n", |
2526 | "please submit /sys/kernel/debug/hid/%s/rdesc for this device.\n", | 2525 | dev_name(&hdev->dev)); |
2527 | dev_name(&hdev->dev)); | ||
2528 | 2526 | ||
2529 | /* Setup keypad input device */ | 2527 | /* Setup keypad input device */ |
2530 | error = picolcd_init_keys(data, picolcd_in_report(REPORT_KEY_STATE, hdev)); | 2528 | error = picolcd_init_keys(data, picolcd_in_report(REPORT_KEY_STATE, hdev)); |
@@ -2581,9 +2579,8 @@ static int picolcd_probe_bootloader(struct hid_device *hdev, struct picolcd_data | |||
2581 | return error; | 2579 | return error; |
2582 | 2580 | ||
2583 | if (data->version[0] != 1 && data->version[1] != 0) | 2581 | if (data->version[0] != 1 && data->version[1] != 0) |
2584 | dev_info(&hdev->dev, "Device with untested bootloader revision, " | 2582 | hid_info(hdev, "Device with untested bootloader revision, please submit /sys/kernel/debug/hid/%s/rdesc for this device.\n", |
2585 | "please submit /sys/kernel/debug/hid/%s/rdesc for this device.\n", | 2583 | dev_name(&hdev->dev)); |
2586 | dev_name(&hdev->dev)); | ||
2587 | 2584 | ||
2588 | picolcd_init_devfs(data, NULL, NULL, | 2585 | picolcd_init_devfs(data, NULL, NULL, |
2589 | picolcd_out_report(REPORT_BL_READ_MEMORY, hdev), | 2586 | picolcd_out_report(REPORT_BL_READ_MEMORY, hdev), |
@@ -2605,7 +2602,7 @@ static int picolcd_probe(struct hid_device *hdev, | |||
2605 | */ | 2602 | */ |
2606 | data = kzalloc(sizeof(struct picolcd_data), GFP_KERNEL); | 2603 | data = kzalloc(sizeof(struct picolcd_data), GFP_KERNEL); |
2607 | if (data == NULL) { | 2604 | if (data == NULL) { |
2608 | dev_err(&hdev->dev, "can't allocate space for Minibox PicoLCD device data\n"); | 2605 | hid_err(hdev, "can't allocate space for Minibox PicoLCD device data\n"); |
2609 | error = -ENOMEM; | 2606 | error = -ENOMEM; |
2610 | goto err_no_cleanup; | 2607 | goto err_no_cleanup; |
2611 | } | 2608 | } |
@@ -2621,7 +2618,7 @@ static int picolcd_probe(struct hid_device *hdev, | |||
2621 | /* Parse the device reports and start it up */ | 2618 | /* Parse the device reports and start it up */ |
2622 | error = hid_parse(hdev); | 2619 | error = hid_parse(hdev); |
2623 | if (error) { | 2620 | if (error) { |
2624 | dev_err(&hdev->dev, "device report parse failed\n"); | 2621 | hid_err(hdev, "device report parse failed\n"); |
2625 | goto err_cleanup_data; | 2622 | goto err_cleanup_data; |
2626 | } | 2623 | } |
2627 | 2624 | ||
@@ -2631,25 +2628,25 @@ static int picolcd_probe(struct hid_device *hdev, | |||
2631 | error = hid_hw_start(hdev, 0); | 2628 | error = hid_hw_start(hdev, 0); |
2632 | hdev->claimed = 0; | 2629 | hdev->claimed = 0; |
2633 | if (error) { | 2630 | if (error) { |
2634 | dev_err(&hdev->dev, "hardware start failed\n"); | 2631 | hid_err(hdev, "hardware start failed\n"); |
2635 | goto err_cleanup_data; | 2632 | goto err_cleanup_data; |
2636 | } | 2633 | } |
2637 | 2634 | ||
2638 | error = hid_hw_open(hdev); | 2635 | error = hid_hw_open(hdev); |
2639 | if (error) { | 2636 | if (error) { |
2640 | dev_err(&hdev->dev, "failed to open input interrupt pipe for key and IR events\n"); | 2637 | hid_err(hdev, "failed to open input interrupt pipe for key and IR events\n"); |
2641 | goto err_cleanup_hid_hw; | 2638 | goto err_cleanup_hid_hw; |
2642 | } | 2639 | } |
2643 | 2640 | ||
2644 | error = device_create_file(&hdev->dev, &dev_attr_operation_mode_delay); | 2641 | error = device_create_file(&hdev->dev, &dev_attr_operation_mode_delay); |
2645 | if (error) { | 2642 | if (error) { |
2646 | dev_err(&hdev->dev, "failed to create sysfs attributes\n"); | 2643 | hid_err(hdev, "failed to create sysfs attributes\n"); |
2647 | goto err_cleanup_hid_ll; | 2644 | goto err_cleanup_hid_ll; |
2648 | } | 2645 | } |
2649 | 2646 | ||
2650 | error = device_create_file(&hdev->dev, &dev_attr_operation_mode); | 2647 | error = device_create_file(&hdev->dev, &dev_attr_operation_mode); |
2651 | if (error) { | 2648 | if (error) { |
2652 | dev_err(&hdev->dev, "failed to create sysfs attributes\n"); | 2649 | hid_err(hdev, "failed to create sysfs attributes\n"); |
2653 | goto err_cleanup_sysfs1; | 2650 | goto err_cleanup_sysfs1; |
2654 | } | 2651 | } |
2655 | 2652 | ||
diff --git a/drivers/hid/hid-pl.c b/drivers/hid/hid-pl.c index 9f41e2bd8483..06e5300d43d2 100644 --- a/drivers/hid/hid-pl.c +++ b/drivers/hid/hid-pl.c | |||
@@ -103,7 +103,7 @@ static int plff_init(struct hid_device *hid) | |||
103 | */ | 103 | */ |
104 | 104 | ||
105 | if (list_empty(report_list)) { | 105 | if (list_empty(report_list)) { |
106 | dev_err(&hid->dev, "no output reports found\n"); | 106 | hid_err(hid, "no output reports found\n"); |
107 | return -ENODEV; | 107 | return -ENODEV; |
108 | } | 108 | } |
109 | 109 | ||
@@ -112,14 +112,13 @@ static int plff_init(struct hid_device *hid) | |||
112 | report_ptr = report_ptr->next; | 112 | report_ptr = report_ptr->next; |
113 | 113 | ||
114 | if (report_ptr == report_list) { | 114 | if (report_ptr == report_list) { |
115 | dev_err(&hid->dev, "required output report is " | 115 | hid_err(hid, "required output report is missing\n"); |
116 | "missing\n"); | ||
117 | return -ENODEV; | 116 | return -ENODEV; |
118 | } | 117 | } |
119 | 118 | ||
120 | report = list_entry(report_ptr, struct hid_report, list); | 119 | report = list_entry(report_ptr, struct hid_report, list); |
121 | if (report->maxfield < 1) { | 120 | if (report->maxfield < 1) { |
122 | dev_err(&hid->dev, "no fields in the report\n"); | 121 | hid_err(hid, "no fields in the report\n"); |
123 | return -ENODEV; | 122 | return -ENODEV; |
124 | } | 123 | } |
125 | 124 | ||
@@ -137,7 +136,7 @@ static int plff_init(struct hid_device *hid) | |||
137 | weak = &report->field[3]->value[0]; | 136 | weak = &report->field[3]->value[0]; |
138 | debug("detected 4-field device"); | 137 | debug("detected 4-field device"); |
139 | } else { | 138 | } else { |
140 | dev_err(&hid->dev, "not enough fields or values\n"); | 139 | hid_err(hid, "not enough fields or values\n"); |
141 | return -ENODEV; | 140 | return -ENODEV; |
142 | } | 141 | } |
143 | 142 | ||
@@ -164,8 +163,7 @@ static int plff_init(struct hid_device *hid) | |||
164 | usbhid_submit_report(hid, plff->report, USB_DIR_OUT); | 163 | usbhid_submit_report(hid, plff->report, USB_DIR_OUT); |
165 | } | 164 | } |
166 | 165 | ||
167 | dev_info(&hid->dev, "Force feedback for PantherLord/GreenAsia " | 166 | hid_info(hid, "Force feedback for PantherLord/GreenAsia devices by Anssi Hannula <anssi.hannula@gmail.com>\n"); |
168 | "devices by Anssi Hannula <anssi.hannula@gmail.com>\n"); | ||
169 | 167 | ||
170 | return 0; | 168 | return 0; |
171 | } | 169 | } |
@@ -185,13 +183,13 @@ static int pl_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
185 | 183 | ||
186 | ret = hid_parse(hdev); | 184 | ret = hid_parse(hdev); |
187 | if (ret) { | 185 | if (ret) { |
188 | dev_err(&hdev->dev, "parse failed\n"); | 186 | hid_err(hdev, "parse failed\n"); |
189 | goto err; | 187 | goto err; |
190 | } | 188 | } |
191 | 189 | ||
192 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); | 190 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); |
193 | if (ret) { | 191 | if (ret) { |
194 | dev_err(&hdev->dev, "hw start failed\n"); | 192 | hid_err(hdev, "hw start failed\n"); |
195 | goto err; | 193 | goto err; |
196 | } | 194 | } |
197 | 195 | ||
diff --git a/drivers/hid/hid-prodikeys.c b/drivers/hid/hid-prodikeys.c index 5f0fa6c1bf87..ab19f2905d27 100644 --- a/drivers/hid/hid-prodikeys.c +++ b/drivers/hid/hid-prodikeys.c | |||
@@ -16,6 +16,8 @@ | |||
16 | * any later version. | 16 | * any later version. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
20 | |||
19 | #include <linux/device.h> | 21 | #include <linux/device.h> |
20 | #include <linux/module.h> | 22 | #include <linux/module.h> |
21 | #include <linux/usb.h> | 23 | #include <linux/usb.h> |
@@ -285,11 +287,11 @@ static int pcmidi_get_output_report(struct pcmidi_snd *pm) | |||
285 | continue; | 287 | continue; |
286 | 288 | ||
287 | if (report->maxfield < 1) { | 289 | if (report->maxfield < 1) { |
288 | dev_err(&hdev->dev, "output report is empty\n"); | 290 | hid_err(hdev, "output report is empty\n"); |
289 | break; | 291 | break; |
290 | } | 292 | } |
291 | if (report->field[0]->report_count != 2) { | 293 | if (report->field[0]->report_count != 2) { |
292 | dev_err(&hdev->dev, "field count too low\n"); | 294 | hid_err(hdev, "field count too low\n"); |
293 | break; | 295 | break; |
294 | } | 296 | } |
295 | pm->pcmidi_report6 = report; | 297 | pm->pcmidi_report6 = report; |
@@ -746,8 +748,8 @@ static __u8 *pk_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
746 | if (*rsize == 178 && | 748 | if (*rsize == 178 && |
747 | rdesc[111] == 0x06 && rdesc[112] == 0x00 && | 749 | rdesc[111] == 0x06 && rdesc[112] == 0x00 && |
748 | rdesc[113] == 0xff) { | 750 | rdesc[113] == 0xff) { |
749 | dev_info(&hdev->dev, "fixing up pc-midi keyboard report " | 751 | hid_info(hdev, |
750 | "descriptor\n"); | 752 | "fixing up pc-midi keyboard report descriptor\n"); |
751 | 753 | ||
752 | rdesc[144] = 0x18; /* report 4: was 0x10 report count */ | 754 | rdesc[144] = 0x18; /* report 4: was 0x10 report count */ |
753 | } | 755 | } |
@@ -805,7 +807,7 @@ static int pk_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
805 | 807 | ||
806 | pk = kzalloc(sizeof(*pk), GFP_KERNEL); | 808 | pk = kzalloc(sizeof(*pk), GFP_KERNEL); |
807 | if (pk == NULL) { | 809 | if (pk == NULL) { |
808 | dev_err(&hdev->dev, "prodikeys: can't alloc descriptor\n"); | 810 | hid_err(hdev, "can't alloc descriptor\n"); |
809 | return -ENOMEM; | 811 | return -ENOMEM; |
810 | } | 812 | } |
811 | 813 | ||
@@ -813,8 +815,7 @@ static int pk_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
813 | 815 | ||
814 | pm = kzalloc(sizeof(*pm), GFP_KERNEL); | 816 | pm = kzalloc(sizeof(*pm), GFP_KERNEL); |
815 | if (pm == NULL) { | 817 | if (pm == NULL) { |
816 | dev_err(&hdev->dev, | 818 | hid_err(hdev, "can't alloc descriptor\n"); |
817 | "prodikeys: can't alloc descriptor\n"); | ||
818 | ret = -ENOMEM; | 819 | ret = -ENOMEM; |
819 | goto err_free; | 820 | goto err_free; |
820 | } | 821 | } |
@@ -827,7 +828,7 @@ static int pk_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
827 | 828 | ||
828 | ret = hid_parse(hdev); | 829 | ret = hid_parse(hdev); |
829 | if (ret) { | 830 | if (ret) { |
830 | dev_err(&hdev->dev, "prodikeys: hid parse failed\n"); | 831 | hid_err(hdev, "hid parse failed\n"); |
831 | goto err_free; | 832 | goto err_free; |
832 | } | 833 | } |
833 | 834 | ||
@@ -837,7 +838,7 @@ static int pk_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
837 | 838 | ||
838 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); | 839 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); |
839 | if (ret) { | 840 | if (ret) { |
840 | dev_err(&hdev->dev, "prodikeys: hw start failed\n"); | 841 | hid_err(hdev, "hw start failed\n"); |
841 | goto err_free; | 842 | goto err_free; |
842 | } | 843 | } |
843 | 844 | ||
@@ -896,7 +897,7 @@ static int pk_init(void) | |||
896 | 897 | ||
897 | ret = hid_register_driver(&pk_driver); | 898 | ret = hid_register_driver(&pk_driver); |
898 | if (ret) | 899 | if (ret) |
899 | printk(KERN_ERR "can't register prodikeys driver\n"); | 900 | pr_err("can't register prodikeys driver\n"); |
900 | 901 | ||
901 | return ret; | 902 | return ret; |
902 | } | 903 | } |
diff --git a/drivers/hid/hid-quanta.c b/drivers/hid/hid-quanta.c index 54d3db50605b..87a54df4d4ac 100644 --- a/drivers/hid/hid-quanta.c +++ b/drivers/hid/hid-quanta.c | |||
@@ -195,7 +195,7 @@ static int quanta_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
195 | 195 | ||
196 | td = kmalloc(sizeof(struct quanta_data), GFP_KERNEL); | 196 | td = kmalloc(sizeof(struct quanta_data), GFP_KERNEL); |
197 | if (!td) { | 197 | if (!td) { |
198 | dev_err(&hdev->dev, "cannot allocate Quanta Touch data\n"); | 198 | hid_err(hdev, "cannot allocate Quanta Touch data\n"); |
199 | return -ENOMEM; | 199 | return -ENOMEM; |
200 | } | 200 | } |
201 | td->valid = false; | 201 | td->valid = false; |
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; |
572 | exit_no_settings: | 571 | exit_no_settings: |
573 | dev_err(&usb_dev->dev, "couldn't read settings\n"); | 572 | hid_err(usb_dev, "couldn't read settings\n"); |
574 | exit_unlock: | 573 | exit_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 | ||
diff --git a/drivers/hid/hid-roccat-pyra.c b/drivers/hid/hid-roccat-pyra.c index 9bf23047892a..e7b4affe2664 100644 --- a/drivers/hid/hid-roccat-pyra.c +++ b/drivers/hid/hid-roccat-pyra.c | |||
@@ -87,9 +87,8 @@ static int pyra_receive_control_status(struct usb_device *usb_dev) | |||
87 | control.value == 1) | 87 | control.value == 1) |
88 | return 0; | 88 | return 0; |
89 | else { | 89 | else { |
90 | dev_err(&usb_dev->dev, "receive control status: " | 90 | hid_err(usb_dev, "receive control status: unknown response 0x%x 0x%x\n", |
91 | "unknown response 0x%x 0x%x\n", | 91 | control.request, control.value); |
92 | control.request, control.value); | ||
93 | return -EINVAL; | 92 | return -EINVAL; |
94 | } | 93 | } |
95 | } | 94 | } |
@@ -770,21 +769,20 @@ static int pyra_init_specials(struct hid_device *hdev) | |||
770 | 769 | ||
771 | pyra = kzalloc(sizeof(*pyra), GFP_KERNEL); | 770 | pyra = kzalloc(sizeof(*pyra), GFP_KERNEL); |
772 | if (!pyra) { | 771 | if (!pyra) { |
773 | dev_err(&hdev->dev, "can't alloc device descriptor\n"); | 772 | hid_err(hdev, "can't alloc device descriptor\n"); |
774 | return -ENOMEM; | 773 | return -ENOMEM; |
775 | } | 774 | } |
776 | hid_set_drvdata(hdev, pyra); | 775 | hid_set_drvdata(hdev, pyra); |
777 | 776 | ||
778 | retval = pyra_init_pyra_device_struct(usb_dev, pyra); | 777 | retval = pyra_init_pyra_device_struct(usb_dev, pyra); |
779 | if (retval) { | 778 | if (retval) { |
780 | dev_err(&hdev->dev, | 779 | hid_err(hdev, "couldn't init struct pyra_device\n"); |
781 | "couldn't init struct pyra_device\n"); | ||
782 | goto exit_free; | 780 | goto exit_free; |
783 | } | 781 | } |
784 | 782 | ||
785 | retval = roccat_connect(hdev); | 783 | retval = roccat_connect(hdev); |
786 | if (retval < 0) { | 784 | if (retval < 0) { |
787 | dev_err(&hdev->dev, "couldn't init char dev\n"); | 785 | hid_err(hdev, "couldn't init char dev\n"); |
788 | } else { | 786 | } else { |
789 | pyra->chrdev_minor = retval; | 787 | pyra->chrdev_minor = retval; |
790 | pyra->roccat_claimed = 1; | 788 | pyra->roccat_claimed = 1; |
@@ -792,7 +790,7 @@ static int pyra_init_specials(struct hid_device *hdev) | |||
792 | 790 | ||
793 | retval = pyra_create_sysfs_attributes(intf); | 791 | retval = pyra_create_sysfs_attributes(intf); |
794 | if (retval) { | 792 | if (retval) { |
795 | dev_err(&hdev->dev, "cannot create sysfs files\n"); | 793 | hid_err(hdev, "cannot create sysfs files\n"); |
796 | goto exit_free; | 794 | goto exit_free; |
797 | } | 795 | } |
798 | } else { | 796 | } else { |
@@ -826,19 +824,19 @@ static int pyra_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
826 | 824 | ||
827 | retval = hid_parse(hdev); | 825 | retval = hid_parse(hdev); |
828 | if (retval) { | 826 | if (retval) { |
829 | dev_err(&hdev->dev, "parse failed\n"); | 827 | hid_err(hdev, "parse failed\n"); |
830 | goto exit; | 828 | goto exit; |
831 | } | 829 | } |
832 | 830 | ||
833 | retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT); | 831 | retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT); |
834 | if (retval) { | 832 | if (retval) { |
835 | dev_err(&hdev->dev, "hw start failed\n"); | 833 | hid_err(hdev, "hw start failed\n"); |
836 | goto exit; | 834 | goto exit; |
837 | } | 835 | } |
838 | 836 | ||
839 | retval = pyra_init_specials(hdev); | 837 | retval = pyra_init_specials(hdev); |
840 | if (retval) { | 838 | if (retval) { |
841 | dev_err(&hdev->dev, "couldn't install mouse\n"); | 839 | hid_err(hdev, "couldn't install mouse\n"); |
842 | goto exit_stop; | 840 | goto exit_stop; |
843 | } | 841 | } |
844 | return 0; | 842 | return 0; |
diff --git a/drivers/hid/hid-roccat.c b/drivers/hid/hid-roccat.c index a9d9b29ff47f..4bc7a93dc1f5 100644 --- a/drivers/hid/hid-roccat.c +++ b/drivers/hid/hid-roccat.c | |||
@@ -21,6 +21,8 @@ | |||
21 | * It is inspired by hidraw, but uses only one circular buffer for all readers. | 21 | * It is inspired by hidraw, but uses only one circular buffer for all readers. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
25 | |||
24 | #include <linux/cdev.h> | 26 | #include <linux/cdev.h> |
25 | #include <linux/poll.h> | 27 | #include <linux/poll.h> |
26 | #include <linux/sched.h> | 28 | #include <linux/sched.h> |
@@ -165,8 +167,7 @@ static int roccat_open(struct inode *inode, struct file *file) | |||
165 | mutex_lock(&device->readers_lock); | 167 | mutex_lock(&device->readers_lock); |
166 | 168 | ||
167 | if (!device) { | 169 | if (!device) { |
168 | printk(KERN_EMERG "roccat device with minor %d doesn't exist\n", | 170 | pr_emerg("roccat device with minor %d doesn't exist\n", minor); |
169 | minor); | ||
170 | error = -ENODEV; | 171 | error = -ENODEV; |
171 | goto exit_err; | 172 | goto exit_err; |
172 | } | 173 | } |
@@ -214,8 +215,7 @@ static int roccat_release(struct inode *inode, struct file *file) | |||
214 | device = devices[minor]; | 215 | device = devices[minor]; |
215 | if (!device) { | 216 | if (!device) { |
216 | mutex_unlock(&devices_lock); | 217 | mutex_unlock(&devices_lock); |
217 | printk(KERN_EMERG "roccat device with minor %d doesn't exist\n", | 218 | pr_emerg("roccat device with minor %d doesn't exist\n", minor); |
218 | minor); | ||
219 | return -ENODEV; | 219 | return -ENODEV; |
220 | } | 220 | } |
221 | 221 | ||
@@ -392,7 +392,7 @@ static int __init roccat_init(void) | |||
392 | roccat_major = MAJOR(dev_id); | 392 | roccat_major = MAJOR(dev_id); |
393 | 393 | ||
394 | if (retval < 0) { | 394 | if (retval < 0) { |
395 | printk(KERN_WARNING "roccat: can't get major number\n"); | 395 | pr_warn("can't get major number\n"); |
396 | return retval; | 396 | return retval; |
397 | } | 397 | } |
398 | 398 | ||
diff --git a/drivers/hid/hid-samsung.c b/drivers/hid/hid-samsung.c index 35894444e000..3c1fd8af5e0c 100644 --- a/drivers/hid/hid-samsung.c +++ b/drivers/hid/hid-samsung.c | |||
@@ -57,8 +57,8 @@ | |||
57 | static inline void samsung_irda_dev_trace(struct hid_device *hdev, | 57 | static inline void samsung_irda_dev_trace(struct hid_device *hdev, |
58 | unsigned int rsize) | 58 | unsigned int rsize) |
59 | { | 59 | { |
60 | dev_info(&hdev->dev, "fixing up Samsung IrDA %d byte report " | 60 | hid_info(hdev, "fixing up Samsung IrDA %d byte report descriptor\n", |
61 | "descriptor\n", rsize); | 61 | rsize); |
62 | } | 62 | } |
63 | 63 | ||
64 | static __u8 *samsung_irda_report_fixup(struct hid_device *hdev, __u8 *rdesc, | 64 | static __u8 *samsung_irda_report_fixup(struct hid_device *hdev, __u8 *rdesc, |
@@ -160,7 +160,7 @@ static int samsung_probe(struct hid_device *hdev, | |||
160 | 160 | ||
161 | ret = hid_parse(hdev); | 161 | ret = hid_parse(hdev); |
162 | if (ret) { | 162 | if (ret) { |
163 | dev_err(&hdev->dev, "parse failed\n"); | 163 | hid_err(hdev, "parse failed\n"); |
164 | goto err_free; | 164 | goto err_free; |
165 | } | 165 | } |
166 | 166 | ||
@@ -174,7 +174,7 @@ static int samsung_probe(struct hid_device *hdev, | |||
174 | 174 | ||
175 | ret = hid_hw_start(hdev, cmask); | 175 | ret = hid_hw_start(hdev, cmask); |
176 | if (ret) { | 176 | if (ret) { |
177 | dev_err(&hdev->dev, "hw start failed\n"); | 177 | hid_err(hdev, "hw start failed\n"); |
178 | goto err_free; | 178 | goto err_free; |
179 | } | 179 | } |
180 | 180 | ||
diff --git a/drivers/hid/hid-sjoy.c b/drivers/hid/hid-sjoy.c index e10a7687ebf2..16f7cafc9695 100644 --- a/drivers/hid/hid-sjoy.c +++ b/drivers/hid/hid-sjoy.c | |||
@@ -74,26 +74,25 @@ static int sjoyff_init(struct hid_device *hid) | |||
74 | int error; | 74 | int error; |
75 | 75 | ||
76 | if (list_empty(report_list)) { | 76 | if (list_empty(report_list)) { |
77 | dev_err(&hid->dev, "no output reports found\n"); | 77 | hid_err(hid, "no output reports found\n"); |
78 | return -ENODEV; | 78 | return -ENODEV; |
79 | } | 79 | } |
80 | 80 | ||
81 | report_ptr = report_ptr->next; | 81 | report_ptr = report_ptr->next; |
82 | 82 | ||
83 | if (report_ptr == report_list) { | 83 | if (report_ptr == report_list) { |
84 | dev_err(&hid->dev, "required output report is " | 84 | hid_err(hid, "required output report is missing\n"); |
85 | "missing\n"); | ||
86 | return -ENODEV; | 85 | return -ENODEV; |
87 | } | 86 | } |
88 | 87 | ||
89 | report = list_entry(report_ptr, struct hid_report, list); | 88 | report = list_entry(report_ptr, struct hid_report, list); |
90 | if (report->maxfield < 1) { | 89 | if (report->maxfield < 1) { |
91 | dev_err(&hid->dev, "no fields in the report\n"); | 90 | hid_err(hid, "no fields in the report\n"); |
92 | return -ENODEV; | 91 | return -ENODEV; |
93 | } | 92 | } |
94 | 93 | ||
95 | if (report->field[0]->report_count < 3) { | 94 | if (report->field[0]->report_count < 3) { |
96 | dev_err(&hid->dev, "not enough values in the field\n"); | 95 | hid_err(hid, "not enough values in the field\n"); |
97 | return -ENODEV; | 96 | return -ENODEV; |
98 | } | 97 | } |
99 | 98 | ||
@@ -117,8 +116,7 @@ static int sjoyff_init(struct hid_device *hid) | |||
117 | sjoyff->report->field[0]->value[2] = 0x00; | 116 | sjoyff->report->field[0]->value[2] = 0x00; |
118 | usbhid_submit_report(hid, sjoyff->report, USB_DIR_OUT); | 117 | usbhid_submit_report(hid, sjoyff->report, USB_DIR_OUT); |
119 | 118 | ||
120 | dev_info(&hid->dev, | 119 | hid_info(hid, "Force feedback for SmartJoy PLUS PS2/USB adapter\n"); |
121 | "Force feedback for SmartJoy PLUS PS2/USB adapter\n"); | ||
122 | 120 | ||
123 | return 0; | 121 | return 0; |
124 | } | 122 | } |
@@ -135,13 +133,13 @@ static int sjoy_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
135 | 133 | ||
136 | ret = hid_parse(hdev); | 134 | ret = hid_parse(hdev); |
137 | if (ret) { | 135 | if (ret) { |
138 | dev_err(&hdev->dev, "parse failed\n"); | 136 | hid_err(hdev, "parse failed\n"); |
139 | goto err; | 137 | goto err; |
140 | } | 138 | } |
141 | 139 | ||
142 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); | 140 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); |
143 | if (ret) { | 141 | if (ret) { |
144 | dev_err(&hdev->dev, "hw start failed\n"); | 142 | hid_err(hdev, "hw start failed\n"); |
145 | goto err; | 143 | goto err; |
146 | } | 144 | } |
147 | 145 | ||
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index 677bb3da10e8..68d7b36e31e4 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c | |||
@@ -40,8 +40,7 @@ static __u8 *sony_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
40 | 40 | ||
41 | if ((sc->quirks & VAIO_RDESC_CONSTANT) && | 41 | if ((sc->quirks & VAIO_RDESC_CONSTANT) && |
42 | *rsize >= 56 && rdesc[54] == 0x81 && rdesc[55] == 0x07) { | 42 | *rsize >= 56 && rdesc[54] == 0x81 && rdesc[55] == 0x07) { |
43 | dev_info(&hdev->dev, "Fixing up Sony Vaio VGX report " | 43 | hid_info(hdev, "Fixing up Sony Vaio VGX report descriptor\n"); |
44 | "descriptor\n"); | ||
45 | rdesc[55] = 0x06; | 44 | rdesc[55] = 0x06; |
46 | } | 45 | } |
47 | return rdesc; | 46 | return rdesc; |
@@ -89,7 +88,7 @@ static int sixaxis_set_operational_usb(struct hid_device *hdev) | |||
89 | (3 << 8) | 0xf2, ifnum, buf, 17, | 88 | (3 << 8) | 0xf2, ifnum, buf, 17, |
90 | USB_CTRL_GET_TIMEOUT); | 89 | USB_CTRL_GET_TIMEOUT); |
91 | if (ret < 0) | 90 | if (ret < 0) |
92 | dev_err(&hdev->dev, "can't set operational mode\n"); | 91 | hid_err(hdev, "can't set operational mode\n"); |
93 | 92 | ||
94 | kfree(buf); | 93 | kfree(buf); |
95 | 94 | ||
@@ -110,7 +109,7 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
110 | 109 | ||
111 | sc = kzalloc(sizeof(*sc), GFP_KERNEL); | 110 | sc = kzalloc(sizeof(*sc), GFP_KERNEL); |
112 | if (sc == NULL) { | 111 | if (sc == NULL) { |
113 | dev_err(&hdev->dev, "can't alloc sony descriptor\n"); | 112 | hid_err(hdev, "can't alloc sony descriptor\n"); |
114 | return -ENOMEM; | 113 | return -ENOMEM; |
115 | } | 114 | } |
116 | 115 | ||
@@ -119,14 +118,14 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
119 | 118 | ||
120 | ret = hid_parse(hdev); | 119 | ret = hid_parse(hdev); |
121 | if (ret) { | 120 | if (ret) { |
122 | dev_err(&hdev->dev, "parse failed\n"); | 121 | hid_err(hdev, "parse failed\n"); |
123 | goto err_free; | 122 | goto err_free; |
124 | } | 123 | } |
125 | 124 | ||
126 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT | | 125 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT | |
127 | HID_CONNECT_HIDDEV_FORCE); | 126 | HID_CONNECT_HIDDEV_FORCE); |
128 | if (ret) { | 127 | if (ret) { |
129 | dev_err(&hdev->dev, "hw start failed\n"); | 128 | hid_err(hdev, "hw start failed\n"); |
130 | goto err_free; | 129 | goto err_free; |
131 | } | 130 | } |
132 | 131 | ||
diff --git a/drivers/hid/hid-stantum.c b/drivers/hid/hid-stantum.c index 3171be28c3d5..b2be1d11916b 100644 --- a/drivers/hid/hid-stantum.c +++ b/drivers/hid/hid-stantum.c | |||
@@ -222,7 +222,7 @@ static int stantum_probe(struct hid_device *hdev, | |||
222 | 222 | ||
223 | sd = kmalloc(sizeof(struct stantum_data), GFP_KERNEL); | 223 | sd = kmalloc(sizeof(struct stantum_data), GFP_KERNEL); |
224 | if (!sd) { | 224 | if (!sd) { |
225 | dev_err(&hdev->dev, "cannot allocate Stantum data\n"); | 225 | hid_err(hdev, "cannot allocate Stantum data\n"); |
226 | return -ENOMEM; | 226 | return -ENOMEM; |
227 | } | 227 | } |
228 | sd->valid = false; | 228 | sd->valid = false; |
diff --git a/drivers/hid/hid-sunplus.c b/drivers/hid/hid-sunplus.c index 164ed568f6cf..d484a0043dd4 100644 --- a/drivers/hid/hid-sunplus.c +++ b/drivers/hid/hid-sunplus.c | |||
@@ -27,8 +27,7 @@ static __u8 *sp_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
27 | { | 27 | { |
28 | if (*rsize >= 107 && rdesc[104] == 0x26 && rdesc[105] == 0x80 && | 28 | if (*rsize >= 107 && rdesc[104] == 0x26 && rdesc[105] == 0x80 && |
29 | rdesc[106] == 0x03) { | 29 | rdesc[106] == 0x03) { |
30 | dev_info(&hdev->dev, "fixing up Sunplus Wireless Desktop " | 30 | hid_info(hdev, "fixing up Sunplus Wireless Desktop report descriptor\n"); |
31 | "report descriptor\n"); | ||
32 | rdesc[105] = rdesc[110] = 0x03; | 31 | rdesc[105] = rdesc[110] = 0x03; |
33 | rdesc[106] = rdesc[111] = 0x21; | 32 | rdesc[106] = rdesc[111] = 0x21; |
34 | } | 33 | } |
diff --git a/drivers/hid/hid-tmff.c b/drivers/hid/hid-tmff.c index 15434c814793..356a98fcb365 100644 --- a/drivers/hid/hid-tmff.c +++ b/drivers/hid/hid-tmff.c | |||
@@ -151,28 +151,23 @@ static int tmff_init(struct hid_device *hid, const signed short *ff_bits) | |||
151 | switch (field->usage[0].hid) { | 151 | switch (field->usage[0].hid) { |
152 | case THRUSTMASTER_USAGE_FF: | 152 | case THRUSTMASTER_USAGE_FF: |
153 | if (field->report_count < 2) { | 153 | if (field->report_count < 2) { |
154 | dev_warn(&hid->dev, "ignoring FF field " | 154 | hid_warn(hid, "ignoring FF field with report_count < 2\n"); |
155 | "with report_count < 2\n"); | ||
156 | continue; | 155 | continue; |
157 | } | 156 | } |
158 | 157 | ||
159 | if (field->logical_maximum == | 158 | if (field->logical_maximum == |
160 | field->logical_minimum) { | 159 | field->logical_minimum) { |
161 | dev_warn(&hid->dev, "ignoring FF field " | 160 | hid_warn(hid, "ignoring FF field with logical_maximum == logical_minimum\n"); |
162 | "with logical_maximum " | ||
163 | "== logical_minimum\n"); | ||
164 | continue; | 161 | continue; |
165 | } | 162 | } |
166 | 163 | ||
167 | if (tmff->report && tmff->report != report) { | 164 | if (tmff->report && tmff->report != report) { |
168 | dev_warn(&hid->dev, "ignoring FF field " | 165 | hid_warn(hid, "ignoring FF field in other report\n"); |
169 | "in other report\n"); | ||
170 | continue; | 166 | continue; |
171 | } | 167 | } |
172 | 168 | ||
173 | if (tmff->ff_field && tmff->ff_field != field) { | 169 | if (tmff->ff_field && tmff->ff_field != field) { |
174 | dev_warn(&hid->dev, "ignoring " | 170 | hid_warn(hid, "ignoring duplicate FF field\n"); |
175 | "duplicate FF field\n"); | ||
176 | continue; | 171 | continue; |
177 | } | 172 | } |
178 | 173 | ||
@@ -185,16 +180,15 @@ static int tmff_init(struct hid_device *hid, const signed short *ff_bits) | |||
185 | break; | 180 | break; |
186 | 181 | ||
187 | default: | 182 | default: |
188 | dev_warn(&hid->dev, "ignoring unknown output " | 183 | hid_warn(hid, "ignoring unknown output usage %08x\n", |
189 | "usage %08x\n", | 184 | field->usage[0].hid); |
190 | field->usage[0].hid); | ||
191 | continue; | 185 | continue; |
192 | } | 186 | } |
193 | } | 187 | } |
194 | } | 188 | } |
195 | 189 | ||
196 | if (!tmff->report) { | 190 | if (!tmff->report) { |
197 | dev_err(&hid->dev, "can't find FF field in output reports\n"); | 191 | hid_err(hid, "can't find FF field in output reports\n"); |
198 | error = -ENODEV; | 192 | error = -ENODEV; |
199 | goto fail; | 193 | goto fail; |
200 | } | 194 | } |
@@ -203,8 +197,7 @@ static int tmff_init(struct hid_device *hid, const signed short *ff_bits) | |||
203 | if (error) | 197 | if (error) |
204 | goto fail; | 198 | goto fail; |
205 | 199 | ||
206 | dev_info(&hid->dev, "force feedback for ThrustMaster devices by Zinx " | 200 | hid_info(hid, "force feedback for ThrustMaster devices by Zinx Verituse <zinx@epicsol.org>\n"); |
207 | "Verituse <zinx@epicsol.org>"); | ||
208 | return 0; | 201 | return 0; |
209 | 202 | ||
210 | fail: | 203 | fail: |
@@ -224,13 +217,13 @@ static int tm_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
224 | 217 | ||
225 | ret = hid_parse(hdev); | 218 | ret = hid_parse(hdev); |
226 | if (ret) { | 219 | if (ret) { |
227 | dev_err(&hdev->dev, "parse failed\n"); | 220 | hid_err(hdev, "parse failed\n"); |
228 | goto err; | 221 | goto err; |
229 | } | 222 | } |
230 | 223 | ||
231 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); | 224 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); |
232 | if (ret) { | 225 | if (ret) { |
233 | dev_err(&hdev->dev, "hw start failed\n"); | 226 | hid_err(hdev, "hw start failed\n"); |
234 | goto err; | 227 | goto err; |
235 | } | 228 | } |
236 | 229 | ||
diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c index 94caae731381..06888323828c 100644 --- a/drivers/hid/hid-wacom.c +++ b/drivers/hid/hid-wacom.c | |||
@@ -18,6 +18,8 @@ | |||
18 | * any later version. | 18 | * any later version. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
22 | |||
21 | #include <linux/device.h> | 23 | #include <linux/device.h> |
22 | #include <linux/hid.h> | 24 | #include <linux/hid.h> |
23 | #include <linux/module.h> | 25 | #include <linux/module.h> |
@@ -141,8 +143,8 @@ static void wacom_poke(struct hid_device *hdev, u8 speed) | |||
141 | * Note that if the raw queries fail, it's not a hard failure and it | 143 | * Note that if the raw queries fail, it's not a hard failure and it |
142 | * is safe to continue | 144 | * is safe to continue |
143 | */ | 145 | */ |
144 | dev_warn(&hdev->dev, "failed to poke device, command %d, err %d\n", | 146 | hid_warn(hdev, "failed to poke device, command %d, err %d\n", |
145 | rep_data[0], ret); | 147 | rep_data[0], ret); |
146 | return; | 148 | return; |
147 | } | 149 | } |
148 | 150 | ||
@@ -312,7 +314,7 @@ static int wacom_probe(struct hid_device *hdev, | |||
312 | 314 | ||
313 | wdata = kzalloc(sizeof(*wdata), GFP_KERNEL); | 315 | wdata = kzalloc(sizeof(*wdata), GFP_KERNEL); |
314 | if (wdata == NULL) { | 316 | if (wdata == NULL) { |
315 | dev_err(&hdev->dev, "can't alloc wacom descriptor\n"); | 317 | hid_err(hdev, "can't alloc wacom descriptor\n"); |
316 | return -ENOMEM; | 318 | return -ENOMEM; |
317 | } | 319 | } |
318 | 320 | ||
@@ -321,20 +323,20 @@ static int wacom_probe(struct hid_device *hdev, | |||
321 | /* Parse the HID report now */ | 323 | /* Parse the HID report now */ |
322 | ret = hid_parse(hdev); | 324 | ret = hid_parse(hdev); |
323 | if (ret) { | 325 | if (ret) { |
324 | dev_err(&hdev->dev, "parse failed\n"); | 326 | hid_err(hdev, "parse failed\n"); |
325 | goto err_free; | 327 | goto err_free; |
326 | } | 328 | } |
327 | 329 | ||
328 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); | 330 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); |
329 | if (ret) { | 331 | if (ret) { |
330 | dev_err(&hdev->dev, "hw start failed\n"); | 332 | hid_err(hdev, "hw start failed\n"); |
331 | goto err_free; | 333 | goto err_free; |
332 | } | 334 | } |
333 | 335 | ||
334 | ret = device_create_file(&hdev->dev, &dev_attr_speed); | 336 | ret = device_create_file(&hdev->dev, &dev_attr_speed); |
335 | if (ret) | 337 | if (ret) |
336 | dev_warn(&hdev->dev, | 338 | hid_warn(hdev, |
337 | "can't create sysfs speed attribute err: %d\n", ret); | 339 | "can't create sysfs speed attribute err: %d\n", ret); |
338 | 340 | ||
339 | /* Set Wacom mode 2 with high reporting speed */ | 341 | /* Set Wacom mode 2 with high reporting speed */ |
340 | wacom_poke(hdev, 1); | 342 | wacom_poke(hdev, 1); |
@@ -349,8 +351,8 @@ static int wacom_probe(struct hid_device *hdev, | |||
349 | 351 | ||
350 | ret = power_supply_register(&hdev->dev, &wdata->battery); | 352 | ret = power_supply_register(&hdev->dev, &wdata->battery); |
351 | if (ret) { | 353 | if (ret) { |
352 | dev_warn(&hdev->dev, | 354 | hid_warn(hdev, "can't create sysfs battery attribute, err: %d\n", |
353 | "can't create sysfs battery attribute, err: %d\n", ret); | 355 | ret); |
354 | /* | 356 | /* |
355 | * battery attribute is not critical for the tablet, but if it | 357 | * battery attribute is not critical for the tablet, but if it |
356 | * failed then there is no need to create ac attribute | 358 | * failed then there is no need to create ac attribute |
@@ -367,8 +369,8 @@ static int wacom_probe(struct hid_device *hdev, | |||
367 | 369 | ||
368 | ret = power_supply_register(&hdev->dev, &wdata->ac); | 370 | ret = power_supply_register(&hdev->dev, &wdata->ac); |
369 | if (ret) { | 371 | if (ret) { |
370 | dev_warn(&hdev->dev, | 372 | hid_warn(hdev, |
371 | "can't create ac battery attribute, err: %d\n", ret); | 373 | "can't create ac battery attribute, err: %d\n", ret); |
372 | /* | 374 | /* |
373 | * ac attribute is not critical for the tablet, but if it | 375 | * ac attribute is not critical for the tablet, but if it |
374 | * failed then we don't want to battery attribute to exist | 376 | * failed then we don't want to battery attribute to exist |
@@ -454,7 +456,7 @@ static int __init wacom_init(void) | |||
454 | 456 | ||
455 | ret = hid_register_driver(&wacom_driver); | 457 | ret = hid_register_driver(&wacom_driver); |
456 | if (ret) | 458 | if (ret) |
457 | printk(KERN_ERR "can't register wacom driver\n"); | 459 | pr_err("can't register wacom driver\n"); |
458 | return ret; | 460 | return ret; |
459 | } | 461 | } |
460 | 462 | ||
diff --git a/drivers/hid/hid-zpff.c b/drivers/hid/hid-zpff.c index b7acceabba80..f31fab012f2f 100644 --- a/drivers/hid/hid-zpff.c +++ b/drivers/hid/hid-zpff.c | |||
@@ -75,14 +75,14 @@ static int zpff_init(struct hid_device *hid) | |||
75 | int error; | 75 | int error; |
76 | 76 | ||
77 | if (list_empty(report_list)) { | 77 | if (list_empty(report_list)) { |
78 | dev_err(&hid->dev, "no output report found\n"); | 78 | hid_err(hid, "no output report found\n"); |
79 | return -ENODEV; | 79 | return -ENODEV; |
80 | } | 80 | } |
81 | 81 | ||
82 | report = list_entry(report_list->next, struct hid_report, list); | 82 | report = list_entry(report_list->next, struct hid_report, list); |
83 | 83 | ||
84 | if (report->maxfield < 4) { | 84 | if (report->maxfield < 4) { |
85 | dev_err(&hid->dev, "not enough fields in report\n"); | 85 | hid_err(hid, "not enough fields in report\n"); |
86 | return -ENODEV; | 86 | return -ENODEV; |
87 | } | 87 | } |
88 | 88 | ||
@@ -105,8 +105,7 @@ static int zpff_init(struct hid_device *hid) | |||
105 | zpff->report->field[3]->value[0] = 0x00; | 105 | zpff->report->field[3]->value[0] = 0x00; |
106 | usbhid_submit_report(hid, zpff->report, USB_DIR_OUT); | 106 | usbhid_submit_report(hid, zpff->report, USB_DIR_OUT); |
107 | 107 | ||
108 | dev_info(&hid->dev, "force feedback for Zeroplus based devices by " | 108 | hid_info(hid, "force feedback for Zeroplus based devices by Anssi Hannula <anssi.hannula@gmail.com>\n"); |
109 | "Anssi Hannula <anssi.hannula@gmail.com>\n"); | ||
110 | 109 | ||
111 | return 0; | 110 | return 0; |
112 | } | 111 | } |
@@ -123,13 +122,13 @@ static int zp_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
123 | 122 | ||
124 | ret = hid_parse(hdev); | 123 | ret = hid_parse(hdev); |
125 | if (ret) { | 124 | if (ret) { |
126 | dev_err(&hdev->dev, "parse failed\n"); | 125 | hid_err(hdev, "parse failed\n"); |
127 | goto err; | 126 | goto err; |
128 | } | 127 | } |
129 | 128 | ||
130 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); | 129 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_FF); |
131 | if (ret) { | 130 | if (ret) { |
132 | dev_err(&hdev->dev, "hw start failed\n"); | 131 | hid_err(hdev, "hw start failed\n"); |
133 | goto err; | 132 | goto err; |
134 | } | 133 | } |
135 | 134 | ||
diff --git a/drivers/hid/hid-zydacron.c b/drivers/hid/hid-zydacron.c index aac1f9273149..e90371508fd2 100644 --- a/drivers/hid/hid-zydacron.c +++ b/drivers/hid/hid-zydacron.c | |||
@@ -34,9 +34,8 @@ static __u8 *zc_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
34 | rdesc[0x96] == 0xbc && rdesc[0x97] == 0xff && | 34 | rdesc[0x96] == 0xbc && rdesc[0x97] == 0xff && |
35 | rdesc[0xca] == 0xbc && rdesc[0xcb] == 0xff && | 35 | rdesc[0xca] == 0xbc && rdesc[0xcb] == 0xff && |
36 | rdesc[0xe1] == 0xbc && rdesc[0xe2] == 0xff) { | 36 | rdesc[0xe1] == 0xbc && rdesc[0xe2] == 0xff) { |
37 | dev_info(&hdev->dev, | 37 | hid_info(hdev, |
38 | "fixing up zydacron remote control report " | 38 | "fixing up zydacron remote control report descriptor\n"); |
39 | "descriptor\n"); | ||
40 | rdesc[0x96] = rdesc[0xca] = rdesc[0xe1] = 0x0c; | 39 | rdesc[0x96] = rdesc[0xca] = rdesc[0xe1] = 0x0c; |
41 | rdesc[0x97] = rdesc[0xcb] = rdesc[0xe2] = 0x00; | 40 | rdesc[0x97] = rdesc[0xcb] = rdesc[0xe2] = 0x00; |
42 | } | 41 | } |
@@ -172,7 +171,7 @@ static int zc_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
172 | 171 | ||
173 | zc = kzalloc(sizeof(*zc), GFP_KERNEL); | 172 | zc = kzalloc(sizeof(*zc), GFP_KERNEL); |
174 | if (zc == NULL) { | 173 | if (zc == NULL) { |
175 | dev_err(&hdev->dev, "zydacron: can't alloc descriptor\n"); | 174 | hid_err(hdev, "can't alloc descriptor\n"); |
176 | return -ENOMEM; | 175 | return -ENOMEM; |
177 | } | 176 | } |
178 | 177 | ||
@@ -180,13 +179,13 @@ static int zc_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
180 | 179 | ||
181 | ret = hid_parse(hdev); | 180 | ret = hid_parse(hdev); |
182 | if (ret) { | 181 | if (ret) { |
183 | dev_err(&hdev->dev, "zydacron: parse failed\n"); | 182 | hid_err(hdev, "parse failed\n"); |
184 | goto err_free; | 183 | goto err_free; |
185 | } | 184 | } |
186 | 185 | ||
187 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); | 186 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); |
188 | if (ret) { | 187 | if (ret) { |
189 | dev_err(&hdev->dev, "zydacron: hw start failed\n"); | 188 | hid_err(hdev, "hw start failed\n"); |
190 | goto err_free; | 189 | goto err_free; |
191 | } | 190 | } |
192 | 191 | ||
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c index 5aefe73cf795..eb16cd143e2a 100644 --- a/drivers/hid/hidraw.c +++ b/drivers/hid/hidraw.c | |||
@@ -19,6 +19,8 @@ | |||
19 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | 19 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
23 | |||
22 | #include <linux/fs.h> | 24 | #include <linux/fs.h> |
23 | #include <linux/module.h> | 25 | #include <linux/module.h> |
24 | #include <linux/errno.h> | 26 | #include <linux/errno.h> |
@@ -123,15 +125,15 @@ static ssize_t hidraw_write(struct file *file, const char __user *buffer, size_t | |||
123 | } | 125 | } |
124 | 126 | ||
125 | if (count > HID_MAX_BUFFER_SIZE) { | 127 | if (count > HID_MAX_BUFFER_SIZE) { |
126 | printk(KERN_WARNING "hidraw: pid %d passed too large report\n", | 128 | hid_warn(dev, "pid %d passed too large report\n", |
127 | task_pid_nr(current)); | 129 | task_pid_nr(current)); |
128 | ret = -EINVAL; | 130 | ret = -EINVAL; |
129 | goto out; | 131 | goto out; |
130 | } | 132 | } |
131 | 133 | ||
132 | if (count < 2) { | 134 | if (count < 2) { |
133 | printk(KERN_WARNING "hidraw: pid %d passed too short report\n", | 135 | hid_warn(dev, "pid %d passed too short report\n", |
134 | task_pid_nr(current)); | 136 | task_pid_nr(current)); |
135 | ret = -EINVAL; | 137 | ret = -EINVAL; |
136 | goto out; | 138 | goto out; |
137 | } | 139 | } |
@@ -450,7 +452,7 @@ int __init hidraw_init(void) | |||
450 | hidraw_major = MAJOR(dev_id); | 452 | hidraw_major = MAJOR(dev_id); |
451 | 453 | ||
452 | if (result < 0) { | 454 | if (result < 0) { |
453 | printk(KERN_WARNING "hidraw: can't get major number\n"); | 455 | pr_warn("can't get major number\n"); |
454 | result = 0; | 456 | result = 0; |
455 | goto out; | 457 | goto out; |
456 | } | 458 | } |
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 5489eab3a6bd..276758f53ab5 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c | |||
@@ -136,10 +136,10 @@ static void hid_reset(struct work_struct *work) | |||
136 | hid_io_error(hid); | 136 | hid_io_error(hid); |
137 | break; | 137 | break; |
138 | default: | 138 | default: |
139 | err_hid("can't reset device, %s-%s/input%d, status %d", | 139 | hid_err(hid, "can't reset device, %s-%s/input%d, status %d\n", |
140 | hid_to_usb_dev(hid)->bus->bus_name, | 140 | hid_to_usb_dev(hid)->bus->bus_name, |
141 | hid_to_usb_dev(hid)->devpath, | 141 | hid_to_usb_dev(hid)->devpath, |
142 | usbhid->ifnum, rc); | 142 | usbhid->ifnum, rc); |
143 | /* FALLTHROUGH */ | 143 | /* FALLTHROUGH */ |
144 | case -EHOSTUNREACH: | 144 | case -EHOSTUNREACH: |
145 | case -ENODEV: | 145 | case -ENODEV: |
@@ -278,18 +278,18 @@ static void hid_irq_in(struct urb *urb) | |||
278 | hid_io_error(hid); | 278 | hid_io_error(hid); |
279 | return; | 279 | return; |
280 | default: /* error */ | 280 | default: /* error */ |
281 | dev_warn(&urb->dev->dev, "input irq status %d " | 281 | hid_warn(urb->dev, "input irq status %d received\n", |
282 | "received\n", urb->status); | 282 | urb->status); |
283 | } | 283 | } |
284 | 284 | ||
285 | status = usb_submit_urb(urb, GFP_ATOMIC); | 285 | status = usb_submit_urb(urb, GFP_ATOMIC); |
286 | if (status) { | 286 | if (status) { |
287 | clear_bit(HID_IN_RUNNING, &usbhid->iofl); | 287 | clear_bit(HID_IN_RUNNING, &usbhid->iofl); |
288 | if (status != -EPERM) { | 288 | if (status != -EPERM) { |
289 | err_hid("can't resubmit intr, %s-%s/input%d, status %d", | 289 | hid_err(hid, "can't resubmit intr, %s-%s/input%d, status %d\n", |
290 | hid_to_usb_dev(hid)->bus->bus_name, | 290 | hid_to_usb_dev(hid)->bus->bus_name, |
291 | hid_to_usb_dev(hid)->devpath, | 291 | hid_to_usb_dev(hid)->devpath, |
292 | usbhid->ifnum, status); | 292 | usbhid->ifnum, status); |
293 | hid_io_error(hid); | 293 | hid_io_error(hid); |
294 | } | 294 | } |
295 | } | 295 | } |
@@ -313,7 +313,7 @@ static int hid_submit_out(struct hid_device *hid) | |||
313 | dbg_hid("submitting out urb\n"); | 313 | dbg_hid("submitting out urb\n"); |
314 | 314 | ||
315 | if (usb_submit_urb(usbhid->urbout, GFP_ATOMIC)) { | 315 | if (usb_submit_urb(usbhid->urbout, GFP_ATOMIC)) { |
316 | err_hid("usb_submit_urb(out) failed"); | 316 | hid_err(hid, "usb_submit_urb(out) failed\n"); |
317 | return -1; | 317 | return -1; |
318 | } | 318 | } |
319 | usbhid->last_out = jiffies; | 319 | usbhid->last_out = jiffies; |
@@ -375,7 +375,7 @@ static int hid_submit_ctrl(struct hid_device *hid) | |||
375 | usbhid->cr->wValue, usbhid->cr->wIndex, usbhid->cr->wLength); | 375 | usbhid->cr->wValue, usbhid->cr->wIndex, usbhid->cr->wLength); |
376 | 376 | ||
377 | if (usb_submit_urb(usbhid->urbctrl, GFP_ATOMIC)) { | 377 | if (usb_submit_urb(usbhid->urbctrl, GFP_ATOMIC)) { |
378 | err_hid("usb_submit_urb(ctrl) failed"); | 378 | hid_err(hid, "usb_submit_urb(ctrl) failed\n"); |
379 | return -1; | 379 | return -1; |
380 | } | 380 | } |
381 | usbhid->last_ctrl = jiffies; | 381 | usbhid->last_ctrl = jiffies; |
@@ -413,8 +413,8 @@ static void hid_irq_out(struct urb *urb) | |||
413 | case -ENOENT: | 413 | case -ENOENT: |
414 | break; | 414 | break; |
415 | default: /* error */ | 415 | default: /* error */ |
416 | dev_warn(&urb->dev->dev, "output irq status %d " | 416 | hid_warn(urb->dev, "output irq status %d received\n", |
417 | "received\n", urb->status); | 417 | urb->status); |
418 | } | 418 | } |
419 | 419 | ||
420 | spin_lock_irqsave(&usbhid->lock, flags); | 420 | spin_lock_irqsave(&usbhid->lock, flags); |
@@ -466,8 +466,7 @@ static void hid_ctrl(struct urb *urb) | |||
466 | case -EPIPE: /* report not available */ | 466 | case -EPIPE: /* report not available */ |
467 | break; | 467 | break; |
468 | default: /* error */ | 468 | default: /* error */ |
469 | dev_warn(&urb->dev->dev, "ctrl urb status %d " | 469 | hid_warn(urb->dev, "ctrl urb status %d received\n", status); |
470 | "received\n", status); | ||
471 | } | 470 | } |
472 | 471 | ||
473 | if (unplug) | 472 | if (unplug) |
@@ -501,13 +500,13 @@ static void __usbhid_submit_report(struct hid_device *hid, struct hid_report *re | |||
501 | 500 | ||
502 | if (usbhid->urbout && dir == USB_DIR_OUT && report->type == HID_OUTPUT_REPORT) { | 501 | if (usbhid->urbout && dir == USB_DIR_OUT && report->type == HID_OUTPUT_REPORT) { |
503 | if ((head = (usbhid->outhead + 1) & (HID_OUTPUT_FIFO_SIZE - 1)) == usbhid->outtail) { | 502 | if ((head = (usbhid->outhead + 1) & (HID_OUTPUT_FIFO_SIZE - 1)) == usbhid->outtail) { |
504 | dev_warn(&hid->dev, "output queue full\n"); | 503 | hid_warn(hid, "output queue full\n"); |
505 | return; | 504 | return; |
506 | } | 505 | } |
507 | 506 | ||
508 | usbhid->out[usbhid->outhead].raw_report = kmalloc(len, GFP_ATOMIC); | 507 | usbhid->out[usbhid->outhead].raw_report = kmalloc(len, GFP_ATOMIC); |
509 | if (!usbhid->out[usbhid->outhead].raw_report) { | 508 | if (!usbhid->out[usbhid->outhead].raw_report) { |
510 | dev_warn(&hid->dev, "output queueing failed\n"); | 509 | hid_warn(hid, "output queueing failed\n"); |
511 | return; | 510 | return; |
512 | } | 511 | } |
513 | hid_output_report(report, usbhid->out[usbhid->outhead].raw_report); | 512 | hid_output_report(report, usbhid->out[usbhid->outhead].raw_report); |
@@ -532,14 +531,14 @@ static void __usbhid_submit_report(struct hid_device *hid, struct hid_report *re | |||
532 | } | 531 | } |
533 | 532 | ||
534 | if ((head = (usbhid->ctrlhead + 1) & (HID_CONTROL_FIFO_SIZE - 1)) == usbhid->ctrltail) { | 533 | if ((head = (usbhid->ctrlhead + 1) & (HID_CONTROL_FIFO_SIZE - 1)) == usbhid->ctrltail) { |
535 | dev_warn(&hid->dev, "control queue full\n"); | 534 | hid_warn(hid, "control queue full\n"); |
536 | return; | 535 | return; |
537 | } | 536 | } |
538 | 537 | ||
539 | if (dir == USB_DIR_OUT) { | 538 | if (dir == USB_DIR_OUT) { |
540 | usbhid->ctrl[usbhid->ctrlhead].raw_report = kmalloc(len, GFP_ATOMIC); | 539 | usbhid->ctrl[usbhid->ctrlhead].raw_report = kmalloc(len, GFP_ATOMIC); |
541 | if (!usbhid->ctrl[usbhid->ctrlhead].raw_report) { | 540 | if (!usbhid->ctrl[usbhid->ctrlhead].raw_report) { |
542 | dev_warn(&hid->dev, "control queueing failed\n"); | 541 | hid_warn(hid, "control queueing failed\n"); |
543 | return; | 542 | return; |
544 | } | 543 | } |
545 | hid_output_report(report, usbhid->ctrl[usbhid->ctrlhead].raw_report); | 544 | hid_output_report(report, usbhid->ctrl[usbhid->ctrlhead].raw_report); |
@@ -590,7 +589,7 @@ static int usb_hidinput_input_event(struct input_dev *dev, unsigned int type, un | |||
590 | return -1; | 589 | return -1; |
591 | 590 | ||
592 | if ((offset = hidinput_find_field(hid, type, code, &field)) == -1) { | 591 | if ((offset = hidinput_find_field(hid, type, code, &field)) == -1) { |
593 | dev_warn(&dev->dev, "event field not found\n"); | 592 | hid_warn(dev, "event field not found\n"); |
594 | return -1; | 593 | return -1; |
595 | } | 594 | } |
596 | 595 | ||
@@ -722,7 +721,7 @@ void usbhid_init_reports(struct hid_device *hid) | |||
722 | } | 721 | } |
723 | 722 | ||
724 | if (err) | 723 | if (err) |
725 | dev_warn(&hid->dev, "timeout initializing reports\n"); | 724 | hid_warn(hid, "timeout initializing reports\n"); |
726 | } | 725 | } |
727 | 726 | ||
728 | /* | 727 | /* |
@@ -1140,8 +1139,7 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id * | |||
1140 | if (usb_endpoint_is_int_in(&interface->endpoint[n].desc)) | 1139 | if (usb_endpoint_is_int_in(&interface->endpoint[n].desc)) |
1141 | has_in++; | 1140 | has_in++; |
1142 | if (!has_in) { | 1141 | if (!has_in) { |
1143 | dev_err(&intf->dev, "couldn't find an input interrupt " | 1142 | hid_err(intf, "couldn't find an input interrupt endpoint\n"); |
1144 | "endpoint\n"); | ||
1145 | return -ENODEV; | 1143 | return -ENODEV; |
1146 | } | 1144 | } |
1147 | 1145 | ||
@@ -1213,7 +1211,7 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id * | |||
1213 | ret = hid_add_device(hid); | 1211 | ret = hid_add_device(hid); |
1214 | if (ret) { | 1212 | if (ret) { |
1215 | if (ret != -ENODEV) | 1213 | if (ret != -ENODEV) |
1216 | dev_err(&intf->dev, "can't add hid device: %d\n", ret); | 1214 | hid_err(intf, "can't add hid device: %d\n", ret); |
1217 | goto err_free; | 1215 | goto err_free; |
1218 | } | 1216 | } |
1219 | 1217 | ||
diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c index ef381d79cfa8..f91c136821f7 100644 --- a/drivers/hid/usbhid/hid-pidff.c +++ b/drivers/hid/usbhid/hid-pidff.c | |||
@@ -22,7 +22,7 @@ | |||
22 | 22 | ||
23 | /* #define DEBUG */ | 23 | /* #define DEBUG */ |
24 | 24 | ||
25 | #define debug(format, arg...) pr_debug("hid-pidff: " format "\n" , ## arg) | 25 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
26 | 26 | ||
27 | #include <linux/input.h> | 27 | #include <linux/input.h> |
28 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
@@ -220,7 +220,7 @@ static int pidff_rescale_signed(int i, struct hid_field *field) | |||
220 | static void pidff_set(struct pidff_usage *usage, u16 value) | 220 | static void pidff_set(struct pidff_usage *usage, u16 value) |
221 | { | 221 | { |
222 | usage->value[0] = pidff_rescale(value, 0xffff, usage->field); | 222 | usage->value[0] = pidff_rescale(value, 0xffff, usage->field); |
223 | debug("calculated from %d to %d", value, usage->value[0]); | 223 | pr_debug("calculated from %d to %d\n", value, usage->value[0]); |
224 | } | 224 | } |
225 | 225 | ||
226 | static void pidff_set_signed(struct pidff_usage *usage, s16 value) | 226 | static void pidff_set_signed(struct pidff_usage *usage, s16 value) |
@@ -235,7 +235,7 @@ static void pidff_set_signed(struct pidff_usage *usage, s16 value) | |||
235 | usage->value[0] = | 235 | usage->value[0] = |
236 | pidff_rescale(value, 0x7fff, usage->field); | 236 | pidff_rescale(value, 0x7fff, usage->field); |
237 | } | 237 | } |
238 | debug("calculated from %d to %d", value, usage->value[0]); | 238 | pr_debug("calculated from %d to %d\n", value, usage->value[0]); |
239 | } | 239 | } |
240 | 240 | ||
241 | /* | 241 | /* |
@@ -259,8 +259,9 @@ static void pidff_set_envelope_report(struct pidff_device *pidff, | |||
259 | pidff->set_envelope[PID_ATTACK_TIME].value[0] = envelope->attack_length; | 259 | pidff->set_envelope[PID_ATTACK_TIME].value[0] = envelope->attack_length; |
260 | pidff->set_envelope[PID_FADE_TIME].value[0] = envelope->fade_length; | 260 | pidff->set_envelope[PID_FADE_TIME].value[0] = envelope->fade_length; |
261 | 261 | ||
262 | debug("attack %u => %d", envelope->attack_level, | 262 | hid_dbg(pidff->hid, "attack %u => %d\n", |
263 | pidff->set_envelope[PID_ATTACK_LEVEL].value[0]); | 263 | envelope->attack_level, |
264 | pidff->set_envelope[PID_ATTACK_LEVEL].value[0]); | ||
264 | 265 | ||
265 | usbhid_submit_report(pidff->hid, pidff->reports[PID_SET_ENVELOPE], | 266 | usbhid_submit_report(pidff->hid, pidff->reports[PID_SET_ENVELOPE], |
266 | USB_DIR_OUT); | 267 | USB_DIR_OUT); |
@@ -466,33 +467,33 @@ static int pidff_request_effect_upload(struct pidff_device *pidff, int efnum) | |||
466 | pidff->create_new_effect_type->value[0] = efnum; | 467 | pidff->create_new_effect_type->value[0] = efnum; |
467 | usbhid_submit_report(pidff->hid, pidff->reports[PID_CREATE_NEW_EFFECT], | 468 | usbhid_submit_report(pidff->hid, pidff->reports[PID_CREATE_NEW_EFFECT], |
468 | USB_DIR_OUT); | 469 | USB_DIR_OUT); |
469 | debug("create_new_effect sent, type: %d", efnum); | 470 | hid_dbg(pidff->hid, "create_new_effect sent, type: %d\n", efnum); |
470 | 471 | ||
471 | pidff->block_load[PID_EFFECT_BLOCK_INDEX].value[0] = 0; | 472 | pidff->block_load[PID_EFFECT_BLOCK_INDEX].value[0] = 0; |
472 | pidff->block_load_status->value[0] = 0; | 473 | pidff->block_load_status->value[0] = 0; |
473 | usbhid_wait_io(pidff->hid); | 474 | usbhid_wait_io(pidff->hid); |
474 | 475 | ||
475 | for (j = 0; j < 60; j++) { | 476 | for (j = 0; j < 60; j++) { |
476 | debug("pid_block_load requested"); | 477 | hid_dbg(pidff->hid, "pid_block_load requested\n"); |
477 | usbhid_submit_report(pidff->hid, pidff->reports[PID_BLOCK_LOAD], | 478 | usbhid_submit_report(pidff->hid, pidff->reports[PID_BLOCK_LOAD], |
478 | USB_DIR_IN); | 479 | USB_DIR_IN); |
479 | usbhid_wait_io(pidff->hid); | 480 | usbhid_wait_io(pidff->hid); |
480 | if (pidff->block_load_status->value[0] == | 481 | if (pidff->block_load_status->value[0] == |
481 | pidff->status_id[PID_BLOCK_LOAD_SUCCESS]) { | 482 | pidff->status_id[PID_BLOCK_LOAD_SUCCESS]) { |
482 | debug("device reported free memory: %d bytes", | 483 | hid_dbg(pidff->hid, "device reported free memory: %d bytes\n", |
483 | pidff->block_load[PID_RAM_POOL_AVAILABLE].value ? | 484 | pidff->block_load[PID_RAM_POOL_AVAILABLE].value ? |
484 | pidff->block_load[PID_RAM_POOL_AVAILABLE].value[0] : -1); | 485 | pidff->block_load[PID_RAM_POOL_AVAILABLE].value[0] : -1); |
485 | return 0; | 486 | return 0; |
486 | } | 487 | } |
487 | if (pidff->block_load_status->value[0] == | 488 | if (pidff->block_load_status->value[0] == |
488 | pidff->status_id[PID_BLOCK_LOAD_FULL]) { | 489 | pidff->status_id[PID_BLOCK_LOAD_FULL]) { |
489 | debug("not enough memory free: %d bytes", | 490 | hid_dbg(pidff->hid, "not enough memory free: %d bytes\n", |
490 | pidff->block_load[PID_RAM_POOL_AVAILABLE].value ? | 491 | pidff->block_load[PID_RAM_POOL_AVAILABLE].value ? |
491 | pidff->block_load[PID_RAM_POOL_AVAILABLE].value[0] : -1); | 492 | pidff->block_load[PID_RAM_POOL_AVAILABLE].value[0] : -1); |
492 | return -ENOSPC; | 493 | return -ENOSPC; |
493 | } | 494 | } |
494 | } | 495 | } |
495 | printk(KERN_ERR "hid-pidff: pid_block_load failed 60 times\n"); | 496 | hid_err(pidff->hid, "pid_block_load failed 60 times\n"); |
496 | return -EIO; | 497 | return -EIO; |
497 | } | 498 | } |
498 | 499 | ||
@@ -546,7 +547,8 @@ static int pidff_erase_effect(struct input_dev *dev, int effect_id) | |||
546 | struct pidff_device *pidff = dev->ff->private; | 547 | struct pidff_device *pidff = dev->ff->private; |
547 | int pid_id = pidff->pid_id[effect_id]; | 548 | int pid_id = pidff->pid_id[effect_id]; |
548 | 549 | ||
549 | debug("starting to erase %d/%d", effect_id, pidff->pid_id[effect_id]); | 550 | hid_dbg(pidff->hid, "starting to erase %d/%d\n", |
551 | effect_id, pidff->pid_id[effect_id]); | ||
550 | /* Wait for the queue to clear. We do not want a full fifo to | 552 | /* Wait for the queue to clear. We do not want a full fifo to |
551 | prevent the effect removal. */ | 553 | prevent the effect removal. */ |
552 | usbhid_wait_io(pidff->hid); | 554 | usbhid_wait_io(pidff->hid); |
@@ -604,8 +606,7 @@ static int pidff_upload_effect(struct input_dev *dev, struct ff_effect *effect, | |||
604 | type_id = PID_SAW_DOWN; | 606 | type_id = PID_SAW_DOWN; |
605 | break; | 607 | break; |
606 | default: | 608 | default: |
607 | printk(KERN_ERR | 609 | hid_err(pidff->hid, "invalid waveform\n"); |
608 | "hid-pidff: invalid waveform\n"); | ||
609 | return -EINVAL; | 610 | return -EINVAL; |
610 | } | 611 | } |
611 | 612 | ||
@@ -696,7 +697,7 @@ static int pidff_upload_effect(struct input_dev *dev, struct ff_effect *effect, | |||
696 | break; | 697 | break; |
697 | 698 | ||
698 | default: | 699 | default: |
699 | printk(KERN_ERR "hid-pidff: invalid type\n"); | 700 | hid_err(pidff->hid, "invalid type\n"); |
700 | return -EINVAL; | 701 | return -EINVAL; |
701 | } | 702 | } |
702 | 703 | ||
@@ -704,7 +705,7 @@ static int pidff_upload_effect(struct input_dev *dev, struct ff_effect *effect, | |||
704 | pidff->pid_id[effect->id] = | 705 | pidff->pid_id[effect->id] = |
705 | pidff->block_load[PID_EFFECT_BLOCK_INDEX].value[0]; | 706 | pidff->block_load[PID_EFFECT_BLOCK_INDEX].value[0]; |
706 | 707 | ||
707 | debug("uploaded"); | 708 | hid_dbg(pidff->hid, "uploaded\n"); |
708 | 709 | ||
709 | return 0; | 710 | return 0; |
710 | } | 711 | } |
@@ -770,14 +771,14 @@ static int pidff_find_fields(struct pidff_usage *usage, const u8 *table, | |||
770 | for (i = 0; i < report->maxfield; i++) { | 771 | for (i = 0; i < report->maxfield; i++) { |
771 | if (report->field[i]->maxusage != | 772 | if (report->field[i]->maxusage != |
772 | report->field[i]->report_count) { | 773 | report->field[i]->report_count) { |
773 | debug("maxusage and report_count do not match, " | 774 | pr_debug("maxusage and report_count do not match, skipping\n"); |
774 | "skipping"); | ||
775 | continue; | 775 | continue; |
776 | } | 776 | } |
777 | for (j = 0; j < report->field[i]->maxusage; j++) { | 777 | for (j = 0; j < report->field[i]->maxusage; j++) { |
778 | if (report->field[i]->usage[j].hid == | 778 | if (report->field[i]->usage[j].hid == |
779 | (HID_UP_PID | table[k])) { | 779 | (HID_UP_PID | table[k])) { |
780 | debug("found %d at %d->%d", k, i, j); | 780 | pr_debug("found %d at %d->%d\n", |
781 | k, i, j); | ||
781 | usage[k].field = report->field[i]; | 782 | usage[k].field = report->field[i]; |
782 | usage[k].value = | 783 | usage[k].value = |
783 | &report->field[i]->value[j]; | 784 | &report->field[i]->value[j]; |
@@ -789,7 +790,7 @@ static int pidff_find_fields(struct pidff_usage *usage, const u8 *table, | |||
789 | break; | 790 | break; |
790 | } | 791 | } |
791 | if (!found && strict) { | 792 | if (!found && strict) { |
792 | debug("failed to locate %d", k); | 793 | pr_debug("failed to locate %d\n", k); |
793 | return -1; | 794 | return -1; |
794 | } | 795 | } |
795 | } | 796 | } |
@@ -826,8 +827,8 @@ static void pidff_find_reports(struct hid_device *hid, int report_type, | |||
826 | continue; | 827 | continue; |
827 | ret = pidff_check_usage(report->field[0]->logical); | 828 | ret = pidff_check_usage(report->field[0]->logical); |
828 | if (ret != -1) { | 829 | if (ret != -1) { |
829 | debug("found usage 0x%02x from field->logical", | 830 | hid_dbg(hid, "found usage 0x%02x from field->logical\n", |
830 | pidff_reports[ret]); | 831 | pidff_reports[ret]); |
831 | pidff->reports[ret] = report; | 832 | pidff->reports[ret] = report; |
832 | continue; | 833 | continue; |
833 | } | 834 | } |
@@ -845,8 +846,9 @@ static void pidff_find_reports(struct hid_device *hid, int report_type, | |||
845 | continue; | 846 | continue; |
846 | ret = pidff_check_usage(hid->collection[i - 1].usage); | 847 | ret = pidff_check_usage(hid->collection[i - 1].usage); |
847 | if (ret != -1 && !pidff->reports[ret]) { | 848 | if (ret != -1 && !pidff->reports[ret]) { |
848 | debug("found usage 0x%02x from collection array", | 849 | hid_dbg(hid, |
849 | pidff_reports[ret]); | 850 | "found usage 0x%02x from collection array\n", |
851 | pidff_reports[ret]); | ||
850 | pidff->reports[ret] = report; | 852 | pidff->reports[ret] = report; |
851 | } | 853 | } |
852 | } | 854 | } |
@@ -861,7 +863,7 @@ static int pidff_reports_ok(struct pidff_device *pidff) | |||
861 | 863 | ||
862 | for (i = 0; i <= PID_REQUIRED_REPORTS; i++) { | 864 | for (i = 0; i <= PID_REQUIRED_REPORTS; i++) { |
863 | if (!pidff->reports[i]) { | 865 | if (!pidff->reports[i]) { |
864 | debug("%d missing", i); | 866 | hid_dbg(pidff->hid, "%d missing\n", i); |
865 | return 0; | 867 | return 0; |
866 | } | 868 | } |
867 | } | 869 | } |
@@ -884,8 +886,7 @@ static struct hid_field *pidff_find_special_field(struct hid_report *report, | |||
884 | report->field[i]->logical_minimum == 1) | 886 | report->field[i]->logical_minimum == 1) |
885 | return report->field[i]; | 887 | return report->field[i]; |
886 | else { | 888 | else { |
887 | printk(KERN_ERR "hid-pidff: logical_minimum " | 889 | pr_err("logical_minimum is not 1 as it should be\n"); |
888 | "is not 1 as it should be\n"); | ||
889 | return NULL; | 890 | return NULL; |
890 | } | 891 | } |
891 | } | 892 | } |
@@ -924,7 +925,7 @@ static int pidff_find_special_keys(int *keys, struct hid_field *fld, | |||
924 | */ | 925 | */ |
925 | static int pidff_find_special_fields(struct pidff_device *pidff) | 926 | static int pidff_find_special_fields(struct pidff_device *pidff) |
926 | { | 927 | { |
927 | debug("finding special fields"); | 928 | hid_dbg(pidff->hid, "finding special fields\n"); |
928 | 929 | ||
929 | pidff->create_new_effect_type = | 930 | pidff->create_new_effect_type = |
930 | pidff_find_special_field(pidff->reports[PID_CREATE_NEW_EFFECT], | 931 | pidff_find_special_field(pidff->reports[PID_CREATE_NEW_EFFECT], |
@@ -945,32 +946,30 @@ static int pidff_find_special_fields(struct pidff_device *pidff) | |||
945 | pidff_find_special_field(pidff->reports[PID_EFFECT_OPERATION], | 946 | pidff_find_special_field(pidff->reports[PID_EFFECT_OPERATION], |
946 | 0x78, 1); | 947 | 0x78, 1); |
947 | 948 | ||
948 | debug("search done"); | 949 | hid_dbg(pidff->hid, "search done\n"); |
949 | 950 | ||
950 | if (!pidff->create_new_effect_type || !pidff->set_effect_type) { | 951 | if (!pidff->create_new_effect_type || !pidff->set_effect_type) { |
951 | printk(KERN_ERR "hid-pidff: effect lists not found\n"); | 952 | hid_err(pidff->hid, "effect lists not found\n"); |
952 | return -1; | 953 | return -1; |
953 | } | 954 | } |
954 | 955 | ||
955 | if (!pidff->effect_direction) { | 956 | if (!pidff->effect_direction) { |
956 | printk(KERN_ERR "hid-pidff: direction field not found\n"); | 957 | hid_err(pidff->hid, "direction field not found\n"); |
957 | return -1; | 958 | return -1; |
958 | } | 959 | } |
959 | 960 | ||
960 | if (!pidff->device_control) { | 961 | if (!pidff->device_control) { |
961 | printk(KERN_ERR "hid-pidff: device control field not found\n"); | 962 | hid_err(pidff->hid, "device control field not found\n"); |
962 | return -1; | 963 | return -1; |
963 | } | 964 | } |
964 | 965 | ||
965 | if (!pidff->block_load_status) { | 966 | if (!pidff->block_load_status) { |
966 | printk(KERN_ERR | 967 | hid_err(pidff->hid, "block load status field not found\n"); |
967 | "hid-pidff: block load status field not found\n"); | ||
968 | return -1; | 968 | return -1; |
969 | } | 969 | } |
970 | 970 | ||
971 | if (!pidff->effect_operation_status) { | 971 | if (!pidff->effect_operation_status) { |
972 | printk(KERN_ERR | 972 | hid_err(pidff->hid, "effect operation field not found\n"); |
973 | "hid-pidff: effect operation field not found\n"); | ||
974 | return -1; | 973 | return -1; |
975 | } | 974 | } |
976 | 975 | ||
@@ -982,23 +981,22 @@ static int pidff_find_special_fields(struct pidff_device *pidff) | |||
982 | 981 | ||
983 | if (!PIDFF_FIND_SPECIAL_KEYS(type_id, create_new_effect_type, | 982 | if (!PIDFF_FIND_SPECIAL_KEYS(type_id, create_new_effect_type, |
984 | effect_types)) { | 983 | effect_types)) { |
985 | printk(KERN_ERR "hid-pidff: no effect types found\n"); | 984 | hid_err(pidff->hid, "no effect types found\n"); |
986 | return -1; | 985 | return -1; |
987 | } | 986 | } |
988 | 987 | ||
989 | if (PIDFF_FIND_SPECIAL_KEYS(status_id, block_load_status, | 988 | if (PIDFF_FIND_SPECIAL_KEYS(status_id, block_load_status, |
990 | block_load_status) != | 989 | block_load_status) != |
991 | sizeof(pidff_block_load_status)) { | 990 | sizeof(pidff_block_load_status)) { |
992 | printk(KERN_ERR | 991 | hid_err(pidff->hid, |
993 | "hidpidff: block load status identifiers not found\n"); | 992 | "block load status identifiers not found\n"); |
994 | return -1; | 993 | return -1; |
995 | } | 994 | } |
996 | 995 | ||
997 | if (PIDFF_FIND_SPECIAL_KEYS(operation_id, effect_operation_status, | 996 | if (PIDFF_FIND_SPECIAL_KEYS(operation_id, effect_operation_status, |
998 | effect_operation_status) != | 997 | effect_operation_status) != |
999 | sizeof(pidff_effect_operation_status)) { | 998 | sizeof(pidff_effect_operation_status)) { |
1000 | printk(KERN_ERR | 999 | hid_err(pidff->hid, "effect operation identifiers not found\n"); |
1001 | "hidpidff: effect operation identifiers not found\n"); | ||
1002 | return -1; | 1000 | return -1; |
1003 | } | 1001 | } |
1004 | 1002 | ||
@@ -1017,8 +1015,8 @@ static int pidff_find_effects(struct pidff_device *pidff, | |||
1017 | int pidff_type = pidff->type_id[i]; | 1015 | int pidff_type = pidff->type_id[i]; |
1018 | if (pidff->set_effect_type->usage[pidff_type].hid != | 1016 | if (pidff->set_effect_type->usage[pidff_type].hid != |
1019 | pidff->create_new_effect_type->usage[pidff_type].hid) { | 1017 | pidff->create_new_effect_type->usage[pidff_type].hid) { |
1020 | printk(KERN_ERR "hid-pidff: " | 1018 | hid_err(pidff->hid, |
1021 | "effect type number %d is invalid\n", i); | 1019 | "effect type number %d is invalid\n", i); |
1022 | return -1; | 1020 | return -1; |
1023 | } | 1021 | } |
1024 | } | 1022 | } |
@@ -1073,27 +1071,23 @@ static int pidff_init_fields(struct pidff_device *pidff, struct input_dev *dev) | |||
1073 | int envelope_ok = 0; | 1071 | int envelope_ok = 0; |
1074 | 1072 | ||
1075 | if (PIDFF_FIND_FIELDS(set_effect, PID_SET_EFFECT, 1)) { | 1073 | if (PIDFF_FIND_FIELDS(set_effect, PID_SET_EFFECT, 1)) { |
1076 | printk(KERN_ERR | 1074 | hid_err(pidff->hid, "unknown set_effect report layout\n"); |
1077 | "hid-pidff: unknown set_effect report layout\n"); | ||
1078 | return -ENODEV; | 1075 | return -ENODEV; |
1079 | } | 1076 | } |
1080 | 1077 | ||
1081 | PIDFF_FIND_FIELDS(block_load, PID_BLOCK_LOAD, 0); | 1078 | PIDFF_FIND_FIELDS(block_load, PID_BLOCK_LOAD, 0); |
1082 | if (!pidff->block_load[PID_EFFECT_BLOCK_INDEX].value) { | 1079 | if (!pidff->block_load[PID_EFFECT_BLOCK_INDEX].value) { |
1083 | printk(KERN_ERR | 1080 | hid_err(pidff->hid, "unknown pid_block_load report layout\n"); |
1084 | "hid-pidff: unknown pid_block_load report layout\n"); | ||
1085 | return -ENODEV; | 1081 | return -ENODEV; |
1086 | } | 1082 | } |
1087 | 1083 | ||
1088 | if (PIDFF_FIND_FIELDS(effect_operation, PID_EFFECT_OPERATION, 1)) { | 1084 | if (PIDFF_FIND_FIELDS(effect_operation, PID_EFFECT_OPERATION, 1)) { |
1089 | printk(KERN_ERR | 1085 | hid_err(pidff->hid, "unknown effect_operation report layout\n"); |
1090 | "hid-pidff: unknown effect_operation report layout\n"); | ||
1091 | return -ENODEV; | 1086 | return -ENODEV; |
1092 | } | 1087 | } |
1093 | 1088 | ||
1094 | if (PIDFF_FIND_FIELDS(block_free, PID_BLOCK_FREE, 1)) { | 1089 | if (PIDFF_FIND_FIELDS(block_free, PID_BLOCK_FREE, 1)) { |
1095 | printk(KERN_ERR | 1090 | hid_err(pidff->hid, "unknown pid_block_free report layout\n"); |
1096 | "hid-pidff: unknown pid_block_free report layout\n"); | ||
1097 | return -ENODEV; | 1091 | return -ENODEV; |
1098 | } | 1092 | } |
1099 | 1093 | ||
@@ -1105,27 +1099,26 @@ static int pidff_init_fields(struct pidff_device *pidff, struct input_dev *dev) | |||
1105 | 1099 | ||
1106 | if (!envelope_ok) { | 1100 | if (!envelope_ok) { |
1107 | if (test_and_clear_bit(FF_CONSTANT, dev->ffbit)) | 1101 | if (test_and_clear_bit(FF_CONSTANT, dev->ffbit)) |
1108 | printk(KERN_WARNING "hid-pidff: " | 1102 | hid_warn(pidff->hid, |
1109 | "has constant effect but no envelope\n"); | 1103 | "has constant effect but no envelope\n"); |
1110 | if (test_and_clear_bit(FF_RAMP, dev->ffbit)) | 1104 | if (test_and_clear_bit(FF_RAMP, dev->ffbit)) |
1111 | printk(KERN_WARNING "hid-pidff: " | 1105 | hid_warn(pidff->hid, |
1112 | "has ramp effect but no envelope\n"); | 1106 | "has ramp effect but no envelope\n"); |
1113 | 1107 | ||
1114 | if (test_and_clear_bit(FF_PERIODIC, dev->ffbit)) | 1108 | if (test_and_clear_bit(FF_PERIODIC, dev->ffbit)) |
1115 | printk(KERN_WARNING "hid-pidff: " | 1109 | hid_warn(pidff->hid, |
1116 | "has periodic effect but no envelope\n"); | 1110 | "has periodic effect but no envelope\n"); |
1117 | } | 1111 | } |
1118 | 1112 | ||
1119 | if (test_bit(FF_CONSTANT, dev->ffbit) && | 1113 | if (test_bit(FF_CONSTANT, dev->ffbit) && |
1120 | PIDFF_FIND_FIELDS(set_constant, PID_SET_CONSTANT, 1)) { | 1114 | PIDFF_FIND_FIELDS(set_constant, PID_SET_CONSTANT, 1)) { |
1121 | printk(KERN_WARNING | 1115 | hid_warn(pidff->hid, "unknown constant effect layout\n"); |
1122 | "hid-pidff: unknown constant effect layout\n"); | ||
1123 | clear_bit(FF_CONSTANT, dev->ffbit); | 1116 | clear_bit(FF_CONSTANT, dev->ffbit); |
1124 | } | 1117 | } |
1125 | 1118 | ||
1126 | if (test_bit(FF_RAMP, dev->ffbit) && | 1119 | if (test_bit(FF_RAMP, dev->ffbit) && |
1127 | PIDFF_FIND_FIELDS(set_ramp, PID_SET_RAMP, 1)) { | 1120 | PIDFF_FIND_FIELDS(set_ramp, PID_SET_RAMP, 1)) { |
1128 | printk(KERN_WARNING "hid-pidff: unknown ramp effect layout\n"); | 1121 | hid_warn(pidff->hid, "unknown ramp effect layout\n"); |
1129 | clear_bit(FF_RAMP, dev->ffbit); | 1122 | clear_bit(FF_RAMP, dev->ffbit); |
1130 | } | 1123 | } |
1131 | 1124 | ||
@@ -1134,8 +1127,7 @@ static int pidff_init_fields(struct pidff_device *pidff, struct input_dev *dev) | |||
1134 | test_bit(FF_FRICTION, dev->ffbit) || | 1127 | test_bit(FF_FRICTION, dev->ffbit) || |
1135 | test_bit(FF_INERTIA, dev->ffbit)) && | 1128 | test_bit(FF_INERTIA, dev->ffbit)) && |
1136 | PIDFF_FIND_FIELDS(set_condition, PID_SET_CONDITION, 1)) { | 1129 | PIDFF_FIND_FIELDS(set_condition, PID_SET_CONDITION, 1)) { |
1137 | printk(KERN_WARNING | 1130 | hid_warn(pidff->hid, "unknown condition effect layout\n"); |
1138 | "hid-pidff: unknown condition effect layout\n"); | ||
1139 | clear_bit(FF_SPRING, dev->ffbit); | 1131 | clear_bit(FF_SPRING, dev->ffbit); |
1140 | clear_bit(FF_DAMPER, dev->ffbit); | 1132 | clear_bit(FF_DAMPER, dev->ffbit); |
1141 | clear_bit(FF_FRICTION, dev->ffbit); | 1133 | clear_bit(FF_FRICTION, dev->ffbit); |
@@ -1144,8 +1136,7 @@ static int pidff_init_fields(struct pidff_device *pidff, struct input_dev *dev) | |||
1144 | 1136 | ||
1145 | if (test_bit(FF_PERIODIC, dev->ffbit) && | 1137 | if (test_bit(FF_PERIODIC, dev->ffbit) && |
1146 | PIDFF_FIND_FIELDS(set_periodic, PID_SET_PERIODIC, 1)) { | 1138 | PIDFF_FIND_FIELDS(set_periodic, PID_SET_PERIODIC, 1)) { |
1147 | printk(KERN_WARNING | 1139 | hid_warn(pidff->hid, "unknown periodic effect layout\n"); |
1148 | "hid-pidff: unknown periodic effect layout\n"); | ||
1149 | clear_bit(FF_PERIODIC, dev->ffbit); | 1140 | clear_bit(FF_PERIODIC, dev->ffbit); |
1150 | } | 1141 | } |
1151 | 1142 | ||
@@ -1184,12 +1175,12 @@ static void pidff_reset(struct pidff_device *pidff) | |||
1184 | if (pidff->pool[PID_SIMULTANEOUS_MAX].value) { | 1175 | if (pidff->pool[PID_SIMULTANEOUS_MAX].value) { |
1185 | while (pidff->pool[PID_SIMULTANEOUS_MAX].value[0] < 2) { | 1176 | while (pidff->pool[PID_SIMULTANEOUS_MAX].value[0] < 2) { |
1186 | if (i++ > 20) { | 1177 | if (i++ > 20) { |
1187 | printk(KERN_WARNING "hid-pidff: device reports " | 1178 | hid_warn(pidff->hid, |
1188 | "%d simultaneous effects\n", | 1179 | "device reports %d simultaneous effects\n", |
1189 | pidff->pool[PID_SIMULTANEOUS_MAX].value[0]); | 1180 | pidff->pool[PID_SIMULTANEOUS_MAX].value[0]); |
1190 | break; | 1181 | break; |
1191 | } | 1182 | } |
1192 | debug("pid_pool requested again"); | 1183 | hid_dbg(pidff->hid, "pid_pool requested again\n"); |
1193 | usbhid_submit_report(hid, pidff->reports[PID_POOL], | 1184 | usbhid_submit_report(hid, pidff->reports[PID_POOL], |
1194 | USB_DIR_IN); | 1185 | USB_DIR_IN); |
1195 | usbhid_wait_io(hid); | 1186 | usbhid_wait_io(hid); |
@@ -1215,7 +1206,7 @@ static int pidff_check_autocenter(struct pidff_device *pidff, | |||
1215 | 1206 | ||
1216 | error = pidff_request_effect_upload(pidff, 1); | 1207 | error = pidff_request_effect_upload(pidff, 1); |
1217 | if (error) { | 1208 | if (error) { |
1218 | printk(KERN_ERR "hid-pidff: upload request failed\n"); | 1209 | hid_err(pidff->hid, "upload request failed\n"); |
1219 | return error; | 1210 | return error; |
1220 | } | 1211 | } |
1221 | 1212 | ||
@@ -1224,8 +1215,8 @@ static int pidff_check_autocenter(struct pidff_device *pidff, | |||
1224 | pidff_autocenter(pidff, 0xffff); | 1215 | pidff_autocenter(pidff, 0xffff); |
1225 | set_bit(FF_AUTOCENTER, dev->ffbit); | 1216 | set_bit(FF_AUTOCENTER, dev->ffbit); |
1226 | } else { | 1217 | } else { |
1227 | printk(KERN_NOTICE "hid-pidff: " | 1218 | hid_notice(pidff->hid, |
1228 | "device has unknown autocenter control method\n"); | 1219 | "device has unknown autocenter control method\n"); |
1229 | } | 1220 | } |
1230 | 1221 | ||
1231 | pidff_erase_pid(pidff, | 1222 | pidff_erase_pid(pidff, |
@@ -1248,10 +1239,10 @@ int hid_pidff_init(struct hid_device *hid) | |||
1248 | int max_effects; | 1239 | int max_effects; |
1249 | int error; | 1240 | int error; |
1250 | 1241 | ||
1251 | debug("starting pid init"); | 1242 | hid_dbg(hid, "starting pid init\n"); |
1252 | 1243 | ||
1253 | if (list_empty(&hid->report_enum[HID_OUTPUT_REPORT].report_list)) { | 1244 | if (list_empty(&hid->report_enum[HID_OUTPUT_REPORT].report_list)) { |
1254 | debug("not a PID device, no output report"); | 1245 | hid_dbg(hid, "not a PID device, no output report\n"); |
1255 | return -ENODEV; | 1246 | return -ENODEV; |
1256 | } | 1247 | } |
1257 | 1248 | ||
@@ -1265,7 +1256,7 @@ int hid_pidff_init(struct hid_device *hid) | |||
1265 | pidff_find_reports(hid, HID_FEATURE_REPORT, pidff); | 1256 | pidff_find_reports(hid, HID_FEATURE_REPORT, pidff); |
1266 | 1257 | ||
1267 | if (!pidff_reports_ok(pidff)) { | 1258 | if (!pidff_reports_ok(pidff)) { |
1268 | debug("reports not ok, aborting"); | 1259 | hid_dbg(hid, "reports not ok, aborting\n"); |
1269 | error = -ENODEV; | 1260 | error = -ENODEV; |
1270 | goto fail; | 1261 | goto fail; |
1271 | } | 1262 | } |
@@ -1278,8 +1269,8 @@ int hid_pidff_init(struct hid_device *hid) | |||
1278 | 1269 | ||
1279 | if (test_bit(FF_GAIN, dev->ffbit)) { | 1270 | if (test_bit(FF_GAIN, dev->ffbit)) { |
1280 | pidff_set(&pidff->device_gain[PID_DEVICE_GAIN_FIELD], 0xffff); | 1271 | pidff_set(&pidff->device_gain[PID_DEVICE_GAIN_FIELD], 0xffff); |
1281 | usbhid_submit_report(pidff->hid, pidff->reports[PID_DEVICE_GAIN], | 1272 | usbhid_submit_report(hid, pidff->reports[PID_DEVICE_GAIN], |
1282 | USB_DIR_OUT); | 1273 | USB_DIR_OUT); |
1283 | } | 1274 | } |
1284 | 1275 | ||
1285 | error = pidff_check_autocenter(pidff, dev); | 1276 | error = pidff_check_autocenter(pidff, dev); |
@@ -1290,23 +1281,23 @@ int hid_pidff_init(struct hid_device *hid) | |||
1290 | pidff->block_load[PID_EFFECT_BLOCK_INDEX].field->logical_maximum - | 1281 | pidff->block_load[PID_EFFECT_BLOCK_INDEX].field->logical_maximum - |
1291 | pidff->block_load[PID_EFFECT_BLOCK_INDEX].field->logical_minimum + | 1282 | pidff->block_load[PID_EFFECT_BLOCK_INDEX].field->logical_minimum + |
1292 | 1; | 1283 | 1; |
1293 | debug("max effects is %d", max_effects); | 1284 | hid_dbg(hid, "max effects is %d\n", max_effects); |
1294 | 1285 | ||
1295 | if (max_effects > PID_EFFECTS_MAX) | 1286 | if (max_effects > PID_EFFECTS_MAX) |
1296 | max_effects = PID_EFFECTS_MAX; | 1287 | max_effects = PID_EFFECTS_MAX; |
1297 | 1288 | ||
1298 | if (pidff->pool[PID_SIMULTANEOUS_MAX].value) | 1289 | if (pidff->pool[PID_SIMULTANEOUS_MAX].value) |
1299 | debug("max simultaneous effects is %d", | 1290 | hid_dbg(hid, "max simultaneous effects is %d\n", |
1300 | pidff->pool[PID_SIMULTANEOUS_MAX].value[0]); | 1291 | pidff->pool[PID_SIMULTANEOUS_MAX].value[0]); |
1301 | 1292 | ||
1302 | if (pidff->pool[PID_RAM_POOL_SIZE].value) | 1293 | if (pidff->pool[PID_RAM_POOL_SIZE].value) |
1303 | debug("device memory size is %d bytes", | 1294 | hid_dbg(hid, "device memory size is %d bytes\n", |
1304 | pidff->pool[PID_RAM_POOL_SIZE].value[0]); | 1295 | pidff->pool[PID_RAM_POOL_SIZE].value[0]); |
1305 | 1296 | ||
1306 | if (pidff->pool[PID_DEVICE_MANAGED_POOL].value && | 1297 | if (pidff->pool[PID_DEVICE_MANAGED_POOL].value && |
1307 | pidff->pool[PID_DEVICE_MANAGED_POOL].value[0] == 0) { | 1298 | pidff->pool[PID_DEVICE_MANAGED_POOL].value[0] == 0) { |
1308 | printk(KERN_NOTICE "hid-pidff: " | 1299 | hid_notice(hid, |
1309 | "device does not support device managed pool\n"); | 1300 | "device does not support device managed pool\n"); |
1310 | goto fail; | 1301 | goto fail; |
1311 | } | 1302 | } |
1312 | 1303 | ||
@@ -1322,8 +1313,7 @@ int hid_pidff_init(struct hid_device *hid) | |||
1322 | ff->set_autocenter = pidff_set_autocenter; | 1313 | ff->set_autocenter = pidff_set_autocenter; |
1323 | ff->playback = pidff_playback; | 1314 | ff->playback = pidff_playback; |
1324 | 1315 | ||
1325 | printk(KERN_INFO "Force feedback for USB HID PID devices by " | 1316 | hid_info(dev, "Force feedback for USB HID PID devices by Anssi Hannula <anssi.hannula@gmail.com>\n"); |
1326 | "Anssi Hannula <anssi.hannula@gmail.com>\n"); | ||
1327 | 1317 | ||
1328 | return 0; | 1318 | return 0; |
1329 | 1319 | ||
diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c index a9935f6709f7..fb78f75d49a9 100644 --- a/drivers/hid/usbhid/hiddev.c +++ b/drivers/hid/usbhid/hiddev.c | |||
@@ -906,7 +906,7 @@ int hiddev_connect(struct hid_device *hid, unsigned int force) | |||
906 | hiddev->exist = 1; | 906 | hiddev->exist = 1; |
907 | retval = usb_register_dev(usbhid->intf, &hiddev_class); | 907 | retval = usb_register_dev(usbhid->intf, &hiddev_class); |
908 | if (retval) { | 908 | if (retval) { |
909 | err_hid("Not able to get a minor for this device."); | 909 | hid_err(hid, "Not able to get a minor for this device\n"); |
910 | hid->hiddev = NULL; | 910 | hid->hiddev = NULL; |
911 | kfree(hiddev); | 911 | kfree(hiddev); |
912 | return -1; | 912 | return -1; |
diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c index a948605564fb..065817329f03 100644 --- a/drivers/hid/usbhid/usbkbd.c +++ b/drivers/hid/usbhid/usbkbd.c | |||
@@ -24,6 +24,8 @@ | |||
24 | * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic | 24 | * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
28 | |||
27 | #include <linux/kernel.h> | 29 | #include <linux/kernel.h> |
28 | #include <linux/slab.h> | 30 | #include <linux/slab.h> |
29 | #include <linux/module.h> | 31 | #include <linux/module.h> |
@@ -104,16 +106,18 @@ static void usb_kbd_irq(struct urb *urb) | |||
104 | if (usb_kbd_keycode[kbd->old[i]]) | 106 | if (usb_kbd_keycode[kbd->old[i]]) |
105 | input_report_key(kbd->dev, usb_kbd_keycode[kbd->old[i]], 0); | 107 | input_report_key(kbd->dev, usb_kbd_keycode[kbd->old[i]], 0); |
106 | else | 108 | else |
107 | dev_info(&urb->dev->dev, | 109 | hid_info(urb->dev, |
108 | "Unknown key (scancode %#x) released.\n", kbd->old[i]); | 110 | "Unknown key (scancode %#x) released.\n", |
111 | kbd->old[i]); | ||
109 | } | 112 | } |
110 | 113 | ||
111 | if (kbd->new[i] > 3 && memscan(kbd->old + 2, kbd->new[i], 6) == kbd->old + 8) { | 114 | if (kbd->new[i] > 3 && memscan(kbd->old + 2, kbd->new[i], 6) == kbd->old + 8) { |
112 | if (usb_kbd_keycode[kbd->new[i]]) | 115 | if (usb_kbd_keycode[kbd->new[i]]) |
113 | input_report_key(kbd->dev, usb_kbd_keycode[kbd->new[i]], 1); | 116 | input_report_key(kbd->dev, usb_kbd_keycode[kbd->new[i]], 1); |
114 | else | 117 | else |
115 | dev_info(&urb->dev->dev, | 118 | hid_info(urb->dev, |
116 | "Unknown key (scancode %#x) released.\n", kbd->new[i]); | 119 | "Unknown key (scancode %#x) released.\n", |
120 | kbd->new[i]); | ||
117 | } | 121 | } |
118 | } | 122 | } |
119 | 123 | ||
@@ -124,9 +128,9 @@ static void usb_kbd_irq(struct urb *urb) | |||
124 | resubmit: | 128 | resubmit: |
125 | i = usb_submit_urb (urb, GFP_ATOMIC); | 129 | i = usb_submit_urb (urb, GFP_ATOMIC); |
126 | if (i) | 130 | if (i) |
127 | err_hid ("can't resubmit intr, %s-%s/input0, status %d", | 131 | hid_err(urb->dev, "can't resubmit intr, %s-%s/input0, status %d", |
128 | kbd->usbdev->bus->bus_name, | 132 | kbd->usbdev->bus->bus_name, |
129 | kbd->usbdev->devpath, i); | 133 | kbd->usbdev->devpath, i); |
130 | } | 134 | } |
131 | 135 | ||
132 | static int usb_kbd_event(struct input_dev *dev, unsigned int type, | 136 | static int usb_kbd_event(struct input_dev *dev, unsigned int type, |
@@ -150,7 +154,7 @@ static int usb_kbd_event(struct input_dev *dev, unsigned int type, | |||
150 | *(kbd->leds) = kbd->newleds; | 154 | *(kbd->leds) = kbd->newleds; |
151 | kbd->led->dev = kbd->usbdev; | 155 | kbd->led->dev = kbd->usbdev; |
152 | if (usb_submit_urb(kbd->led, GFP_ATOMIC)) | 156 | if (usb_submit_urb(kbd->led, GFP_ATOMIC)) |
153 | err_hid("usb_submit_urb(leds) failed"); | 157 | pr_err("usb_submit_urb(leds) failed\n"); |
154 | 158 | ||
155 | return 0; | 159 | return 0; |
156 | } | 160 | } |
@@ -160,7 +164,7 @@ static void usb_kbd_led(struct urb *urb) | |||
160 | struct usb_kbd *kbd = urb->context; | 164 | struct usb_kbd *kbd = urb->context; |
161 | 165 | ||
162 | if (urb->status) | 166 | if (urb->status) |
163 | dev_warn(&urb->dev->dev, "led urb status %d received\n", | 167 | hid_warn(urb->dev, "led urb status %d received\n", |
164 | urb->status); | 168 | urb->status); |
165 | 169 | ||
166 | if (*(kbd->leds) == kbd->newleds) | 170 | if (*(kbd->leds) == kbd->newleds) |
@@ -169,7 +173,7 @@ static void usb_kbd_led(struct urb *urb) | |||
169 | *(kbd->leds) = kbd->newleds; | 173 | *(kbd->leds) = kbd->newleds; |
170 | kbd->led->dev = kbd->usbdev; | 174 | kbd->led->dev = kbd->usbdev; |
171 | if (usb_submit_urb(kbd->led, GFP_ATOMIC)) | 175 | if (usb_submit_urb(kbd->led, GFP_ATOMIC)) |
172 | err_hid("usb_submit_urb(leds) failed"); | 176 | hid_err(urb->dev, "usb_submit_urb(leds) failed\n"); |
173 | } | 177 | } |
174 | 178 | ||
175 | static int usb_kbd_open(struct input_dev *dev) | 179 | static int usb_kbd_open(struct input_dev *dev) |