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-wacom.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-wacom.c')
-rw-r--r-- | drivers/hid/hid-wacom.c | 26 |
1 files changed, 14 insertions, 12 deletions
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 | ||