aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/ccwgroup.c
diff options
context:
space:
mode:
authorCornelia Huck <cornelia.huck@de.ibm.com>2008-01-26 08:10:46 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2008-01-26 08:11:02 -0500
commitdb6a64238a927777e6e7b251927313f186455b1c (patch)
tree1c87902e01b7e0a67b81eb641392cd83717a8970 /drivers/s390/cio/ccwgroup.c
parentb279a4f56d5476a0b9b0a97397f7a7bbe00b9b2f (diff)
[S390] cio: Use dev_{g,s}et_drvdata().
Also define helpers sch_{g,s}et_cdev() to make the intention more clear. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/ccwgroup.c')
-rw-r--r--drivers/s390/cio/ccwgroup.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c
index b3e2c16caa41..b9997fb4883c 100644
--- a/drivers/s390/cio/ccwgroup.c
+++ b/drivers/s390/cio/ccwgroup.c
@@ -111,7 +111,7 @@ ccwgroup_release (struct device *dev)
111 gdev = to_ccwgroupdev(dev); 111 gdev = to_ccwgroupdev(dev);
112 112
113 for (i = 0; i < gdev->count; i++) { 113 for (i = 0; i < gdev->count; i++) {
114 gdev->cdev[i]->dev.driver_data = NULL; 114 dev_set_drvdata(&gdev->cdev[i]->dev, NULL);
115 put_device(&gdev->cdev[i]->dev); 115 put_device(&gdev->cdev[i]->dev);
116 } 116 }
117 kfree(gdev); 117 kfree(gdev);
@@ -196,11 +196,11 @@ int ccwgroup_create(struct device *root, unsigned int creator_id,
196 goto error; 196 goto error;
197 } 197 }
198 /* Don't allow a device to belong to more than one group. */ 198 /* Don't allow a device to belong to more than one group. */
199 if (gdev->cdev[i]->dev.driver_data) { 199 if (dev_get_drvdata(&gdev->cdev[i]->dev)) {
200 rc = -EINVAL; 200 rc = -EINVAL;
201 goto error; 201 goto error;
202 } 202 }
203 gdev->cdev[i]->dev.driver_data = gdev; 203 dev_set_drvdata(&gdev->cdev[i]->dev, gdev);
204 } 204 }
205 205
206 gdev->creator_id = creator_id; 206 gdev->creator_id = creator_id;
@@ -234,8 +234,8 @@ int ccwgroup_create(struct device *root, unsigned int creator_id,
234error: 234error:
235 for (i = 0; i < argc; i++) 235 for (i = 0; i < argc; i++)
236 if (gdev->cdev[i]) { 236 if (gdev->cdev[i]) {
237 if (gdev->cdev[i]->dev.driver_data == gdev) 237 if (dev_get_drvdata(&gdev->cdev[i]->dev) == gdev)
238 gdev->cdev[i]->dev.driver_data = NULL; 238 dev_set_drvdata(&gdev->cdev[i]->dev, NULL);
239 put_device(&gdev->cdev[i]->dev); 239 put_device(&gdev->cdev[i]->dev);
240 } 240 }
241 mutex_unlock(&gdev->reg_mutex); 241 mutex_unlock(&gdev->reg_mutex);
@@ -463,8 +463,8 @@ __ccwgroup_get_gdev_by_cdev(struct ccw_device *cdev)
463{ 463{
464 struct ccwgroup_device *gdev; 464 struct ccwgroup_device *gdev;
465 465
466 if (cdev->dev.driver_data) { 466 gdev = dev_get_drvdata(&cdev->dev);
467 gdev = (struct ccwgroup_device *)cdev->dev.driver_data; 467 if (gdev) {
468 if (get_device(&gdev->dev)) { 468 if (get_device(&gdev->dev)) {
469 mutex_lock(&gdev->reg_mutex); 469 mutex_lock(&gdev->reg_mutex);
470 if (device_is_registered(&gdev->dev)) 470 if (device_is_registered(&gdev->dev))