Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jiri Slaby and committed by
Jiri Kosina
79575019 76483cf4

+27 -24
+4 -4
drivers/hid/hid-lg2ff.c
··· 71 71 int error; 72 72 73 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 75 return -ENODEV; 76 76 } 77 77 78 78 report = list_entry(report_list->next, struct hid_report, list); 79 79 80 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 82 return -ENODEV; 83 83 } 84 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 86 return -ENODEV; 87 87 } 88 88 ··· 109 109 110 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 113 "Anssi Hannula <anssi.hannula@gmail.com>\n"); 114 114 115 115 return 0;
+6 -5
drivers/hid/hid-pl.c
··· 90 90 currently unknown. */ 91 91 92 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 94 return -ENODEV; 95 95 } 96 96 ··· 99 99 report_ptr = report_ptr->next; 100 100 101 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 104 return -ENODEV; 104 105 } 105 106 106 107 report = list_entry(report_ptr, struct hid_report, list); 107 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 110 return -ENODEV; 110 111 } 111 112 112 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 115 return -ENODEV; 115 116 } 116 117 ··· 137 136 usbhid_submit_report(hid, plff->report, USB_DIR_OUT); 138 137 } 139 138 140 - printk(KERN_INFO "hid-plff: Force feedback for PantherLord/GreenAsia " 139 + dev_info(&hid->dev, "Force feedback for PantherLord/GreenAsia " 141 140 "devices by Anssi Hannula <anssi.hannula@gmail.com>\n"); 142 141 143 142 return 0;
+14 -12
drivers/hid/hid-tmff.c
··· 149 149 switch (field->usage[0].hid) { 150 150 case THRUSTMASTER_USAGE_FF: 151 151 if (field->report_count < 2) { 152 - warn("ignoring FF field with " 153 - "report_count < 2"); 152 + dev_warn(&hid->dev, "ignoring FF field " 153 + "with report_count < 2\n"); 154 154 continue; 155 155 } 156 156 157 157 if (field->logical_maximum == 158 158 field->logical_minimum) { 159 - warn("ignoring FF field with " 160 - "logical_maximum == " 161 - "logical_minimum"); 159 + dev_warn(&hid->dev, "ignoring FF field " 160 + "with logical_maximum " 161 + "== logical_minimum\n"); 162 162 continue; 163 163 } 164 164 165 165 if (tmff->report && tmff->report != report) { 166 - warn("ignoring FF field in other " 167 - "report"); 166 + dev_warn(&hid->dev, "ignoring FF field " 167 + "in other report\n"); 168 168 continue; 169 169 } 170 170 171 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 174 continue; 174 175 } 175 176 ··· 183 182 break; 184 183 185 184 default: 186 - warn("ignoring unknown output usage %08x", 185 + dev_warn(&hid->dev, "ignoring unknown output " 186 + "usage %08x\n", 187 187 field->usage[0].hid); 188 188 continue; 189 189 } ··· 192 190 } 193 191 194 192 if (!tmff->report) { 195 - err("cant find FF field in output reports\n"); 193 + dev_err(&hid->dev, "can't find FF field in output reports\n"); 196 194 error = -ENODEV; 197 195 goto fail; 198 196 } ··· 201 199 if (error) 202 200 goto fail; 203 201 204 - info("Force feedback for ThrustMaster devices by Zinx Verituse " 205 - "<zinx@epicsol.org>"); 202 + dev_info(&hid->dev, "force feedback for ThrustMaster devices by Zinx " 203 + "Verituse <zinx@epicsol.org>"); 206 204 return 0; 207 205 208 206 fail:
+3 -3
drivers/hid/hid-zpff.c
··· 73 73 int error; 74 74 75 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 77 return -ENODEV; 78 78 } 79 79 80 80 report = list_entry(report_list->next, struct hid_report, list); 81 81 82 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 84 return -ENODEV; 85 85 } 86 86 ··· 103 103 zpff->report->field[3]->value[0] = 0x00; 104 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 107 "Anssi Hannula <anssi.hannula@gmail.com>\n"); 108 108 109 109 return 0;