Staging: hv: netvsc: fix up driver_data usage

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Wednesday, September 16, 2009 - 9:04 am

Gitweb:     http://git.kernel.org/linus/621d7fb7597e8cc2e24e6b0ca67118b452675d90
Commit:     621d7fb7597e8cc2e24e6b0ca67118b452675d90
Parent:     511bda8fe1607ab2e4b2f3b008b7cfbffc2720b1
Author:     Greg Kroah-Hartman <gregkh@suse.de>
AuthorDate: Fri Jul 24 11:00:39 2009 -0700
Committer:  Greg Kroah-Hartman <gregkh@suse.de>
CommitDate: Tue Sep 15 12:01:45 2009 -0700

    Staging: hv: netvsc: fix up driver_data usage
    
    driver_data is gone now from struct device, so use the proper functions
    to access it instead.
    
    Thanks to Bill Pemberton for pointing out this build error.
    
    Cc: Bill Pemberton <wfp5p@viridian.itc.Virginia.EDU>
    Cc: Hank Janssen <hjanssen@microsoft.com>
    Cc: Haiyang Zhang <haiyangz@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/staging/hv/netvsc_drv.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index 71931f5..cd3f3b5 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -209,14 +209,14 @@ static int netvsc_probe(struct device *device)
 
 	net_device_ctx = netdev_priv(net);
 	net_device_ctx->device_ctx = device_ctx;
-	device->driver_data = net;
+	dev_set_drvdata(device, net);
 
 	// Notify the netvsc driver of the new device
 	ret = net_drv_obj->Base.OnDeviceAdd(device_obj, (void*)&device_info);
 	if (ret != 0)
 	{
 		free_netdev(net);
-		device->driver_data = NULL;
+		dev_set_drvdata(device, NULL);
 
 		DPRINT_ERR(NETVSC_DRV, "unable to add netvsc device (ret %d)", ret);
 		return ret;
@@ -262,7 +262,7 @@ static int netvsc_remove(struct device *device)
 	NETVSC_DRIVER_OBJECT *net_drv_obj = &net_drv_ctx->drv_obj;
 
 	struct device_context *device_ctx = device_to_device_context(device);
-	struct net_device *net = (struct net_device *)device_ctx->device.driver_data;
+	struct net_device *net = dev_get_drvdata(&device_ctx->device);
 	DEVICE_OBJECT *device_obj = &device_ctx->device_obj;
 
 	DPRINT_ENTER(NETVSC_DRV);
@@ -536,7 +536,7 @@ Desc:	Link up/down notification
 static void netvsc_linkstatus_callback(DEVICE_OBJECT *device_obj, unsigned int status)
 {
 	struct device_context* device_ctx = to_device_context(device_obj);
-	struct net_device* net = (struct net_device *)device_ctx->device.driver_data;
+	struct net_device* net = dev_get_drvdata(&device_ctx->device);
 
 	DPRINT_ENTER(NETVSC_DRV);
 
@@ -571,7 +571,7 @@ static int netvsc_recv_callback(DEVICE_OBJECT *device_obj, NETVSC_PACKET* packet
 {
 	int ret=0;
 	struct device_context *device_ctx = to_device_context(device_obj);
-	struct net_device *net = (struct net_device *)device_ctx->device.driver_data;
+	struct net_device *net = dev_get_drvdata(&device_ctx->device);
 	struct net_device_context *net_device_ctx;
 
 	struct sk_buff *skb;
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Staging: hv: netvsc: fix up driver_data usage, Linux Kernel Mailing ..., (Wed Sep 16, 9:04 am)