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 | |
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>
-rw-r--r-- | drivers/scsi/osst.c | 10 | ||||
-rw-r--r-- | drivers/scsi/sg.c | 14 | ||||
-rw-r--r-- | drivers/scsi/st.c | 28 |
3 files changed, 27 insertions, 25 deletions
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c index c585c7bef247..89a4a0615c22 100644 --- a/drivers/scsi/osst.c +++ b/drivers/scsi/osst.c | |||
@@ -5608,13 +5608,13 @@ static ssize_t osst_filemark_cnt_show(struct class_device *class_dev, char *buf) | |||
5608 | 5608 | ||
5609 | CLASS_DEVICE_ATTR(file_count, S_IRUGO, osst_filemark_cnt_show, NULL); | 5609 | CLASS_DEVICE_ATTR(file_count, S_IRUGO, osst_filemark_cnt_show, NULL); |
5610 | 5610 | ||
5611 | static struct class_simple * osst_sysfs_class; | 5611 | static struct class *osst_sysfs_class; |
5612 | 5612 | ||
5613 | static int osst_sysfs_valid = 0; | 5613 | static int osst_sysfs_valid = 0; |
5614 | 5614 | ||
5615 | static void osst_sysfs_init(void) | 5615 | static void osst_sysfs_init(void) |
5616 | { | 5616 | { |
5617 | osst_sysfs_class = class_simple_create(THIS_MODULE, "onstream_tape"); | 5617 | osst_sysfs_class = class_create(THIS_MODULE, "onstream_tape"); |
5618 | if ( IS_ERR(osst_sysfs_class) ) | 5618 | if ( IS_ERR(osst_sysfs_class) ) |
5619 | printk(KERN_WARNING "osst :W: Unable to register sysfs class\n"); | 5619 | printk(KERN_WARNING "osst :W: Unable to register sysfs class\n"); |
5620 | else | 5620 | else |
@@ -5627,7 +5627,7 @@ static void osst_sysfs_add(dev_t dev, struct device *device, struct osst_tape * | |||
5627 | 5627 | ||
5628 | if (!osst_sysfs_valid) return; | 5628 | if (!osst_sysfs_valid) return; |
5629 | 5629 | ||
5630 | osst_class_member = class_simple_device_add(osst_sysfs_class, dev, device, "%s", name); | 5630 | osst_class_member = class_device_create(osst_sysfs_class, dev, device, "%s", name); |
5631 | if (IS_ERR(osst_class_member)) { | 5631 | if (IS_ERR(osst_class_member)) { |
5632 | printk(KERN_WARNING "osst :W: Unable to add sysfs class member %s\n", name); | 5632 | printk(KERN_WARNING "osst :W: Unable to add sysfs class member %s\n", name); |
5633 | return; | 5633 | return; |
@@ -5645,13 +5645,13 @@ static void osst_sysfs_destroy(dev_t dev) | |||
5645 | { | 5645 | { |
5646 | if (!osst_sysfs_valid) return; | 5646 | if (!osst_sysfs_valid) return; |
5647 | 5647 | ||
5648 | class_simple_device_remove(dev); | 5648 | class_device_destroy(osst_sysfs_class, dev); |
5649 | } | 5649 | } |
5650 | 5650 | ||
5651 | static void osst_sysfs_cleanup(void) | 5651 | static void osst_sysfs_cleanup(void) |
5652 | { | 5652 | { |
5653 | if (osst_sysfs_valid) { | 5653 | if (osst_sysfs_valid) { |
5654 | class_simple_destroy(osst_sysfs_class); | 5654 | class_destroy(osst_sysfs_class); |
5655 | osst_sysfs_valid = 0; | 5655 | osst_sysfs_valid = 0; |
5656 | } | 5656 | } |
5657 | } | 5657 | } |
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 3d1d7bff38ed..51292f269ce5 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c | |||
@@ -1430,7 +1430,7 @@ static struct file_operations sg_fops = { | |||
1430 | .fasync = sg_fasync, | 1430 | .fasync = sg_fasync, |
1431 | }; | 1431 | }; |
1432 | 1432 | ||
1433 | static struct class_simple * sg_sysfs_class; | 1433 | static struct class *sg_sysfs_class; |
1434 | 1434 | ||
1435 | static int sg_sysfs_valid = 0; | 1435 | static int sg_sysfs_valid = 0; |
1436 | 1436 | ||
@@ -1551,13 +1551,13 @@ sg_add(struct class_device *cl_dev) | |||
1551 | if (sg_sysfs_valid) { | 1551 | if (sg_sysfs_valid) { |
1552 | struct class_device * sg_class_member; | 1552 | struct class_device * sg_class_member; |
1553 | 1553 | ||
1554 | sg_class_member = class_simple_device_add(sg_sysfs_class, | 1554 | sg_class_member = class_device_create(sg_sysfs_class, |
1555 | MKDEV(SCSI_GENERIC_MAJOR, k), | 1555 | MKDEV(SCSI_GENERIC_MAJOR, k), |
1556 | cl_dev->dev, "%s", | 1556 | cl_dev->dev, "%s", |
1557 | disk->disk_name); | 1557 | disk->disk_name); |
1558 | if (IS_ERR(sg_class_member)) | 1558 | if (IS_ERR(sg_class_member)) |
1559 | printk(KERN_WARNING "sg_add: " | 1559 | printk(KERN_WARNING "sg_add: " |
1560 | "class_simple_device_add failed\n"); | 1560 | "class_device_create failed\n"); |
1561 | class_set_devdata(sg_class_member, sdp); | 1561 | class_set_devdata(sg_class_member, sdp); |
1562 | error = sysfs_create_link(&scsidp->sdev_gendev.kobj, | 1562 | error = sysfs_create_link(&scsidp->sdev_gendev.kobj, |
1563 | &sg_class_member->kobj, "generic"); | 1563 | &sg_class_member->kobj, "generic"); |
@@ -1636,7 +1636,7 @@ sg_remove(struct class_device *cl_dev) | |||
1636 | 1636 | ||
1637 | if (sdp) { | 1637 | if (sdp) { |
1638 | sysfs_remove_link(&scsidp->sdev_gendev.kobj, "generic"); | 1638 | sysfs_remove_link(&scsidp->sdev_gendev.kobj, "generic"); |
1639 | class_simple_device_remove(MKDEV(SCSI_GENERIC_MAJOR, k)); | 1639 | class_device_destroy(sg_sysfs_class, MKDEV(SCSI_GENERIC_MAJOR, k)); |
1640 | cdev_del(sdp->cdev); | 1640 | cdev_del(sdp->cdev); |
1641 | sdp->cdev = NULL; | 1641 | sdp->cdev = NULL; |
1642 | devfs_remove("%s/generic", scsidp->devfs_name); | 1642 | devfs_remove("%s/generic", scsidp->devfs_name); |
@@ -1677,7 +1677,7 @@ init_sg(void) | |||
1677 | SG_MAX_DEVS, "sg"); | 1677 | SG_MAX_DEVS, "sg"); |
1678 | if (rc) | 1678 | if (rc) |
1679 | return rc; | 1679 | return rc; |
1680 | sg_sysfs_class = class_simple_create(THIS_MODULE, "scsi_generic"); | 1680 | sg_sysfs_class = class_create(THIS_MODULE, "scsi_generic"); |
1681 | if ( IS_ERR(sg_sysfs_class) ) { | 1681 | if ( IS_ERR(sg_sysfs_class) ) { |
1682 | rc = PTR_ERR(sg_sysfs_class); | 1682 | rc = PTR_ERR(sg_sysfs_class); |
1683 | goto err_out; | 1683 | goto err_out; |
@@ -1690,7 +1690,7 @@ init_sg(void) | |||
1690 | #endif /* CONFIG_SCSI_PROC_FS */ | 1690 | #endif /* CONFIG_SCSI_PROC_FS */ |
1691 | return 0; | 1691 | return 0; |
1692 | } | 1692 | } |
1693 | class_simple_destroy(sg_sysfs_class); | 1693 | class_destroy(sg_sysfs_class); |
1694 | err_out: | 1694 | err_out: |
1695 | unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0), SG_MAX_DEVS); | 1695 | unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0), SG_MAX_DEVS); |
1696 | return rc; | 1696 | return rc; |
@@ -1703,7 +1703,7 @@ exit_sg(void) | |||
1703 | sg_proc_cleanup(); | 1703 | sg_proc_cleanup(); |
1704 | #endif /* CONFIG_SCSI_PROC_FS */ | 1704 | #endif /* CONFIG_SCSI_PROC_FS */ |
1705 | scsi_unregister_interface(&sg_interface); | 1705 | scsi_unregister_interface(&sg_interface); |
1706 | class_simple_destroy(sg_sysfs_class); | 1706 | class_destroy(sg_sysfs_class); |
1707 | sg_sysfs_valid = 0; | 1707 | sg_sysfs_valid = 0; |
1708 | unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0), | 1708 | unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0), |
1709 | SG_MAX_DEVS); | 1709 | SG_MAX_DEVS); |
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 | } |