aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-01 17:09:20 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-01 17:09:20 -0500
commit481c8c6476f86d7e92435764ba710315d644a45e (patch)
tree1fd78ec51fee83d680f5221dbf4dc33322b69480 /drivers/ide
parentf18f960c5c1568fa2f720e2cb31d6c1af9ea1e1a (diff)
ide-cd: cleanup ide_cdrom_update_speed()
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide-cd.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index f02ddc5b3b17..0f6d2e065b9a 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -2416,19 +2416,20 @@ int ide_cdrom_get_capabilities(ide_drive_t *drive, struct atapi_capabilities_pag
2416static 2416static
2417void ide_cdrom_update_speed (ide_drive_t *drive, struct atapi_capabilities_page *cap) 2417void ide_cdrom_update_speed (ide_drive_t *drive, struct atapi_capabilities_page *cap)
2418{ 2418{
2419 u16 curspeed, maxspeed;
2420
2419 /* The ACER/AOpen 24X cdrom has the speed fields byte-swapped */ 2421 /* The ACER/AOpen 24X cdrom has the speed fields byte-swapped */
2420 if (!drive->id->model[0] && 2422 if (!drive->id->model[0] &&
2421 !strncmp(drive->id->fw_rev, "241N", 4)) { 2423 !strncmp(drive->id->fw_rev, "241N", 4)) {
2422 CDROM_STATE_FLAGS(drive)->current_speed = 2424 curspeed = le16_to_cpu(cap->curspeed);
2423 (le16_to_cpu(cap->curspeed) + (176/2)) / 176; 2425 maxspeed = le16_to_cpu(cap->maxspeed);
2424 CDROM_CONFIG_FLAGS(drive)->max_speed =
2425 (le16_to_cpu(cap->maxspeed) + (176/2)) / 176;
2426 } else { 2426 } else {
2427 CDROM_STATE_FLAGS(drive)->current_speed = 2427 curspeed = be16_to_cpu(cap->curspeed);
2428 (be16_to_cpu(cap->curspeed) + (176/2)) / 176; 2428 maxspeed = be16_to_cpu(cap->maxspeed);
2429 CDROM_CONFIG_FLAGS(drive)->max_speed =
2430 (be16_to_cpu(cap->maxspeed) + (176/2)) / 176;
2431 } 2429 }
2430
2431 CDROM_STATE_FLAGS(drive)->current_speed = (curspeed + (176/2)) / 176;
2432 CDROM_CONFIG_FLAGS(drive)->max_speed = (maxspeed + (176/2)) / 176;
2432} 2433}
2433 2434
2434static 2435static