diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2008-09-18 06:23:34 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2008-10-14 17:51:01 -0400 |
commit | 795750197f240ca2a3f064c0210c4efd40dbaed3 (patch) | |
tree | 05c40a4331091817e73710ddf34fcc3a3ab5a2c6 /drivers/hid | |
parent | 76483cf4d0efbc35eaf9905a437f2f1be0221360 (diff) |
HID: convert to dev_* prints
Since we have a real device bound to a driver, we may use struct
device for printing. Use dev_* functions instead of printks in
4 drivers.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-lg2ff.c | 8 | ||||
-rw-r--r-- | drivers/hid/hid-pl.c | 11 | ||||
-rw-r--r-- | drivers/hid/hid-tmff.c | 26 | ||||
-rw-r--r-- | drivers/hid/hid-zpff.c | 6 |
4 files changed, 27 insertions, 24 deletions
diff --git a/drivers/hid/hid-lg2ff.c b/drivers/hid/hid-lg2ff.c index b2e9a67aa652..4e6dc6e26523 100644 --- a/drivers/hid/hid-lg2ff.c +++ b/drivers/hid/hid-lg2ff.c | |||
@@ -71,18 +71,18 @@ int lg2ff_init(struct hid_device *hid) | |||
71 | int error; | 71 | int error; |
72 | 72 | ||
73 | if (list_empty(report_list)) { | 73 | if (list_empty(report_list)) { |
74 | printk(KERN_ERR "hid-lg2ff: no output report found\n"); | 74 | dev_err(&hid->dev, "no output report found\n"); |
75 | return -ENODEV; | 75 | return -ENODEV; |
76 | } | 76 | } |
77 | 77 | ||
78 | report = list_entry(report_list->next, struct hid_report, list); | 78 | report = list_entry(report_list->next, struct hid_report, list); |
79 | 79 | ||
80 | if (report->maxfield < 1) { | 80 | if (report->maxfield < 1) { |
81 | printk(KERN_ERR "hid-lg2ff: output report is empty\n"); | 81 | dev_err(&hid->dev, "output report is empty\n"); |
82 | return -ENODEV; | 82 | return -ENODEV; |
83 | } | 83 | } |
84 | if (report->field[0]->report_count < 7) { | 84 | if (report->field[0]->report_count < 7) { |
85 | printk(KERN_ERR "hid-lg2ff: not enough values in the field\n"); | 85 | dev_err(&hid->dev, "not enough values in the field\n"); |
86 | return -ENODEV; | 86 | return -ENODEV; |
87 | } | 87 | } |
88 | 88 | ||
@@ -109,7 +109,7 @@ int lg2ff_init(struct hid_device *hid) | |||
109 | 109 | ||
110 | usbhid_submit_report(hid, report, USB_DIR_OUT); | 110 | usbhid_submit_report(hid, report, USB_DIR_OUT); |
111 | 111 | ||
112 | printk(KERN_INFO "Force feedback for Logitech Rumblepad 2 by " | 112 | dev_info(&hid->dev, "Force feedback for Logitech Rumblepad 2 by " |
113 | "Anssi Hannula <anssi.hannula@gmail.com>\n"); | 113 | "Anssi Hannula <anssi.hannula@gmail.com>\n"); |
114 | 114 | ||
115 | return 0; | 115 | return 0; |
diff --git a/drivers/hid/hid-pl.c b/drivers/hid/hid-pl.c index a1d1fb9da125..acd815586182 100644 --- a/drivers/hid/hid-pl.c +++ b/drivers/hid/hid-pl.c | |||
@@ -90,7 +90,7 @@ static int plff_init(struct hid_device *hid) | |||
90 | currently unknown. */ | 90 | currently unknown. */ |
91 | 91 | ||
92 | if (list_empty(report_list)) { | 92 | if (list_empty(report_list)) { |
93 | printk(KERN_ERR "hid-plff: no output reports found\n"); | 93 | dev_err(&hid->dev, "no output reports found\n"); |
94 | return -ENODEV; | 94 | return -ENODEV; |
95 | } | 95 | } |
96 | 96 | ||
@@ -99,18 +99,19 @@ static int plff_init(struct hid_device *hid) | |||
99 | report_ptr = report_ptr->next; | 99 | report_ptr = report_ptr->next; |
100 | 100 | ||
101 | if (report_ptr == report_list) { | 101 | if (report_ptr == report_list) { |
102 | printk(KERN_ERR "hid-plff: required output report is missing\n"); | 102 | dev_err(&hid->dev, "required output report is " |
103 | "missing\n"); | ||
103 | return -ENODEV; | 104 | return -ENODEV; |
104 | } | 105 | } |
105 | 106 | ||
106 | report = list_entry(report_ptr, struct hid_report, list); | 107 | report = list_entry(report_ptr, struct hid_report, list); |
107 | if (report->maxfield < 1) { | 108 | if (report->maxfield < 1) { |
108 | printk(KERN_ERR "hid-plff: no fields in the report\n"); | 109 | dev_err(&hid->dev, "no fields in the report\n"); |
109 | return -ENODEV; | 110 | return -ENODEV; |
110 | } | 111 | } |
111 | 112 | ||
112 | if (report->field[0]->report_count < 4) { | 113 | if (report->field[0]->report_count < 4) { |
113 | printk(KERN_ERR "hid-plff: not enough values in the field\n"); | 114 | dev_err(&hid->dev, "not enough values in the field\n"); |
114 | return -ENODEV; | 115 | return -ENODEV; |
115 | } | 116 | } |
116 | 117 | ||
@@ -136,7 +137,7 @@ static int plff_init(struct hid_device *hid) | |||
136 | usbhid_submit_report(hid, plff->report, USB_DIR_OUT); | 137 | usbhid_submit_report(hid, plff->report, USB_DIR_OUT); |
137 | } | 138 | } |
138 | 139 | ||
139 | printk(KERN_INFO "hid-plff: Force feedback for PantherLord/GreenAsia " | 140 | dev_info(&hid->dev, "Force feedback for PantherLord/GreenAsia " |
140 | "devices by Anssi Hannula <anssi.hannula@gmail.com>\n"); | 141 | "devices by Anssi Hannula <anssi.hannula@gmail.com>\n"); |
141 | 142 | ||
142 | return 0; | 143 | return 0; |
diff --git a/drivers/hid/hid-tmff.c b/drivers/hid/hid-tmff.c index be7ebe286a16..1b7cba0f7e1f 100644 --- a/drivers/hid/hid-tmff.c +++ b/drivers/hid/hid-tmff.c | |||
@@ -149,27 +149,28 @@ static int tmff_init(struct hid_device *hid, const signed short *ff_bits) | |||
149 | switch (field->usage[0].hid) { | 149 | switch (field->usage[0].hid) { |
150 | case THRUSTMASTER_USAGE_FF: | 150 | case THRUSTMASTER_USAGE_FF: |
151 | if (field->report_count < 2) { | 151 | if (field->report_count < 2) { |
152 | warn("ignoring FF field with " | 152 | dev_warn(&hid->dev, "ignoring FF field " |
153 | "report_count < 2"); | 153 | "with report_count < 2\n"); |
154 | continue; | 154 | continue; |
155 | } | 155 | } |
156 | 156 | ||
157 | if (field->logical_maximum == | 157 | if (field->logical_maximum == |
158 | field->logical_minimum) { | 158 | field->logical_minimum) { |
159 | warn("ignoring FF field with " | 159 | dev_warn(&hid->dev, "ignoring FF field " |
160 | "logical_maximum == " | 160 | "with logical_maximum " |
161 | "logical_minimum"); | 161 | "== logical_minimum\n"); |
162 | continue; | 162 | continue; |
163 | } | 163 | } |
164 | 164 | ||
165 | if (tmff->report && tmff->report != report) { | 165 | if (tmff->report && tmff->report != report) { |
166 | warn("ignoring FF field in other " | 166 | dev_warn(&hid->dev, "ignoring FF field " |
167 | "report"); | 167 | "in other report\n"); |
168 | continue; | 168 | continue; |
169 | } | 169 | } |
170 | 170 | ||
171 | if (tmff->ff_field && tmff->ff_field != field) { | 171 | if (tmff->ff_field && tmff->ff_field != field) { |
172 | warn("ignoring duplicate FF field"); | 172 | dev_warn(&hid->dev, "ignoring " |
173 | "duplicate FF field\n"); | ||
173 | continue; | 174 | continue; |
174 | } | 175 | } |
175 | 176 | ||
@@ -182,7 +183,8 @@ static int tmff_init(struct hid_device *hid, const signed short *ff_bits) | |||
182 | break; | 183 | break; |
183 | 184 | ||
184 | default: | 185 | default: |
185 | warn("ignoring unknown output usage %08x", | 186 | dev_warn(&hid->dev, "ignoring unknown output " |
187 | "usage %08x\n", | ||
186 | field->usage[0].hid); | 188 | field->usage[0].hid); |
187 | continue; | 189 | continue; |
188 | } | 190 | } |
@@ -190,7 +192,7 @@ static int tmff_init(struct hid_device *hid, const signed short *ff_bits) | |||
190 | } | 192 | } |
191 | 193 | ||
192 | if (!tmff->report) { | 194 | if (!tmff->report) { |
193 | err("cant find FF field in output reports\n"); | 195 | dev_err(&hid->dev, "can't find FF field in output reports\n"); |
194 | error = -ENODEV; | 196 | error = -ENODEV; |
195 | goto fail; | 197 | goto fail; |
196 | } | 198 | } |
@@ -199,8 +201,8 @@ static int tmff_init(struct hid_device *hid, const signed short *ff_bits) | |||
199 | if (error) | 201 | if (error) |
200 | goto fail; | 202 | goto fail; |
201 | 203 | ||
202 | info("Force feedback for ThrustMaster devices by Zinx Verituse " | 204 | dev_info(&hid->dev, "force feedback for ThrustMaster devices by Zinx " |
203 | "<zinx@epicsol.org>"); | 205 | "Verituse <zinx@epicsol.org>"); |
204 | return 0; | 206 | return 0; |
205 | 207 | ||
206 | fail: | 208 | fail: |
diff --git a/drivers/hid/hid-zpff.c b/drivers/hid/hid-zpff.c index 9ed04ee9d642..ea82f3718b21 100644 --- a/drivers/hid/hid-zpff.c +++ b/drivers/hid/hid-zpff.c | |||
@@ -73,14 +73,14 @@ static int zpff_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 | printk(KERN_ERR "hid-zpff: no output report found\n"); | 76 | dev_err(&hid->dev, "no output report found\n"); |
77 | return -ENODEV; | 77 | return -ENODEV; |
78 | } | 78 | } |
79 | 79 | ||
80 | report = list_entry(report_list->next, struct hid_report, list); | 80 | report = list_entry(report_list->next, struct hid_report, list); |
81 | 81 | ||
82 | if (report->maxfield < 4) { | 82 | if (report->maxfield < 4) { |
83 | printk(KERN_ERR "hid-zpff: not enough fields in report\n"); | 83 | dev_err(&hid->dev, "not enough fields in report\n"); |
84 | return -ENODEV; | 84 | return -ENODEV; |
85 | } | 85 | } |
86 | 86 | ||
@@ -103,7 +103,7 @@ static int zpff_init(struct hid_device *hid) | |||
103 | zpff->report->field[3]->value[0] = 0x00; | 103 | zpff->report->field[3]->value[0] = 0x00; |
104 | usbhid_submit_report(hid, zpff->report, USB_DIR_OUT); | 104 | usbhid_submit_report(hid, zpff->report, USB_DIR_OUT); |
105 | 105 | ||
106 | printk(KERN_INFO "Force feedback for Zeroplus based devices by " | 106 | dev_info(&hid->dev, "force feedback for Zeroplus based devices by " |
107 | "Anssi Hannula <anssi.hannula@gmail.com>\n"); | 107 | "Anssi Hannula <anssi.hannula@gmail.com>\n"); |
108 | 108 | ||
109 | return 0; | 109 | return 0; |