diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-25 15:37:48 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-25 15:37:48 -0400 |
commit | db6b22196cc013968742d6c725f26ef6d8154048 (patch) | |
tree | 0a3a8923974adfc20b1ce8de793102071fb108b9 /drivers/net/usb | |
parent | 495f71e2b95d30198314e6e358987f8effbefcc9 (diff) |
USB: kaweth.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/net/usb')
-rw-r--r-- | drivers/net/usb/kaweth.c | 63 |
1 files changed, 37 insertions, 26 deletions
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c index df2a2cf35a99..b8baf0858515 100644 --- a/drivers/net/usb/kaweth.c +++ b/drivers/net/usb/kaweth.c | |||
@@ -400,12 +400,13 @@ static int kaweth_download_firmware(struct kaweth_device *kaweth, | |||
400 | 400 | ||
401 | ret = request_firmware(&fw, fwname, &kaweth->dev->dev); | 401 | ret = request_firmware(&fw, fwname, &kaweth->dev->dev); |
402 | if (ret) { | 402 | if (ret) { |
403 | err("Firmware request failed\n"); | 403 | dev_err(&kaweth->intf->dev, "Firmware request failed\n"); |
404 | return ret; | 404 | return ret; |
405 | } | 405 | } |
406 | 406 | ||
407 | if (fw->size > KAWETH_FIRMWARE_BUF_SIZE) { | 407 | if (fw->size > KAWETH_FIRMWARE_BUF_SIZE) { |
408 | err("Firmware too big: %zu", fw->size); | 408 | dev_err(&kaweth->intf->dev, "Firmware too big: %zu\n", |
409 | fw->size); | ||
409 | release_firmware(fw); | 410 | release_firmware(fw); |
410 | return -ENOSPC; | 411 | return -ENOSPC; |
411 | } | 412 | } |
@@ -501,9 +502,10 @@ static void kaweth_resubmit_int_urb(struct kaweth_device *kaweth, gfp_t mf) | |||
501 | } | 502 | } |
502 | 503 | ||
503 | if (status) | 504 | if (status) |
504 | err ("can't resubmit intr, %s-%s, status %d", | 505 | dev_err(&kaweth->intf->dev, |
505 | kaweth->dev->bus->bus_name, | 506 | "can't resubmit intr, %s-%s, status %d\n", |
506 | kaweth->dev->devpath, status); | 507 | kaweth->dev->bus->bus_name, |
508 | kaweth->dev->devpath, status); | ||
507 | } | 509 | } |
508 | 510 | ||
509 | static void int_callback(struct urb *u) | 511 | static void int_callback(struct urb *u) |
@@ -576,7 +578,8 @@ static int kaweth_resubmit_rx_urb(struct kaweth_device *kaweth, | |||
576 | kaweth->suspend_lowmem_rx = 1; | 578 | kaweth->suspend_lowmem_rx = 1; |
577 | schedule_delayed_work(&kaweth->lowmem_work, HZ/4); | 579 | schedule_delayed_work(&kaweth->lowmem_work, HZ/4); |
578 | } | 580 | } |
579 | err("resubmitting rx_urb %d failed", result); | 581 | dev_err(&kaweth->intf->dev, "resubmitting rx_urb %d failed\n", |
582 | result); | ||
580 | } else { | 583 | } else { |
581 | kaweth->suspend_lowmem_rx = 0; | 584 | kaweth->suspend_lowmem_rx = 0; |
582 | } | 585 | } |
@@ -634,20 +637,21 @@ static void kaweth_usb_receive(struct urb *urb) | |||
634 | spin_unlock(&kaweth->device_lock); | 637 | spin_unlock(&kaweth->device_lock); |
635 | 638 | ||
636 | if(status && status != -EREMOTEIO && count != 1) { | 639 | if(status && status != -EREMOTEIO && count != 1) { |
637 | err("%s RX status: %d count: %d packet_len: %d", | 640 | dev_err(&kaweth->intf->dev, |
638 | net->name, | 641 | "%s RX status: %d count: %d packet_len: %d\n", |
639 | status, | 642 | net->name, status, count, (int)pkt_len); |
640 | count, | ||
641 | (int)pkt_len); | ||
642 | kaweth_resubmit_rx_urb(kaweth, GFP_ATOMIC); | 643 | kaweth_resubmit_rx_urb(kaweth, GFP_ATOMIC); |
643 | return; | 644 | return; |
644 | } | 645 | } |
645 | 646 | ||
646 | if(kaweth->net && (count > 2)) { | 647 | if(kaweth->net && (count > 2)) { |
647 | if(pkt_len > (count - 2)) { | 648 | if(pkt_len > (count - 2)) { |
648 | err("Packet length too long for USB frame (pkt_len: %x, count: %x)",pkt_len, count); | 649 | dev_err(&kaweth->intf->dev, |
649 | err("Packet len & 2047: %x", pkt_len & 2047); | 650 | "Packet length too long for USB frame (pkt_len: %x, count: %x)\n", |
650 | err("Count 2: %x", count2); | 651 | pkt_len, count); |
652 | dev_err(&kaweth->intf->dev, "Packet len & 2047: %x\n", | ||
653 | pkt_len & 2047); | ||
654 | dev_err(&kaweth->intf->dev, "Count 2: %x\n", count2); | ||
651 | kaweth_resubmit_rx_urb(kaweth, GFP_ATOMIC); | 655 | kaweth_resubmit_rx_urb(kaweth, GFP_ATOMIC); |
652 | return; | 656 | return; |
653 | } | 657 | } |
@@ -686,7 +690,7 @@ static int kaweth_open(struct net_device *net) | |||
686 | 690 | ||
687 | res = usb_autopm_get_interface(kaweth->intf); | 691 | res = usb_autopm_get_interface(kaweth->intf); |
688 | if (res) { | 692 | if (res) { |
689 | err("Interface cannot be resumed."); | 693 | dev_err(&kaweth->intf->dev, "Interface cannot be resumed.\n"); |
690 | return -EIO; | 694 | return -EIO; |
691 | } | 695 | } |
692 | res = kaweth_resubmit_rx_urb(kaweth, GFP_KERNEL); | 696 | res = kaweth_resubmit_rx_urb(kaweth, GFP_KERNEL); |
@@ -907,7 +911,8 @@ static void kaweth_async_set_rx_mode(struct kaweth_device *kaweth) | |||
907 | KAWETH_CONTROL_TIMEOUT); | 911 | KAWETH_CONTROL_TIMEOUT); |
908 | 912 | ||
909 | if(result < 0) { | 913 | if(result < 0) { |
910 | err("Failed to set Rx mode: %d", result); | 914 | dev_err(&kaweth->intf->dev, "Failed to set Rx mode: %d\n", |
915 | result); | ||
911 | } | 916 | } |
912 | else { | 917 | else { |
913 | dbg("Set Rx mode to %d", packet_filter_bitmap); | 918 | dbg("Set Rx mode to %d", packet_filter_bitmap); |
@@ -1045,7 +1050,8 @@ static int kaweth_probe( | |||
1045 | "kaweth/new_code.bin", | 1050 | "kaweth/new_code.bin", |
1046 | 100, | 1051 | 100, |
1047 | 2)) < 0) { | 1052 | 2)) < 0) { |
1048 | err("Error downloading firmware (%d)", result); | 1053 | dev_err(&intf->dev, "Error downloading firmware (%d)\n", |
1054 | result); | ||
1049 | goto err_fw; | 1055 | goto err_fw; |
1050 | } | 1056 | } |
1051 | 1057 | ||
@@ -1053,7 +1059,9 @@ static int kaweth_probe( | |||
1053 | "kaweth/new_code_fix.bin", | 1059 | "kaweth/new_code_fix.bin", |
1054 | 100, | 1060 | 100, |
1055 | 3)) < 0) { | 1061 | 3)) < 0) { |
1056 | err("Error downloading firmware fix (%d)", result); | 1062 | dev_err(&intf->dev, |
1063 | "Error downloading firmware fix (%d)\n", | ||
1064 | result); | ||
1057 | goto err_fw; | 1065 | goto err_fw; |
1058 | } | 1066 | } |
1059 | 1067 | ||
@@ -1061,7 +1069,9 @@ static int kaweth_probe( | |||
1061 | "kaweth/trigger_code.bin", | 1069 | "kaweth/trigger_code.bin", |
1062 | 126, | 1070 | 126, |
1063 | 2)) < 0) { | 1071 | 2)) < 0) { |
1064 | err("Error downloading trigger code (%d)", result); | 1072 | dev_err(&intf->dev, |
1073 | "Error downloading trigger code (%d)\n", | ||
1074 | result); | ||
1065 | goto err_fw; | 1075 | goto err_fw; |
1066 | 1076 | ||
1067 | } | 1077 | } |
@@ -1070,13 +1080,14 @@ static int kaweth_probe( | |||
1070 | "kaweth/trigger_code_fix.bin", | 1080 | "kaweth/trigger_code_fix.bin", |
1071 | 126, | 1081 | 126, |
1072 | 3)) < 0) { | 1082 | 3)) < 0) { |
1073 | err("Error downloading trigger code fix (%d)", result); | 1083 | dev_err(&intf->dev, "Error downloading trigger code fix (%d)\n", result); |
1074 | goto err_fw; | 1084 | goto err_fw; |
1075 | } | 1085 | } |
1076 | 1086 | ||
1077 | 1087 | ||
1078 | if ((result = kaweth_trigger_firmware(kaweth, 126)) < 0) { | 1088 | if ((result = kaweth_trigger_firmware(kaweth, 126)) < 0) { |
1079 | err("Error triggering firmware (%d)", result); | 1089 | dev_err(&intf->dev, "Error triggering firmware (%d)\n", |
1090 | result); | ||
1080 | goto err_fw; | 1091 | goto err_fw; |
1081 | } | 1092 | } |
1082 | 1093 | ||
@@ -1091,7 +1102,7 @@ err_fw: | |||
1091 | result = kaweth_read_configuration(kaweth); | 1102 | result = kaweth_read_configuration(kaweth); |
1092 | 1103 | ||
1093 | if(result < 0) { | 1104 | if(result < 0) { |
1094 | err("Error reading configuration (%d), no net device created", result); | 1105 | dev_err(&intf->dev, "Error reading configuration (%d), no net device created\n", result); |
1095 | goto err_free_netdev; | 1106 | goto err_free_netdev; |
1096 | } | 1107 | } |
1097 | 1108 | ||
@@ -1103,7 +1114,7 @@ err_fw: | |||
1103 | if(!memcmp(&kaweth->configuration.hw_addr, | 1114 | if(!memcmp(&kaweth->configuration.hw_addr, |
1104 | &bcast_addr, | 1115 | &bcast_addr, |
1105 | sizeof(bcast_addr))) { | 1116 | sizeof(bcast_addr))) { |
1106 | err("Firmware not functioning properly, no net device created"); | 1117 | dev_err(&intf->dev, "Firmware not functioning properly, no net device created\n"); |
1107 | goto err_free_netdev; | 1118 | goto err_free_netdev; |
1108 | } | 1119 | } |
1109 | 1120 | ||
@@ -1113,7 +1124,7 @@ err_fw: | |||
1113 | } | 1124 | } |
1114 | 1125 | ||
1115 | if(kaweth_set_sofs_wait(kaweth, KAWETH_SOFS_TO_WAIT) < 0) { | 1126 | if(kaweth_set_sofs_wait(kaweth, KAWETH_SOFS_TO_WAIT) < 0) { |
1116 | err("Error setting SOFS wait"); | 1127 | dev_err(&intf->dev, "Error setting SOFS wait\n"); |
1117 | goto err_free_netdev; | 1128 | goto err_free_netdev; |
1118 | } | 1129 | } |
1119 | 1130 | ||
@@ -1123,7 +1134,7 @@ err_fw: | |||
1123 | KAWETH_PACKET_FILTER_MULTICAST); | 1134 | KAWETH_PACKET_FILTER_MULTICAST); |
1124 | 1135 | ||
1125 | if(result < 0) { | 1136 | if(result < 0) { |
1126 | err("Error setting receive filter"); | 1137 | dev_err(&intf->dev, "Error setting receive filter\n"); |
1127 | goto err_free_netdev; | 1138 | goto err_free_netdev; |
1128 | } | 1139 | } |
1129 | 1140 | ||
@@ -1175,7 +1186,7 @@ err_fw: | |||
1175 | 1186 | ||
1176 | SET_NETDEV_DEV(netdev, &intf->dev); | 1187 | SET_NETDEV_DEV(netdev, &intf->dev); |
1177 | if (register_netdev(netdev) != 0) { | 1188 | if (register_netdev(netdev) != 0) { |
1178 | err("Error registering netdev."); | 1189 | dev_err(&intf->dev, "Error registering netdev.\n"); |
1179 | goto err_intfdata; | 1190 | goto err_intfdata; |
1180 | } | 1191 | } |
1181 | 1192 | ||