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-sjoy.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-sjoy.c')
-rw-r--r-- | drivers/hid/hid-sjoy.c | 16 |
1 files changed, 7 insertions, 9 deletions
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 | ||