summaryrefslogtreecommitdiffstats
path: root/drivers/staging/hv/netvsc_drv.c
diff options
context:
space:
mode:
authorHank Janssen2011-03-29 22:58:48 +0200
committerGreg Kroah-Hartman2011-04-05 07:03:07 +0200
commiteb335bc42781ddc19da98a3c74add1013ba08da2 (patch)
tree884f3071a5d4c97105d6830123165439f8f994b2 /drivers/staging/hv/netvsc_drv.c
parentstaging: hv: Replace DPRINT with natives in hv_vmbus (diff)
downloadkernel-qcow2-linux-eb335bc42781ddc19da98a3c74add1013ba08da2.tar.gz
kernel-qcow2-linux-eb335bc42781ddc19da98a3c74add1013ba08da2.tar.xz
kernel-qcow2-linux-eb335bc42781ddc19da98a3c74add1013ba08da2.zip
staging: hv: replace DPRINT with native primitives in hv_netvsc
Replace all remaining DPRINT calls with their native dev_ and netvsc_ calls. And also change some of the verbiage to be more useful. rndis_filter has a few remaining DPRINT calls in it that will be removed in a future patch because the debug will be implemented differently. Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/hv/netvsc_drv.c')
-rw-r--r--drivers/staging/hv/netvsc_drv.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index 1772a194ef48..54a203ba1de5 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -18,6 +18,8 @@
* Haiyang Zhang <haiyangz@microsoft.com>
* Hank Janssen <hjanssen@microsoft.com>
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/init.h>
#include <linux/module.h>
#include <linux/highmem.h>
@@ -77,14 +79,14 @@ static int netvsc_open(struct net_device *net)
/* Open up the device */
ret = rndis_filter_open(device_obj);
if (ret != 0) {
- DPRINT_ERR(NETVSC_DRV,
- "unable to open device (ret %d).", ret);
+ netdev_err(net, "unable to open device (ret %d).\n",
+ ret);
return ret;
}
netif_start_queue(net);
} else {
- DPRINT_ERR(NETVSC_DRV, "unable to open device...link is down.");
+ netdev_err(net, "unable to open device...link is down.\n");
}
return ret;
@@ -100,7 +102,7 @@ static int netvsc_close(struct net_device *net)
ret = rndis_filter_close(device_obj);
if (ret != 0)
- DPRINT_ERR(NETVSC_DRV, "unable to close device (ret %d).", ret);
+ netdev_err(net, "unable to close device (ret %d).\n", ret);
return ret;
}
@@ -147,7 +149,7 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
net_drv_obj->req_ext_size, GFP_ATOMIC);
if (!packet) {
/* out of memory, silently drop packet */
- DPRINT_ERR(NETVSC_DRV, "unable to allocate hv_netvsc_packet");
+ netdev_err(net, "unable to allocate hv_netvsc_packet\n");
dev_kfree_skb(skb);
net->stats.tx_dropped++;
@@ -214,8 +216,8 @@ static void netvsc_linkstatus_callback(struct hv_device *device_obj,
struct net_device *net = dev_get_drvdata(&device_obj->device);
if (!net) {
- DPRINT_ERR(NETVSC_DRV, "got link status but net device "
- "not initialized yet");
+ netdev_err(net, "got link status but net device "
+ "not initialized yet\n");
return;
}
@@ -243,8 +245,8 @@ static int netvsc_recv_callback(struct hv_device *device_obj,
unsigned long flags;
if (!net) {
- DPRINT_ERR(NETVSC_DRV, "got receive callback but net device "
- "not initialized yet");
+ netdev_err(net, "got receive callback but net device"
+ " not initialized yet\n");
return 0;
}
@@ -350,8 +352,7 @@ static int netvsc_probe(struct device *device)
free_netdev(net);
dev_set_drvdata(device, NULL);
- DPRINT_ERR(NETVSC_DRV, "unable to add netvsc device (ret %d)",
- ret);
+ netdev_err(net, "unable to add netvsc device (ret %d)\n", ret);
return ret;
}
@@ -397,7 +398,7 @@ static int netvsc_remove(struct device *device)
int ret;
if (net == NULL) {
- DPRINT_INFO(NETVSC, "no net device to remove");
+ dev_err(device, "No net device to remove\n");
return 0;
}
@@ -417,7 +418,7 @@ static int netvsc_remove(struct device *device)
ret = net_drv_obj->base.dev_rm(device_obj);
if (ret != 0) {
/* TODO: */
- DPRINT_ERR(NETVSC, "unable to remove vsc device (ret %d)", ret);
+ netdev_err(net, "unable to remove vsc device (ret %d)\n", ret);
}
free_netdev(net);
@@ -446,16 +447,13 @@ static void netvsc_drv_exit(void)
/* Get the device */
ret = driver_for_each_device(&drv->driver, NULL,
&current_dev, netvsc_drv_exit_cb);
- if (ret)
- DPRINT_WARN(NETVSC_DRV,
- "driver_for_each_device returned %d", ret);
if (current_dev == NULL)
break;
/* Initiate removal from the top-down */
- DPRINT_INFO(NETVSC_DRV, "unregistering device (%p)...",
- current_dev);
+ dev_err(current_dev, "unregistering device (%s)...\n",
+ dev_name(current_dev));
device_unregister(current_dev);
}
@@ -509,7 +507,7 @@ MODULE_DEVICE_TABLE(dmi, hv_netvsc_dmi_table);
static int __init netvsc_init(void)
{
- DPRINT_INFO(NETVSC_DRV, "Netvsc initializing....");
+ pr_info("initializing....");
if (!dmi_check_system(hv_netvsc_dmi_table))
return -ENODEV;