X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fscsi%2Fsg.c;h=14fb179b3842193dceacd206b1b22d23d54a324f;hb=d3301874083874f8a0ac88aa1bb7da6b62df34d2;hp=3d1d7bff38edb6ea01272c92db3e08719b204ffb;hpb=3237ee78fc00f786d5f5aec6f9310b0e39069f15;p=linux-2.6-omap-h63xx.git diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 3d1d7bff38e..14fb179b384 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -1027,8 +1027,7 @@ sg_ioctl(struct inode *inode, struct file *filp, if (sdp->detached) return -ENODEV; if (filp->f_flags & O_NONBLOCK) { - if (test_bit(SHOST_RECOVERY, - &sdp->device->host->shost_state)) + if (sdp->device->host->shost_state == SHOST_RECOVERY) return -EBUSY; } else if (!scsi_block_when_processing_errors(sdp->device)) return -EBUSY; @@ -1430,7 +1429,7 @@ static struct file_operations sg_fops = { .fasync = sg_fasync, }; -static struct class_simple * sg_sysfs_class; +static struct class *sg_sysfs_class; static int sg_sysfs_valid = 0; @@ -1551,13 +1550,13 @@ sg_add(struct class_device *cl_dev) if (sg_sysfs_valid) { 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), cl_dev->dev, "%s", disk->disk_name); if (IS_ERR(sg_class_member)) printk(KERN_WARNING "sg_add: " - "class_simple_device_add failed\n"); + "class_device_create failed\n"); class_set_devdata(sg_class_member, sdp); error = sysfs_create_link(&scsidp->sdev_gendev.kobj, &sg_class_member->kobj, "generic"); @@ -1636,7 +1635,7 @@ sg_remove(struct class_device *cl_dev) if (sdp) { 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); sdp->cdev = NULL; devfs_remove("%s/generic", scsidp->devfs_name); @@ -1677,7 +1676,7 @@ init_sg(void) SG_MAX_DEVS, "sg"); if (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) ) { rc = PTR_ERR(sg_sysfs_class); goto err_out; @@ -1690,7 +1689,7 @@ init_sg(void) #endif /* CONFIG_SCSI_PROC_FS */ return 0; } - class_simple_destroy(sg_sysfs_class); + class_destroy(sg_sysfs_class); err_out: unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0), SG_MAX_DEVS); return rc; @@ -1703,7 +1702,7 @@ exit_sg(void) sg_proc_cleanup(); #endif /* CONFIG_SCSI_PROC_FS */ scsi_unregister_interface(&sg_interface); - class_simple_destroy(sg_sysfs_class); + class_destroy(sg_sysfs_class); sg_sysfs_valid = 0; unregister_chrdev_region(MKDEV(SCSI_GENERIC_MAJOR, 0), SG_MAX_DEVS);