]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/ide-tape.c
ide: allow device drivers to specify per-device type /proc settings
[linux-2.6-omap-h63xx.git] / drivers / ide / ide-tape.c
index 27665e3a41cbf8357c2eeaa75e9cc4ea0be2ad2f..b2b2e5e8d38ebf499ec78ffd48df02d2b88496f9 100644 (file)
@@ -2108,7 +2108,7 @@ static void idetape_get_mode_sense_results(ide_drive_t *drive)
 
        /* device lacks locking support according to capabilities page */
        if ((caps[6] & 1) == 0)
-               drive->atapi_flags |= IDE_AFLAG_NO_DOORLOCK;
+               drive->dev_flags &= ~IDE_DFLAG_DOORLOCKING;
 
        if (caps[7] & 0x02)
                tape->blk_size = 512;
@@ -2185,7 +2185,6 @@ static void idetape_setup(ide_drive_t *drive, idetape_tape_t *tape, int minor)
        unsigned long t;
        int speed;
        int buffer_size;
-       u8 gcw[2];
        u16 *ctl = (u16 *)&tape->caps[12];
 
        drive->pc_callback       = ide_tape_callback;
@@ -2212,12 +2211,6 @@ static void idetape_setup(ide_drive_t *drive, idetape_tape_t *tape, int minor)
        tape->name[2] = '0' + minor;
        tape->chrdev_dir = IDETAPE_DIR_NONE;
 
-       *((u16 *)&gcw) = drive->id[ATA_ID_CONFIG];
-
-       /* Command packet DRQ type */
-       if (((gcw[0] & 0x60) >> 5) == 1)
-               set_bit(IDE_AFLAG_DRQ_INTERRUPT, &drive->atapi_flags);
-
        idetape_get_inquiry_results(drive);
        idetape_get_mode_sense_results(drive);
        ide_tape_get_bsize_from_bdesc(drive);
@@ -2305,6 +2298,16 @@ static ide_proc_entry_t idetape_proc[] = {
        { "name",       S_IFREG|S_IRUGO,        proc_idetape_read_name, NULL },
        { NULL, 0, NULL, NULL }
 };
+
+static ide_proc_entry_t *ide_tape_proc_entries(ide_drive_t *drive)
+{
+       return idetape_proc;
+}
+
+static const struct ide_proc_devset *ide_tape_proc_devsets(ide_drive_t *drive)
+{
+       return idetape_settings;
+}
 #endif
 
 static int ide_tape_probe(ide_drive_t *);
@@ -2322,8 +2325,8 @@ static ide_driver_t idetape_driver = {
        .end_request            = idetape_end_request,
        .error                  = __ide_error,
 #ifdef CONFIG_IDE_PROC_FS
-       .proc                   = idetape_proc,
-       .settings               = idetape_settings,
+       .proc_entries           = ide_tape_proc_entries,
+       .proc_devsets           = ide_tape_proc_devsets,
 #endif
 };
 
@@ -2427,12 +2430,11 @@ static int ide_tape_probe(ide_drive_t *drive)
 
        idetape_setup(drive, tape, minor);
 
-       device_create_drvdata(idetape_sysfs_class, &drive->gendev,
-                             MKDEV(IDETAPE_MAJOR, minor), NULL,
-                             "%s", tape->name);
-       device_create_drvdata(idetape_sysfs_class, &drive->gendev,
-                             MKDEV(IDETAPE_MAJOR, minor + 128), NULL,
-                             "n%s", tape->name);
+       device_create(idetape_sysfs_class, &drive->gendev,
+                     MKDEV(IDETAPE_MAJOR, minor), NULL, "%s", tape->name);
+       device_create(idetape_sysfs_class, &drive->gendev,
+                     MKDEV(IDETAPE_MAJOR, minor + 128), NULL,
+                     "n%s", tape->name);
 
        g->fops = &idetape_block_ops;
        ide_register_region(g);