diff options
author | Gerd Knorr <kraxel@bytesex.org> | 2005-05-12 04:25:26 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-05-20 13:53:51 -0400 |
commit | 21feb5ccd5d054b8a17fe86b1b5df1e16809df64 (patch) | |
tree | 3d616a700dfeaada445049dddee91f7b13d53f7d /drivers/scsi/ch.c | |
parent | daa6eda65a53e5addf86c6bc829129ff51b08bda (diff) |
[SCSI] convert scsi changer driver from class simple
Here is a incremental patch which switches the driver over to
the new non-simple functions. Compile-tested.
Signed-off-by: Gerd Knorr <kraxel@bytesex.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/ch.c')
-rw-r--r-- | drivers/scsi/ch.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c index 44f5a71ec34a..3900e28ac7d6 100644 --- a/drivers/scsi/ch.c +++ b/drivers/scsi/ch.c | |||
@@ -101,7 +101,7 @@ static long ch_ioctl_compat(struct file * filp, | |||
101 | unsigned int cmd, unsigned long arg); | 101 | unsigned int cmd, unsigned long arg); |
102 | #endif | 102 | #endif |
103 | 103 | ||
104 | static struct class_simple * ch_sysfs_class; | 104 | static struct class * ch_sysfs_class; |
105 | 105 | ||
106 | typedef struct { | 106 | typedef struct { |
107 | struct list_head list; | 107 | struct list_head list; |
@@ -942,9 +942,9 @@ static int ch_probe(struct device *dev) | |||
942 | 942 | ||
943 | devfs_mk_cdev(MKDEV(SCSI_CHANGER_MAJOR,ch->minor), | 943 | devfs_mk_cdev(MKDEV(SCSI_CHANGER_MAJOR,ch->minor), |
944 | S_IFCHR | S_IRUGO | S_IWUGO, ch->name); | 944 | S_IFCHR | S_IRUGO | S_IWUGO, ch->name); |
945 | class_simple_device_add(ch_sysfs_class, | 945 | class_device_create(ch_sysfs_class, |
946 | MKDEV(SCSI_CHANGER_MAJOR,ch->minor), | 946 | MKDEV(SCSI_CHANGER_MAJOR,ch->minor), |
947 | dev, "s%s", ch->name); | 947 | dev, "s%s", ch->name); |
948 | 948 | ||
949 | printk(KERN_INFO "Attached scsi changer %s " | 949 | printk(KERN_INFO "Attached scsi changer %s " |
950 | "at scsi%d, channel %d, id %d, lun %d\n", | 950 | "at scsi%d, channel %d, id %d, lun %d\n", |
@@ -972,7 +972,8 @@ static int ch_remove(struct device *dev) | |||
972 | list_del(&ch->list); | 972 | list_del(&ch->list); |
973 | spin_unlock(&ch_devlist_lock); | 973 | spin_unlock(&ch_devlist_lock); |
974 | 974 | ||
975 | class_simple_device_remove(MKDEV(SCSI_CHANGER_MAJOR,ch->minor)); | 975 | class_device_destroy(ch_sysfs_class, |
976 | MKDEV(SCSI_CHANGER_MAJOR,ch->minor)); | ||
976 | devfs_remove(ch->name); | 977 | devfs_remove(ch->name); |
977 | kfree(ch->dt); | 978 | kfree(ch->dt); |
978 | kfree(ch); | 979 | kfree(ch); |
@@ -985,7 +986,7 @@ static int __init init_ch_module(void) | |||
985 | int rc; | 986 | int rc; |
986 | 987 | ||
987 | printk(KERN_INFO "SCSI Media Changer driver v" VERSION " \n"); | 988 | printk(KERN_INFO "SCSI Media Changer driver v" VERSION " \n"); |
988 | ch_sysfs_class = class_simple_create(THIS_MODULE, "scsi_changer"); | 989 | ch_sysfs_class = class_create(THIS_MODULE, "scsi_changer"); |
989 | if (IS_ERR(ch_sysfs_class)) { | 990 | if (IS_ERR(ch_sysfs_class)) { |
990 | rc = PTR_ERR(ch_sysfs_class); | 991 | rc = PTR_ERR(ch_sysfs_class); |
991 | return rc; | 992 | return rc; |
@@ -1004,7 +1005,7 @@ static int __init init_ch_module(void) | |||
1004 | fail2: | 1005 | fail2: |
1005 | unregister_chrdev(SCSI_CHANGER_MAJOR, "ch"); | 1006 | unregister_chrdev(SCSI_CHANGER_MAJOR, "ch"); |
1006 | fail1: | 1007 | fail1: |
1007 | class_simple_destroy(ch_sysfs_class); | 1008 | class_destroy(ch_sysfs_class); |
1008 | return rc; | 1009 | return rc; |
1009 | } | 1010 | } |
1010 | 1011 | ||
@@ -1012,7 +1013,7 @@ static void __exit exit_ch_module(void) | |||
1012 | { | 1013 | { |
1013 | scsi_unregister_driver(&ch_template.gendrv); | 1014 | scsi_unregister_driver(&ch_template.gendrv); |
1014 | unregister_chrdev(SCSI_CHANGER_MAJOR, "ch"); | 1015 | unregister_chrdev(SCSI_CHANGER_MAJOR, "ch"); |
1015 | class_simple_destroy(ch_sysfs_class); | 1016 | class_destroy(ch_sysfs_class); |
1016 | } | 1017 | } |
1017 | 1018 | ||
1018 | module_init(init_ch_module); | 1019 | module_init(init_ch_module); |