aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/usbhid/usbkbd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/usbhid/usbkbd.c')
-rw-r--r--drivers/hid/usbhid/usbkbd.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c
index a948605564fb..065817329f03 100644
--- a/drivers/hid/usbhid/usbkbd.c
+++ b/drivers/hid/usbhid/usbkbd.c
@@ -24,6 +24,8 @@
24 * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic 24 * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
25 */ 25 */
26 26
27#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
28
27#include <linux/kernel.h> 29#include <linux/kernel.h>
28#include <linux/slab.h> 30#include <linux/slab.h>
29#include <linux/module.h> 31#include <linux/module.h>
@@ -104,16 +106,18 @@ static void usb_kbd_irq(struct urb *urb)
104 if (usb_kbd_keycode[kbd->old[i]]) 106 if (usb_kbd_keycode[kbd->old[i]])
105 input_report_key(kbd->dev, usb_kbd_keycode[kbd->old[i]], 0); 107 input_report_key(kbd->dev, usb_kbd_keycode[kbd->old[i]], 0);
106 else 108 else
107 dev_info(&urb->dev->dev, 109 hid_info(urb->dev,
108 "Unknown key (scancode %#x) released.\n", kbd->old[i]); 110 "Unknown key (scancode %#x) released.\n",
111 kbd->old[i]);
109 } 112 }
110 113
111 if (kbd->new[i] > 3 && memscan(kbd->old + 2, kbd->new[i], 6) == kbd->old + 8) { 114 if (kbd->new[i] > 3 && memscan(kbd->old + 2, kbd->new[i], 6) == kbd->old + 8) {
112 if (usb_kbd_keycode[kbd->new[i]]) 115 if (usb_kbd_keycode[kbd->new[i]])
113 input_report_key(kbd->dev, usb_kbd_keycode[kbd->new[i]], 1); 116 input_report_key(kbd->dev, usb_kbd_keycode[kbd->new[i]], 1);
114 else 117 else
115 dev_info(&urb->dev->dev, 118 hid_info(urb->dev,
116 "Unknown key (scancode %#x) released.\n", kbd->new[i]); 119 "Unknown key (scancode %#x) released.\n",
120 kbd->new[i]);
117 } 121 }
118 } 122 }
119 123
@@ -124,9 +128,9 @@ static void usb_kbd_irq(struct urb *urb)
124resubmit: 128resubmit:
125 i = usb_submit_urb (urb, GFP_ATOMIC); 129 i = usb_submit_urb (urb, GFP_ATOMIC);
126 if (i) 130 if (i)
127 err_hid ("can't resubmit intr, %s-%s/input0, status %d", 131 hid_err(urb->dev, "can't resubmit intr, %s-%s/input0, status %d",
128 kbd->usbdev->bus->bus_name, 132 kbd->usbdev->bus->bus_name,
129 kbd->usbdev->devpath, i); 133 kbd->usbdev->devpath, i);
130} 134}
131 135
132static int usb_kbd_event(struct input_dev *dev, unsigned int type, 136static int usb_kbd_event(struct input_dev *dev, unsigned int type,
@@ -150,7 +154,7 @@ static int usb_kbd_event(struct input_dev *dev, unsigned int type,
150 *(kbd->leds) = kbd->newleds; 154 *(kbd->leds) = kbd->newleds;
151 kbd->led->dev = kbd->usbdev; 155 kbd->led->dev = kbd->usbdev;
152 if (usb_submit_urb(kbd->led, GFP_ATOMIC)) 156 if (usb_submit_urb(kbd->led, GFP_ATOMIC))
153 err_hid("usb_submit_urb(leds) failed"); 157 pr_err("usb_submit_urb(leds) failed\n");
154 158
155 return 0; 159 return 0;
156} 160}
@@ -160,7 +164,7 @@ static void usb_kbd_led(struct urb *urb)
160 struct usb_kbd *kbd = urb->context; 164 struct usb_kbd *kbd = urb->context;
161 165
162 if (urb->status) 166 if (urb->status)
163 dev_warn(&urb->dev->dev, "led urb status %d received\n", 167 hid_warn(urb->dev, "led urb status %d received\n",
164 urb->status); 168 urb->status);
165 169
166 if (*(kbd->leds) == kbd->newleds) 170 if (*(kbd->leds) == kbd->newleds)
@@ -169,7 +173,7 @@ static void usb_kbd_led(struct urb *urb)
169 *(kbd->leds) = kbd->newleds; 173 *(kbd->leds) = kbd->newleds;
170 kbd->led->dev = kbd->usbdev; 174 kbd->led->dev = kbd->usbdev;
171 if (usb_submit_urb(kbd->led, GFP_ATOMIC)) 175 if (usb_submit_urb(kbd->led, GFP_ATOMIC))
172 err_hid("usb_submit_urb(leds) failed"); 176 hid_err(urb->dev, "usb_submit_urb(leds) failed\n");
173} 177}
174 178
175static int usb_kbd_open(struct input_dev *dev) 179static int usb_kbd_open(struct input_dev *dev)