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/hid-tmff.c | |
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/hid-tmff.c')
-rw-r--r-- | drivers/hid/hid-tmff.c | 27 |
1 files changed, 10 insertions, 17 deletions
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 | ||