Commit 79575019 authored by Jiri Slaby's avatar Jiri Slaby Committed by Jiri Kosina

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: default avatarJiri Slaby <jirislaby@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 76483cf4
...@@ -71,18 +71,18 @@ int lg2ff_init(struct hid_device *hid) ...@@ -71,18 +71,18 @@ int lg2ff_init(struct hid_device *hid)
int error; int error;
if (list_empty(report_list)) { if (list_empty(report_list)) {
printk(KERN_ERR "hid-lg2ff: no output report found\n"); dev_err(&hid->dev, "no output report found\n");
return -ENODEV; return -ENODEV;
} }
report = list_entry(report_list->next, struct hid_report, list); report = list_entry(report_list->next, struct hid_report, list);
if (report->maxfield < 1) { if (report->maxfield < 1) {
printk(KERN_ERR "hid-lg2ff: output report is empty\n"); dev_err(&hid->dev, "output report is empty\n");
return -ENODEV; return -ENODEV;
} }
if (report->field[0]->report_count < 7) { if (report->field[0]->report_count < 7) {
printk(KERN_ERR "hid-lg2ff: not enough values in the field\n"); dev_err(&hid->dev, "not enough values in the field\n");
return -ENODEV; return -ENODEV;
} }
...@@ -109,7 +109,7 @@ int lg2ff_init(struct hid_device *hid) ...@@ -109,7 +109,7 @@ int lg2ff_init(struct hid_device *hid)
usbhid_submit_report(hid, report, USB_DIR_OUT); usbhid_submit_report(hid, report, USB_DIR_OUT);
printk(KERN_INFO "Force feedback for Logitech Rumblepad 2 by " dev_info(&hid->dev, "Force feedback for Logitech Rumblepad 2 by "
"Anssi Hannula <anssi.hannula@gmail.com>\n"); "Anssi Hannula <anssi.hannula@gmail.com>\n");
return 0; return 0;
......
...@@ -90,7 +90,7 @@ static int plff_init(struct hid_device *hid) ...@@ -90,7 +90,7 @@ static int plff_init(struct hid_device *hid)
currently unknown. */ currently unknown. */
if (list_empty(report_list)) { if (list_empty(report_list)) {
printk(KERN_ERR "hid-plff: no output reports found\n"); dev_err(&hid->dev, "no output reports found\n");
return -ENODEV; return -ENODEV;
} }
...@@ -99,18 +99,19 @@ static int plff_init(struct hid_device *hid) ...@@ -99,18 +99,19 @@ static int plff_init(struct hid_device *hid)
report_ptr = report_ptr->next; report_ptr = report_ptr->next;
if (report_ptr == report_list) { if (report_ptr == report_list) {
printk(KERN_ERR "hid-plff: required output report is missing\n"); dev_err(&hid->dev, "required output report is "
"missing\n");
return -ENODEV; return -ENODEV;
} }
report = list_entry(report_ptr, struct hid_report, list); report = list_entry(report_ptr, struct hid_report, list);
if (report->maxfield < 1) { if (report->maxfield < 1) {
printk(KERN_ERR "hid-plff: no fields in the report\n"); dev_err(&hid->dev, "no fields in the report\n");
return -ENODEV; return -ENODEV;
} }
if (report->field[0]->report_count < 4) { if (report->field[0]->report_count < 4) {
printk(KERN_ERR "hid-plff: not enough values in the field\n"); dev_err(&hid->dev, "not enough values in the field\n");
return -ENODEV; return -ENODEV;
} }
...@@ -136,7 +137,7 @@ static int plff_init(struct hid_device *hid) ...@@ -136,7 +137,7 @@ static int plff_init(struct hid_device *hid)
usbhid_submit_report(hid, plff->report, USB_DIR_OUT); usbhid_submit_report(hid, plff->report, USB_DIR_OUT);
} }
printk(KERN_INFO "hid-plff: Force feedback for PantherLord/GreenAsia " dev_info(&hid->dev, "Force feedback for PantherLord/GreenAsia "
"devices by Anssi Hannula <anssi.hannula@gmail.com>\n"); "devices by Anssi Hannula <anssi.hannula@gmail.com>\n");
return 0; return 0;
......
...@@ -149,27 +149,28 @@ static int tmff_init(struct hid_device *hid, const signed short *ff_bits) ...@@ -149,27 +149,28 @@ static int tmff_init(struct hid_device *hid, const signed short *ff_bits)
switch (field->usage[0].hid) { switch (field->usage[0].hid) {
case THRUSTMASTER_USAGE_FF: case THRUSTMASTER_USAGE_FF:
if (field->report_count < 2) { if (field->report_count < 2) {
warn("ignoring FF field with " dev_warn(&hid->dev, "ignoring FF field "
"report_count < 2"); "with report_count < 2\n");
continue; continue;
} }
if (field->logical_maximum == if (field->logical_maximum ==
field->logical_minimum) { field->logical_minimum) {
warn("ignoring FF field with " dev_warn(&hid->dev, "ignoring FF field "
"logical_maximum == " "with logical_maximum "
"logical_minimum"); "== logical_minimum\n");
continue; continue;
} }
if (tmff->report && tmff->report != report) { if (tmff->report && tmff->report != report) {
warn("ignoring FF field in other " dev_warn(&hid->dev, "ignoring FF field "
"report"); "in other report\n");
continue; continue;
} }
if (tmff->ff_field && tmff->ff_field != field) { if (tmff->ff_field && tmff->ff_field != field) {
warn("ignoring duplicate FF field"); dev_warn(&hid->dev, "ignoring "
"duplicate FF field\n");
continue; continue;
} }
...@@ -182,7 +183,8 @@ static int tmff_init(struct hid_device *hid, const signed short *ff_bits) ...@@ -182,7 +183,8 @@ static int tmff_init(struct hid_device *hid, const signed short *ff_bits)
break; break;
default: default:
warn("ignoring unknown output usage %08x", dev_warn(&hid->dev, "ignoring unknown output "
"usage %08x\n",
field->usage[0].hid); field->usage[0].hid);
continue; continue;
} }
...@@ -190,7 +192,7 @@ static int tmff_init(struct hid_device *hid, const signed short *ff_bits) ...@@ -190,7 +192,7 @@ static int tmff_init(struct hid_device *hid, const signed short *ff_bits)
} }
if (!tmff->report) { if (!tmff->report) {
err("cant find FF field in output reports\n"); dev_err(&hid->dev, "can't find FF field in output reports\n");
error = -ENODEV; error = -ENODEV;
goto fail; goto fail;
} }
...@@ -199,8 +201,8 @@ static int tmff_init(struct hid_device *hid, const signed short *ff_bits) ...@@ -199,8 +201,8 @@ static int tmff_init(struct hid_device *hid, const signed short *ff_bits)
if (error) if (error)
goto fail; goto fail;
info("Force feedback for ThrustMaster devices by Zinx Verituse " dev_info(&hid->dev, "force feedback for ThrustMaster devices by Zinx "
"<zinx@epicsol.org>"); "Verituse <zinx@epicsol.org>");
return 0; return 0;
fail: fail:
......
...@@ -73,14 +73,14 @@ static int zpff_init(struct hid_device *hid) ...@@ -73,14 +73,14 @@ static int zpff_init(struct hid_device *hid)
int error; int error;
if (list_empty(report_list)) { if (list_empty(report_list)) {
printk(KERN_ERR "hid-zpff: no output report found\n"); dev_err(&hid->dev, "no output report found\n");
return -ENODEV; return -ENODEV;
} }
report = list_entry(report_list->next, struct hid_report, list); report = list_entry(report_list->next, struct hid_report, list);
if (report->maxfield < 4) { if (report->maxfield < 4) {
printk(KERN_ERR "hid-zpff: not enough fields in report\n"); dev_err(&hid->dev, "not enough fields in report\n");
return -ENODEV; return -ENODEV;
} }
...@@ -103,7 +103,7 @@ static int zpff_init(struct hid_device *hid) ...@@ -103,7 +103,7 @@ static int zpff_init(struct hid_device *hid)
zpff->report->field[3]->value[0] = 0x00; zpff->report->field[3]->value[0] = 0x00;
usbhid_submit_report(hid, zpff->report, USB_DIR_OUT); usbhid_submit_report(hid, zpff->report, USB_DIR_OUT);
printk(KERN_INFO "Force feedback for Zeroplus based devices by " dev_info(&hid->dev, "force feedback for Zeroplus based devices by "
"Anssi Hannula <anssi.hannula@gmail.com>\n"); "Anssi Hannula <anssi.hannula@gmail.com>\n");
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment