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/raw3270.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/raw3270.c')
-rw-r--r-- | drivers/s390/char/raw3270.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c index 0b15cf107ec9..1ab69df2684c 100644 --- a/drivers/s390/char/raw3270.c +++ b/drivers/s390/char/raw3270.c | |||
@@ -355,7 +355,7 @@ raw3270_irq (struct ccw_device *cdev, unsigned long intparm, struct irb *irb) | |||
355 | struct raw3270_request *rq; | 355 | struct raw3270_request *rq; |
356 | int rc; | 356 | int rc; |
357 | 357 | ||
358 | rp = (struct raw3270 *) cdev->dev.driver_data; | 358 | rp = dev_get_drvdata(&cdev->dev); |
359 | if (!rp) | 359 | if (!rp) |
360 | return; | 360 | return; |
361 | rq = (struct raw3270_request *) intparm; | 361 | rq = (struct raw3270_request *) intparm; |
@@ -828,7 +828,7 @@ raw3270_setup_device(struct ccw_device *cdev, struct raw3270 *rp, char *ascebc) | |||
828 | if (rp->minor == -1) | 828 | if (rp->minor == -1) |
829 | return -EUSERS; | 829 | return -EUSERS; |
830 | rp->cdev = cdev; | 830 | rp->cdev = cdev; |
831 | cdev->dev.driver_data = rp; | 831 | dev_set_drvdata(&cdev->dev, rp); |
832 | cdev->handler = raw3270_irq; | 832 | cdev->handler = raw3270_irq; |
833 | return 0; | 833 | return 0; |
834 | } | 834 | } |
@@ -1105,7 +1105,7 @@ raw3270_delete_device(struct raw3270 *rp) | |||
1105 | /* Disconnect from ccw_device. */ | 1105 | /* Disconnect from ccw_device. */ |
1106 | cdev = rp->cdev; | 1106 | cdev = rp->cdev; |
1107 | rp->cdev = NULL; | 1107 | rp->cdev = NULL; |
1108 | cdev->dev.driver_data = NULL; | 1108 | dev_set_drvdata(&cdev->dev, NULL); |
1109 | cdev->handler = NULL; | 1109 | cdev->handler = NULL; |
1110 | 1110 | ||
1111 | /* Put ccw_device structure. */ | 1111 | /* Put ccw_device structure. */ |
@@ -1129,7 +1129,7 @@ static ssize_t | |||
1129 | raw3270_model_show(struct device *dev, struct device_attribute *attr, char *buf) | 1129 | raw3270_model_show(struct device *dev, struct device_attribute *attr, char *buf) |
1130 | { | 1130 | { |
1131 | return snprintf(buf, PAGE_SIZE, "%i\n", | 1131 | return snprintf(buf, PAGE_SIZE, "%i\n", |
1132 | ((struct raw3270 *) dev->driver_data)->model); | 1132 | ((struct raw3270 *) dev_get_drvdata(dev))->model); |
1133 | } | 1133 | } |
1134 | static DEVICE_ATTR(model, 0444, raw3270_model_show, NULL); | 1134 | static DEVICE_ATTR(model, 0444, raw3270_model_show, NULL); |
1135 | 1135 | ||
@@ -1137,7 +1137,7 @@ static ssize_t | |||
1137 | raw3270_rows_show(struct device *dev, struct device_attribute *attr, char *buf) | 1137 | raw3270_rows_show(struct device *dev, struct device_attribute *attr, char *buf) |
1138 | { | 1138 | { |
1139 | return snprintf(buf, PAGE_SIZE, "%i\n", | 1139 | return snprintf(buf, PAGE_SIZE, "%i\n", |
1140 | ((struct raw3270 *) dev->driver_data)->rows); | 1140 | ((struct raw3270 *) dev_get_drvdata(dev))->rows); |
1141 | } | 1141 | } |
1142 | static DEVICE_ATTR(rows, 0444, raw3270_rows_show, NULL); | 1142 | static DEVICE_ATTR(rows, 0444, raw3270_rows_show, NULL); |
1143 | 1143 | ||
@@ -1145,7 +1145,7 @@ static ssize_t | |||
1145 | raw3270_columns_show(struct device *dev, struct device_attribute *attr, char *buf) | 1145 | raw3270_columns_show(struct device *dev, struct device_attribute *attr, char *buf) |
1146 | { | 1146 | { |
1147 | return snprintf(buf, PAGE_SIZE, "%i\n", | 1147 | return snprintf(buf, PAGE_SIZE, "%i\n", |
1148 | ((struct raw3270 *) dev->driver_data)->cols); | 1148 | ((struct raw3270 *) dev_get_drvdata(dev))->cols); |
1149 | } | 1149 | } |
1150 | static DEVICE_ATTR(columns, 0444, raw3270_columns_show, NULL); | 1150 | static DEVICE_ATTR(columns, 0444, raw3270_columns_show, NULL); |
1151 | 1151 | ||
@@ -1282,7 +1282,7 @@ raw3270_remove (struct ccw_device *cdev) | |||
1282 | struct raw3270_view *v; | 1282 | struct raw3270_view *v; |
1283 | struct raw3270_notifier *np; | 1283 | struct raw3270_notifier *np; |
1284 | 1284 | ||
1285 | rp = cdev->dev.driver_data; | 1285 | rp = dev_get_drvdata(&cdev->dev); |
1286 | /* | 1286 | /* |
1287 | * _remove is the opposite of _probe; it's probe that | 1287 | * _remove is the opposite of _probe; it's probe that |
1288 | * should set up rp. raw3270_remove gets entered for | 1288 | * should set up rp. raw3270_remove gets entered for |
@@ -1330,7 +1330,7 @@ raw3270_set_offline (struct ccw_device *cdev) | |||
1330 | { | 1330 | { |
1331 | struct raw3270 *rp; | 1331 | struct raw3270 *rp; |
1332 | 1332 | ||
1333 | rp = cdev->dev.driver_data; | 1333 | rp = dev_get_drvdata(&cdev->dev); |
1334 | if (test_bit(RAW3270_FLAGS_CONSOLE, &rp->flags)) | 1334 | if (test_bit(RAW3270_FLAGS_CONSOLE, &rp->flags)) |
1335 | return -EBUSY; | 1335 | return -EBUSY; |
1336 | raw3270_remove(cdev); | 1336 | raw3270_remove(cdev); |