diff options
Diffstat (limited to 'drivers')
| -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 | ||||
| -rw-r--r-- | drivers/s390/cio/chp.c | 12 | ||||
| -rw-r--r-- | drivers/s390/cio/css.c | 9 |
6 files changed, 41 insertions, 44 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); |
diff --git a/drivers/s390/cio/chp.c b/drivers/s390/cio/chp.c index 42c1f4659adb..297cdceb0ca4 100644 --- a/drivers/s390/cio/chp.c +++ b/drivers/s390/cio/chp.c | |||
| @@ -246,7 +246,7 @@ int chp_add_cmg_attr(struct channel_path *chp) | |||
| 246 | static ssize_t chp_status_show(struct device *dev, | 246 | static ssize_t chp_status_show(struct device *dev, |
| 247 | struct device_attribute *attr, char *buf) | 247 | struct device_attribute *attr, char *buf) |
| 248 | { | 248 | { |
| 249 | struct channel_path *chp = container_of(dev, struct channel_path, dev); | 249 | struct channel_path *chp = to_channelpath(dev); |
| 250 | 250 | ||
| 251 | if (!chp) | 251 | if (!chp) |
| 252 | return 0; | 252 | return 0; |
| @@ -258,7 +258,7 @@ static ssize_t chp_status_write(struct device *dev, | |||
| 258 | struct device_attribute *attr, | 258 | struct device_attribute *attr, |
| 259 | const char *buf, size_t count) | 259 | const char *buf, size_t count) |
| 260 | { | 260 | { |
| 261 | struct channel_path *cp = container_of(dev, struct channel_path, dev); | 261 | struct channel_path *cp = to_channelpath(dev); |
| 262 | char cmd[10]; | 262 | char cmd[10]; |
| 263 | int num_args; | 263 | int num_args; |
| 264 | int error; | 264 | int error; |
| @@ -286,7 +286,7 @@ static ssize_t chp_configure_show(struct device *dev, | |||
| 286 | struct channel_path *cp; | 286 | struct channel_path *cp; |
| 287 | int status; | 287 | int status; |
| 288 | 288 | ||
| 289 | cp = container_of(dev, struct channel_path, dev); | 289 | cp = to_channelpath(dev); |
| 290 | status = chp_info_get_status(cp->chpid); | 290 | status = chp_info_get_status(cp->chpid); |
| 291 | if (status < 0) | 291 | if (status < 0) |
| 292 | return status; | 292 | return status; |
| @@ -308,7 +308,7 @@ static ssize_t chp_configure_write(struct device *dev, | |||
| 308 | return -EINVAL; | 308 | return -EINVAL; |
| 309 | if (val != 0 && val != 1) | 309 | if (val != 0 && val != 1) |
| 310 | return -EINVAL; | 310 | return -EINVAL; |
| 311 | cp = container_of(dev, struct channel_path, dev); | 311 | cp = to_channelpath(dev); |
| 312 | chp_cfg_schedule(cp->chpid, val); | 312 | chp_cfg_schedule(cp->chpid, val); |
| 313 | cfg_wait_idle(); | 313 | cfg_wait_idle(); |
| 314 | 314 | ||
| @@ -320,7 +320,7 @@ static DEVICE_ATTR(configure, 0644, chp_configure_show, chp_configure_write); | |||
| 320 | static ssize_t chp_type_show(struct device *dev, struct device_attribute *attr, | 320 | static ssize_t chp_type_show(struct device *dev, struct device_attribute *attr, |
| 321 | char *buf) | 321 | char *buf) |
| 322 | { | 322 | { |
| 323 | struct channel_path *chp = container_of(dev, struct channel_path, dev); | 323 | struct channel_path *chp = to_channelpath(dev); |
| 324 | 324 | ||
| 325 | if (!chp) | 325 | if (!chp) |
| 326 | return 0; | 326 | return 0; |
| @@ -374,7 +374,7 @@ static void chp_release(struct device *dev) | |||
| 374 | { | 374 | { |
| 375 | struct channel_path *cp; | 375 | struct channel_path *cp; |
| 376 | 376 | ||
| 377 | cp = container_of(dev, struct channel_path, dev); | 377 | cp = to_channelpath(dev); |
| 378 | kfree(cp); | 378 | kfree(cp); |
| 379 | } | 379 | } |
| 380 | 380 | ||
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 5d83dd471461..838f7ac0dc32 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c | |||
| @@ -182,6 +182,15 @@ static int css_register_subchannel(struct subchannel *sch) | |||
| 182 | sch->dev.bus = &css_bus_type; | 182 | sch->dev.bus = &css_bus_type; |
| 183 | sch->dev.release = &css_subchannel_release; | 183 | sch->dev.release = &css_subchannel_release; |
| 184 | sch->dev.groups = subch_attr_groups; | 184 | sch->dev.groups = subch_attr_groups; |
| 185 | /* | ||
| 186 | * We don't want to generate uevents for I/O subchannels that don't | ||
| 187 | * have a working ccw device behind them since they will be | ||
| 188 | * unregistered before they can be used anyway, so we delay the add | ||
| 189 | * uevent until after device recognition was successful. | ||
| 190 | */ | ||
| 191 | if (!cio_is_console(sch->schid)) | ||
| 192 | /* Console is special, no need to suppress. */ | ||
| 193 | sch->dev.uevent_suppress = 1; | ||
| 185 | css_update_ssd_info(sch); | 194 | css_update_ssd_info(sch); |
| 186 | /* make it known to the system */ | 195 | /* make it known to the system */ |
| 187 | ret = css_sch_device_register(sch); | 196 | ret = css_sch_device_register(sch); |
