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:
Greg Kroah-Hartman
2009-05-04 21:33:19 -07:00
committed by David S. Miller
parent 088eb2d905
commit c7ae011dc8
3 changed files with 11 additions and 11 deletions

View File

@@ -2300,7 +2300,7 @@ static const struct net_device_ops sbmac_netdev_ops = {
static int sbmac_init(struct platform_device *pldev, long long base)
{
struct net_device *dev = pldev->dev.driver_data;
struct net_device *dev = dev_get_drvdata(&pldev->dev);
int idx = pldev->id;
struct sbmac_softc *sc = netdev_priv(dev);
unsigned char *eaddr;
@@ -2731,7 +2731,7 @@ static int __init sbmac_probe(struct platform_device *pldev)
goto out_unmap;
}
pldev->dev.driver_data = dev;
dev_set_drvdata(&pldev->dev, dev);
SET_NETDEV_DEV(dev, &pldev->dev);
sc = netdev_priv(dev);
@@ -2756,7 +2756,7 @@ out_out:
static int __exit sbmac_remove(struct platform_device *pldev)
{
struct net_device *dev = pldev->dev.driver_data;
struct net_device *dev = dev_get_drvdata(&pldev->dev);
struct sbmac_softc *sc = netdev_priv(dev);
unregister_netdev(dev);