Commit fc99856a authored by Adrian Bunk's avatar Adrian Bunk Committed by Bartlomiej Zolnierkiewicz

ide-cd: use bcd2bin/bin2bcd

Change ide-cd to use the new bcd2bin/bin2bcd functions instead of the
obsolete BCD2BIN/BIN2BCD macros.
Signed-off-by: default avatarAdrian Bunk <bunk@kernel.org>
Acked-by: default avatarBorislav Petkov <petkovbb@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent bce31b67
...@@ -1272,9 +1272,9 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq, ...@@ -1272,9 +1272,9 @@ static ide_startstop_t ide_cd_do_request(ide_drive_t *drive, struct request *rq,
*/ */
static void msf_from_bcd(struct atapi_msf *msf) static void msf_from_bcd(struct atapi_msf *msf)
{ {
msf->minute = BCD2BIN(msf->minute); msf->minute = bcd2bin(msf->minute);
msf->second = BCD2BIN(msf->second); msf->second = bcd2bin(msf->second);
msf->frame = BCD2BIN(msf->frame); msf->frame = bcd2bin(msf->frame);
} }
int cdrom_check_status(ide_drive_t *drive, struct request_sense *sense) int cdrom_check_status(ide_drive_t *drive, struct request_sense *sense)
...@@ -1415,8 +1415,8 @@ int ide_cd_read_toc(ide_drive_t *drive, struct request_sense *sense) ...@@ -1415,8 +1415,8 @@ int ide_cd_read_toc(ide_drive_t *drive, struct request_sense *sense)
return stat; return stat;
if (drive->atapi_flags & IDE_AFLAG_TOCTRACKS_AS_BCD) { if (drive->atapi_flags & IDE_AFLAG_TOCTRACKS_AS_BCD) {
toc->hdr.first_track = BCD2BIN(toc->hdr.first_track); toc->hdr.first_track = bcd2bin(toc->hdr.first_track);
toc->hdr.last_track = BCD2BIN(toc->hdr.last_track); toc->hdr.last_track = bcd2bin(toc->hdr.last_track);
} }
ntracks = toc->hdr.last_track - toc->hdr.first_track + 1; ntracks = toc->hdr.last_track - toc->hdr.first_track + 1;
...@@ -1456,8 +1456,8 @@ int ide_cd_read_toc(ide_drive_t *drive, struct request_sense *sense) ...@@ -1456,8 +1456,8 @@ int ide_cd_read_toc(ide_drive_t *drive, struct request_sense *sense)
return stat; return stat;
if (drive->atapi_flags & IDE_AFLAG_TOCTRACKS_AS_BCD) { if (drive->atapi_flags & IDE_AFLAG_TOCTRACKS_AS_BCD) {
toc->hdr.first_track = (u8)BIN2BCD(CDROM_LEADOUT); toc->hdr.first_track = (u8)bin2bcd(CDROM_LEADOUT);
toc->hdr.last_track = (u8)BIN2BCD(CDROM_LEADOUT); toc->hdr.last_track = (u8)bin2bcd(CDROM_LEADOUT);
} else { } else {
toc->hdr.first_track = CDROM_LEADOUT; toc->hdr.first_track = CDROM_LEADOUT;
toc->hdr.last_track = CDROM_LEADOUT; toc->hdr.last_track = CDROM_LEADOUT;
...@@ -1470,14 +1470,14 @@ int ide_cd_read_toc(ide_drive_t *drive, struct request_sense *sense) ...@@ -1470,14 +1470,14 @@ int ide_cd_read_toc(ide_drive_t *drive, struct request_sense *sense)
toc->hdr.toc_length = be16_to_cpu(toc->hdr.toc_length); toc->hdr.toc_length = be16_to_cpu(toc->hdr.toc_length);
if (drive->atapi_flags & IDE_AFLAG_TOCTRACKS_AS_BCD) { if (drive->atapi_flags & IDE_AFLAG_TOCTRACKS_AS_BCD) {
toc->hdr.first_track = BCD2BIN(toc->hdr.first_track); toc->hdr.first_track = bcd2bin(toc->hdr.first_track);
toc->hdr.last_track = BCD2BIN(toc->hdr.last_track); toc->hdr.last_track = bcd2bin(toc->hdr.last_track);
} }
for (i = 0; i <= ntracks; i++) { for (i = 0; i <= ntracks; i++) {
if (drive->atapi_flags & IDE_AFLAG_TOCADDR_AS_BCD) { if (drive->atapi_flags & IDE_AFLAG_TOCADDR_AS_BCD) {
if (drive->atapi_flags & IDE_AFLAG_TOCTRACKS_AS_BCD) if (drive->atapi_flags & IDE_AFLAG_TOCTRACKS_AS_BCD)
toc->ent[i].track = BCD2BIN(toc->ent[i].track); toc->ent[i].track = bcd2bin(toc->ent[i].track);
msf_from_bcd(&toc->ent[i].addr.msf); msf_from_bcd(&toc->ent[i].addr.msf);
} }
toc->ent[i].addr.lba = msf_to_lba(toc->ent[i].addr.msf.minute, toc->ent[i].addr.lba = msf_to_lba(toc->ent[i].addr.msf.minute,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment