aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/drivers
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2009-05-04 15:40:54 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-06-16 00:30:28 -0400
commit8691b97b99d8b0ba7427afde1a50695cc4112938 (patch)
treeab55b4e8486bab2cad73bdd9c5f8f49ac979a27c /arch/um/drivers
parent5888fd30ac70fa50f08979c46f9206d01ca6ad49 (diff)
uml: 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: user-mode-linux-devel@lists.sourceforge.net Cc: Jeff Dike <jdike@addtoit.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/um/drivers')
-rw-r--r--arch/um/drivers/net_kern.c4
-rw-r--r--arch/um/drivers/ubd_kern.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index 434ba121e3c5..3b44b47c7e1d 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -360,7 +360,7 @@ static struct platform_driver uml_net_driver = {
360 360
361static void net_device_release(struct device *dev) 361static void net_device_release(struct device *dev)
362{ 362{
363 struct uml_net *device = dev->driver_data; 363 struct uml_net *device = dev_get_drvdata(dev);
364 struct net_device *netdev = device->dev; 364 struct net_device *netdev = device->dev;
365 struct uml_net_private *lp = netdev_priv(netdev); 365 struct uml_net_private *lp = netdev_priv(netdev);
366 366
@@ -440,7 +440,7 @@ static void eth_configure(int n, void *init, char *mac,
440 device->pdev.id = n; 440 device->pdev.id = n;
441 device->pdev.name = DRIVER_NAME; 441 device->pdev.name = DRIVER_NAME;
442 device->pdev.dev.release = net_device_release; 442 device->pdev.dev.release = net_device_release;
443 device->pdev.dev.driver_data = device; 443 dev_set_drvdata(&device->pdev.dev, device);
444 if (platform_device_register(&device->pdev)) 444 if (platform_device_register(&device->pdev))
445 goto out_free_netdev; 445 goto out_free_netdev;
446 SET_NETDEV_DEV(dev,&device->pdev.dev); 446 SET_NETDEV_DEV(dev,&device->pdev.dev);
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index aa9e926e13d7..8f05d4d9da12 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -778,7 +778,7 @@ static int ubd_open_dev(struct ubd *ubd_dev)
778 778
779static void ubd_device_release(struct device *dev) 779static void ubd_device_release(struct device *dev)
780{ 780{
781 struct ubd *ubd_dev = dev->driver_data; 781 struct ubd *ubd_dev = dev_get_drvdata(dev);
782 782
783 blk_cleanup_queue(ubd_dev->queue); 783 blk_cleanup_queue(ubd_dev->queue);
784 *ubd_dev = ((struct ubd) DEFAULT_UBD); 784 *ubd_dev = ((struct ubd) DEFAULT_UBD);
@@ -807,7 +807,7 @@ static int ubd_disk_register(int major, u64 size, int unit,
807 ubd_devs[unit].pdev.id = unit; 807 ubd_devs[unit].pdev.id = unit;
808 ubd_devs[unit].pdev.name = DRIVER_NAME; 808 ubd_devs[unit].pdev.name = DRIVER_NAME;
809 ubd_devs[unit].pdev.dev.release = ubd_device_release; 809 ubd_devs[unit].pdev.dev.release = ubd_device_release;
810 ubd_devs[unit].pdev.dev.driver_data = &ubd_devs[unit]; 810 dev_set_drvdata(&ubd_devs[unit].pdev.dev, &ubd_devs[unit]);
811 platform_device_register(&ubd_devs[unit].pdev); 811 platform_device_register(&ubd_devs[unit].pdev);
812 disk->driverfs_dev = &ubd_devs[unit].pdev.dev; 812 disk->driverfs_dev = &ubd_devs[unit].pdev.dev;
813 } 813 }