aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/catc.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-19 05:46:14 -0400
committerDavid S. Miller <davem@davemloft.net>2012-09-20 17:53:14 -0400
commit49ae25b03c8622e381e4e54d066cd4ee2dbcc3e2 (patch)
tree858136fb869d6077abcaca9abb05ef50146dc098 /drivers/net/usb/catc.c
parent4308fc58dceda40fac8a8d9c05b7cfba0a6bbed3 (diff)
USB: remove dbg() usage in USB networking drivers
The dbg() USB macro is so old, it predates me. The USB networking drivers are the last hold-out using this macro, and we want to get rid of it, so replace the usage of it with the proper netdev_dbg() or dev_dbg() (depending on the context) calls. Some places we end up using a local variable for the debug call, so also convert the other existing dev_* calls to use it as well, to save tiny amounts of code space. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb/catc.c')
-rw-r--r--drivers/net/usb/catc.c55
1 files changed, 32 insertions, 23 deletions
diff --git a/drivers/net/usb/catc.c b/drivers/net/usb/catc.c
index 26c5bebd9eca..18d9579123ea 100644
--- a/drivers/net/usb/catc.c
+++ b/drivers/net/usb/catc.c
@@ -236,7 +236,8 @@ static void catc_rx_done(struct urb *urb)
236 } 236 }
237 237
238 if (status) { 238 if (status) {
239 dbg("rx_done, status %d, length %d", status, urb->actual_length); 239 dev_dbg(&urb->dev->dev, "rx_done, status %d, length %d\n",
240 status, urb->actual_length);
240 return; 241 return;
241 } 242 }
242 243
@@ -275,10 +276,11 @@ static void catc_rx_done(struct urb *urb)
275 if (atomic_read(&catc->recq_sz)) { 276 if (atomic_read(&catc->recq_sz)) {
276 int state; 277 int state;
277 atomic_dec(&catc->recq_sz); 278 atomic_dec(&catc->recq_sz);
278 dbg("getting extra packet"); 279 netdev_dbg(catc->netdev, "getting extra packet\n");
279 urb->dev = catc->usbdev; 280 urb->dev = catc->usbdev;
280 if ((state = usb_submit_urb(urb, GFP_ATOMIC)) < 0) { 281 if ((state = usb_submit_urb(urb, GFP_ATOMIC)) < 0) {
281 dbg("submit(rx_urb) status %d", state); 282 netdev_dbg(catc->netdev,
283 "submit(rx_urb) status %d\n", state);
282 } 284 }
283 } else { 285 } else {
284 clear_bit(RX_RUNNING, &catc->flags); 286 clear_bit(RX_RUNNING, &catc->flags);
@@ -317,18 +319,20 @@ static void catc_irq_done(struct urb *urb)
317 return; 319 return;
318 /* -EPIPE: should clear the halt */ 320 /* -EPIPE: should clear the halt */
319 default: /* error */ 321 default: /* error */
320 dbg("irq_done, status %d, data %02x %02x.", status, data[0], data[1]); 322 dev_dbg(&urb->dev->dev,
323 "irq_done, status %d, data %02x %02x.\n",
324 status, data[0], data[1]);
321 goto resubmit; 325 goto resubmit;
322 } 326 }
323 327
324 if (linksts == LinkGood) { 328 if (linksts == LinkGood) {
325 netif_carrier_on(catc->netdev); 329 netif_carrier_on(catc->netdev);
326 dbg("link ok"); 330 netdev_dbg(catc->netdev, "link ok\n");
327 } 331 }
328 332
329 if (linksts == LinkBad) { 333 if (linksts == LinkBad) {
330 netif_carrier_off(catc->netdev); 334 netif_carrier_off(catc->netdev);
331 dbg("link bad"); 335 netdev_dbg(catc->netdev, "link bad\n");
332 } 336 }
333 337
334 if (hasdata) { 338 if (hasdata) {
@@ -385,7 +389,7 @@ static void catc_tx_done(struct urb *urb)
385 int r, status = urb->status; 389 int r, status = urb->status;
386 390
387 if (status == -ECONNRESET) { 391 if (status == -ECONNRESET) {
388 dbg("Tx Reset."); 392 dev_dbg(&urb->dev->dev, "Tx Reset.\n");
389 urb->status = 0; 393 urb->status = 0;
390 catc->netdev->trans_start = jiffies; 394 catc->netdev->trans_start = jiffies;
391 catc->netdev->stats.tx_errors++; 395 catc->netdev->stats.tx_errors++;
@@ -395,7 +399,8 @@ static void catc_tx_done(struct urb *urb)
395 } 399 }
396 400
397 if (status) { 401 if (status) {
398 dbg("tx_done, status %d, length %d", status, urb->actual_length); 402 dev_dbg(&urb->dev->dev, "tx_done, status %d, length %d\n",
403 status, urb->actual_length);
399 return; 404 return;
400 } 405 }
401 406
@@ -511,7 +516,8 @@ static void catc_ctrl_done(struct urb *urb)
511 int status = urb->status; 516 int status = urb->status;
512 517
513 if (status) 518 if (status)
514 dbg("ctrl_done, status %d, len %d.", status, urb->actual_length); 519 dev_dbg(&urb->dev->dev, "ctrl_done, status %d, len %d.\n",
520 status, urb->actual_length);
515 521
516 spin_lock_irqsave(&catc->ctrl_lock, flags); 522 spin_lock_irqsave(&catc->ctrl_lock, flags);
517 523
@@ -667,7 +673,9 @@ static void catc_set_multicast_list(struct net_device *netdev)
667 f5u011_mchash_async(catc, catc->multicast); 673 f5u011_mchash_async(catc, catc->multicast);
668 if (catc->rxmode[0] != rx) { 674 if (catc->rxmode[0] != rx) {
669 catc->rxmode[0] = rx; 675 catc->rxmode[0] = rx;
670 dbg("Setting RX mode to %2.2X %2.2X", catc->rxmode[0], catc->rxmode[1]); 676 netdev_dbg(catc->netdev,
677 "Setting RX mode to %2.2X %2.2X\n",
678 catc->rxmode[0], catc->rxmode[1]);
671 f5u011_rxmode_async(catc, catc->rxmode); 679 f5u011_rxmode_async(catc, catc->rxmode);
672 } 680 }
673 } 681 }
@@ -766,6 +774,7 @@ static const struct net_device_ops catc_netdev_ops = {
766 774
767static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id) 775static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id)
768{ 776{
777 struct device *dev = &intf->dev;
769 struct usb_device *usbdev = interface_to_usbdev(intf); 778 struct usb_device *usbdev = interface_to_usbdev(intf);
770 struct net_device *netdev; 779 struct net_device *netdev;
771 struct catc *catc; 780 struct catc *catc;
@@ -774,7 +783,7 @@ static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id
774 783
775 if (usb_set_interface(usbdev, 784 if (usb_set_interface(usbdev,
776 intf->altsetting->desc.bInterfaceNumber, 1)) { 785 intf->altsetting->desc.bInterfaceNumber, 1)) {
777 dev_err(&intf->dev, "Can't set altsetting 1.\n"); 786 dev_err(dev, "Can't set altsetting 1.\n");
778 return -EIO; 787 return -EIO;
779 } 788 }
780 789
@@ -817,7 +826,7 @@ static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id
817 if (le16_to_cpu(usbdev->descriptor.idVendor) == 0x0423 && 826 if (le16_to_cpu(usbdev->descriptor.idVendor) == 0x0423 &&
818 le16_to_cpu(usbdev->descriptor.idProduct) == 0xa && 827 le16_to_cpu(usbdev->descriptor.idProduct) == 0xa &&
819 le16_to_cpu(catc->usbdev->descriptor.bcdDevice) == 0x0130) { 828 le16_to_cpu(catc->usbdev->descriptor.bcdDevice) == 0x0130) {
820 dbg("Testing for f5u011"); 829 dev_dbg(dev, "Testing for f5u011\n");
821 catc->is_f5u011 = 1; 830 catc->is_f5u011 = 1;
822 atomic_set(&catc->recq_sz, 0); 831 atomic_set(&catc->recq_sz, 0);
823 pktsz = RX_PKT_SZ; 832 pktsz = RX_PKT_SZ;
@@ -838,7 +847,7 @@ static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id
838 catc->irq_buf, 2, catc_irq_done, catc, 1); 847 catc->irq_buf, 2, catc_irq_done, catc, 1);
839 848
840 if (!catc->is_f5u011) { 849 if (!catc->is_f5u011) {
841 dbg("Checking memory size\n"); 850 dev_dbg(dev, "Checking memory size\n");
842 851
843 i = 0x12345678; 852 i = 0x12345678;
844 catc_write_mem(catc, 0x7a80, &i, 4); 853 catc_write_mem(catc, 0x7a80, &i, 4);
@@ -850,7 +859,7 @@ static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id
850 case 0x12345678: 859 case 0x12345678:
851 catc_set_reg(catc, TxBufCount, 8); 860 catc_set_reg(catc, TxBufCount, 8);
852 catc_set_reg(catc, RxBufCount, 32); 861 catc_set_reg(catc, RxBufCount, 32);
853 dbg("64k Memory\n"); 862 dev_dbg(dev, "64k Memory\n");
854 break; 863 break;
855 default: 864 default:
856 dev_warn(&intf->dev, 865 dev_warn(&intf->dev,
@@ -858,49 +867,49 @@ static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id
858 case 0x87654321: 867 case 0x87654321:
859 catc_set_reg(catc, TxBufCount, 4); 868 catc_set_reg(catc, TxBufCount, 4);
860 catc_set_reg(catc, RxBufCount, 16); 869 catc_set_reg(catc, RxBufCount, 16);
861 dbg("32k Memory\n"); 870 dev_dbg(dev, "32k Memory\n");
862 break; 871 break;
863 } 872 }
864 873
865 dbg("Getting MAC from SEEROM."); 874 dev_dbg(dev, "Getting MAC from SEEROM.\n");
866 875
867 catc_get_mac(catc, netdev->dev_addr); 876 catc_get_mac(catc, netdev->dev_addr);
868 877
869 dbg("Setting MAC into registers."); 878 dev_dbg(dev, "Setting MAC into registers.\n");
870 879
871 for (i = 0; i < 6; i++) 880 for (i = 0; i < 6; i++)
872 catc_set_reg(catc, StationAddr0 - i, netdev->dev_addr[i]); 881 catc_set_reg(catc, StationAddr0 - i, netdev->dev_addr[i]);
873 882
874 dbg("Filling the multicast list."); 883 dev_dbg(dev, "Filling the multicast list.\n");
875 884
876 memset(broadcast, 0xff, 6); 885 memset(broadcast, 0xff, 6);
877 catc_multicast(broadcast, catc->multicast); 886 catc_multicast(broadcast, catc->multicast);
878 catc_multicast(netdev->dev_addr, catc->multicast); 887 catc_multicast(netdev->dev_addr, catc->multicast);
879 catc_write_mem(catc, 0xfa80, catc->multicast, 64); 888 catc_write_mem(catc, 0xfa80, catc->multicast, 64);
880 889
881 dbg("Clearing error counters."); 890 dev_dbg(dev, "Clearing error counters.\n");
882 891
883 for (i = 0; i < 8; i++) 892 for (i = 0; i < 8; i++)
884 catc_set_reg(catc, EthStats + i, 0); 893 catc_set_reg(catc, EthStats + i, 0);
885 catc->last_stats = jiffies; 894 catc->last_stats = jiffies;
886 895
887 dbg("Enabling."); 896 dev_dbg(dev, "Enabling.\n");
888 897
889 catc_set_reg(catc, MaxBurst, RX_MAX_BURST); 898 catc_set_reg(catc, MaxBurst, RX_MAX_BURST);
890 catc_set_reg(catc, OpModes, OpTxMerge | OpRxMerge | OpLenInclude | Op3MemWaits); 899 catc_set_reg(catc, OpModes, OpTxMerge | OpRxMerge | OpLenInclude | Op3MemWaits);
891 catc_set_reg(catc, LEDCtrl, LEDLink); 900 catc_set_reg(catc, LEDCtrl, LEDLink);
892 catc_set_reg(catc, RxUnit, RxEnable | RxPolarity | RxMultiCast); 901 catc_set_reg(catc, RxUnit, RxEnable | RxPolarity | RxMultiCast);
893 } else { 902 } else {
894 dbg("Performing reset\n"); 903 dev_dbg(dev, "Performing reset\n");
895 catc_reset(catc); 904 catc_reset(catc);
896 catc_get_mac(catc, netdev->dev_addr); 905 catc_get_mac(catc, netdev->dev_addr);
897 906
898 dbg("Setting RX Mode"); 907 dev_dbg(dev, "Setting RX Mode\n");
899 catc->rxmode[0] = RxEnable | RxPolarity | RxMultiCast; 908 catc->rxmode[0] = RxEnable | RxPolarity | RxMultiCast;
900 catc->rxmode[1] = 0; 909 catc->rxmode[1] = 0;
901 f5u011_rxmode(catc, catc->rxmode); 910 f5u011_rxmode(catc, catc->rxmode);
902 } 911 }
903 dbg("Init done."); 912 dev_dbg(dev, "Init done.\n");
904 printk(KERN_INFO "%s: %s USB Ethernet at usb-%s-%s, %pM.\n", 913 printk(KERN_INFO "%s: %s USB Ethernet at usb-%s-%s, %pM.\n",
905 netdev->name, (catc->is_f5u011) ? "Belkin F5U011" : "CATC EL1210A NetMate", 914 netdev->name, (catc->is_f5u011) ? "Belkin F5U011" : "CATC EL1210A NetMate",
906 usbdev->bus->bus_name, usbdev->devpath, netdev->dev_addr); 915 usbdev->bus->bus_name, usbdev->devpath, netdev->dev_addr);