aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-magicmouse.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-12-09 22:29:03 -0500
committerJiri Kosina <jkosina@suse.cz>2010-12-10 09:10:38 -0500
commit4291ee305e9bb0699504a66f0e2b7aefcf0512a5 (patch)
tree3996b77eb64d4f3b76a0799f30a5b2ba6cbc9ddb /drivers/hid/hid-magicmouse.c
parent5bea7660bba973dc5e8e9d92b11fb1dd5b524ebf (diff)
HID: Add and use hid_<level>: dev_<level> equivalents
Neaten current uses of dev_<level> by adding and using hid specific hid_<level> macros. Convert existing uses of dev_<level> uses to hid_<level>. Convert hid-pidff printk uses to hid_<level>. Remove err_hid and use hid_err instead. Add missing newlines to logging messages where necessary. Coalesce format strings. Add and use pr_fmt(fmt) KBUILD_MODNAME ": " fmt Other miscellaneous changes: Add const struct hid_device * argument to hid-core functions extract() and implement() so hid_<level> can be used by them. Fix bad indentation in hid-core hid_input_field function that calls extract() function above. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-magicmouse.c')
-rw-r--r--drivers/hid/hid-magicmouse.c15
1 files changed, 8 insertions, 7 deletions
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}