aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sg.c
diff options
context:
space:
mode:
authorgregkh@suse.de <gregkh@suse.de>2005-03-23 12:55:22 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-20 18:15:08 -0400
commitd253878b3d9ae523c76118f5336a662780ad3757 (patch)
tree398e59c1d242183269dc8f4a9dd3d7a8057afa16 /drivers/scsi/sg.c
parent7e25ab9155aef04e83da69545742cf65c9b801ce (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/sg.c')
-rw-r--r--drivers/scsi/sg.c14
1 files changed, 7 insertions, 7 deletions
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
1433static struct class_simple * sg_sysfs_class; 1433static struct class *sg_sysfs_class;
1434 1434
1435static int sg_sysfs_valid = 0; 1435static 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);
1694err_out: 1694err_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);