ide-atapi: add a dev_is_idecd-inline
authorBorislav Petkov <petkovbb@googlemail.com>
Fri, 2 Jan 2009 15:12:52 +0000 (16:12 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Fri, 2 Jan 2009 15:12:52 +0000 (16:12 +0100)
There should be no functionality change resulting from this patch.

Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-atapi.c

index 4e58b9e7a58a01592eb3e130aee781a41e4891d1..33a15343e8bbbcc5b2d2b8441163b25ac52b244d 100644 (file)
 #define debug_log(fmt, args...) do {} while (0)
 #endif
 
+static inline int dev_is_idecd(ide_drive_t *drive)
+{
+       return (drive->media == ide_cdrom || drive->media == ide_optical) &&
+               !(drive->dev_flags & IDE_DFLAG_SCSI);
+}
+
 /*
  * Check whether we can support a device,
  * based on the ATAPI IDENTIFY command results.
@@ -577,7 +583,7 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, unsigned int timeout,
 
        if (scsi)
                tf_flags = 0;
-       else if (drive->media == ide_cdrom || drive->media == ide_optical)
+       else if (dev_is_idecd(drive))
                tf_flags = IDE_TFLAG_OUT_NSECT | IDE_TFLAG_OUT_LBAL;
        else
                tf_flags = IDE_TFLAG_OUT_DEVICE;