diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2009-05-05 00:33:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-05 00:33:19 -0400 |
commit | c7ae011dc8306d982c25fb4f679752e790a08dc4 (patch) | |
tree | f5ba5370f13272d1cfc43496b4f2b02352e15209 /drivers | |
parent | 088eb2d905de9518dad913995bb8aef493d4a7c5 (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ehea/ehea_main.c | 8 | ||||
-rw-r--r-- | drivers/net/ibmveth.c | 8 | ||||
-rw-r--r-- | drivers/net/sb1250-mac.c | 6 |
3 files changed, 11 insertions, 11 deletions
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 604c844d0769..37a190d85fcd 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -3256,7 +3256,7 @@ static ssize_t ehea_probe_port(struct device *dev, | |||
3256 | struct device_attribute *attr, | 3256 | struct device_attribute *attr, |
3257 | const char *buf, size_t count) | 3257 | const char *buf, size_t count) |
3258 | { | 3258 | { |
3259 | struct ehea_adapter *adapter = dev->driver_data; | 3259 | struct ehea_adapter *adapter = dev_get_drvdata(dev); |
3260 | struct ehea_port *port; | 3260 | struct ehea_port *port; |
3261 | struct device_node *eth_dn = NULL; | 3261 | struct device_node *eth_dn = NULL; |
3262 | int i; | 3262 | int i; |
@@ -3311,7 +3311,7 @@ static ssize_t ehea_remove_port(struct device *dev, | |||
3311 | struct device_attribute *attr, | 3311 | struct device_attribute *attr, |
3312 | const char *buf, size_t count) | 3312 | const char *buf, size_t count) |
3313 | { | 3313 | { |
3314 | struct ehea_adapter *adapter = dev->driver_data; | 3314 | struct ehea_adapter *adapter = dev_get_drvdata(dev); |
3315 | struct ehea_port *port; | 3315 | struct ehea_port *port; |
3316 | int i; | 3316 | int i; |
3317 | u32 logical_port_id; | 3317 | u32 logical_port_id; |
@@ -3399,7 +3399,7 @@ static int __devinit ehea_probe_adapter(struct of_device *dev, | |||
3399 | 3399 | ||
3400 | adapter->pd = EHEA_PD_ID; | 3400 | adapter->pd = EHEA_PD_ID; |
3401 | 3401 | ||
3402 | dev->dev.driver_data = adapter; | 3402 | dev_set_drvdata(&dev->dev, adapter); |
3403 | 3403 | ||
3404 | 3404 | ||
3405 | /* initialize adapter and ports */ | 3405 | /* initialize adapter and ports */ |
@@ -3463,7 +3463,7 @@ out: | |||
3463 | 3463 | ||
3464 | static int __devexit ehea_remove(struct of_device *dev) | 3464 | static int __devexit ehea_remove(struct of_device *dev) |
3465 | { | 3465 | { |
3466 | struct ehea_adapter *adapter = dev->dev.driver_data; | 3466 | struct ehea_adapter *adapter = dev_get_drvdata(&dev->dev); |
3467 | int i; | 3467 | int i; |
3468 | 3468 | ||
3469 | for (i = 0; i < EHEA_MAX_PORTS; i++) | 3469 | for (i = 0; i < EHEA_MAX_PORTS; i++) |
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c index 0a51b0bd1e49..7902e5e16a1a 100644 --- a/drivers/net/ibmveth.c +++ b/drivers/net/ibmveth.c | |||
@@ -1255,7 +1255,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_ | |||
1255 | return -ENOMEM; | 1255 | return -ENOMEM; |
1256 | 1256 | ||
1257 | adapter = netdev_priv(netdev); | 1257 | adapter = netdev_priv(netdev); |
1258 | dev->dev.driver_data = netdev; | 1258 | dev_set_drvdata(&dev->dev, netdev); |
1259 | 1259 | ||
1260 | adapter->vdev = dev; | 1260 | adapter->vdev = dev; |
1261 | adapter->netdev = netdev; | 1261 | adapter->netdev = netdev; |
@@ -1341,7 +1341,7 @@ static int __devinit ibmveth_probe(struct vio_dev *dev, const struct vio_device_ | |||
1341 | 1341 | ||
1342 | static int __devexit ibmveth_remove(struct vio_dev *dev) | 1342 | static int __devexit ibmveth_remove(struct vio_dev *dev) |
1343 | { | 1343 | { |
1344 | struct net_device *netdev = dev->dev.driver_data; | 1344 | struct net_device *netdev = dev_get_drvdata(&dev->dev); |
1345 | struct ibmveth_adapter *adapter = netdev_priv(netdev); | 1345 | struct ibmveth_adapter *adapter = netdev_priv(netdev); |
1346 | int i; | 1346 | int i; |
1347 | 1347 | ||
@@ -1474,8 +1474,8 @@ const char * buf, size_t count) | |||
1474 | struct ibmveth_buff_pool *pool = container_of(kobj, | 1474 | struct ibmveth_buff_pool *pool = container_of(kobj, |
1475 | struct ibmveth_buff_pool, | 1475 | struct ibmveth_buff_pool, |
1476 | kobj); | 1476 | kobj); |
1477 | struct net_device *netdev = | 1477 | struct net_device *netdev = dev_get_drvdata( |
1478 | container_of(kobj->parent, struct device, kobj)->driver_data; | 1478 | container_of(kobj->parent, struct device, kobj)); |
1479 | struct ibmveth_adapter *adapter = netdev_priv(netdev); | 1479 | struct ibmveth_adapter *adapter = netdev_priv(netdev); |
1480 | long value = simple_strtol(buf, NULL, 10); | 1480 | long value = simple_strtol(buf, NULL, 10); |
1481 | long rc; | 1481 | long rc; |
diff --git a/drivers/net/sb1250-mac.c b/drivers/net/sb1250-mac.c index aaeebf57a9a4..7a4b9fbddbaf 100644 --- a/drivers/net/sb1250-mac.c +++ b/drivers/net/sb1250-mac.c | |||
@@ -2300,7 +2300,7 @@ static const struct net_device_ops sbmac_netdev_ops = { | |||
2300 | 2300 | ||
2301 | static int sbmac_init(struct platform_device *pldev, long long base) | 2301 | static int sbmac_init(struct platform_device *pldev, long long base) |
2302 | { | 2302 | { |
2303 | struct net_device *dev = pldev->dev.driver_data; | 2303 | struct net_device *dev = dev_get_drvdata(&pldev->dev); |
2304 | int idx = pldev->id; | 2304 | int idx = pldev->id; |
2305 | struct sbmac_softc *sc = netdev_priv(dev); | 2305 | struct sbmac_softc *sc = netdev_priv(dev); |
2306 | unsigned char *eaddr; | 2306 | unsigned char *eaddr; |
@@ -2731,7 +2731,7 @@ static int __init sbmac_probe(struct platform_device *pldev) | |||
2731 | goto out_unmap; | 2731 | goto out_unmap; |
2732 | } | 2732 | } |
2733 | 2733 | ||
2734 | pldev->dev.driver_data = dev; | 2734 | dev_set_drvdata(&pldev->dev, dev); |
2735 | SET_NETDEV_DEV(dev, &pldev->dev); | 2735 | SET_NETDEV_DEV(dev, &pldev->dev); |
2736 | 2736 | ||
2737 | sc = netdev_priv(dev); | 2737 | sc = netdev_priv(dev); |
@@ -2756,7 +2756,7 @@ out_out: | |||
2756 | 2756 | ||
2757 | static int __exit sbmac_remove(struct platform_device *pldev) | 2757 | static int __exit sbmac_remove(struct platform_device *pldev) |
2758 | { | 2758 | { |
2759 | struct net_device *dev = pldev->dev.driver_data; | 2759 | struct net_device *dev = dev_get_drvdata(&pldev->dev); |
2760 | struct sbmac_softc *sc = netdev_priv(dev); | 2760 | struct sbmac_softc *sc = netdev_priv(dev); |
2761 | 2761 | ||
2762 | unregister_netdev(dev); | 2762 | unregister_netdev(dev); |