diff options
author | Borislav Petkov <petkovbb@googlemail.com> | 2009-01-02 10:12:52 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-01-02 10:12:52 -0500 |
commit | 991cb26a6ad287c3bc6555c41e830590a23910c4 (patch) | |
tree | 3bd8546ca394103083047af6b9fabf7545b38cf3 /drivers/ide | |
parent | 93c164af19f608c5f737eb9bed8cb4de3a872329 (diff) |
ide-atapi: add a dev_is_idecd-inline
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>
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/ide-atapi.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c index 4e58b9e7a58a..33a15343e8bb 100644 --- a/drivers/ide/ide-atapi.c +++ b/drivers/ide/ide-atapi.c | |||
@@ -14,6 +14,12 @@ | |||
14 | #define debug_log(fmt, args...) do {} while (0) | 14 | #define debug_log(fmt, args...) do {} while (0) |
15 | #endif | 15 | #endif |
16 | 16 | ||
17 | static inline int dev_is_idecd(ide_drive_t *drive) | ||
18 | { | ||
19 | return (drive->media == ide_cdrom || drive->media == ide_optical) && | ||
20 | !(drive->dev_flags & IDE_DFLAG_SCSI); | ||
21 | } | ||
22 | |||
17 | /* | 23 | /* |
18 | * Check whether we can support a device, | 24 | * Check whether we can support a device, |
19 | * based on the ATAPI IDENTIFY command results. | 25 | * based on the ATAPI IDENTIFY command results. |
@@ -577,7 +583,7 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, unsigned int timeout, | |||
577 | 583 | ||
578 | if (scsi) | 584 | if (scsi) |
579 | tf_flags = 0; | 585 | tf_flags = 0; |
580 | else if (drive->media == ide_cdrom || drive->media == ide_optical) | 586 | else if (dev_is_idecd(drive)) |
581 | tf_flags = IDE_TFLAG_OUT_NSECT | IDE_TFLAG_OUT_LBAL; | 587 | tf_flags = IDE_TFLAG_OUT_NSECT | IDE_TFLAG_OUT_LBAL; |
582 | else | 588 | else |
583 | tf_flags = IDE_TFLAG_OUT_DEVICE; | 589 | tf_flags = IDE_TFLAG_OUT_DEVICE; |