diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2009-05-04 15:40:54 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-16 00:30:28 -0400 |
commit | dff59b64af94dc588044d70f3708cb835055c5b6 (patch) | |
tree | 5d4069fa0ac280b637b8aa691e71ac3b58a508b5 /drivers/s390/char/vmur.c | |
parent | 61616115d748e2eb76c43715383e602b09d9bf50 (diff) |
s390: 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.
Thanks to Sebastian Ott <sebott@linux.vnet.ibm.com> for fixing a few
typos in my original version of this patch.
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Sebastian Ott <sebott@linux.vnet.ibm.com>
Cc: linux-s390@vger.kernel.org
Cc: linux390@de.ibm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/s390/char/vmur.c')
-rw-r--r-- | drivers/s390/char/vmur.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/s390/char/vmur.c b/drivers/s390/char/vmur.c index 5dcef81fc9d9..6492b2015dd4 100644 --- a/drivers/s390/char/vmur.c +++ b/drivers/s390/char/vmur.c | |||
@@ -78,11 +78,11 @@ static DEFINE_MUTEX(vmur_mutex); | |||
78 | * | 78 | * |
79 | * Each ur device (urd) contains a reference to its corresponding ccw device | 79 | * Each ur device (urd) contains a reference to its corresponding ccw device |
80 | * (cdev) using the urd->cdev pointer. Each ccw device has a reference to the | 80 | * (cdev) using the urd->cdev pointer. Each ccw device has a reference to the |
81 | * ur device using the cdev->dev.driver_data pointer. | 81 | * ur device using dev_get_drvdata(&cdev->dev) pointer. |
82 | * | 82 | * |
83 | * urd references: | 83 | * urd references: |
84 | * - ur_probe gets a urd reference, ur_remove drops the reference | 84 | * - ur_probe gets a urd reference, ur_remove drops the reference |
85 | * (cdev->dev.driver_data) | 85 | * dev_get_drvdata(&cdev->dev) |
86 | * - ur_open gets a urd reference, ur_relase drops the reference | 86 | * - ur_open gets a urd reference, ur_relase drops the reference |
87 | * (urf->urd) | 87 | * (urf->urd) |
88 | * | 88 | * |
@@ -90,7 +90,7 @@ static DEFINE_MUTEX(vmur_mutex); | |||
90 | * - urdev_alloc get a cdev reference (urd->cdev) | 90 | * - urdev_alloc get a cdev reference (urd->cdev) |
91 | * - urdev_free drops the cdev reference (urd->cdev) | 91 | * - urdev_free drops the cdev reference (urd->cdev) |
92 | * | 92 | * |
93 | * Setting and clearing of cdev->dev.driver_data is protected by the ccwdev lock | 93 | * Setting and clearing of dev_get_drvdata(&cdev->dev) is protected by the ccwdev lock |
94 | */ | 94 | */ |
95 | static struct urdev *urdev_alloc(struct ccw_device *cdev) | 95 | static struct urdev *urdev_alloc(struct ccw_device *cdev) |
96 | { | 96 | { |
@@ -129,7 +129,7 @@ static struct urdev *urdev_get_from_cdev(struct ccw_device *cdev) | |||
129 | unsigned long flags; | 129 | unsigned long flags; |
130 | 130 | ||
131 | spin_lock_irqsave(get_ccwdev_lock(cdev), flags); | 131 | spin_lock_irqsave(get_ccwdev_lock(cdev), flags); |
132 | urd = cdev->dev.driver_data; | 132 | urd = dev_get_drvdata(&cdev->dev); |
133 | if (urd) | 133 | if (urd) |
134 | urdev_get(urd); | 134 | urdev_get(urd); |
135 | spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags); | 135 | spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags); |
@@ -286,7 +286,7 @@ static void ur_int_handler(struct ccw_device *cdev, unsigned long intparm, | |||
286 | TRACE("ur_int_handler: unsolicited interrupt\n"); | 286 | TRACE("ur_int_handler: unsolicited interrupt\n"); |
287 | return; | 287 | return; |
288 | } | 288 | } |
289 | urd = cdev->dev.driver_data; | 289 | urd = dev_get_drvdata(&cdev->dev); |
290 | BUG_ON(!urd); | 290 | BUG_ON(!urd); |
291 | /* On special conditions irb is an error pointer */ | 291 | /* On special conditions irb is an error pointer */ |
292 | if (IS_ERR(irb)) | 292 | if (IS_ERR(irb)) |
@@ -832,7 +832,7 @@ static int ur_probe(struct ccw_device *cdev) | |||
832 | goto fail_remove_attr; | 832 | goto fail_remove_attr; |
833 | } | 833 | } |
834 | spin_lock_irq(get_ccwdev_lock(cdev)); | 834 | spin_lock_irq(get_ccwdev_lock(cdev)); |
835 | cdev->dev.driver_data = urd; | 835 | dev_set_drvdata(&cdev->dev, urd); |
836 | spin_unlock_irq(get_ccwdev_lock(cdev)); | 836 | spin_unlock_irq(get_ccwdev_lock(cdev)); |
837 | 837 | ||
838 | mutex_unlock(&vmur_mutex); | 838 | mutex_unlock(&vmur_mutex); |
@@ -972,8 +972,8 @@ static void ur_remove(struct ccw_device *cdev) | |||
972 | ur_remove_attributes(&cdev->dev); | 972 | ur_remove_attributes(&cdev->dev); |
973 | 973 | ||
974 | spin_lock_irqsave(get_ccwdev_lock(cdev), flags); | 974 | spin_lock_irqsave(get_ccwdev_lock(cdev), flags); |
975 | urdev_put(cdev->dev.driver_data); | 975 | urdev_put(dev_get_drvdata(&cdev->dev)); |
976 | cdev->dev.driver_data = NULL; | 976 | dev_set_drvdata(&cdev->dev, NULL); |
977 | spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags); | 977 | spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags); |
978 | 978 | ||
979 | mutex_unlock(&vmur_mutex); | 979 | mutex_unlock(&vmur_mutex); |