aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/irda/ksdazzle-sir.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/irda/ksdazzle-sir.c')
-rw-r--r--drivers/net/irda/ksdazzle-sir.c46
1 files changed, 28 insertions, 18 deletions
diff --git a/drivers/net/irda/ksdazzle-sir.c b/drivers/net/irda/ksdazzle-sir.c
index f8c01088eeb..5a278ab83c2 100644
--- a/drivers/net/irda/ksdazzle-sir.c
+++ b/drivers/net/irda/ksdazzle-sir.c
@@ -168,10 +168,10 @@ struct ksdazzle_cb {
168static void ksdazzle_speed_irq(struct urb *urb) 168static void ksdazzle_speed_irq(struct urb *urb)
169{ 169{
170 /* unlink, shutdown, unplug, other nasties */ 170 /* unlink, shutdown, unplug, other nasties */
171 if (urb->status != 0) { 171 if (urb->status != 0)
172 err("ksdazzle_speed_irq: urb asynchronously failed - %d", 172 dev_err(&urb->dev->dev,
173 urb->status); 173 "ksdazzle_speed_irq: urb asynchronously failed - %d\n",
174 } 174 urb->status);
175} 175}
176 176
177/* Send a control request to change speed of the dongle */ 177/* Send a control request to change speed of the dongle */
@@ -245,14 +245,16 @@ static void ksdazzle_send_irq(struct urb *urb)
245 245
246 /* in process of stopping, just drop data */ 246 /* in process of stopping, just drop data */
247 if (!netif_running(kingsun->netdev)) { 247 if (!netif_running(kingsun->netdev)) {
248 err("ksdazzle_send_irq: Network not running!"); 248 dev_err(&kingsun->usbdev->dev,
249 "ksdazzle_send_irq: Network not running!\n");
249 return; 250 return;
250 } 251 }
251 252
252 /* unlink, shutdown, unplug, other nasties */ 253 /* unlink, shutdown, unplug, other nasties */
253 if (urb->status != 0) { 254 if (urb->status != 0) {
254 err("ksdazzle_send_irq: urb asynchronously failed - %d", 255 dev_err(&kingsun->usbdev->dev,
255 urb->status); 256 "ksdazzle_send_irq: urb asynchronously failed - %d\n",
257 urb->status);
256 return; 258 return;
257 } 259 }
258 260
@@ -271,7 +273,9 @@ static void ksdazzle_send_irq(struct urb *urb)
271 if (kingsun->tx_buf_clear_used > 0) { 273 if (kingsun->tx_buf_clear_used > 0) {
272 /* There is more data to be sent */ 274 /* There is more data to be sent */
273 if ((ret = ksdazzle_submit_tx_fragment(kingsun)) != 0) { 275 if ((ret = ksdazzle_submit_tx_fragment(kingsun)) != 0) {
274 err("ksdazzle_send_irq: failed tx_urb submit: %d", ret); 276 dev_err(&kingsun->usbdev->dev,
277 "ksdazzle_send_irq: failed tx_urb submit: %d\n",
278 ret);
275 switch (ret) { 279 switch (ret) {
276 case -ENODEV: 280 case -ENODEV:
277 case -EPIPE: 281 case -EPIPE:
@@ -320,7 +324,8 @@ static netdev_tx_t ksdazzle_hard_xmit(struct sk_buff *skb,
320 kingsun->tx_buf_clear_used = wraplen; 324 kingsun->tx_buf_clear_used = wraplen;
321 325
322 if ((ret = ksdazzle_submit_tx_fragment(kingsun)) != 0) { 326 if ((ret = ksdazzle_submit_tx_fragment(kingsun)) != 0) {
323 err("ksdazzle_hard_xmit: failed tx_urb submit: %d", ret); 327 dev_err(&kingsun->usbdev->dev,
328 "ksdazzle_hard_xmit: failed tx_urb submit: %d\n", ret);
324 switch (ret) { 329 switch (ret) {
325 case -ENODEV: 330 case -ENODEV:
326 case -EPIPE: 331 case -EPIPE:
@@ -355,8 +360,9 @@ static void ksdazzle_rcv_irq(struct urb *urb)
355 360
356 /* unlink, shutdown, unplug, other nasties */ 361 /* unlink, shutdown, unplug, other nasties */
357 if (urb->status != 0) { 362 if (urb->status != 0) {
358 err("ksdazzle_rcv_irq: urb asynchronously failed - %d", 363 dev_err(&kingsun->usbdev->dev,
359 urb->status); 364 "ksdazzle_rcv_irq: urb asynchronously failed - %d\n",
365 urb->status);
360 kingsun->receiving = 0; 366 kingsun->receiving = 0;
361 return; 367 return;
362 } 368 }
@@ -430,7 +436,7 @@ static int ksdazzle_net_open(struct net_device *netdev)
430 sprintf(hwname, "usb#%d", kingsun->usbdev->devnum); 436 sprintf(hwname, "usb#%d", kingsun->usbdev->devnum);
431 kingsun->irlap = irlap_open(netdev, &kingsun->qos, hwname); 437 kingsun->irlap = irlap_open(netdev, &kingsun->qos, hwname);
432 if (!kingsun->irlap) { 438 if (!kingsun->irlap) {
433 err("ksdazzle-sir: irlap_open failed"); 439 dev_err(&kingsun->usbdev->dev, "irlap_open failed\n");
434 goto free_mem; 440 goto free_mem;
435 } 441 }
436 442
@@ -442,7 +448,7 @@ static int ksdazzle_net_open(struct net_device *netdev)
442 kingsun->rx_urb->status = 0; 448 kingsun->rx_urb->status = 0;
443 err = usb_submit_urb(kingsun->rx_urb, GFP_KERNEL); 449 err = usb_submit_urb(kingsun->rx_urb, GFP_KERNEL);
444 if (err) { 450 if (err) {
445 err("ksdazzle-sir: first urb-submit failed: %d", err); 451 dev_err(&kingsun->usbdev->dev, "first urb-submit failed: %d\n", err);
446 goto close_irlap; 452 goto close_irlap;
447 } 453 }
448 454
@@ -590,13 +596,14 @@ static int ksdazzle_probe(struct usb_interface *intf,
590 */ 596 */
591 interface = intf->cur_altsetting; 597 interface = intf->cur_altsetting;
592 if (interface->desc.bNumEndpoints != 2) { 598 if (interface->desc.bNumEndpoints != 2) {
593 err("ksdazzle: expected 2 endpoints, found %d", 599 dev_err(&intf->dev, "ksdazzle: expected 2 endpoints, found %d\n",
594 interface->desc.bNumEndpoints); 600 interface->desc.bNumEndpoints);
595 return -ENODEV; 601 return -ENODEV;
596 } 602 }
597 endpoint = &interface->endpoint[KINGSUN_EP_IN].desc; 603 endpoint = &interface->endpoint[KINGSUN_EP_IN].desc;
598 if (!usb_endpoint_is_int_in(endpoint)) { 604 if (!usb_endpoint_is_int_in(endpoint)) {
599 err("ksdazzle: endpoint 0 is not interrupt IN"); 605 dev_err(&intf->dev,
606 "ksdazzle: endpoint 0 is not interrupt IN\n");
600 return -ENODEV; 607 return -ENODEV;
601 } 608 }
602 609
@@ -604,13 +611,16 @@ static int ksdazzle_probe(struct usb_interface *intf,
604 pipe = usb_rcvintpipe(dev, ep_in); 611 pipe = usb_rcvintpipe(dev, ep_in);
605 maxp_in = usb_maxpacket(dev, pipe, usb_pipeout(pipe)); 612 maxp_in = usb_maxpacket(dev, pipe, usb_pipeout(pipe));
606 if (maxp_in > 255 || maxp_in <= 1) { 613 if (maxp_in > 255 || maxp_in <= 1) {
607 err("ksdazzle: endpoint 0 has max packet size %d not in range [2..255]", maxp_in); 614 dev_err(&intf->dev,
615 "ksdazzle: endpoint 0 has max packet size %d not in range [2..255]\n",
616 maxp_in);
608 return -ENODEV; 617 return -ENODEV;
609 } 618 }
610 619
611 endpoint = &interface->endpoint[KINGSUN_EP_OUT].desc; 620 endpoint = &interface->endpoint[KINGSUN_EP_OUT].desc;
612 if (!usb_endpoint_is_int_out(endpoint)) { 621 if (!usb_endpoint_is_int_out(endpoint)) {
613 err("ksdazzle: endpoint 1 is not interrupt OUT"); 622 dev_err(&intf->dev,
623 "ksdazzle: endpoint 1 is not interrupt OUT\n");
614 return -ENODEV; 624 return -ENODEV;
615 } 625 }
616 626