diff options
Diffstat (limited to 'drivers/usb/misc/yurex.c')
-rw-r--r-- | drivers/usb/misc/yurex.c | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c index 70201462e19c..1d8ad4c5b99e 100644 --- a/drivers/usb/misc/yurex.c +++ b/drivers/usb/misc/yurex.c | |||
@@ -83,7 +83,8 @@ static void yurex_control_callback(struct urb *urb) | |||
83 | int status = urb->status; | 83 | int status = urb->status; |
84 | 84 | ||
85 | if (status) { | 85 | if (status) { |
86 | err("%s - control failed: %d\n", __func__, status); | 86 | dev_err(&urb->dev->dev, "%s - control failed: %d\n", |
87 | __func__, status); | ||
87 | wake_up_interruptible(&dev->waitq); | 88 | wake_up_interruptible(&dev->waitq); |
88 | return; | 89 | return; |
89 | } | 90 | } |
@@ -137,8 +138,9 @@ static void yurex_interrupt(struct urb *urb) | |||
137 | case 0: /*success*/ | 138 | case 0: /*success*/ |
138 | break; | 139 | break; |
139 | case -EOVERFLOW: | 140 | case -EOVERFLOW: |
140 | err("%s - overflow with length %d, actual length is %d", | 141 | dev_err(&dev->interface->dev, |
141 | __func__, YUREX_BUF_SIZE, dev->urb->actual_length); | 142 | "%s - overflow with length %d, actual length is %d\n", |
143 | __func__, YUREX_BUF_SIZE, dev->urb->actual_length); | ||
142 | case -ECONNRESET: | 144 | case -ECONNRESET: |
143 | case -ENOENT: | 145 | case -ENOENT: |
144 | case -ESHUTDOWN: | 146 | case -ESHUTDOWN: |
@@ -146,7 +148,8 @@ static void yurex_interrupt(struct urb *urb) | |||
146 | /* The device is terminated, clean up */ | 148 | /* The device is terminated, clean up */ |
147 | return; | 149 | return; |
148 | default: | 150 | default: |
149 | err("%s - unknown status received: %d", __func__, status); | 151 | dev_err(&dev->interface->dev, |
152 | "%s - unknown status received: %d\n", __func__, status); | ||
150 | goto exit; | 153 | goto exit; |
151 | } | 154 | } |
152 | 155 | ||
@@ -179,7 +182,7 @@ static void yurex_interrupt(struct urb *urb) | |||
179 | exit: | 182 | exit: |
180 | retval = usb_submit_urb(dev->urb, GFP_ATOMIC); | 183 | retval = usb_submit_urb(dev->urb, GFP_ATOMIC); |
181 | if (retval) { | 184 | if (retval) { |
182 | err("%s - usb_submit_urb failed: %d", | 185 | dev_err(&dev->interface->dev, "%s - usb_submit_urb failed: %d\n", |
183 | __func__, retval); | 186 | __func__, retval); |
184 | } | 187 | } |
185 | } | 188 | } |
@@ -196,7 +199,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ | |||
196 | /* allocate memory for our device state and initialize it */ | 199 | /* allocate memory for our device state and initialize it */ |
197 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); | 200 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); |
198 | if (!dev) { | 201 | if (!dev) { |
199 | err("Out of memory"); | 202 | dev_err(&interface->dev, "Out of memory\n"); |
200 | goto error; | 203 | goto error; |
201 | } | 204 | } |
202 | kref_init(&dev->kref); | 205 | kref_init(&dev->kref); |
@@ -219,7 +222,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ | |||
219 | } | 222 | } |
220 | if (!dev->int_in_endpointAddr) { | 223 | if (!dev->int_in_endpointAddr) { |
221 | retval = -ENODEV; | 224 | retval = -ENODEV; |
222 | err("Could not find endpoints"); | 225 | dev_err(&interface->dev, "Could not find endpoints\n"); |
223 | goto error; | 226 | goto error; |
224 | } | 227 | } |
225 | 228 | ||
@@ -227,14 +230,14 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ | |||
227 | /* allocate control URB */ | 230 | /* allocate control URB */ |
228 | dev->cntl_urb = usb_alloc_urb(0, GFP_KERNEL); | 231 | dev->cntl_urb = usb_alloc_urb(0, GFP_KERNEL); |
229 | if (!dev->cntl_urb) { | 232 | if (!dev->cntl_urb) { |
230 | err("Could not allocate control URB"); | 233 | dev_err(&interface->dev, "Could not allocate control URB\n"); |
231 | goto error; | 234 | goto error; |
232 | } | 235 | } |
233 | 236 | ||
234 | /* allocate buffer for control req */ | 237 | /* allocate buffer for control req */ |
235 | dev->cntl_req = kmalloc(YUREX_BUF_SIZE, GFP_KERNEL); | 238 | dev->cntl_req = kmalloc(YUREX_BUF_SIZE, GFP_KERNEL); |
236 | if (!dev->cntl_req) { | 239 | if (!dev->cntl_req) { |
237 | err("Could not allocate cntl_req"); | 240 | dev_err(&interface->dev, "Could not allocate cntl_req\n"); |
238 | goto error; | 241 | goto error; |
239 | } | 242 | } |
240 | 243 | ||
@@ -243,7 +246,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ | |||
243 | GFP_KERNEL, | 246 | GFP_KERNEL, |
244 | &dev->cntl_urb->transfer_dma); | 247 | &dev->cntl_urb->transfer_dma); |
245 | if (!dev->cntl_buffer) { | 248 | if (!dev->cntl_buffer) { |
246 | err("Could not allocate cntl_buffer"); | 249 | dev_err(&interface->dev, "Could not allocate cntl_buffer\n"); |
247 | goto error; | 250 | goto error; |
248 | } | 251 | } |
249 | 252 | ||
@@ -265,7 +268,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ | |||
265 | /* allocate interrupt URB */ | 268 | /* allocate interrupt URB */ |
266 | dev->urb = usb_alloc_urb(0, GFP_KERNEL); | 269 | dev->urb = usb_alloc_urb(0, GFP_KERNEL); |
267 | if (!dev->urb) { | 270 | if (!dev->urb) { |
268 | err("Could not allocate URB"); | 271 | dev_err(&interface->dev, "Could not allocate URB\n"); |
269 | goto error; | 272 | goto error; |
270 | } | 273 | } |
271 | 274 | ||
@@ -273,7 +276,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ | |||
273 | dev->int_buffer = usb_alloc_coherent(dev->udev, YUREX_BUF_SIZE, | 276 | dev->int_buffer = usb_alloc_coherent(dev->udev, YUREX_BUF_SIZE, |
274 | GFP_KERNEL, &dev->urb->transfer_dma); | 277 | GFP_KERNEL, &dev->urb->transfer_dma); |
275 | if (!dev->int_buffer) { | 278 | if (!dev->int_buffer) { |
276 | err("Could not allocate int_buffer"); | 279 | dev_err(&interface->dev, "Could not allocate int_buffer\n"); |
277 | goto error; | 280 | goto error; |
278 | } | 281 | } |
279 | 282 | ||
@@ -285,7 +288,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ | |||
285 | dev->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; | 288 | dev->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; |
286 | if (usb_submit_urb(dev->urb, GFP_KERNEL)) { | 289 | if (usb_submit_urb(dev->urb, GFP_KERNEL)) { |
287 | retval = -EIO; | 290 | retval = -EIO; |
288 | err("Could not submitting URB"); | 291 | dev_err(&interface->dev, "Could not submitting URB\n"); |
289 | goto error; | 292 | goto error; |
290 | } | 293 | } |
291 | 294 | ||
@@ -295,7 +298,8 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_ | |||
295 | /* we can register the device now, as it is ready */ | 298 | /* we can register the device now, as it is ready */ |
296 | retval = usb_register_dev(interface, &yurex_class); | 299 | retval = usb_register_dev(interface, &yurex_class); |
297 | if (retval) { | 300 | if (retval) { |
298 | err("Not able to get a minor for this device."); | 301 | dev_err(&interface->dev, |
302 | "Not able to get a minor for this device.\n"); | ||
299 | usb_set_intfdata(interface, NULL); | 303 | usb_set_intfdata(interface, NULL); |
300 | goto error; | 304 | goto error; |
301 | } | 305 | } |
@@ -368,8 +372,8 @@ static int yurex_open(struct inode *inode, struct file *file) | |||
368 | 372 | ||
369 | interface = usb_find_interface(&yurex_driver, subminor); | 373 | interface = usb_find_interface(&yurex_driver, subminor); |
370 | if (!interface) { | 374 | if (!interface) { |
371 | err("%s - error, can't find device for minor %d", | 375 | printk(KERN_ERR "%s - error, can't find device for minor %d", |
372 | __func__, subminor); | 376 | __func__, subminor); |
373 | retval = -ENODEV; | 377 | retval = -ENODEV; |
374 | goto exit; | 378 | goto exit; |
375 | } | 379 | } |
@@ -514,7 +518,9 @@ static ssize_t yurex_write(struct file *file, const char *user_buffer, size_t co | |||
514 | mutex_unlock(&dev->io_mutex); | 518 | mutex_unlock(&dev->io_mutex); |
515 | 519 | ||
516 | if (retval < 0) { | 520 | if (retval < 0) { |
517 | err("%s - failed to send bulk msg, error %d", __func__, retval); | 521 | dev_err(&dev->interface->dev, |
522 | "%s - failed to send bulk msg, error %d\n", | ||
523 | __func__, retval); | ||
518 | goto error; | 524 | goto error; |
519 | } | 525 | } |
520 | if (set && timeout) | 526 | if (set && timeout) |