Skip to content

Commit

Permalink
ide-cd: fix ACER/AOpen 24X CDROM speed reporting on big-endian machines
Browse files Browse the repository at this point in the history
* Fix ACER/AOpen 24X CDROM speed reporting on big-endian machines
  by adding missing le16_to_cpu() calls.

While at it:
* Replace ntohs() by be16_to_cpu().

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Dec 24, 2007
1 parent 3cbd814 commit aa5dc8e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2688,14 +2688,14 @@ void ide_cdrom_update_speed (ide_drive_t *drive, struct atapi_capabilities_page
if (!drive->id->model[0] &&
!strncmp(drive->id->fw_rev, "241N", 4)) {
CDROM_STATE_FLAGS(drive)->current_speed =
(((unsigned int)cap->curspeed) + (176/2)) / 176;
(le16_to_cpu(cap->curspeed) + (176/2)) / 176;
CDROM_CONFIG_FLAGS(drive)->max_speed =
(((unsigned int)cap->maxspeed) + (176/2)) / 176;
(le16_to_cpu(cap->maxspeed) + (176/2)) / 176;
} else {
CDROM_STATE_FLAGS(drive)->current_speed =
(ntohs(cap->curspeed) + (176/2)) / 176;
(be16_to_cpu(cap->curspeed) + (176/2)) / 176;
CDROM_CONFIG_FLAGS(drive)->max_speed =
(ntohs(cap->maxspeed) + (176/2)) / 176;
(be16_to_cpu(cap->maxspeed) + (176/2)) / 176;
}
}

Expand Down

0 comments on commit aa5dc8e

Please sign in to comment.