net: remove driver_data direct access of struct device
In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: netdev@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
aba7453037
commit
1aec5bdfed
@@ -810,7 +810,7 @@ static int __init depca_hw_init (struct net_device *dev, struct device *device)
|
||||
|
||||
dev->mem_start = 0;
|
||||
|
||||
device->driver_data = dev;
|
||||
dev_set_drvdata(device, dev);
|
||||
SET_NETDEV_DEV (dev, device);
|
||||
|
||||
status = register_netdev(dev);
|
||||
@@ -1614,7 +1614,7 @@ static int __devexit depca_device_remove (struct device *device)
|
||||
struct depca_private *lp;
|
||||
int bus;
|
||||
|
||||
dev = device->driver_data;
|
||||
dev = dev_get_drvdata(device);
|
||||
lp = netdev_priv(dev);
|
||||
|
||||
unregister_netdev (dev);
|
||||
|
Reference in New Issue
Block a user