Skip to content

Commit 2a92466

Browse files
committed
ide: remove needless drive->present checks from device drivers
Remove needless drive->present checks from ->probe methods (device model takes care of that). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
1 parent 3cd5f1e commit 2a92466

5 files changed

Lines changed: 7 additions & 9 deletions

File tree

‎drivers/ide/ide-cd.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2109,10 +2109,10 @@ static int ide_cd_probe(ide_drive_t *drive)
21092109

21102110
if (!strstr("ide-cdrom", drive->driver_req))
21112111
goto failed;
2112-
if (!drive->present)
2113-
goto failed;
2112+
21142113
if (drive->media != ide_cdrom && drive->media != ide_optical)
21152114
goto failed;
2115+
21162116
/* skip drives that we were told to ignore */
21172117
if (ignore != NULL) {
21182118
if (strstr(ignore, drive->name)) {

‎drivers/ide/ide-disk.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,8 +1136,7 @@ static int ide_disk_probe(ide_drive_t *drive)
11361136
/* strstr("foo", "") is non-NULL */
11371137
if (!strstr("ide-disk", drive->driver_req))
11381138
goto failed;
1139-
if (!drive->present)
1140-
goto failed;
1139+
11411140
if (drive->media != ide_disk)
11421141
goto failed;
11431142

‎drivers/ide/ide-floppy.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,10 +1390,10 @@ static int ide_floppy_probe(ide_drive_t *drive)
13901390

13911391
if (!strstr("ide-floppy", drive->driver_req))
13921392
goto failed;
1393-
if (!drive->present)
1394-
goto failed;
1393+
13951394
if (drive->media != ide_floppy)
13961395
goto failed;
1396+
13971397
if (!idefloppy_identify_device(drive, drive->id)) {
13981398
printk(KERN_ERR "ide-floppy: %s: not supported by this version"
13991399
" of ide-floppy\n", drive->name);

‎drivers/ide/ide-tape.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2647,10 +2647,10 @@ static int ide_tape_probe(ide_drive_t *drive)
26472647

26482648
if (!strstr("ide-tape", drive->driver_req))
26492649
goto failed;
2650-
if (!drive->present)
2651-
goto failed;
2650+
26522651
if (drive->media != ide_tape)
26532652
goto failed;
2653+
26542654
if (!idetape_identify_device(drive)) {
26552655
printk(KERN_ERR "ide-tape: %s: not supported by this version of"
26562656
" the driver\n", drive->name);

‎drivers/scsi/ide-scsi.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,6 @@ static int ide_scsi_probe(ide_drive_t *drive)
822822
return -ENODEV;
823823

824824
if (!strstr("ide-scsi", drive->driver_req) ||
825-
!drive->present ||
826825
drive->media == ide_disk ||
827826
!(host = scsi_host_alloc(&idescsi_template,sizeof(idescsi_scsi_t))))
828827
return -ENODEV;

0 commit comments

Comments
 (0)