diff options
author | gregkh@suse.de <gregkh@suse.de> | 2005-03-23 12:55:22 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-20 18:15:08 -0400 |
commit | d253878b3d9ae523c76118f5336a662780ad3757 (patch) | |
tree | 398e59c1d242183269dc8f4a9dd3d7a8057afa16 /drivers/scsi/st.c | |
parent | 7e25ab9155aef04e83da69545742cf65c9b801ce (diff) |
[PATCH] class: convert drivers/scsi/* to use the new class api instead of class_simple
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/scsi/st.c')
-rw-r--r-- | drivers/scsi/st.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 03b902c20e09..0291a8fb654d 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c | |||
@@ -84,7 +84,7 @@ static int try_wdio = 1; | |||
84 | static int st_dev_max; | 84 | static int st_dev_max; |
85 | static int st_nr_dev; | 85 | static int st_nr_dev; |
86 | 86 | ||
87 | static struct class_simple *st_sysfs_class; | 87 | static struct class *st_sysfs_class; |
88 | 88 | ||
89 | MODULE_AUTHOR("Kai Makisara"); | 89 | MODULE_AUTHOR("Kai Makisara"); |
90 | MODULE_DESCRIPTION("SCSI Tape Driver"); | 90 | MODULE_DESCRIPTION("SCSI Tape Driver"); |
@@ -4024,8 +4024,9 @@ out_free_tape: | |||
4024 | if (STm->cdevs[j]) { | 4024 | if (STm->cdevs[j]) { |
4025 | if (cdev == STm->cdevs[j]) | 4025 | if (cdev == STm->cdevs[j]) |
4026 | cdev = NULL; | 4026 | cdev = NULL; |
4027 | class_simple_device_remove(MKDEV(SCSI_TAPE_MAJOR, | 4027 | class_device_destroy(st_sysfs_class, |
4028 | TAPE_MINOR(i, mode, j))); | 4028 | MKDEV(SCSI_TAPE_MAJOR, |
4029 | TAPE_MINOR(i, mode, j))); | ||
4029 | cdev_del(STm->cdevs[j]); | 4030 | cdev_del(STm->cdevs[j]); |
4030 | } | 4031 | } |
4031 | } | 4032 | } |
@@ -4068,8 +4069,9 @@ static int st_remove(struct device *dev) | |||
4068 | devfs_remove("%s/mt%s", SDp->devfs_name, st_formats[j]); | 4069 | devfs_remove("%s/mt%s", SDp->devfs_name, st_formats[j]); |
4069 | devfs_remove("%s/mt%sn", SDp->devfs_name, st_formats[j]); | 4070 | devfs_remove("%s/mt%sn", SDp->devfs_name, st_formats[j]); |
4070 | for (j=0; j < 2; j++) { | 4071 | for (j=0; j < 2; j++) { |
4071 | class_simple_device_remove(MKDEV(SCSI_TAPE_MAJOR, | 4072 | class_device_destroy(st_sysfs_class, |
4072 | TAPE_MINOR(i, mode, j))); | 4073 | MKDEV(SCSI_TAPE_MAJOR, |
4074 | TAPE_MINOR(i, mode, j))); | ||
4073 | cdev_del(tpnt->modes[mode].cdevs[j]); | 4075 | cdev_del(tpnt->modes[mode].cdevs[j]); |
4074 | tpnt->modes[mode].cdevs[j] = NULL; | 4076 | tpnt->modes[mode].cdevs[j] = NULL; |
4075 | } | 4077 | } |
@@ -4134,7 +4136,7 @@ static int __init init_st(void) | |||
4134 | "st: Version %s, fixed bufsize %d, s/g segs %d\n", | 4136 | "st: Version %s, fixed bufsize %d, s/g segs %d\n", |
4135 | verstr, st_fixed_buffer_size, st_max_sg_segs); | 4137 | verstr, st_fixed_buffer_size, st_max_sg_segs); |
4136 | 4138 | ||
4137 | st_sysfs_class = class_simple_create(THIS_MODULE, "scsi_tape"); | 4139 | st_sysfs_class = class_create(THIS_MODULE, "scsi_tape"); |
4138 | if (IS_ERR(st_sysfs_class)) { | 4140 | if (IS_ERR(st_sysfs_class)) { |
4139 | st_sysfs_class = NULL; | 4141 | st_sysfs_class = NULL; |
4140 | printk(KERN_ERR "Unable create sysfs class for SCSI tapes\n"); | 4142 | printk(KERN_ERR "Unable create sysfs class for SCSI tapes\n"); |
@@ -4148,7 +4150,7 @@ static int __init init_st(void) | |||
4148 | return 0; | 4150 | return 0; |
4149 | } | 4151 | } |
4150 | if (st_sysfs_class) | 4152 | if (st_sysfs_class) |
4151 | class_simple_destroy(st_sysfs_class); | 4153 | class_destroy(st_sysfs_class); |
4152 | unregister_chrdev_region(MKDEV(SCSI_TAPE_MAJOR, 0), | 4154 | unregister_chrdev_region(MKDEV(SCSI_TAPE_MAJOR, 0), |
4153 | 4155 | ||
4154 | ST_MAX_TAPE_ENTRIES); | 4156 | ST_MAX_TAPE_ENTRIES); |
@@ -4161,7 +4163,7 @@ static int __init init_st(void) | |||
4161 | static void __exit exit_st(void) | 4163 | static void __exit exit_st(void) |
4162 | { | 4164 | { |
4163 | if (st_sysfs_class) | 4165 | if (st_sysfs_class) |
4164 | class_simple_destroy(st_sysfs_class); | 4166 | class_destroy(st_sysfs_class); |
4165 | st_sysfs_class = NULL; | 4167 | st_sysfs_class = NULL; |
4166 | do_remove_driverfs_files(); | 4168 | do_remove_driverfs_files(); |
4167 | scsi_unregister_driver(&st_template.gendrv); | 4169 | scsi_unregister_driver(&st_template.gendrv); |
@@ -4284,12 +4286,12 @@ static void do_create_class_files(struct scsi_tape *STp, int dev_num, int mode) | |||
4284 | snprintf(name, 10, "%s%s%s", rew ? "n" : "", | 4286 | snprintf(name, 10, "%s%s%s", rew ? "n" : "", |
4285 | STp->disk->disk_name, st_formats[i]); | 4287 | STp->disk->disk_name, st_formats[i]); |
4286 | st_class_member = | 4288 | st_class_member = |
4287 | class_simple_device_add(st_sysfs_class, | 4289 | class_device_create(st_sysfs_class, |
4288 | MKDEV(SCSI_TAPE_MAJOR, | 4290 | MKDEV(SCSI_TAPE_MAJOR, |
4289 | TAPE_MINOR(dev_num, mode, rew)), | 4291 | TAPE_MINOR(dev_num, mode, rew)), |
4290 | &STp->device->sdev_gendev, "%s", name); | 4292 | &STp->device->sdev_gendev, "%s", name); |
4291 | if (IS_ERR(st_class_member)) { | 4293 | if (IS_ERR(st_class_member)) { |
4292 | printk(KERN_WARNING "st%d: class_simple_device_add failed\n", | 4294 | printk(KERN_WARNING "st%d: class_device_create failed\n", |
4293 | dev_num); | 4295 | dev_num); |
4294 | goto out; | 4296 | goto out; |
4295 | } | 4297 | } |