net: remove driver_data direct access of struct device from more drivers
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. 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
088eb2d905
commit
c7ae011dc8
@@ -1255,7 +1255,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
|
||||
return -ENOMEM;
|
||||
|
||||
adapter = netdev_priv(netdev);
|
||||
dev->dev.driver_data = netdev;
|
||||
dev_set_drvdata(&dev->dev, netdev);
|
||||
|
||||
adapter->vdev = dev;
|
||||
adapter->netdev = netdev;
|
||||
@@ -1341,7 +1341,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_
|
||||
|
||||
static int __devexit ibmveth_remove(struct vio_dev *dev)
|
||||
{
|
||||
struct net_device *netdev = dev->dev.driver_data;
|
||||
struct net_device *netdev = dev_get_drvdata(&dev->dev);
|
||||
struct ibmveth_adapter *adapter = netdev_priv(netdev);
|
||||
int i;
|
||||
|
||||
@@ -1474,8 +1474,8 @@ const char * buf, size_t count)
|
||||
struct ibmveth_buff_pool *pool = container_of(kobj,
|
||||
struct ibmveth_buff_pool,
|
||||
kobj);
|
||||
struct net_device *netdev =
|
||||
container_of(kobj->parent, struct device, kobj)->driver_data;
|
||||
struct net_device *netdev = dev_get_drvdata(
|
||||
container_of(kobj->parent, struct device, kobj));
|
||||
struct ibmveth_adapter *adapter = netdev_priv(netdev);
|
||||
long value = simple_strtol(buf, NULL, 10);
|
||||
long rc;
|
||||
|
Reference in New Issue
Block a user