diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2009-04-30 17:43:31 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-16 00:30:27 -0400 |
commit | a1b4b12b372e76d22d4f3bf58b47e4cf2fb132fe (patch) | |
tree | 5bebca9a1e67c23a4e39fb91d2fe2bc3429690b9 /drivers | |
parent | 0e968a3b6da710294a56460473cac32dc821fd4a (diff) |
xen block: 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: xen-devel@lists.xensource.com
Cc: virtualization@lists.osdl.org
Acked-by: Chris Wright <chrisw@sous-sol.org>
Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/xen-blkfront.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index c1996829d5ec..e53284767f7c 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c | |||
@@ -753,12 +753,12 @@ static int blkfront_probe(struct xenbus_device *dev, | |||
753 | 753 | ||
754 | /* Front end dir is a number, which is used as the id. */ | 754 | /* Front end dir is a number, which is used as the id. */ |
755 | info->handle = simple_strtoul(strrchr(dev->nodename, '/')+1, NULL, 0); | 755 | info->handle = simple_strtoul(strrchr(dev->nodename, '/')+1, NULL, 0); |
756 | dev->dev.driver_data = info; | 756 | dev_set_drvdata(&dev->dev, info); |
757 | 757 | ||
758 | err = talk_to_backend(dev, info); | 758 | err = talk_to_backend(dev, info); |
759 | if (err) { | 759 | if (err) { |
760 | kfree(info); | 760 | kfree(info); |
761 | dev->dev.driver_data = NULL; | 761 | dev_set_drvdata(&dev->dev, NULL); |
762 | return err; | 762 | return err; |
763 | } | 763 | } |
764 | 764 | ||
@@ -843,7 +843,7 @@ static int blkif_recover(struct blkfront_info *info) | |||
843 | */ | 843 | */ |
844 | static int blkfront_resume(struct xenbus_device *dev) | 844 | static int blkfront_resume(struct xenbus_device *dev) |
845 | { | 845 | { |
846 | struct blkfront_info *info = dev->dev.driver_data; | 846 | struct blkfront_info *info = dev_get_drvdata(&dev->dev); |
847 | int err; | 847 | int err; |
848 | 848 | ||
849 | dev_dbg(&dev->dev, "blkfront_resume: %s\n", dev->nodename); | 849 | dev_dbg(&dev->dev, "blkfront_resume: %s\n", dev->nodename); |
@@ -922,7 +922,7 @@ static void blkfront_connect(struct blkfront_info *info) | |||
922 | */ | 922 | */ |
923 | static void blkfront_closing(struct xenbus_device *dev) | 923 | static void blkfront_closing(struct xenbus_device *dev) |
924 | { | 924 | { |
925 | struct blkfront_info *info = dev->dev.driver_data; | 925 | struct blkfront_info *info = dev_get_drvdata(&dev->dev); |
926 | unsigned long flags; | 926 | unsigned long flags; |
927 | 927 | ||
928 | dev_dbg(&dev->dev, "blkfront_closing: %s removed\n", dev->nodename); | 928 | dev_dbg(&dev->dev, "blkfront_closing: %s removed\n", dev->nodename); |
@@ -957,7 +957,7 @@ static void blkfront_closing(struct xenbus_device *dev) | |||
957 | static void backend_changed(struct xenbus_device *dev, | 957 | static void backend_changed(struct xenbus_device *dev, |
958 | enum xenbus_state backend_state) | 958 | enum xenbus_state backend_state) |
959 | { | 959 | { |
960 | struct blkfront_info *info = dev->dev.driver_data; | 960 | struct blkfront_info *info = dev_get_drvdata(&dev->dev); |
961 | struct block_device *bd; | 961 | struct block_device *bd; |
962 | 962 | ||
963 | dev_dbg(&dev->dev, "blkfront:backend_changed.\n"); | 963 | dev_dbg(&dev->dev, "blkfront:backend_changed.\n"); |
@@ -997,7 +997,7 @@ static void backend_changed(struct xenbus_device *dev, | |||
997 | 997 | ||
998 | static int blkfront_remove(struct xenbus_device *dev) | 998 | static int blkfront_remove(struct xenbus_device *dev) |
999 | { | 999 | { |
1000 | struct blkfront_info *info = dev->dev.driver_data; | 1000 | struct blkfront_info *info = dev_get_drvdata(&dev->dev); |
1001 | 1001 | ||
1002 | dev_dbg(&dev->dev, "blkfront_remove: %s removed\n", dev->nodename); | 1002 | dev_dbg(&dev->dev, "blkfront_remove: %s removed\n", dev->nodename); |
1003 | 1003 | ||
@@ -1010,7 +1010,7 @@ static int blkfront_remove(struct xenbus_device *dev) | |||
1010 | 1010 | ||
1011 | static int blkfront_is_ready(struct xenbus_device *dev) | 1011 | static int blkfront_is_ready(struct xenbus_device *dev) |
1012 | { | 1012 | { |
1013 | struct blkfront_info *info = dev->dev.driver_data; | 1013 | struct blkfront_info *info = dev_get_drvdata(&dev->dev); |
1014 | 1014 | ||
1015 | return info->is_ready; | 1015 | return info->is_ready; |
1016 | } | 1016 | } |