]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ide: remove needless drive->present checks from device drivers
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 10 Oct 2008 20:39:24 +0000 (22:39 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 10 Oct 2008 20:39:24 +0000 (22:39 +0200)
Remove needless drive->present checks from ->probe methods
(device model takes care of that).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-cd.c
drivers/ide/ide-disk.c
drivers/ide/ide-floppy.c
drivers/ide/ide-tape.c
drivers/scsi/ide-scsi.c

index accb53b85ba7edca91ba5f31fb3cee99c78aeaac..607af5de16f8ab60bc3c4b502b05343570a79635 100644 (file)
@@ -2109,10 +2109,10 @@ static int ide_cd_probe(ide_drive_t *drive)
 
        if (!strstr("ide-cdrom", drive->driver_req))
                goto failed;
-       if (!drive->present)
-               goto failed;
+
        if (drive->media != ide_cdrom && drive->media != ide_optical)
                goto failed;
+
        /* skip drives that we were told to ignore */
        if (ignore != NULL) {
                if (strstr(ignore, drive->name)) {
index edfa63750dde075a1557e3d49df3f590842e0cc8..eeb2c3b22e9791c0793ce57cdafbcf1165e2e2ce 100644 (file)
@@ -1136,8 +1136,7 @@ static int ide_disk_probe(ide_drive_t *drive)
        /* strstr("foo", "") is non-NULL */
        if (!strstr("ide-disk", drive->driver_req))
                goto failed;
-       if (!drive->present)
-               goto failed;
+
        if (drive->media != ide_disk)
                goto failed;
 
index 59baa9643f8b4db43bb9d0ced73e53cccea86e9b..327960380908df3e1107c28f71c13ba230d547b8 100644 (file)
@@ -1390,10 +1390,10 @@ static int ide_floppy_probe(ide_drive_t *drive)
 
        if (!strstr("ide-floppy", drive->driver_req))
                goto failed;
-       if (!drive->present)
-               goto failed;
+
        if (drive->media != ide_floppy)
                goto failed;
+
        if (!idefloppy_identify_device(drive, drive->id)) {
                printk(KERN_ERR "ide-floppy: %s: not supported by this version"
                                " of ide-floppy\n", drive->name);
index 2745e5d268487f46841fae0dd553e9ef8005c07b..874e60fc85d16e15073f132d08427bb2940b31f7 100644 (file)
@@ -2647,10 +2647,10 @@ static int ide_tape_probe(ide_drive_t *drive)
 
        if (!strstr("ide-tape", drive->driver_req))
                goto failed;
-       if (!drive->present)
-               goto failed;
+
        if (drive->media != ide_tape)
                goto failed;
+
        if (!idetape_identify_device(drive)) {
                printk(KERN_ERR "ide-tape: %s: not supported by this version of"
                                " the driver\n", drive->name);
index daa5f3115ddc25e2b2222823fbc9dcb60e0336e6..6a661a4454ee4a2f415a365b080dd13d0cd54da9 100644 (file)
@@ -822,7 +822,6 @@ static int ide_scsi_probe(ide_drive_t *drive)
                return -ENODEV;
 
        if (!strstr("ide-scsi", drive->driver_req) ||
-           !drive->present ||
            drive->media == ide_disk ||
            !(host = scsi_host_alloc(&idescsi_template,sizeof(idescsi_scsi_t))))
                return -ENODEV;