diff options
Diffstat (limited to 'drivers/hid/usbhid/hid-core.c')
-rw-r--r-- | drivers/hid/usbhid/hid-core.c | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 5489eab3a6bd..276758f53ab5 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c | |||
@@ -136,10 +136,10 @@ static void hid_reset(struct work_struct *work) | |||
136 | hid_io_error(hid); | 136 | hid_io_error(hid); |
137 | break; | 137 | break; |
138 | default: | 138 | default: |
139 | err_hid("can't reset device, %s-%s/input%d, status %d", | 139 | hid_err(hid, "can't reset device, %s-%s/input%d, status %d\n", |
140 | hid_to_usb_dev(hid)->bus->bus_name, | 140 | hid_to_usb_dev(hid)->bus->bus_name, |
141 | hid_to_usb_dev(hid)->devpath, | 141 | hid_to_usb_dev(hid)->devpath, |
142 | usbhid->ifnum, rc); | 142 | usbhid->ifnum, rc); |
143 | /* FALLTHROUGH */ | 143 | /* FALLTHROUGH */ |
144 | case -EHOSTUNREACH: | 144 | case -EHOSTUNREACH: |
145 | case -ENODEV: | 145 | case -ENODEV: |
@@ -278,18 +278,18 @@ static void hid_irq_in(struct urb *urb) | |||
278 | hid_io_error(hid); | 278 | hid_io_error(hid); |
279 | return; | 279 | return; |
280 | default: /* error */ | 280 | default: /* error */ |
281 | dev_warn(&urb->dev->dev, "input irq status %d " | 281 | hid_warn(urb->dev, "input irq status %d received\n", |
282 | "received\n", urb->status); | 282 | urb->status); |
283 | } | 283 | } |
284 | 284 | ||
285 | status = usb_submit_urb(urb, GFP_ATOMIC); | 285 | status = usb_submit_urb(urb, GFP_ATOMIC); |
286 | if (status) { | 286 | if (status) { |
287 | clear_bit(HID_IN_RUNNING, &usbhid->iofl); | 287 | clear_bit(HID_IN_RUNNING, &usbhid->iofl); |
288 | if (status != -EPERM) { | 288 | if (status != -EPERM) { |
289 | err_hid("can't resubmit intr, %s-%s/input%d, status %d", | 289 | hid_err(hid, "can't resubmit intr, %s-%s/input%d, status %d\n", |
290 | hid_to_usb_dev(hid)->bus->bus_name, | 290 | hid_to_usb_dev(hid)->bus->bus_name, |
291 | hid_to_usb_dev(hid)->devpath, | 291 | hid_to_usb_dev(hid)->devpath, |
292 | usbhid->ifnum, status); | 292 | usbhid->ifnum, status); |
293 | hid_io_error(hid); | 293 | hid_io_error(hid); |
294 | } | 294 | } |
295 | } | 295 | } |
@@ -313,7 +313,7 @@ static int hid_submit_out(struct hid_device *hid) | |||
313 | dbg_hid("submitting out urb\n"); | 313 | dbg_hid("submitting out urb\n"); |
314 | 314 | ||
315 | if (usb_submit_urb(usbhid->urbout, GFP_ATOMIC)) { | 315 | if (usb_submit_urb(usbhid->urbout, GFP_ATOMIC)) { |
316 | err_hid("usb_submit_urb(out) failed"); | 316 | hid_err(hid, "usb_submit_urb(out) failed\n"); |
317 | return -1; | 317 | return -1; |
318 | } | 318 | } |
319 | usbhid->last_out = jiffies; | 319 | usbhid->last_out = jiffies; |
@@ -375,7 +375,7 @@ static int hid_submit_ctrl(struct hid_device *hid) | |||
375 | usbhid->cr->wValue, usbhid->cr->wIndex, usbhid->cr->wLength); | 375 | usbhid->cr->wValue, usbhid->cr->wIndex, usbhid->cr->wLength); |
376 | 376 | ||
377 | if (usb_submit_urb(usbhid->urbctrl, GFP_ATOMIC)) { | 377 | if (usb_submit_urb(usbhid->urbctrl, GFP_ATOMIC)) { |
378 | err_hid("usb_submit_urb(ctrl) failed"); | 378 | hid_err(hid, "usb_submit_urb(ctrl) failed\n"); |
379 | return -1; | 379 | return -1; |
380 | } | 380 | } |
381 | usbhid->last_ctrl = jiffies; | 381 | usbhid->last_ctrl = jiffies; |
@@ -413,8 +413,8 @@ static void hid_irq_out(struct urb *urb) | |||
413 | case -ENOENT: | 413 | case -ENOENT: |
414 | break; | 414 | break; |
415 | default: /* error */ | 415 | default: /* error */ |
416 | dev_warn(&urb->dev->dev, "output irq status %d " | 416 | hid_warn(urb->dev, "output irq status %d received\n", |
417 | "received\n", urb->status); | 417 | urb->status); |
418 | } | 418 | } |
419 | 419 | ||
420 | spin_lock_irqsave(&usbhid->lock, flags); | 420 | spin_lock_irqsave(&usbhid->lock, flags); |
@@ -466,8 +466,7 @@ static void hid_ctrl(struct urb *urb) | |||
466 | case -EPIPE: /* report not available */ | 466 | case -EPIPE: /* report not available */ |
467 | break; | 467 | break; |
468 | default: /* error */ | 468 | default: /* error */ |
469 | dev_warn(&urb->dev->dev, "ctrl urb status %d " | 469 | hid_warn(urb->dev, "ctrl urb status %d received\n", status); |
470 | "received\n", status); | ||
471 | } | 470 | } |
472 | 471 | ||
473 | if (unplug) | 472 | if (unplug) |
@@ -501,13 +500,13 @@ static void __usbhid_submit_report(struct hid_device *hid, struct hid_report *re | |||
501 | 500 | ||
502 | if (usbhid->urbout && dir == USB_DIR_OUT && report->type == HID_OUTPUT_REPORT) { | 501 | if (usbhid->urbout && dir == USB_DIR_OUT && report->type == HID_OUTPUT_REPORT) { |
503 | if ((head = (usbhid->outhead + 1) & (HID_OUTPUT_FIFO_SIZE - 1)) == usbhid->outtail) { | 502 | if ((head = (usbhid->outhead + 1) & (HID_OUTPUT_FIFO_SIZE - 1)) == usbhid->outtail) { |
504 | dev_warn(&hid->dev, "output queue full\n"); | 503 | hid_warn(hid, "output queue full\n"); |
505 | return; | 504 | return; |
506 | } | 505 | } |
507 | 506 | ||
508 | usbhid->out[usbhid->outhead].raw_report = kmalloc(len, GFP_ATOMIC); | 507 | usbhid->out[usbhid->outhead].raw_report = kmalloc(len, GFP_ATOMIC); |
509 | if (!usbhid->out[usbhid->outhead].raw_report) { | 508 | if (!usbhid->out[usbhid->outhead].raw_report) { |
510 | dev_warn(&hid->dev, "output queueing failed\n"); | 509 | hid_warn(hid, "output queueing failed\n"); |
511 | return; | 510 | return; |
512 | } | 511 | } |
513 | hid_output_report(report, usbhid->out[usbhid->outhead].raw_report); | 512 | hid_output_report(report, usbhid->out[usbhid->outhead].raw_report); |
@@ -532,14 +531,14 @@ static void __usbhid_submit_report(struct hid_device *hid, struct hid_report *re | |||
532 | } | 531 | } |
533 | 532 | ||
534 | if ((head = (usbhid->ctrlhead + 1) & (HID_CONTROL_FIFO_SIZE - 1)) == usbhid->ctrltail) { | 533 | if ((head = (usbhid->ctrlhead + 1) & (HID_CONTROL_FIFO_SIZE - 1)) == usbhid->ctrltail) { |
535 | dev_warn(&hid->dev, "control queue full\n"); | 534 | hid_warn(hid, "control queue full\n"); |
536 | return; | 535 | return; |
537 | } | 536 | } |
538 | 537 | ||
539 | if (dir == USB_DIR_OUT) { | 538 | if (dir == USB_DIR_OUT) { |
540 | usbhid->ctrl[usbhid->ctrlhead].raw_report = kmalloc(len, GFP_ATOMIC); | 539 | usbhid->ctrl[usbhid->ctrlhead].raw_report = kmalloc(len, GFP_ATOMIC); |
541 | if (!usbhid->ctrl[usbhid->ctrlhead].raw_report) { | 540 | if (!usbhid->ctrl[usbhid->ctrlhead].raw_report) { |
542 | dev_warn(&hid->dev, "control queueing failed\n"); | 541 | hid_warn(hid, "control queueing failed\n"); |
543 | return; | 542 | return; |
544 | } | 543 | } |
545 | hid_output_report(report, usbhid->ctrl[usbhid->ctrlhead].raw_report); | 544 | hid_output_report(report, usbhid->ctrl[usbhid->ctrlhead].raw_report); |
@@ -590,7 +589,7 @@ static int usb_hidinput_input_event(struct input_dev *dev, unsigned int type, un | |||
590 | return -1; | 589 | return -1; |
591 | 590 | ||
592 | if ((offset = hidinput_find_field(hid, type, code, &field)) == -1) { | 591 | if ((offset = hidinput_find_field(hid, type, code, &field)) == -1) { |
593 | dev_warn(&dev->dev, "event field not found\n"); | 592 | hid_warn(dev, "event field not found\n"); |
594 | return -1; | 593 | return -1; |
595 | } | 594 | } |
596 | 595 | ||
@@ -722,7 +721,7 @@ void usbhid_init_reports(struct hid_device *hid) | |||
722 | } | 721 | } |
723 | 722 | ||
724 | if (err) | 723 | if (err) |
725 | dev_warn(&hid->dev, "timeout initializing reports\n"); | 724 | hid_warn(hid, "timeout initializing reports\n"); |
726 | } | 725 | } |
727 | 726 | ||
728 | /* | 727 | /* |
@@ -1140,8 +1139,7 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id * | |||
1140 | if (usb_endpoint_is_int_in(&interface->endpoint[n].desc)) | 1139 | if (usb_endpoint_is_int_in(&interface->endpoint[n].desc)) |
1141 | has_in++; | 1140 | has_in++; |
1142 | if (!has_in) { | 1141 | if (!has_in) { |
1143 | dev_err(&intf->dev, "couldn't find an input interrupt " | 1142 | hid_err(intf, "couldn't find an input interrupt endpoint\n"); |
1144 | "endpoint\n"); | ||
1145 | return -ENODEV; | 1143 | return -ENODEV; |
1146 | } | 1144 | } |
1147 | 1145 | ||
@@ -1213,7 +1211,7 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id * | |||
1213 | ret = hid_add_device(hid); | 1211 | ret = hid_add_device(hid); |
1214 | if (ret) { | 1212 | if (ret) { |
1215 | if (ret != -ENODEV) | 1213 | if (ret != -ENODEV) |
1216 | dev_err(&intf->dev, "can't add hid device: %d\n", ret); | 1214 | hid_err(intf, "can't add hid device: %d\n", ret); |
1217 | goto err_free; | 1215 | goto err_free; |
1218 | } | 1216 | } |
1219 | 1217 | ||