Commit d253878b authored by gregkh@suse.de's avatar gregkh@suse.de Committed by Greg Kroah-Hartman

[PATCH] class: convert drivers/scsi/* to use the new class api instead of class_simple

Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7e25ab91
...@@ -5608,13 +5608,13 @@ static ssize_t osst_filemark_cnt_show(struct class_device *class_dev, char *buf) ...@@ -5608,13 +5608,13 @@ static ssize_t osst_filemark_cnt_show(struct class_device *class_dev, char *buf)
CLASS_DEVICE_ATTR(file_count, S_IRUGO, osst_filemark_cnt_show, NULL); CLASS_DEVICE_ATTR(file_count, S_IRUGO, osst_filemark_cnt_show, NULL);
static struct class_simple * osst_sysfs_class; static struct class *osst_sysfs_class;
static int osst_sysfs_valid = 0; static int osst_sysfs_valid = 0;
static void osst_sysfs_init(void) static void osst_sysfs_init(void)
{ {
osst_sysfs_class = class_simple_create(THIS_MODULE, "onstream_tape"); osst_sysfs_class = class_create(THIS_MODULE, "onstream_tape");
if ( IS_ERR(osst_sysfs_class) ) if ( IS_ERR(osst_sysfs_class) )
printk(KERN_WARNING "osst :W: Unable to register sysfs class\n"); printk(KERN_WARNING "osst :W: Unable to register sysfs class\n");
else else
...@@ -5627,7 +5627,7 @@ static void osst_sysfs_add(dev_t dev, struct device *device, struct osst_tape * ...@@ -5627,7 +5627,7 @@ static void osst_sysfs_add(dev_t dev, struct device *device, struct osst_tape *
if (!osst_sysfs_valid) return; if (!osst_sysfs_valid) return;
osst_class_member = class_simple_device_add(osst_sysfs_class, dev, device, "%s", name); osst_class_member = class_device_create(osst_sysfs_class, dev, device, "%s", name);
if (IS_ERR(osst_class_member)) { if (IS_ERR(osst_class_member)) {
printk(KERN_WARNING "osst :W: Unable to add sysfs class member %s\n", name); printk(KERN_WARNING "osst :W: Unable to add sysfs class member %s\n", name);
return; return;
...@@ -5645,13 +5645,13 @@ static void osst_sysfs_destroy(dev_t dev) ...@@ -5645,13 +5645,13 @@ static void osst_sysfs_destroy(dev_t dev)
{ {
if (!osst_sysfs_valid) return; if (!osst_sysfs_valid) return;
class_simple_device_remove(dev); class_device_destroy(osst_sysfs_class, dev);
} }
static void osst_sysfs_cleanup(void) static void osst_sysfs_cleanup(void)
{ {
if (osst_sysfs_valid) { if (osst_sysfs_valid) {
class_simple_destroy(osst_sysfs_class); class_destroy(osst_sysfs_class);
osst_sysfs_valid = 0; osst_sysfs_valid = 0;
} }
} }
......
...@@ -1430,7 +1430,7 @@ static struct file_operations sg_fops = { ...@@ -1430,7 +1430,7 @@ static struct file_operations sg_fops = {
.fasync = sg_fasync, .fasync = sg_fasync,
}; };
static struct class_simple * sg_sysfs_class; static struct class *sg_sysfs_class;
static int sg_sysfs_valid = 0; static int sg_sysfs_valid = 0;
...@@ -1551,13 +1551,13 @@ sg_add(struct class_device *cl_dev) ...@@ -1551,13 +1551,13 @@ sg_add(struct class_device *cl_dev)
if (sg_sysfs_valid) { if (sg_sysfs_valid) {
struct class_device * sg_class_member; struct class_device * sg_class_member;
sg_class_member = class_simple_device_add(sg_sysfs_class, sg_class_member = class_device_create(sg_sysfs_class,
MKDEV(SCSI_GENERIC_MAJOR, k), MKDEV(SCSI_GENERIC_MAJOR, k),
cl_dev->dev, "%s", cl_dev->dev, "%s",
disk->disk_name); disk->disk_name);
if (IS_ERR(sg_class_member)) if (IS_ERR(sg_class_member))
printk(KERN_WARNING "sg_add: " printk(KERN_WARNING "sg_add: "
"class_simple_device_add failed\n"); "class_device_create failed\n");
class_set_devdata(sg_class_member, sdp); class_set_devdata(sg_class_member, sdp);
error = sysfs_create_link(&scsidp->sdev_gendev.kobj, error = sysfs_create_link(&scsidp->sdev_gendev.kobj,
&sg_class_member->kobj, "generic"); &sg_class_member->kobj, "generic");
...@@ -1636,7 +1636,7 @@ sg_remove(struct class_device *cl_dev) ...@@ -1636,7 +1636,7 @@ sg_remove(struct class_device *cl_dev)
if (sdp) { if (sdp) {
sysfs_remove_link(&scsidp->sdev_gendev.kobj, "generic"); sysfs_remove_link(&scsidp->sdev_gendev.kobj, "generic");
class_simple_device_remove(MKDEV(SCSI_GENERIC_MAJOR, k)); class_device_destroy(sg_sysfs_class, MKDEV(SCSI_GENERIC_MAJOR, k));
cdev_del(sdp->cdev); cdev_del(sdp->cdev);
sdp->cdev = NULL; sdp->cdev = NULL;
devfs_remove("%s/generic", scsidp->devfs_name); devfs_remove("%s/generic", scsidp->devfs_name);
...@@ -1677,7 +1677,7 @@ init_sg(void) ...@@ -1677,7 +1677,7 @@ init_sg(void)
SG_MAX_DEVS, "sg"); SG_MAX_DEVS, "sg");
if (rc) if (rc)
return rc; return rc;
sg_sysfs_class = class_simple_create(THIS_MODULE, "scsi_generic"); sg_sysfs_class = class_create(THIS_MODULE, "scsi_generic");
if ( IS_ERR(sg_sysfs_class) ) { if ( IS_ERR(sg_sysfs_class) ) {
rc = PTR_ERR(sg_sysfs_class); rc = PTR_ERR(sg_sysfs_class);
goto err_out; goto err_out;
...@@ -1690,7 +1690,7 @@ init_sg(void) ...@@ -1690,7 +1690,7 @@ init_sg(void)
#endif /* CONFIG_SCSI_PROC_FS */ #endif /* CONFIG_SCSI_PROC_FS */
return 0; return 0;
} }
class_simple_destroy(sg_sysfs_class); class_destroy(sg_sysfs_class);
err_out: err_out:
unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0), SG_MAX_DEVS); unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0), SG_MAX_DEVS);
return rc; return rc;
...@@ -1703,7 +1703,7 @@ exit_sg(void) ...@@ -1703,7 +1703,7 @@ exit_sg(void)
sg_proc_cleanup(); sg_proc_cleanup();
#endif /* CONFIG_SCSI_PROC_FS */ #endif /* CONFIG_SCSI_PROC_FS */
scsi_unregister_interface(&sg_interface); scsi_unregister_interface(&sg_interface);
class_simple_destroy(sg_sysfs_class); class_destroy(sg_sysfs_class);
sg_sysfs_valid = 0; sg_sysfs_valid = 0;
unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0), unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0),
SG_MAX_DEVS); SG_MAX_DEVS);
......
...@@ -84,7 +84,7 @@ static int try_wdio = 1; ...@@ -84,7 +84,7 @@ static int try_wdio = 1;
static int st_dev_max; static int st_dev_max;
static int st_nr_dev; static int st_nr_dev;
static struct class_simple *st_sysfs_class; static struct class *st_sysfs_class;
MODULE_AUTHOR("Kai Makisara"); MODULE_AUTHOR("Kai Makisara");
MODULE_DESCRIPTION("SCSI Tape Driver"); MODULE_DESCRIPTION("SCSI Tape Driver");
...@@ -4024,7 +4024,8 @@ static int st_probe(struct device *dev) ...@@ -4024,7 +4024,8 @@ static int st_probe(struct device *dev)
if (STm->cdevs[j]) { if (STm->cdevs[j]) {
if (cdev == STm->cdevs[j]) if (cdev == STm->cdevs[j])
cdev = NULL; cdev = NULL;
class_simple_device_remove(MKDEV(SCSI_TAPE_MAJOR, class_device_destroy(st_sysfs_class,
MKDEV(SCSI_TAPE_MAJOR,
TAPE_MINOR(i, mode, j))); TAPE_MINOR(i, mode, j)));
cdev_del(STm->cdevs[j]); cdev_del(STm->cdevs[j]);
} }
...@@ -4068,7 +4069,8 @@ static int st_remove(struct device *dev) ...@@ -4068,7 +4069,8 @@ static int st_remove(struct device *dev)
devfs_remove("%s/mt%s", SDp->devfs_name, st_formats[j]); devfs_remove("%s/mt%s", SDp->devfs_name, st_formats[j]);
devfs_remove("%s/mt%sn", SDp->devfs_name, st_formats[j]); devfs_remove("%s/mt%sn", SDp->devfs_name, st_formats[j]);
for (j=0; j < 2; j++) { for (j=0; j < 2; j++) {
class_simple_device_remove(MKDEV(SCSI_TAPE_MAJOR, class_device_destroy(st_sysfs_class,
MKDEV(SCSI_TAPE_MAJOR,
TAPE_MINOR(i, mode, j))); TAPE_MINOR(i, mode, j)));
cdev_del(tpnt->modes[mode].cdevs[j]); cdev_del(tpnt->modes[mode].cdevs[j]);
tpnt->modes[mode].cdevs[j] = NULL; tpnt->modes[mode].cdevs[j] = NULL;
...@@ -4134,7 +4136,7 @@ static int __init init_st(void) ...@@ -4134,7 +4136,7 @@ static int __init init_st(void)
"st: Version %s, fixed bufsize %d, s/g segs %d\n", "st: Version %s, fixed bufsize %d, s/g segs %d\n",
verstr, st_fixed_buffer_size, st_max_sg_segs); verstr, st_fixed_buffer_size, st_max_sg_segs);
st_sysfs_class = class_simple_create(THIS_MODULE, "scsi_tape"); st_sysfs_class = class_create(THIS_MODULE, "scsi_tape");
if (IS_ERR(st_sysfs_class)) { if (IS_ERR(st_sysfs_class)) {
st_sysfs_class = NULL; st_sysfs_class = NULL;
printk(KERN_ERR "Unable create sysfs class for SCSI tapes\n"); printk(KERN_ERR "Unable create sysfs class for SCSI tapes\n");
...@@ -4148,7 +4150,7 @@ static int __init init_st(void) ...@@ -4148,7 +4150,7 @@ static int __init init_st(void)
return 0; return 0;
} }
if (st_sysfs_class) if (st_sysfs_class)
class_simple_destroy(st_sysfs_class); class_destroy(st_sysfs_class);
unregister_chrdev_region(MKDEV(SCSI_TAPE_MAJOR, 0), unregister_chrdev_region(MKDEV(SCSI_TAPE_MAJOR, 0),
ST_MAX_TAPE_ENTRIES); ST_MAX_TAPE_ENTRIES);
...@@ -4161,7 +4163,7 @@ static int __init init_st(void) ...@@ -4161,7 +4163,7 @@ static int __init init_st(void)
static void __exit exit_st(void) static void __exit exit_st(void)
{ {
if (st_sysfs_class) if (st_sysfs_class)
class_simple_destroy(st_sysfs_class); class_destroy(st_sysfs_class);
st_sysfs_class = NULL; st_sysfs_class = NULL;
do_remove_driverfs_files(); do_remove_driverfs_files();
scsi_unregister_driver(&st_template.gendrv); 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,12 +4286,12 @@ static void do_create_class_files(struct scsi_tape *STp, int dev_num, int mode)
snprintf(name, 10, "%s%s%s", rew ? "n" : "", snprintf(name, 10, "%s%s%s", rew ? "n" : "",
STp->disk->disk_name, st_formats[i]); STp->disk->disk_name, st_formats[i]);
st_class_member = st_class_member =
class_simple_device_add(st_sysfs_class, class_device_create(st_sysfs_class,
MKDEV(SCSI_TAPE_MAJOR, MKDEV(SCSI_TAPE_MAJOR,
TAPE_MINOR(dev_num, mode, rew)), TAPE_MINOR(dev_num, mode, rew)),
&STp->device->sdev_gendev, "%s", name); &STp->device->sdev_gendev, "%s", name);
if (IS_ERR(st_class_member)) { if (IS_ERR(st_class_member)) {
printk(KERN_WARNING "st%d: class_simple_device_add failed\n", printk(KERN_WARNING "st%d: class_device_create failed\n",
dev_num); dev_num);
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment