aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-20 19:53:56 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-20 19:53:56 -0400
commit45714104b9e85ffa199c5622e227657e99d92fb5 (patch)
treed7330853f780abd97d8bbbb47386d62359173b95 /drivers/usb/misc
parentd2b1ff7104d86e1e3cc0ab02f6aa0d96aeb2cf86 (diff)
USB: yurex.c: remove err() usage
err() was a very old USB-specific macro that I thought had gone away. This patch removes it from being used in the driver and uses dev_err() instead. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/misc')
-rw-r--r--drivers/usb/misc/yurex.c40
1 files changed, 23 insertions, 17 deletions
diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c
index 897edda42270..e0388dc0a55e 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 }
@@ -139,8 +140,9 @@ static void yurex_interrupt(struct urb *urb)
139 case 0: /*success*/ 140 case 0: /*success*/
140 break; 141 break;
141 case -EOVERFLOW: 142 case -EOVERFLOW:
142 err("%s - overflow with length %d, actual length is %d", 143 dev_err(&dev->interface->dev,
143 __func__, YUREX_BUF_SIZE, dev->urb->actual_length); 144 "%s - overflow with length %d, actual length is %d\n",
145 __func__, YUREX_BUF_SIZE, dev->urb->actual_length);
144 case -ECONNRESET: 146 case -ECONNRESET:
145 case -ENOENT: 147 case -ENOENT:
146 case -ESHUTDOWN: 148 case -ESHUTDOWN:
@@ -148,7 +150,8 @@ static void yurex_interrupt(struct urb *urb)
148 /* The device is terminated, clean up */ 150 /* The device is terminated, clean up */
149 return; 151 return;
150 default: 152 default:
151 err("%s - unknown status received: %d", __func__, status); 153 dev_err(&dev->interface->dev,
154 "%s - unknown status received: %d\n", __func__, status);
152 goto exit; 155 goto exit;
153 } 156 }
154 157
@@ -181,7 +184,7 @@ static void yurex_interrupt(struct urb *urb)
181exit: 184exit:
182 retval = usb_submit_urb(dev->urb, GFP_ATOMIC); 185 retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
183 if (retval) { 186 if (retval) {
184 err("%s - usb_submit_urb failed: %d", 187 dev_err(&dev->interface->dev, "%s - usb_submit_urb failed: %d\n",
185 __func__, retval); 188 __func__, retval);
186 } 189 }
187} 190}
@@ -198,7 +201,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
198 /* allocate memory for our device state and initialize it */ 201 /* allocate memory for our device state and initialize it */
199 dev = kzalloc(sizeof(*dev), GFP_KERNEL); 202 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
200 if (!dev) { 203 if (!dev) {
201 err("Out of memory"); 204 dev_err(&interface->dev, "Out of memory\n");
202 goto error; 205 goto error;
203 } 206 }
204 kref_init(&dev->kref); 207 kref_init(&dev->kref);
@@ -221,7 +224,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
221 } 224 }
222 if (!dev->int_in_endpointAddr) { 225 if (!dev->int_in_endpointAddr) {
223 retval = -ENODEV; 226 retval = -ENODEV;
224 err("Could not find endpoints"); 227 dev_err(&interface->dev, "Could not find endpoints\n");
225 goto error; 228 goto error;
226 } 229 }
227 230
@@ -229,7 +232,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
229 /* allocate control URB */ 232 /* allocate control URB */
230 dev->cntl_urb = usb_alloc_urb(0, GFP_KERNEL); 233 dev->cntl_urb = usb_alloc_urb(0, GFP_KERNEL);
231 if (!dev->cntl_urb) { 234 if (!dev->cntl_urb) {
232 err("Could not allocate control URB"); 235 dev_err(&interface->dev, "Could not allocate control URB\n");
233 goto error; 236 goto error;
234 } 237 }
235 238
@@ -238,7 +241,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
238 GFP_KERNEL, 241 GFP_KERNEL,
239 &dev->cntl_urb->setup_dma); 242 &dev->cntl_urb->setup_dma);
240 if (!dev->cntl_req) { 243 if (!dev->cntl_req) {
241 err("Could not allocate cntl_req"); 244 dev_err(&interface->dev, "Could not allocate cntl_req\n");
242 goto error; 245 goto error;
243 } 246 }
244 247
@@ -247,7 +250,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
247 GFP_KERNEL, 250 GFP_KERNEL,
248 &dev->cntl_urb->transfer_dma); 251 &dev->cntl_urb->transfer_dma);
249 if (!dev->cntl_buffer) { 252 if (!dev->cntl_buffer) {
250 err("Could not allocate cntl_buffer"); 253 dev_err(&interface->dev, "Could not allocate cntl_buffer\n");
251 goto error; 254 goto error;
252 } 255 }
253 256
@@ -269,7 +272,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
269 /* allocate interrupt URB */ 272 /* allocate interrupt URB */
270 dev->urb = usb_alloc_urb(0, GFP_KERNEL); 273 dev->urb = usb_alloc_urb(0, GFP_KERNEL);
271 if (!dev->urb) { 274 if (!dev->urb) {
272 err("Could not allocate URB"); 275 dev_err(&interface->dev, "Could not allocate URB\n");
273 goto error; 276 goto error;
274 } 277 }
275 278
@@ -277,7 +280,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
277 dev->int_buffer = usb_alloc_coherent(dev->udev, YUREX_BUF_SIZE, 280 dev->int_buffer = usb_alloc_coherent(dev->udev, YUREX_BUF_SIZE,
278 GFP_KERNEL, &dev->urb->transfer_dma); 281 GFP_KERNEL, &dev->urb->transfer_dma);
279 if (!dev->int_buffer) { 282 if (!dev->int_buffer) {
280 err("Could not allocate int_buffer"); 283 dev_err(&interface->dev, "Could not allocate int_buffer\n");
281 goto error; 284 goto error;
282 } 285 }
283 286
@@ -289,7 +292,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
289 dev->cntl_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; 292 dev->cntl_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
290 if (usb_submit_urb(dev->urb, GFP_KERNEL)) { 293 if (usb_submit_urb(dev->urb, GFP_KERNEL)) {
291 retval = -EIO; 294 retval = -EIO;
292 err("Could not submitting URB"); 295 dev_err(&interface->dev, "Could not submitting URB\n");
293 goto error; 296 goto error;
294 } 297 }
295 298
@@ -299,7 +302,8 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
299 /* we can register the device now, as it is ready */ 302 /* we can register the device now, as it is ready */
300 retval = usb_register_dev(interface, &yurex_class); 303 retval = usb_register_dev(interface, &yurex_class);
301 if (retval) { 304 if (retval) {
302 err("Not able to get a minor for this device."); 305 dev_err(&interface->dev,
306 "Not able to get a minor for this device.\n");
303 usb_set_intfdata(interface, NULL); 307 usb_set_intfdata(interface, NULL);
304 goto error; 308 goto error;
305 } 309 }
@@ -372,8 +376,8 @@ static int yurex_open(struct inode *inode, struct file *file)
372 376
373 interface = usb_find_interface(&yurex_driver, subminor); 377 interface = usb_find_interface(&yurex_driver, subminor);
374 if (!interface) { 378 if (!interface) {
375 err("%s - error, can't find device for minor %d", 379 printk(KERN_ERR "%s - error, can't find device for minor %d",
376 __func__, subminor); 380 __func__, subminor);
377 retval = -ENODEV; 381 retval = -ENODEV;
378 goto exit; 382 goto exit;
379 } 383 }
@@ -518,7 +522,9 @@ static ssize_t yurex_write(struct file *file, const char *user_buffer, size_t co
518 mutex_unlock(&dev->io_mutex); 522 mutex_unlock(&dev->io_mutex);
519 523
520 if (retval < 0) { 524 if (retval < 0) {
521 err("%s - failed to send bulk msg, error %d", __func__, retval); 525 dev_err(&dev->interface->dev,
526 "%s - failed to send bulk msg, error %d\n",
527 __func__, retval);
522 goto error; 528 goto error;
523 } 529 }
524 if (set && timeout) 530 if (set && timeout)