aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cdrom
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cdrom')
-rw-r--r--drivers/cdrom/cm206.c113
-rw-r--r--drivers/cdrom/isp16.c2
-rw-r--r--drivers/cdrom/mcdx.c8
-rw-r--r--drivers/cdrom/optcd.c28
-rw-r--r--drivers/cdrom/sonycd535.c3
5 files changed, 70 insertions, 84 deletions
diff --git a/drivers/cdrom/cm206.c b/drivers/cdrom/cm206.c
index da80b14335a5..01f035173328 100644
--- a/drivers/cdrom/cm206.c
+++ b/drivers/cdrom/cm206.c
@@ -307,7 +307,7 @@ static DEFINE_SPINLOCK(cm206_lock);
307/* First, we define some polling functions. These are actually 307/* First, we define some polling functions. These are actually
308 only being used in the initialization. */ 308 only being used in the initialization. */
309 309
310void send_command_polled(int command) 310static void send_command_polled(int command)
311{ 311{
312 int loop = POLLOOP; 312 int loop = POLLOOP;
313 while (!(inw(r_line_status) & ls_transmitter_buffer_empty) 313 while (!(inw(r_line_status) & ls_transmitter_buffer_empty)
@@ -318,7 +318,7 @@ void send_command_polled(int command)
318 outw(command, r_uart_transmit); 318 outw(command, r_uart_transmit);
319} 319}
320 320
321uch receive_echo_polled(void) 321static uch receive_echo_polled(void)
322{ 322{
323 int loop = POLLOOP; 323 int loop = POLLOOP;
324 while (!(inw(r_line_status) & ls_receive_buffer_full) && loop > 0) { 324 while (!(inw(r_line_status) & ls_receive_buffer_full) && loop > 0) {
@@ -328,13 +328,13 @@ uch receive_echo_polled(void)
328 return ((uch) inw(r_uart_receive)); 328 return ((uch) inw(r_uart_receive));
329} 329}
330 330
331uch send_receive_polled(int command) 331static uch send_receive_polled(int command)
332{ 332{
333 send_command_polled(command); 333 send_command_polled(command);
334 return receive_echo_polled(); 334 return receive_echo_polled();
335} 335}
336 336
337inline void clear_ur(void) 337static inline void clear_ur(void)
338{ 338{
339 if (cd->ur_r != cd->ur_w) { 339 if (cd->ur_r != cd->ur_w) {
340 debug(("Deleting bytes from fifo:")); 340 debug(("Deleting bytes from fifo:"));
@@ -439,7 +439,7 @@ static irqreturn_t cm206_interrupt(int sig, void *dev_id, struct pt_regs *regs)
439} 439}
440 440
441/* we have put the address of the wait queue in who */ 441/* we have put the address of the wait queue in who */
442void cm206_timeout(unsigned long who) 442static void cm206_timeout(unsigned long who)
443{ 443{
444 cd->timed_out = 1; 444 cd->timed_out = 1;
445 debug(("Timing out\n")); 445 debug(("Timing out\n"));
@@ -448,7 +448,7 @@ void cm206_timeout(unsigned long who)
448 448
449/* This function returns 1 if a timeout occurred, 0 if an interrupt 449/* This function returns 1 if a timeout occurred, 0 if an interrupt
450 happened */ 450 happened */
451int sleep_or_timeout(wait_queue_head_t * wait, int timeout) 451static int sleep_or_timeout(wait_queue_head_t * wait, int timeout)
452{ 452{
453 cd->timed_out = 0; 453 cd->timed_out = 0;
454 init_timer(&cd->timer); 454 init_timer(&cd->timer);
@@ -465,13 +465,7 @@ int sleep_or_timeout(wait_queue_head_t * wait, int timeout)
465 return 0; 465 return 0;
466} 466}
467 467
468void cm206_delay(int nr_jiffies) 468static void send_command(int command)
469{
470 DECLARE_WAIT_QUEUE_HEAD(wait);
471 sleep_or_timeout(&wait, nr_jiffies);
472}
473
474void send_command(int command)
475{ 469{
476 debug(("Sending 0x%x\n", command)); 470 debug(("Sending 0x%x\n", command));
477 if (!(inw(r_line_status) & ls_transmitter_buffer_empty)) { 471 if (!(inw(r_line_status) & ls_transmitter_buffer_empty)) {
@@ -490,7 +484,7 @@ void send_command(int command)
490 outw(command, r_uart_transmit); 484 outw(command, r_uart_transmit);
491} 485}
492 486
493uch receive_byte(int timeout) 487static uch receive_byte(int timeout)
494{ 488{
495 uch ret; 489 uch ret;
496 cli(); 490 cli();
@@ -521,23 +515,23 @@ uch receive_byte(int timeout)
521 return ret; 515 return ret;
522} 516}
523 517
524inline uch receive_echo(void) 518static inline uch receive_echo(void)
525{ 519{
526 return receive_byte(UART_TIMEOUT); 520 return receive_byte(UART_TIMEOUT);
527} 521}
528 522
529inline uch send_receive(int command) 523static inline uch send_receive(int command)
530{ 524{
531 send_command(command); 525 send_command(command);
532 return receive_echo(); 526 return receive_echo();
533} 527}
534 528
535inline uch wait_dsb(void) 529static inline uch wait_dsb(void)
536{ 530{
537 return receive_byte(DSB_TIMEOUT); 531 return receive_byte(DSB_TIMEOUT);
538} 532}
539 533
540int type_0_command(int command, int expect_dsb) 534static int type_0_command(int command, int expect_dsb)
541{ 535{
542 int e; 536 int e;
543 clear_ur(); 537 clear_ur();
@@ -552,7 +546,7 @@ int type_0_command(int command, int expect_dsb)
552 return 0; 546 return 0;
553} 547}
554 548
555int type_1_command(int command, int bytes, uch * status) 549static int type_1_command(int command, int bytes, uch * status)
556{ /* returns info */ 550{ /* returns info */
557 int i; 551 int i;
558 if (type_0_command(command, 0)) 552 if (type_0_command(command, 0))
@@ -564,7 +558,7 @@ int type_1_command(int command, int bytes, uch * status)
564 558
565/* This function resets the adapter card. We'd better not do this too 559/* This function resets the adapter card. We'd better not do this too
566 * often, because it tends to generate `lost interrupts.' */ 560 * often, because it tends to generate `lost interrupts.' */
567void reset_cm260(void) 561static void reset_cm260(void)
568{ 562{
569 outw(dc_normal | dc_initialize | READ_AHEAD, r_data_control); 563 outw(dc_normal | dc_initialize | READ_AHEAD, r_data_control);
570 udelay(10); /* 3.3 mu sec minimum */ 564 udelay(10); /* 3.3 mu sec minimum */
@@ -572,7 +566,7 @@ void reset_cm260(void)
572} 566}
573 567
574/* fsm: frame-sec-min from linear address; one of many */ 568/* fsm: frame-sec-min from linear address; one of many */
575void fsm(int lba, uch * fsm) 569static void fsm(int lba, uch * fsm)
576{ 570{
577 fsm[0] = lba % 75; 571 fsm[0] = lba % 75;
578 lba /= 75; 572 lba /= 75;
@@ -581,17 +575,17 @@ void fsm(int lba, uch * fsm)
581 fsm[2] = lba / 60; 575 fsm[2] = lba / 60;
582} 576}
583 577
584inline int fsm2lba(uch * fsm) 578static inline int fsm2lba(uch * fsm)
585{ 579{
586 return fsm[0] + 75 * (fsm[1] - 2 + 60 * fsm[2]); 580 return fsm[0] + 75 * (fsm[1] - 2 + 60 * fsm[2]);
587} 581}
588 582
589inline int f_s_m2lba(uch f, uch s, uch m) 583static inline int f_s_m2lba(uch f, uch s, uch m)
590{ 584{
591 return f + 75 * (s - 2 + 60 * m); 585 return f + 75 * (s - 2 + 60 * m);
592} 586}
593 587
594int start_read(int start) 588static int start_read(int start)
595{ 589{
596 uch read_sector[4] = { c_read_data, }; 590 uch read_sector[4] = { c_read_data, };
597 int i, e; 591 int i, e;
@@ -613,7 +607,7 @@ int start_read(int start)
613 return 0; 607 return 0;
614} 608}
615 609
616int stop_read(void) 610static int stop_read(void)
617{ 611{
618 int e; 612 int e;
619 type_0_command(c_stop, 0); 613 type_0_command(c_stop, 0);
@@ -630,7 +624,7 @@ int stop_read(void)
630 routine takes care of this. Set a flag `background' in the cd 624 routine takes care of this. Set a flag `background' in the cd
631 struct to indicate the process. */ 625 struct to indicate the process. */
632 626
633int read_background(int start, int reading) 627static int read_background(int start, int reading)
634{ 628{
635 if (cd->background) 629 if (cd->background)
636 return -1; /* can't do twice */ 630 return -1; /* can't do twice */
@@ -658,7 +652,7 @@ void transport_data(int port, ush * dest, int count)
658 652
659 653
660#define MAX_TRIES 100 654#define MAX_TRIES 100
661int read_sector(int start) 655static int read_sector(int start)
662{ 656{
663 int tries = 0; 657 int tries = 0;
664 if (cd->background) { 658 if (cd->background) {
@@ -753,7 +747,7 @@ static DECLARE_TASKLET(cm206_tasklet, cm206_tasklet_func, 0);
753/* This command clears the dsb_possible_media_change flag, so we must 747/* This command clears the dsb_possible_media_change flag, so we must
754 * retain it. 748 * retain it.
755 */ 749 */
756void get_drive_status(void) 750static void get_drive_status(void)
757{ 751{
758 uch status[2]; 752 uch status[2];
759 type_1_command(c_drive_status, 2, status); /* this might be done faster */ 753 type_1_command(c_drive_status, 2, status); /* this might be done faster */
@@ -764,7 +758,7 @@ void get_drive_status(void)
764 dsb_drive_not_ready | dsb_tray_not_closed)); 758 dsb_drive_not_ready | dsb_tray_not_closed));
765} 759}
766 760
767void get_disc_status(void) 761static void get_disc_status(void)
768{ 762{
769 if (type_1_command(c_disc_status, 7, cd->disc_status)) { 763 if (type_1_command(c_disc_status, 7, cd->disc_status)) {
770 debug(("get_disc_status: error\n")); 764 debug(("get_disc_status: error\n"));
@@ -801,7 +795,7 @@ static void cm206_release(struct cdrom_device_info *cdi)
801 795
802/* Empty buffer empties $sectors$ sectors of the adapter card buffer, 796/* Empty buffer empties $sectors$ sectors of the adapter card buffer,
803 * and then reads a sector in kernel memory. */ 797 * and then reads a sector in kernel memory. */
804void empty_buffer(int sectors) 798static void empty_buffer(int sectors)
805{ 799{
806 while (sectors >= 0) { 800 while (sectors >= 0) {
807 transport_data(r_fifo_output_buffer, 801 transport_data(r_fifo_output_buffer,
@@ -819,7 +813,7 @@ void empty_buffer(int sectors)
819/* try_adapter. This function determines if the requested sector is 813/* try_adapter. This function determines if the requested sector is
820 in adapter memory, or will appear there soon. Returns 0 upon 814 in adapter memory, or will appear there soon. Returns 0 upon
821 success */ 815 success */
822int try_adapter(int sector) 816static int try_adapter(int sector)
823{ 817{
824 if (cd->adapter_first <= sector && sector < cd->adapter_last) { 818 if (cd->adapter_first <= sector && sector < cd->adapter_last) {
825 /* sector is in adapter memory */ 819 /* sector is in adapter memory */
@@ -910,7 +904,7 @@ static void do_cm206_request(request_queue_t * q)
910*/ 904*/
911 905
912/* seek seeks to address lba. It does wait to arrive there. */ 906/* seek seeks to address lba. It does wait to arrive there. */
913void seek(int lba) 907static void seek(int lba)
914{ 908{
915 int i; 909 int i;
916 uch seek_command[4] = { c_seek, }; 910 uch seek_command[4] = { c_seek, };
@@ -926,7 +920,7 @@ uch bcdbin(unsigned char bcd)
926 return (bcd >> 4) * 10 + (bcd & 0xf); 920 return (bcd >> 4) * 10 + (bcd & 0xf);
927} 921}
928 922
929inline uch normalize_track(uch track) 923static inline uch normalize_track(uch track)
930{ 924{
931 if (track < 1) 925 if (track < 1)
932 return 1; 926 return 1;
@@ -939,7 +933,7 @@ inline uch normalize_track(uch track)
939 * tracks seen in the process. Input $track$ must be between 1 and 933 * tracks seen in the process. Input $track$ must be between 1 and
940 * #-of-tracks+1. Note that the start of the disc must be in toc[1].fsm. 934 * #-of-tracks+1. Note that the start of the disc must be in toc[1].fsm.
941 */ 935 */
942int get_toc_lba(uch track) 936static int get_toc_lba(uch track)
943{ 937{
944 int max = 74 * 60 * 75 - 150, min = fsm2lba(cd->toc[1].fsm); 938 int max = 74 * 60 * 75 - 150, min = fsm2lba(cd->toc[1].fsm);
945 int i, lba, l, old_lba = 0; 939 int i, lba, l, old_lba = 0;
@@ -991,7 +985,7 @@ int get_toc_lba(uch track)
991 return lba; 985 return lba;
992} 986}
993 987
994void update_toc_entry(uch track) 988static void update_toc_entry(uch track)
995{ 989{
996 track = normalize_track(track); 990 track = normalize_track(track);
997 if (!cd->toc[track].track) 991 if (!cd->toc[track].track)
@@ -999,7 +993,7 @@ void update_toc_entry(uch track)
999} 993}
1000 994
1001/* return 0 upon success */ 995/* return 0 upon success */
1002int read_toc_header(struct cdrom_tochdr *hp) 996static int read_toc_header(struct cdrom_tochdr *hp)
1003{ 997{
1004 if (!FIRST_TRACK) 998 if (!FIRST_TRACK)
1005 get_disc_status(); 999 get_disc_status();
@@ -1016,7 +1010,7 @@ int read_toc_header(struct cdrom_tochdr *hp)
1016 return -1; 1010 return -1;
1017} 1011}
1018 1012
1019void play_from_to_msf(struct cdrom_msf *msfp) 1013static void play_from_to_msf(struct cdrom_msf *msfp)
1020{ 1014{
1021 uch play_command[] = { c_play, 1015 uch play_command[] = { c_play,
1022 msfp->cdmsf_frame0, msfp->cdmsf_sec0, msfp->cdmsf_min0, 1016 msfp->cdmsf_frame0, msfp->cdmsf_sec0, msfp->cdmsf_min0,
@@ -1032,7 +1026,7 @@ void play_from_to_msf(struct cdrom_msf *msfp)
1032 cd->dsb = wait_dsb(); 1026 cd->dsb = wait_dsb();
1033} 1027}
1034 1028
1035void play_from_to_track(int from, int to) 1029static void play_from_to_track(int from, int to)
1036{ 1030{
1037 uch play_command[8] = { c_play, }; 1031 uch play_command[8] = { c_play, };
1038 int i; 1032 int i;
@@ -1059,7 +1053,7 @@ void play_from_to_track(int from, int to)
1059 cd->dsb = wait_dsb(); 1053 cd->dsb = wait_dsb();
1060} 1054}
1061 1055
1062int get_current_q(struct cdrom_subchnl *qp) 1056static int get_current_q(struct cdrom_subchnl *qp)
1063{ 1057{
1064 int i; 1058 int i;
1065 uch *q = cd->q; 1059 uch *q = cd->q;
@@ -1093,14 +1087,14 @@ int get_current_q(struct cdrom_subchnl *qp)
1093 return 0; 1087 return 0;
1094} 1088}
1095 1089
1096void invalidate_toc(void) 1090static void invalidate_toc(void)
1097{ 1091{
1098 memset(cd->toc, 0, sizeof(cd->toc)); 1092 memset(cd->toc, 0, sizeof(cd->toc));
1099 memset(cd->disc_status, 0, sizeof(cd->disc_status)); 1093 memset(cd->disc_status, 0, sizeof(cd->disc_status));
1100} 1094}
1101 1095
1102/* cdrom.c guarantees that cdte_format == CDROM_MSF */ 1096/* cdrom.c guarantees that cdte_format == CDROM_MSF */
1103void get_toc_entry(struct cdrom_tocentry *ep) 1097static void get_toc_entry(struct cdrom_tocentry *ep)
1104{ 1098{
1105 uch track = normalize_track(ep->cdte_track); 1099 uch track = normalize_track(ep->cdte_track);
1106 update_toc_entry(track); 1100 update_toc_entry(track);
@@ -1117,8 +1111,8 @@ void get_toc_entry(struct cdrom_tocentry *ep)
1117 * upon success. Memory checking has been done by cdrom_ioctl(), the 1111 * upon success. Memory checking has been done by cdrom_ioctl(), the
1118 * calling function, as well as LBA/MSF sanitization. 1112 * calling function, as well as LBA/MSF sanitization.
1119*/ 1113*/
1120int cm206_audio_ioctl(struct cdrom_device_info *cdi, unsigned int cmd, 1114static int cm206_audio_ioctl(struct cdrom_device_info *cdi, unsigned int cmd,
1121 void *arg) 1115 void *arg)
1122{ 1116{
1123 switch (cmd) { 1117 switch (cmd) {
1124 case CDROMREADTOCHDR: 1118 case CDROMREADTOCHDR:
@@ -1189,7 +1183,7 @@ static int cm206_ioctl(struct cdrom_device_info *cdi, unsigned int cmd,
1189 } 1183 }
1190} 1184}
1191 1185
1192int cm206_media_changed(struct cdrom_device_info *cdi, int disc_nr) 1186static int cm206_media_changed(struct cdrom_device_info *cdi, int disc_nr)
1193{ 1187{
1194 if (cd != NULL) { 1188 if (cd != NULL) {
1195 int r; 1189 int r;
@@ -1204,16 +1198,9 @@ int cm206_media_changed(struct cdrom_device_info *cdi, int disc_nr)
1204/* The new generic cdrom support. Routines should be concise, most of 1198/* The new generic cdrom support. Routines should be concise, most of
1205 the logic should be in cdrom.c */ 1199 the logic should be in cdrom.c */
1206 1200
1207/* returns number of times device is in use */
1208int cm206_open_files(struct cdrom_device_info *cdi)
1209{
1210 if (cd)
1211 return cd->openfiles;
1212 return -1;
1213}
1214 1201
1215/* controls tray movement */ 1202/* controls tray movement */
1216int cm206_tray_move(struct cdrom_device_info *cdi, int position) 1203static int cm206_tray_move(struct cdrom_device_info *cdi, int position)
1217{ 1204{
1218 if (position) { /* 1: eject */ 1205 if (position) { /* 1: eject */
1219 type_0_command(c_open_tray, 1); 1206 type_0_command(c_open_tray, 1);
@@ -1224,7 +1211,7 @@ int cm206_tray_move(struct cdrom_device_info *cdi, int position)
1224} 1211}
1225 1212
1226/* gives current state of the drive */ 1213/* gives current state of the drive */
1227int cm206_drive_status(struct cdrom_device_info *cdi, int slot_nr) 1214static int cm206_drive_status(struct cdrom_device_info *cdi, int slot_nr)
1228{ 1215{
1229 get_drive_status(); 1216 get_drive_status();
1230 if (cd->dsb & dsb_tray_not_closed) 1217 if (cd->dsb & dsb_tray_not_closed)
@@ -1237,7 +1224,7 @@ int cm206_drive_status(struct cdrom_device_info *cdi, int slot_nr)
1237} 1224}
1238 1225
1239/* locks or unlocks door lock==1: lock; return 0 upon success */ 1226/* locks or unlocks door lock==1: lock; return 0 upon success */
1240int cm206_lock_door(struct cdrom_device_info *cdi, int lock) 1227static int cm206_lock_door(struct cdrom_device_info *cdi, int lock)
1241{ 1228{
1242 uch command = (lock) ? c_lock_tray : c_unlock_tray; 1229 uch command = (lock) ? c_lock_tray : c_unlock_tray;
1243 type_0_command(command, 1); /* wait and get dsb */ 1230 type_0_command(command, 1); /* wait and get dsb */
@@ -1248,8 +1235,8 @@ int cm206_lock_door(struct cdrom_device_info *cdi, int lock)
1248/* Although a session start should be in LBA format, we return it in 1235/* Although a session start should be in LBA format, we return it in
1249 MSF format because it is slightly easier, and the new generic ioctl 1236 MSF format because it is slightly easier, and the new generic ioctl
1250 will take care of the necessary conversion. */ 1237 will take care of the necessary conversion. */
1251int cm206_get_last_session(struct cdrom_device_info *cdi, 1238static int cm206_get_last_session(struct cdrom_device_info *cdi,
1252 struct cdrom_multisession *mssp) 1239 struct cdrom_multisession *mssp)
1253{ 1240{
1254 if (!FIRST_TRACK) 1241 if (!FIRST_TRACK)
1255 get_disc_status(); 1242 get_disc_status();
@@ -1268,7 +1255,7 @@ int cm206_get_last_session(struct cdrom_device_info *cdi,
1268 return 0; 1255 return 0;
1269} 1256}
1270 1257
1271int cm206_get_upc(struct cdrom_device_info *cdi, struct cdrom_mcn *mcn) 1258static int cm206_get_upc(struct cdrom_device_info *cdi, struct cdrom_mcn *mcn)
1272{ 1259{
1273 uch upc[10]; 1260 uch upc[10];
1274 char *ret = mcn->medium_catalog_number; 1261 char *ret = mcn->medium_catalog_number;
@@ -1287,7 +1274,7 @@ int cm206_get_upc(struct cdrom_device_info *cdi, struct cdrom_mcn *mcn)
1287 return 0; 1274 return 0;
1288} 1275}
1289 1276
1290int cm206_reset(struct cdrom_device_info *cdi) 1277static int cm206_reset(struct cdrom_device_info *cdi)
1291{ 1278{
1292 stop_read(); 1279 stop_read();
1293 reset_cm260(); 1280 reset_cm260();
@@ -1300,7 +1287,7 @@ int cm206_reset(struct cdrom_device_info *cdi)
1300 return 0; 1287 return 0;
1301} 1288}
1302 1289
1303int cm206_select_speed(struct cdrom_device_info *cdi, int speed) 1290static int cm206_select_speed(struct cdrom_device_info *cdi, int speed)
1304{ 1291{
1305 int r; 1292 int r;
1306 switch (speed) { 1293 switch (speed) {
@@ -1392,7 +1379,7 @@ static struct gendisk *cm206_gendisk;
1392 request_region, 15 bits of one port and 6 of another make things 1379 request_region, 15 bits of one port and 6 of another make things
1393 likely enough to accept the region on the first hit... 1380 likely enough to accept the region on the first hit...
1394 */ 1381 */
1395int __init probe_base_port(int base) 1382static int __init probe_base_port(int base)
1396{ 1383{
1397 int b = 0x300, e = 0x370; /* this is the range of start addresses */ 1384 int b = 0x300, e = 0x370; /* this is the range of start addresses */
1398 volatile int fool, i; 1385 volatile int fool, i;
@@ -1416,7 +1403,7 @@ int __init probe_base_port(int base)
1416 1403
1417#if !defined(MODULE) || defined(AUTO_PROBE_MODULE) 1404#if !defined(MODULE) || defined(AUTO_PROBE_MODULE)
1418/* Probe for irq# nr. If nr==0, probe for all possible irq's. */ 1405/* Probe for irq# nr. If nr==0, probe for all possible irq's. */
1419int __init probe_irq(int nr) 1406static int __init probe_irq(int nr)
1420{ 1407{
1421 int irqs, irq; 1408 int irqs, irq;
1422 outw(dc_normal | READ_AHEAD, r_data_control); /* disable irq-generation */ 1409 outw(dc_normal | READ_AHEAD, r_data_control); /* disable irq-generation */
@@ -1558,7 +1545,7 @@ static void __init parse_options(void)
1558 } 1545 }
1559} 1546}
1560 1547
1561int __cm206_init(void) 1548static int __cm206_init(void)
1562{ 1549{
1563 parse_options(); 1550 parse_options();
1564#if !defined(AUTO_PROBE_MODULE) 1551#if !defined(AUTO_PROBE_MODULE)
@@ -1567,7 +1554,7 @@ int __cm206_init(void)
1567 return cm206_init(); 1554 return cm206_init();
1568} 1555}
1569 1556
1570void __exit cm206_exit(void) 1557static void __exit cm206_exit(void)
1571{ 1558{
1572 del_gendisk(cm206_gendisk); 1559 del_gendisk(cm206_gendisk);
1573 put_disk(cm206_gendisk); 1560 put_disk(cm206_gendisk);
diff --git a/drivers/cdrom/isp16.c b/drivers/cdrom/isp16.c
index 8e68d858ce64..db0fd9a240e3 100644
--- a/drivers/cdrom/isp16.c
+++ b/drivers/cdrom/isp16.c
@@ -18,7 +18,7 @@
18 * 18 *
19 * 19 June 2004 -- check_region() converted to request_region() 19 * 19 June 2004 -- check_region() converted to request_region()
20 * and return statement cleanups. 20 * and return statement cleanups.
21 * Jesper Juhl <juhl-lkml@dif.dk> 21 * - Jesper Juhl
22 * 22 *
23 * Detect cdrom interface on ISP16 sound card. 23 * Detect cdrom interface on ISP16 sound card.
24 * Configure cdrom interface. 24 * Configure cdrom interface.
diff --git a/drivers/cdrom/mcdx.c b/drivers/cdrom/mcdx.c
index 07bbd24e3c18..b89420e6d704 100644
--- a/drivers/cdrom/mcdx.c
+++ b/drivers/cdrom/mcdx.c
@@ -51,7 +51,7 @@
51 */ 51 */
52 52
53 53
54#if RCS 54#ifdef RCS
55static const char *mcdx_c_version 55static const char *mcdx_c_version
56 = "$Id: mcdx.c,v 1.21 1997/01/26 07:12:59 davem Exp $"; 56 = "$Id: mcdx.c,v 1.21 1997/01/26 07:12:59 davem Exp $";
57#endif 57#endif
@@ -706,7 +706,7 @@ static int mcdx_open(struct cdrom_device_info *cdi, int purpose)
706 xtrace(OPENCLOSE, "open() init irq generation\n"); 706 xtrace(OPENCLOSE, "open() init irq generation\n");
707 if (-1 == mcdx_config(stuffp, 1)) 707 if (-1 == mcdx_config(stuffp, 1))
708 return -EIO; 708 return -EIO;
709#if FALLBACK 709#ifdef FALLBACK
710 /* Set the read speed */ 710 /* Set the read speed */
711 xwarn("AAA %x AAA\n", stuffp->readcmd); 711 xwarn("AAA %x AAA\n", stuffp->readcmd);
712 if (stuffp->readerrs) 712 if (stuffp->readerrs)
@@ -1216,7 +1216,7 @@ static int __init mcdx_init_drive(int drive)
1216 } 1216 }
1217 1217
1218 1218
1219#if WE_KNOW_WHY 1219#ifdef WE_KNOW_WHY
1220 /* irq 11 -> channel register */ 1220 /* irq 11 -> channel register */
1221 outb(0x50, stuffp->wreg_chn); 1221 outb(0x50, stuffp->wreg_chn);
1222#endif 1222#endif
@@ -1294,7 +1294,7 @@ static int mcdx_transfer(struct s_drive_stuff *stuffp,
1294 1294
1295 ans = mcdx_xfer(stuffp, p, sector, nr_sectors); 1295 ans = mcdx_xfer(stuffp, p, sector, nr_sectors);
1296 return ans; 1296 return ans;
1297#if FALLBACK 1297#ifdef FALLBACK
1298 if (-1 == ans) 1298 if (-1 == ans)
1299 stuffp->readerrs++; 1299 stuffp->readerrs++;
1300 else 1300 else
diff --git a/drivers/cdrom/optcd.c b/drivers/cdrom/optcd.c
index 7e69c54568bf..351a01dd503a 100644
--- a/drivers/cdrom/optcd.c
+++ b/drivers/cdrom/optcd.c
@@ -245,7 +245,7 @@ module_param(optcd_port, short, 0);
245 245
246 246
247/* Busy wait until FLAG goes low. Return 0 on timeout. */ 247/* Busy wait until FLAG goes low. Return 0 on timeout. */
248inline static int flag_low(int flag, unsigned long timeout) 248static inline int flag_low(int flag, unsigned long timeout)
249{ 249{
250 int flag_high; 250 int flag_high;
251 unsigned long count = 0; 251 unsigned long count = 0;
@@ -381,7 +381,7 @@ static int send_seek_params(struct cdrom_msf *params)
381 381
382/* Wait for command execution status. Choice between busy waiting 382/* Wait for command execution status. Choice between busy waiting
383 and sleeping. Return value <0 indicates timeout. */ 383 and sleeping. Return value <0 indicates timeout. */
384inline static int get_exec_status(int busy_waiting) 384static inline int get_exec_status(int busy_waiting)
385{ 385{
386 unsigned char exec_status; 386 unsigned char exec_status;
387 387
@@ -398,7 +398,7 @@ inline static int get_exec_status(int busy_waiting)
398 398
399/* Wait busy for extra byte of data that a command returns. 399/* Wait busy for extra byte of data that a command returns.
400 Return value <0 indicates timeout. */ 400 Return value <0 indicates timeout. */
401inline static int get_data(int short_timeout) 401static inline int get_data(int short_timeout)
402{ 402{
403 unsigned char data; 403 unsigned char data;
404 404
@@ -441,14 +441,14 @@ static int reset_drive(void)
441/* Facilities for asynchronous operation */ 441/* Facilities for asynchronous operation */
442 442
443/* Read status/data availability flags FL_STEN and FL_DTEN */ 443/* Read status/data availability flags FL_STEN and FL_DTEN */
444inline static int stdt_flags(void) 444static inline int stdt_flags(void)
445{ 445{
446 return inb(STATUS_PORT) & FL_STDT; 446 return inb(STATUS_PORT) & FL_STDT;
447} 447}
448 448
449 449
450/* Fetch status that has previously been waited for. <0 means not available */ 450/* Fetch status that has previously been waited for. <0 means not available */
451inline static int fetch_status(void) 451static inline int fetch_status(void)
452{ 452{
453 unsigned char status; 453 unsigned char status;
454 454
@@ -462,7 +462,7 @@ inline static int fetch_status(void)
462 462
463 463
464/* Fetch data that has previously been waited for. */ 464/* Fetch data that has previously been waited for. */
465inline static void fetch_data(char *buf, int n) 465static inline void fetch_data(char *buf, int n)
466{ 466{
467 insb(DATA_PORT, buf, n); 467 insb(DATA_PORT, buf, n);
468 DEBUG((DEBUG_DRIVE_IF, "fetched 0x%x bytes", n)); 468 DEBUG((DEBUG_DRIVE_IF, "fetched 0x%x bytes", n));
@@ -470,7 +470,7 @@ inline static void fetch_data(char *buf, int n)
470 470
471 471
472/* Flush status and data fifos */ 472/* Flush status and data fifos */
473inline static void flush_data(void) 473static inline void flush_data(void)
474{ 474{
475 while ((inb(STATUS_PORT) & FL_STDT) != FL_STDT) 475 while ((inb(STATUS_PORT) & FL_STDT) != FL_STDT)
476 inb(DATA_PORT); 476 inb(DATA_PORT);
@@ -482,7 +482,7 @@ inline static void flush_data(void)
482 482
483/* Send a simple command and wait for response. Command codes < COMFETCH 483/* Send a simple command and wait for response. Command codes < COMFETCH
484 are quick response commands */ 484 are quick response commands */
485inline static int exec_cmd(int cmd) 485static inline int exec_cmd(int cmd)
486{ 486{
487 int ack = send_cmd(cmd); 487 int ack = send_cmd(cmd);
488 if (ack < 0) 488 if (ack < 0)
@@ -493,7 +493,7 @@ inline static int exec_cmd(int cmd)
493 493
494/* Send a command with parameters. Don't wait for the response, 494/* Send a command with parameters. Don't wait for the response,
495 * which consists of data blocks read from the CD. */ 495 * which consists of data blocks read from the CD. */
496inline static int exec_read_cmd(int cmd, struct cdrom_msf *params) 496static inline int exec_read_cmd(int cmd, struct cdrom_msf *params)
497{ 497{
498 int ack = send_cmd(cmd); 498 int ack = send_cmd(cmd);
499 if (ack < 0) 499 if (ack < 0)
@@ -503,7 +503,7 @@ inline static int exec_read_cmd(int cmd, struct cdrom_msf *params)
503 503
504 504
505/* Send a seek command with parameters and wait for response */ 505/* Send a seek command with parameters and wait for response */
506inline static int exec_seek_cmd(int cmd, struct cdrom_msf *params) 506static inline int exec_seek_cmd(int cmd, struct cdrom_msf *params)
507{ 507{
508 int ack = send_cmd(cmd); 508 int ack = send_cmd(cmd);
509 if (ack < 0) 509 if (ack < 0)
@@ -516,7 +516,7 @@ inline static int exec_seek_cmd(int cmd, struct cdrom_msf *params)
516 516
517 517
518/* Send a command with parameters and wait for response */ 518/* Send a command with parameters and wait for response */
519inline static int exec_long_cmd(int cmd, struct cdrom_msf *params) 519static inline int exec_long_cmd(int cmd, struct cdrom_msf *params)
520{ 520{
521 int ack = exec_read_cmd(cmd, params); 521 int ack = exec_read_cmd(cmd, params);
522 if (ack < 0) 522 if (ack < 0)
@@ -528,7 +528,7 @@ inline static int exec_long_cmd(int cmd, struct cdrom_msf *params)
528 528
529 529
530/* Binary to BCD (2 digits) */ 530/* Binary to BCD (2 digits) */
531inline static void single_bin2bcd(u_char *p) 531static inline void single_bin2bcd(u_char *p)
532{ 532{
533 DEBUG((DEBUG_CONV, "bin2bcd %02d", *p)); 533 DEBUG((DEBUG_CONV, "bin2bcd %02d", *p));
534 *p = (*p % 10) | ((*p / 10) << 4); 534 *p = (*p % 10) | ((*p / 10) << 4);
@@ -565,7 +565,7 @@ static void lba2msf(int lba, struct cdrom_msf *msf)
565 565
566 566
567/* Two BCD digits to binary */ 567/* Two BCD digits to binary */
568inline static u_char bcd2bin(u_char bcd) 568static inline u_char bcd2bin(u_char bcd)
569{ 569{
570 DEBUG((DEBUG_CONV, "bcd2bin %x%02x", bcd)); 570 DEBUG((DEBUG_CONV, "bcd2bin %x%02x", bcd));
571 return (bcd >> 4) * 10 + (bcd & 0x0f); 571 return (bcd >> 4) * 10 + (bcd & 0x0f);
@@ -988,7 +988,7 @@ static char buf[CD_FRAMESIZE * N_BUFS];
988static volatile int buf_bn[N_BUFS], next_bn; 988static volatile int buf_bn[N_BUFS], next_bn;
989static volatile int buf_in = 0, buf_out = NOBUF; 989static volatile int buf_in = 0, buf_out = NOBUF;
990 990
991inline static void opt_invalidate_buffers(void) 991static inline void opt_invalidate_buffers(void)
992{ 992{
993 int i; 993 int i;
994 994
diff --git a/drivers/cdrom/sonycd535.c b/drivers/cdrom/sonycd535.c
index f4be7bfd6675..9f22e8f1f6c0 100644
--- a/drivers/cdrom/sonycd535.c
+++ b/drivers/cdrom/sonycd535.c
@@ -1605,8 +1605,7 @@ out7:
1605 put_disk(cdu_disk); 1605 put_disk(cdu_disk);
1606out6: 1606out6:
1607 for (i = 0; i < sony_buffer_sectors; i++) 1607 for (i = 0; i < sony_buffer_sectors; i++)
1608 if (sony_buffer[i]) 1608 kfree(sony_buffer[i]);
1609 kfree(sony_buffer[i]);
1610out5: 1609out5:
1611 kfree(sony_buffer); 1610 kfree(sony_buffer);
1612out4: 1611out4: