]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/osst.c
[SCSI] lpfc 8.1.2: Misc FC Discovery changes :
[linux-2.6-omap-h63xx.git] / drivers / scsi / osst.c
index 3f2f2464fa6351ebbe8938c594e3f3cce3dec9c1..b9f6084fdd9e9626a381a9197944252c7d33cc8b 100644 (file)
@@ -48,7 +48,6 @@ static const char * osst_version = "0.99.3";
 #include <linux/vmalloc.h>
 #include <linux/blkdev.h>
 #include <linux/moduleparam.h>
-#include <linux/devfs_fs_kernel.h>
 #include <linux/delay.h>
 #include <asm/uaccess.h>
 #include <asm/dma.h>
@@ -107,8 +106,6 @@ static struct osst_dev_parm {
 };
 #endif
 
-static char *osst_formats[ST_NBR_MODES] ={"", "l", "m", "a"};
-
 /* Some default definitions have been moved to osst_options.h */
 #define OSST_BUFFER_SIZE (OSST_BUFFER_BLOCKS * ST_KILOBYTE)
 #define OSST_WRITE_THRESHOLD (OSST_WRITE_THRESHOLD_BLOCKS * ST_KILOBYTE)
@@ -862,8 +859,7 @@ static int osst_recover_wait_frame(struct osst_tape * STp, struct scsi_request *
                                retval = osst_write_error_recovery(STp, aSRpnt, 0);
                                break;
                        }
-                       set_current_state(TASK_INTERRUPTIBLE);
-                       schedule_timeout (HZ / OSST_POLL_PER_SEC);
+                       schedule_timeout_interruptible(HZ / OSST_POLL_PER_SEC);
 
                        STp->buffer->b_data = mybuf; STp->buffer->buffer_size = 24;
                        memset(cmd, 0, MAX_COMMAND_SIZE);
@@ -1558,8 +1554,7 @@ static int osst_reposition_and_retry(struct osst_tape * STp, struct scsi_request
                        osst_set_frame_position(STp, aSRpnt, frame + skip, 1);
                        flag = 0;
                        attempts--;
-                       set_current_state(TASK_INTERRUPTIBLE);
-                       schedule_timeout(HZ / 10);
+                       schedule_timeout_interruptible(msecs_to_jiffies(100));
                }
                if (osst_get_frame_position(STp, aSRpnt) < 0) {         /* additional write error */
 #if DEBUG
@@ -1620,8 +1615,7 @@ static int osst_reposition_and_retry(struct osst_tape * STp, struct scsi_request
                        debugging = 0;
                }
 #endif
-               set_current_state(TASK_INTERRUPTIBLE);
-               schedule_timeout(HZ / 10);
+               schedule_timeout_interruptible(msecs_to_jiffies(100));
        }
        printk(KERN_ERR "%s:E: Failed to find valid tape media\n", name);
 #if DEBUG
@@ -5146,7 +5140,8 @@ static long osst_compat_ioctl(struct file * file, unsigned int cmd_in, unsigned
 /* Try to allocate a new tape buffer skeleton. Caller must not hold os_scsi_tapes_lock */
 static struct osst_buffer * new_tape_buffer( int from_initialization, int need_dma, int max_sg )
 {
-       int i, priority;
+       int i;
+       gfp_t priority;
        struct osst_buffer *tb;
 
        if (from_initialization)
@@ -5178,7 +5173,8 @@ static struct osst_buffer * new_tape_buffer( int from_initialization, int need_d
 /* Try to allocate a temporary (while a user has the device open) enlarged tape buffer */
 static int enlarge_buffer(struct osst_buffer *STbuffer, int need_dma)
 {
-       int segs, nbr, max_segs, b_size, priority, order, got;
+       int segs, nbr, max_segs, b_size, order, got;
+       gfp_t priority;
 
        if (STbuffer->buffer_size >= OS_FRAME_SIZE)
                return 1;
@@ -5627,7 +5623,7 @@ static void osst_sysfs_add(dev_t dev, struct device *device, struct osst_tape *
 
        if (!osst_sysfs_valid) return;
 
-       osst_class_member = class_device_create(osst_sysfs_class, dev, device, "%s", name);
+       osst_class_member = class_device_create(osst_sysfs_class, NULL, dev, device, "%s", name);
        if (IS_ERR(osst_class_member)) {
                printk(KERN_WARNING "osst :W: Unable to add sysfs class member %s\n", name);
                return;
@@ -5668,7 +5664,7 @@ static int osst_probe(struct device *dev)
        struct st_partstat * STps;
        struct osst_buffer * buffer;
        struct gendisk     * drive;
-       int                  i, mode, dev_num;
+       int                  i, dev_num;
 
        if (SDp->type != TYPE_TAPE || !osst_supports(SDp))
                return -ENODEV;
@@ -5804,22 +5800,10 @@ static int osst_probe(struct device *dev)
                snprintf(name, 8, "%s%s", "n", tape_name(tpnt));
                osst_sysfs_add(MKDEV(OSST_MAJOR, dev_num + 128), dev, tpnt, name);
        }
-       for (mode = 0; mode < ST_NBR_MODES; ++mode) {
-               /*  Rewind entry  */
-               devfs_mk_cdev(MKDEV(OSST_MAJOR, dev_num + (mode << 5)),
-                               S_IFCHR | S_IRUGO | S_IWUGO,
-                               "%s/ot%s", SDp->devfs_name, osst_formats[mode]);
-
-               /*  No-rewind entry  */
-               devfs_mk_cdev(MKDEV(OSST_MAJOR, dev_num + (mode << 5) + 128),
-                               S_IFCHR | S_IRUGO | S_IWUGO,
-                               "%s/ot%sn", SDp->devfs_name, osst_formats[mode]);
-       }
-       drive->number = devfs_register_tape(SDp->devfs_name);
 
-       printk(KERN_INFO
-               "osst :I: Attached OnStream %.5s tape at scsi%d, channel %d, id %d, lun %d as %s\n",
-               SDp->model, SDp->host->host_no, SDp->channel, SDp->id, SDp->lun, tape_name(tpnt));
+       sdev_printk(KERN_INFO, SDp,
+               "osst :I: Attached OnStream %.5s tape as %s\n",
+               SDp->model, tape_name(tpnt));
 
        return 0;
 
@@ -5832,7 +5816,7 @@ static int osst_remove(struct device *dev)
 {
        struct scsi_device * SDp = to_scsi_device(dev);
        struct osst_tape * tpnt;
-       int i, mode;
+       int i;
 
        if ((SDp->type != TYPE_TAPE) || (osst_nr_dev <= 0))
                return 0;
@@ -5843,11 +5827,6 @@ static int osst_remove(struct device *dev)
                        osst_sysfs_destroy(MKDEV(OSST_MAJOR, i));
                        osst_sysfs_destroy(MKDEV(OSST_MAJOR, i+128));
                        tpnt->device = NULL;
-                       for (mode = 0; mode < ST_NBR_MODES; ++mode) {
-                               devfs_remove("%s/ot%s", SDp->devfs_name, osst_formats[mode]);
-                               devfs_remove("%s/ot%sn", SDp->devfs_name, osst_formats[mode]);
-                       }
-                       devfs_unregister_tape(tpnt->drive->number);
                        put_disk(tpnt->drive);
                        os_scsi_tapes[i] = NULL;
                        osst_nr_dev--;