Commit 4a8deae2 authored by Hayes Wang's avatar Hayes Wang Committed by David S. Miller

r8152: correct some messages

 - Replace pr_warn_ratelimited() with net_ratelimit() and netdev_warn().
 - Adjust the algnment of some messages.
 - Remove the peroid.
 - Fix some messages don't have terminating newline.
Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ecca6a96
...@@ -966,10 +966,12 @@ static void read_bulk_callback(struct urb *urb) ...@@ -966,10 +966,12 @@ static void read_bulk_callback(struct urb *urb)
case -ENOENT: case -ENOENT:
return; /* the urb is in unlink state */ return; /* the urb is in unlink state */
case -ETIME: case -ETIME:
pr_warn_ratelimited("may be reset is needed?..\n"); if (net_ratelimit())
netdev_warn(netdev, "maybe reset is needed?\n");
break; break;
default: default:
pr_warn_ratelimited("Rx status %d\n", status); if (net_ratelimit())
netdev_warn(netdev, "Rx status %d\n", status);
break; break;
} }
...@@ -1002,7 +1004,8 @@ static void write_bulk_callback(struct urb *urb) ...@@ -1002,7 +1004,8 @@ static void write_bulk_callback(struct urb *urb)
stats = rtl8152_get_stats(tp->netdev); stats = rtl8152_get_stats(tp->netdev);
if (status) { if (status) {
pr_warn_ratelimited("Tx status %d\n", status); if (net_ratelimit())
netdev_warn(tp->netdev, "Tx status %d\n", status);
stats->tx_errors += agg->skb_num; stats->tx_errors += agg->skb_num;
} else { } else {
stats->tx_packets += agg->skb_num; stats->tx_packets += agg->skb_num;
...@@ -1079,7 +1082,7 @@ static void intr_callback(struct urb *urb) ...@@ -1079,7 +1082,7 @@ static void intr_callback(struct urb *urb)
netif_device_detach(tp->netdev); netif_device_detach(tp->netdev);
else if (res) else if (res)
netif_err(tp, intr, tp->netdev, netif_err(tp, intr, tp->netdev,
"can't resubmit intr, status %d\n", res); "can't resubmit intr, status %d\n", res);
} }
static inline void *rx_agg_align(void *data) static inline void *rx_agg_align(void *data)
...@@ -1490,7 +1493,7 @@ static void rtl8152_tx_timeout(struct net_device *netdev) ...@@ -1490,7 +1493,7 @@ static void rtl8152_tx_timeout(struct net_device *netdev)
struct r8152 *tp = netdev_priv(netdev); struct r8152 *tp = netdev_priv(netdev);
int i; int i;
netif_warn(tp, tx_err, netdev, "Tx timeout.\n"); netif_warn(tp, tx_err, netdev, "Tx timeout\n");
for (i = 0; i < RTL8152_MAX_TX; i++) for (i = 0; i < RTL8152_MAX_TX; i++)
usb_unlink_urb(tp->tx_info[i].urb); usb_unlink_urb(tp->tx_info[i].urb);
} }
...@@ -2284,8 +2287,8 @@ static int rtl8152_open(struct net_device *netdev) ...@@ -2284,8 +2287,8 @@ static int rtl8152_open(struct net_device *netdev)
if (res) { if (res) {
if (res == -ENODEV) if (res == -ENODEV)
netif_device_detach(tp->netdev); netif_device_detach(tp->netdev);
netif_warn(tp, ifup, netdev, netif_warn(tp, ifup, netdev, "intr_urb submit failed: %d\n",
"intr_urb submit failed: %d\n", res); res);
return res; return res;
} }
...@@ -2754,7 +2757,7 @@ static int rtl8152_probe(struct usb_interface *intf, ...@@ -2754,7 +2757,7 @@ static int rtl8152_probe(struct usb_interface *intf,
netdev = alloc_etherdev(sizeof(struct r8152)); netdev = alloc_etherdev(sizeof(struct r8152));
if (!netdev) { if (!netdev) {
dev_err(&intf->dev, "Out of memory"); dev_err(&intf->dev, "Out of memory\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -2800,11 +2803,11 @@ static int rtl8152_probe(struct usb_interface *intf, ...@@ -2800,11 +2803,11 @@ static int rtl8152_probe(struct usb_interface *intf,
ret = register_netdev(netdev); ret = register_netdev(netdev);
if (ret != 0) { if (ret != 0) {
netif_err(tp, probe, netdev, "couldn't register the device"); netif_err(tp, probe, netdev, "couldn't register the device\n");
goto out1; goto out1;
} }
netif_info(tp, probe, netdev, "%s", DRIVER_VERSION); netif_info(tp, probe, netdev, "%s\n", DRIVER_VERSION);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment