diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2007-10-22 06:52:42 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2007-10-22 06:52:48 -0400 |
commit | 7f021ce1957504cacc78896de857b90293badabc (patch) | |
tree | 7784c56c9887742c40e68a09c9855f29991f06e9 | |
parent | 5bf04b2062c5b441d7154216694fea7dc2a6a7f3 (diff) |
[S390] struct class_device -> struct device conversion.
Convert struct class_device users under drivers/s390/char to use
struct device.
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | drivers/s390/char/raw3270.c | 26 | ||||
-rw-r--r-- | drivers/s390/char/tape_class.c | 19 | ||||
-rw-r--r-- | drivers/s390/char/tape_class.h | 4 | ||||
-rw-r--r-- | drivers/s390/char/vmlogrdr.c | 15 |
4 files changed, 26 insertions, 38 deletions
diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c index 2edd5fb6d3dc..8d1c64a24dec 100644 --- a/drivers/s390/char/raw3270.c +++ b/drivers/s390/char/raw3270.c | |||
@@ -48,8 +48,8 @@ struct raw3270 { | |||
48 | struct timer_list timer; /* Device timer. */ | 48 | struct timer_list timer; /* Device timer. */ |
49 | 49 | ||
50 | unsigned char *ascebc; /* ascii -> ebcdic table */ | 50 | unsigned char *ascebc; /* ascii -> ebcdic table */ |
51 | struct class_device *clttydev; /* 3270-class tty device ptr */ | 51 | struct device *clttydev; /* 3270-class tty device ptr */ |
52 | struct class_device *cltubdev; /* 3270-class tub device ptr */ | 52 | struct device *cltubdev; /* 3270-class tub device ptr */ |
53 | 53 | ||
54 | struct raw3270_request init_request; | 54 | struct raw3270_request init_request; |
55 | unsigned char init_data[256]; | 55 | unsigned char init_data[256]; |
@@ -1107,11 +1107,9 @@ raw3270_delete_device(struct raw3270 *rp) | |||
1107 | /* Remove from device chain. */ | 1107 | /* Remove from device chain. */ |
1108 | mutex_lock(&raw3270_mutex); | 1108 | mutex_lock(&raw3270_mutex); |
1109 | if (rp->clttydev && !IS_ERR(rp->clttydev)) | 1109 | if (rp->clttydev && !IS_ERR(rp->clttydev)) |
1110 | class_device_destroy(class3270, | 1110 | device_destroy(class3270, MKDEV(IBM_TTY3270_MAJOR, rp->minor)); |
1111 | MKDEV(IBM_TTY3270_MAJOR, rp->minor)); | ||
1112 | if (rp->cltubdev && !IS_ERR(rp->cltubdev)) | 1111 | if (rp->cltubdev && !IS_ERR(rp->cltubdev)) |
1113 | class_device_destroy(class3270, | 1112 | device_destroy(class3270, MKDEV(IBM_FS3270_MAJOR, rp->minor)); |
1114 | MKDEV(IBM_FS3270_MAJOR, rp->minor)); | ||
1115 | list_del_init(&rp->list); | 1113 | list_del_init(&rp->list); |
1116 | mutex_unlock(&raw3270_mutex); | 1114 | mutex_unlock(&raw3270_mutex); |
1117 | 1115 | ||
@@ -1181,24 +1179,22 @@ static int raw3270_create_attributes(struct raw3270 *rp) | |||
1181 | if (rc) | 1179 | if (rc) |
1182 | goto out; | 1180 | goto out; |
1183 | 1181 | ||
1184 | rp->clttydev = class_device_create(class3270, NULL, | 1182 | rp->clttydev = device_create(class3270, &rp->cdev->dev, |
1185 | MKDEV(IBM_TTY3270_MAJOR, rp->minor), | 1183 | MKDEV(IBM_TTY3270_MAJOR, rp->minor), |
1186 | &rp->cdev->dev, "tty%s", | 1184 | "tty%s", rp->cdev->dev.bus_id); |
1187 | rp->cdev->dev.bus_id); | ||
1188 | if (IS_ERR(rp->clttydev)) { | 1185 | if (IS_ERR(rp->clttydev)) { |
1189 | rc = PTR_ERR(rp->clttydev); | 1186 | rc = PTR_ERR(rp->clttydev); |
1190 | goto out_ttydev; | 1187 | goto out_ttydev; |
1191 | } | 1188 | } |
1192 | 1189 | ||
1193 | rp->cltubdev = class_device_create(class3270, NULL, | 1190 | rp->cltubdev = device_create(class3270, &rp->cdev->dev, |
1194 | MKDEV(IBM_FS3270_MAJOR, rp->minor), | 1191 | MKDEV(IBM_FS3270_MAJOR, rp->minor), |
1195 | &rp->cdev->dev, "tub%s", | 1192 | "tub%s", rp->cdev->dev.bus_id); |
1196 | rp->cdev->dev.bus_id); | ||
1197 | if (!IS_ERR(rp->cltubdev)) | 1193 | if (!IS_ERR(rp->cltubdev)) |
1198 | goto out; | 1194 | goto out; |
1199 | 1195 | ||
1200 | rc = PTR_ERR(rp->cltubdev); | 1196 | rc = PTR_ERR(rp->cltubdev); |
1201 | class_device_destroy(class3270, MKDEV(IBM_TTY3270_MAJOR, rp->minor)); | 1197 | device_destroy(class3270, MKDEV(IBM_TTY3270_MAJOR, rp->minor)); |
1202 | 1198 | ||
1203 | out_ttydev: | 1199 | out_ttydev: |
1204 | sysfs_remove_group(&rp->cdev->dev.kobj, &raw3270_attr_group); | 1200 | sysfs_remove_group(&rp->cdev->dev.kobj, &raw3270_attr_group); |
diff --git a/drivers/s390/char/tape_class.c b/drivers/s390/char/tape_class.c index 2e0d29730b67..aa7f166f4034 100644 --- a/drivers/s390/char/tape_class.c +++ b/drivers/s390/char/tape_class.c | |||
@@ -69,12 +69,9 @@ struct tape_class_device *register_tape_dev( | |||
69 | if (rc) | 69 | if (rc) |
70 | goto fail_with_cdev; | 70 | goto fail_with_cdev; |
71 | 71 | ||
72 | tcd->class_device = class_device_create( | 72 | tcd->class_device = device_create(tape_class, device, |
73 | tape_class, | 73 | tcd->char_device->dev, |
74 | NULL, | 74 | "%s", tcd->device_name |
75 | tcd->char_device->dev, | ||
76 | device, | ||
77 | "%s", tcd->device_name | ||
78 | ); | 75 | ); |
79 | rc = IS_ERR(tcd->class_device) ? PTR_ERR(tcd->class_device) : 0; | 76 | rc = IS_ERR(tcd->class_device) ? PTR_ERR(tcd->class_device) : 0; |
80 | if (rc) | 77 | if (rc) |
@@ -90,7 +87,7 @@ struct tape_class_device *register_tape_dev( | |||
90 | return tcd; | 87 | return tcd; |
91 | 88 | ||
92 | fail_with_class_device: | 89 | fail_with_class_device: |
93 | class_device_destroy(tape_class, tcd->char_device->dev); | 90 | device_destroy(tape_class, tcd->char_device->dev); |
94 | 91 | ||
95 | fail_with_cdev: | 92 | fail_with_cdev: |
96 | cdev_del(tcd->char_device); | 93 | cdev_del(tcd->char_device); |
@@ -105,11 +102,9 @@ EXPORT_SYMBOL(register_tape_dev); | |||
105 | void unregister_tape_dev(struct tape_class_device *tcd) | 102 | void unregister_tape_dev(struct tape_class_device *tcd) |
106 | { | 103 | { |
107 | if (tcd != NULL && !IS_ERR(tcd)) { | 104 | if (tcd != NULL && !IS_ERR(tcd)) { |
108 | sysfs_remove_link( | 105 | sysfs_remove_link(&tcd->class_device->kobj, |
109 | &tcd->class_device->dev->kobj, | 106 | tcd->mode_name); |
110 | tcd->mode_name | 107 | device_destroy(tape_class, tcd->char_device->dev); |
111 | ); | ||
112 | class_device_destroy(tape_class, tcd->char_device->dev); | ||
113 | cdev_del(tcd->char_device); | 108 | cdev_del(tcd->char_device); |
114 | kfree(tcd); | 109 | kfree(tcd); |
115 | } | 110 | } |
diff --git a/drivers/s390/char/tape_class.h b/drivers/s390/char/tape_class.h index a8bd9b47fad6..e2b5ac918acf 100644 --- a/drivers/s390/char/tape_class.h +++ b/drivers/s390/char/tape_class.h | |||
@@ -24,8 +24,8 @@ | |||
24 | #define TAPECLASS_NAME_LEN 32 | 24 | #define TAPECLASS_NAME_LEN 32 |
25 | 25 | ||
26 | struct tape_class_device { | 26 | struct tape_class_device { |
27 | struct cdev * char_device; | 27 | struct cdev *char_device; |
28 | struct class_device * class_device; | 28 | struct device *class_device; |
29 | char device_name[TAPECLASS_NAME_LEN]; | 29 | char device_name[TAPECLASS_NAME_LEN]; |
30 | char mode_name[TAPECLASS_NAME_LEN]; | 30 | char mode_name[TAPECLASS_NAME_LEN]; |
31 | }; | 31 | }; |
diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c index 12f7a4ce82c1..e0c4c508e121 100644 --- a/drivers/s390/char/vmlogrdr.c +++ b/drivers/s390/char/vmlogrdr.c | |||
@@ -74,7 +74,7 @@ struct vmlogrdr_priv_t { | |||
74 | int dev_in_use; /* 1: already opened, 0: not opened*/ | 74 | int dev_in_use; /* 1: already opened, 0: not opened*/ |
75 | spinlock_t priv_lock; | 75 | spinlock_t priv_lock; |
76 | struct device *device; | 76 | struct device *device; |
77 | struct class_device *class_device; | 77 | struct device *class_device; |
78 | int autorecording; | 78 | int autorecording; |
79 | int autopurge; | 79 | int autopurge; |
80 | }; | 80 | }; |
@@ -762,12 +762,10 @@ static int vmlogrdr_register_device(struct vmlogrdr_priv_t *priv) | |||
762 | device_unregister(dev); | 762 | device_unregister(dev); |
763 | return ret; | 763 | return ret; |
764 | } | 764 | } |
765 | priv->class_device = class_device_create( | 765 | priv->class_device = device_create(vmlogrdr_class, dev, |
766 | vmlogrdr_class, | 766 | MKDEV(vmlogrdr_major, |
767 | NULL, | 767 | priv->minor_num), |
768 | MKDEV(vmlogrdr_major, priv->minor_num), | 768 | "%s", dev->bus_id); |
769 | dev, | ||
770 | "%s", dev->bus_id ); | ||
771 | if (IS_ERR(priv->class_device)) { | 769 | if (IS_ERR(priv->class_device)) { |
772 | ret = PTR_ERR(priv->class_device); | 770 | ret = PTR_ERR(priv->class_device); |
773 | priv->class_device=NULL; | 771 | priv->class_device=NULL; |
@@ -783,8 +781,7 @@ static int vmlogrdr_register_device(struct vmlogrdr_priv_t *priv) | |||
783 | 781 | ||
784 | static int vmlogrdr_unregister_device(struct vmlogrdr_priv_t *priv) | 782 | static int vmlogrdr_unregister_device(struct vmlogrdr_priv_t *priv) |
785 | { | 783 | { |
786 | class_device_destroy(vmlogrdr_class, | 784 | device_destroy(vmlogrdr_class, MKDEV(vmlogrdr_major, priv->minor_num)); |
787 | MKDEV(vmlogrdr_major, priv->minor_num)); | ||
788 | if (priv->device != NULL) { | 785 | if (priv->device != NULL) { |
789 | sysfs_remove_group(&priv->device->kobj, &vmlogrdr_attr_group); | 786 | sysfs_remove_group(&priv->device->kobj, &vmlogrdr_attr_group); |
790 | device_unregister(priv->device); | 787 | device_unregister(priv->device); |