aboutsummaryrefslogtreecommitdiffstats
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
commit1b713e00500c6f03317742981674e89a21629399 (patch)
tree28effcbb622d14f72b3d2059c6a7db6b0ec124a6
parent839214aeaae1866d55e745c676206825f8ba7e99 (diff)
xen: 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. Cc: xen-devel@lists.xensource.com Cc: virtualization@lists.osdl.org Acked-by: Chris Wright <chrisw@sous-sol.org> Cc: Jeremy Fitzhardinge <jeremy@xensource.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/input/xen-kbdfront.c8
-rw-r--r--drivers/net/xen-netfront.c10
-rw-r--r--drivers/video/xen-fbfront.c8
3 files changed, 13 insertions, 13 deletions
diff --git a/drivers/input/xen-kbdfront.c b/drivers/input/xen-kbdfront.c
index 928d2ed8865f..b115726dc088 100644
--- a/drivers/input/xen-kbdfront.c
+++ b/drivers/input/xen-kbdfront.c
@@ -114,7 +114,7 @@ static int __devinit xenkbd_probe(struct xenbus_device *dev,
114 xenbus_dev_fatal(dev, -ENOMEM, "allocating info structure"); 114 xenbus_dev_fatal(dev, -ENOMEM, "allocating info structure");
115 return -ENOMEM; 115 return -ENOMEM;
116 } 116 }
117 dev->dev.driver_data = info; 117 dev_set_drvdata(&dev->dev, info);
118 info->xbdev = dev; 118 info->xbdev = dev;
119 info->irq = -1; 119 info->irq = -1;
120 snprintf(info->phys, sizeof(info->phys), "xenbus/%s", dev->nodename); 120 snprintf(info->phys, sizeof(info->phys), "xenbus/%s", dev->nodename);
@@ -186,7 +186,7 @@ static int __devinit xenkbd_probe(struct xenbus_device *dev,
186 186
187static int xenkbd_resume(struct xenbus_device *dev) 187static int xenkbd_resume(struct xenbus_device *dev)
188{ 188{
189 struct xenkbd_info *info = dev->dev.driver_data; 189 struct xenkbd_info *info = dev_get_drvdata(&dev->dev);
190 190
191 xenkbd_disconnect_backend(info); 191 xenkbd_disconnect_backend(info);
192 memset(info->page, 0, PAGE_SIZE); 192 memset(info->page, 0, PAGE_SIZE);
@@ -195,7 +195,7 @@ static int xenkbd_resume(struct xenbus_device *dev)
195 195
196static int xenkbd_remove(struct xenbus_device *dev) 196static int xenkbd_remove(struct xenbus_device *dev)
197{ 197{
198 struct xenkbd_info *info = dev->dev.driver_data; 198 struct xenkbd_info *info = dev_get_drvdata(&dev->dev);
199 199
200 xenkbd_disconnect_backend(info); 200 xenkbd_disconnect_backend(info);
201 if (info->kbd) 201 if (info->kbd)
@@ -266,7 +266,7 @@ static void xenkbd_disconnect_backend(struct xenkbd_info *info)
266static void xenkbd_backend_changed(struct xenbus_device *dev, 266static void xenkbd_backend_changed(struct xenbus_device *dev,
267 enum xenbus_state backend_state) 267 enum xenbus_state backend_state)
268{ 268{
269 struct xenkbd_info *info = dev->dev.driver_data; 269 struct xenkbd_info *info = dev_get_drvdata(&dev->dev);
270 int ret, val; 270 int ret, val;
271 271
272 switch (backend_state) { 272 switch (backend_state) {
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index f67325387902..8d88daeed0c6 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1212,7 +1212,7 @@ static int __devinit netfront_probe(struct xenbus_device *dev,
1212 } 1212 }
1213 1213
1214 info = netdev_priv(netdev); 1214 info = netdev_priv(netdev);
1215 dev->dev.driver_data = info; 1215 dev_set_drvdata(&dev->dev, info);
1216 1216
1217 err = register_netdev(info->netdev); 1217 err = register_netdev(info->netdev);
1218 if (err) { 1218 if (err) {
@@ -1233,7 +1233,7 @@ static int __devinit netfront_probe(struct xenbus_device *dev,
1233 1233
1234 fail: 1234 fail:
1235 free_netdev(netdev); 1235 free_netdev(netdev);
1236 dev->dev.driver_data = NULL; 1236 dev_set_drvdata(&dev->dev, NULL);
1237 return err; 1237 return err;
1238} 1238}
1239 1239
@@ -1275,7 +1275,7 @@ static void xennet_disconnect_backend(struct netfront_info *info)
1275 */ 1275 */
1276static int netfront_resume(struct xenbus_device *dev) 1276static int netfront_resume(struct xenbus_device *dev)
1277{ 1277{
1278 struct netfront_info *info = dev->dev.driver_data; 1278 struct netfront_info *info = dev_get_drvdata(&dev->dev);
1279 1279
1280 dev_dbg(&dev->dev, "%s\n", dev->nodename); 1280 dev_dbg(&dev->dev, "%s\n", dev->nodename);
1281 1281
@@ -1600,7 +1600,7 @@ static int xennet_connect(struct net_device *dev)
1600static void backend_changed(struct xenbus_device *dev, 1600static void backend_changed(struct xenbus_device *dev,
1601 enum xenbus_state backend_state) 1601 enum xenbus_state backend_state)
1602{ 1602{
1603 struct netfront_info *np = dev->dev.driver_data; 1603 struct netfront_info *np = dev_get_drvdata(&dev->dev);
1604 struct net_device *netdev = np->netdev; 1604 struct net_device *netdev = np->netdev;
1605 1605
1606 dev_dbg(&dev->dev, "%s\n", xenbus_strstate(backend_state)); 1606 dev_dbg(&dev->dev, "%s\n", xenbus_strstate(backend_state));
@@ -1774,7 +1774,7 @@ static struct xenbus_device_id netfront_ids[] = {
1774 1774
1775static int __devexit xennet_remove(struct xenbus_device *dev) 1775static int __devexit xennet_remove(struct xenbus_device *dev)
1776{ 1776{
1777 struct netfront_info *info = dev->dev.driver_data; 1777 struct netfront_info *info = dev_get_drvdata(&dev->dev);
1778 1778
1779 dev_dbg(&dev->dev, "%s\n", dev->nodename); 1779 dev_dbg(&dev->dev, "%s\n", dev->nodename);
1780 1780
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c
index 2493f05e9f61..15502d5e3641 100644
--- a/drivers/video/xen-fbfront.c
+++ b/drivers/video/xen-fbfront.c
@@ -384,7 +384,7 @@ static int __devinit xenfb_probe(struct xenbus_device *dev,
384 fb_size = XENFB_DEFAULT_FB_LEN; 384 fb_size = XENFB_DEFAULT_FB_LEN;
385 } 385 }
386 386
387 dev->dev.driver_data = info; 387 dev_set_drvdata(&dev->dev, info);
388 info->xbdev = dev; 388 info->xbdev = dev;
389 info->irq = -1; 389 info->irq = -1;
390 info->x1 = info->y1 = INT_MAX; 390 info->x1 = info->y1 = INT_MAX;
@@ -503,7 +503,7 @@ xenfb_make_preferred_console(void)
503 503
504static int xenfb_resume(struct xenbus_device *dev) 504static int xenfb_resume(struct xenbus_device *dev)
505{ 505{
506 struct xenfb_info *info = dev->dev.driver_data; 506 struct xenfb_info *info = dev_get_drvdata(&dev->dev);
507 507
508 xenfb_disconnect_backend(info); 508 xenfb_disconnect_backend(info);
509 xenfb_init_shared_page(info, info->fb_info); 509 xenfb_init_shared_page(info, info->fb_info);
@@ -512,7 +512,7 @@ static int xenfb_resume(struct xenbus_device *dev)
512 512
513static int xenfb_remove(struct xenbus_device *dev) 513static int xenfb_remove(struct xenbus_device *dev)
514{ 514{
515 struct xenfb_info *info = dev->dev.driver_data; 515 struct xenfb_info *info = dev_get_drvdata(&dev->dev);
516 516
517 xenfb_disconnect_backend(info); 517 xenfb_disconnect_backend(info);
518 if (info->fb_info) { 518 if (info->fb_info) {
@@ -621,7 +621,7 @@ static void xenfb_disconnect_backend(struct xenfb_info *info)
621static void xenfb_backend_changed(struct xenbus_device *dev, 621static void xenfb_backend_changed(struct xenbus_device *dev,
622 enum xenbus_state backend_state) 622 enum xenbus_state backend_state)
623{ 623{
624 struct xenfb_info *info = dev->dev.driver_data; 624 struct xenfb_info *info = dev_get_drvdata(&dev->dev);
625 int val; 625 int val;
626 626
627 switch (backend_state) { 627 switch (backend_state) {