diff options
Diffstat (limited to 'drivers/cdrom')
-rw-r--r-- | drivers/cdrom/cm206.c | 113 | ||||
-rw-r--r-- | drivers/cdrom/isp16.c | 2 | ||||
-rw-r--r-- | drivers/cdrom/mcdx.c | 8 | ||||
-rw-r--r-- | drivers/cdrom/optcd.c | 28 | ||||
-rw-r--r-- | drivers/cdrom/sonycd535.c | 3 |
5 files changed, 70 insertions, 84 deletions
diff --git a/drivers/cdrom/cm206.c b/drivers/cdrom/cm206.c index da80b14..01f0351 100644 --- a/drivers/cdrom/cm206.c +++ b/drivers/cdrom/cm206.c @@ -307,7 +307,7 @@ static DEFINE_SPINLOCK(cm206_lock); /* First, we define some polling functions. These are actually only being used in the initialization. */ -void send_command_polled(int command) +static void send_command_polled(int command) { int loop = POLLOOP; while (!(inw(r_line_status) & ls_transmitter_buffer_empty) @@ -318,7 +318,7 @@ void send_command_polled(int command) outw(command, r_uart_transmit); } -uch receive_echo_polled(void) +static uch receive_echo_polled(void) { int loop = POLLOOP; while (!(inw(r_line_status) & ls_receive_buffer_full) && loop > 0) { @@ -328,13 +328,13 @@ uch receive_echo_polled(void) return ((uch) inw(r_uart_receive)); } -uch send_receive_polled(int command) +static uch send_receive_polled(int command) { send_command_polled(command); return receive_echo_polled(); } -inline void clear_ur(void) +static inline void clear_ur(void) { if (cd->ur_r != cd->ur_w) { debug(("Deleting bytes from fifo:")); @@ -439,7 +439,7 @@ static irqreturn_t cm206_interrupt(int sig, void *dev_id, struct pt_regs *regs) } /* we have put the address of the wait queue in who */ -void cm206_timeout(unsigned long who) +static void cm206_timeout(unsigned long who) { cd->timed_out = 1; debug(("Timing out\n")); @@ -448,7 +448,7 @@ void cm206_timeout(unsigned long who) /* This function returns 1 if a timeout occurred, 0 if an interrupt happened */ -int sleep_or_timeout(wait_queue_head_t * wait, int timeout) +static int sleep_or_timeout(wait_queue_head_t * wait, int timeout) { cd->timed_out = 0; init_timer(&cd->timer); @@ -465,13 +465,7 @@ int sleep_or_timeout(wait_queue_head_t * wait, int timeout) return 0; } -void cm206_delay(int nr_jiffies) -{ - DECLARE_WAIT_QUEUE_HEAD(wait); - sleep_or_timeout(&wait, nr_jiffies); -} - -void send_command(int command) +static void send_command(int command) { debug(("Sending 0x%x\n", command)); if (!(inw(r_line_status) & ls_transmitter_buffer_empty)) { @@ -490,7 +484,7 @@ void send_command(int command) outw(command, r_uart_transmit); } -uch receive_byte(int timeout) +static uch receive_byte(int timeout) { uch ret; cli(); @@ -521,23 +515,23 @@ uch receive_byte(int timeout) return ret; } -inline uch receive_echo(void) +static inline uch receive_echo(void) { return receive_byte(UART_TIMEOUT); } -inline uch send_receive(int command) +static inline uch send_receive(int command) { send_command(command); return receive_echo(); } -inline uch wait_dsb(void) +static inline uch wait_dsb(void) { return receive_byte(DSB_TIMEOUT); } -int type_0_command(int command, int expect_dsb) +static int type_0_command(int command, int expect_dsb) { int e; clear_ur(); @@ -552,7 +546,7 @@ int type_0_command(int command, int expect_dsb) return 0; } -int type_1_command(int command, int bytes, uch * status) +static int type_1_command(int command, int bytes, uch * status) { /* returns info */ int i; if (type_0_command(command, 0)) @@ -564,7 +558,7 @@ int type_1_command(int command, int bytes, uch * status) /* This function resets the adapter card. We'd better not do this too * often, because it tends to generate `lost interrupts.' */ -void reset_cm260(void) +static void reset_cm260(void) { outw(dc_normal | dc_initialize | READ_AHEAD, r_data_control); udelay(10); /* 3.3 mu sec minimum */ @@ -572,7 +566,7 @@ void reset_cm260(void) } /* fsm: frame-sec-min from linear address; one of many */ -void fsm(int lba, uch * fsm) +static void fsm(int lba, uch * fsm) { fsm[0] = lba % 75; lba /= 75; @@ -581,17 +575,17 @@ void fsm(int lba, uch * fsm) fsm[2] = lba / 60; } -inline int fsm2lba(uch * fsm) +static inline int fsm2lba(uch * fsm) { return fsm[0] + 75 * (fsm[1] - 2 + 60 * fsm[2]); } -inline int f_s_m2lba(uch f, uch s, uch m) +static inline int f_s_m2lba(uch f, uch s, uch m) { return f + 75 * (s - 2 + 60 * m); } -int start_read(int start) +static int start_read(int start) { uch read_sector[4] = { c_read_data, }; int i, e; @@ -613,7 +607,7 @@ int start_read(int start) return 0; } -int stop_read(void) +static int stop_read(void) { int e; type_0_command(c_stop, 0); @@ -630,7 +624,7 @@ int stop_read(void) routine takes care of this. Set a flag `background' in the cd struct to indicate the process. */ -int read_background(int start, int reading) +static int read_background(int start, int reading) { if (cd->background) return -1; /* can't do twice */ @@ -658,7 +652,7 @@ void transport_data(int port, ush * dest, int count) #define MAX_TRIES 100 -int read_sector(int start) +static int read_sector(int start) { int tries = 0; if (cd->background) { @@ -753,7 +747,7 @@ static DECLARE_TASKLET(cm206_tasklet, cm206_tasklet_func, 0); /* This command clears the dsb_possible_media_change flag, so we must * retain it. */ -void get_drive_status(void) +static void get_drive_status(void) { uch status[2]; type_1_command(c_drive_status, 2, status); /* this might be done faster */ @@ -764,7 +758,7 @@ void get_drive_status(void) dsb_drive_not_ready | dsb_tray_not_closed)); } -void get_disc_status(void) +static void get_disc_status(void) { if (type_1_command(c_disc_status, 7, cd->disc_status)) { debug(("get_disc_status: error\n")); @@ -801,7 +795,7 @@ static void cm206_release(struct cdrom_device_info *cdi) /* Empty buffer empties $sectors$ sectors of the adapter card buffer, * and then reads a sector in kernel memory. */ -void empty_buffer(int sectors) +static void empty_buffer(int sectors) { while (sectors >= 0) { transport_data(r_fifo_output_buffer, @@ -819,7 +813,7 @@ void empty_buffer(int sectors) /* try_adapter. This function determines if the requested sector is in adapter memory, or will appear there soon. Returns 0 upon success */ -int try_adapter(int sector) +static int try_adapter(int sector) { if (cd->adapter_first <= sector && sector < cd->adapter_last) { /* sector is in adapter memory */ @@ -910,7 +904,7 @@ static void do_cm206_request(request_queue_t * q) */ /* seek seeks to address lba. It does wait to arrive there. */ -void seek(int lba) +static void seek(int lba) { int i; uch seek_command[4] = { c_seek, }; @@ -926,7 +920,7 @@ uch bcdbin(unsigned char bcd) return (bcd >> 4) * 10 + (bcd & 0xf); } -inline uch normalize_track(uch track) +static inline uch normalize_track(uch track) { if (track < 1) return 1; @@ -939,7 +933,7 @@ inline uch normalize_track(uch track) * tracks seen in the process. Input $track$ must be between 1 and * #-of-tracks+1. Note that the start of the disc must be in toc[1].fsm. */ -int get_toc_lba(uch track) +static int get_toc_lba(uch track) { int max = 74 * 60 * 75 - 150, min = fsm2lba(cd->toc[1].fsm); int i, lba, l, old_lba = 0; @@ -991,7 +985,7 @@ int get_toc_lba(uch track) return lba; } -void update_toc_entry(uch track) +static void update_toc_entry(uch track) { track = normalize_track(track); if (!cd->toc[track].track) @@ -999,7 +993,7 @@ void update_toc_entry(uch track) } /* return 0 upon success */ -int read_toc_header(struct cdrom_tochdr *hp) +static int read_toc_header(struct cdrom_tochdr *hp) { if (!FIRST_TRACK) get_disc_status(); @@ -1016,7 +1010,7 @@ int read_toc_header(struct cdrom_tochdr *hp) return -1; } -void play_from_to_msf(struct cdrom_msf *msfp) +static void play_from_to_msf(struct cdrom_msf *msfp) { uch play_command[] = { c_play, msfp->cdmsf_frame0, msfp->cdmsf_sec0, msfp->cdmsf_min0, @@ -1032,7 +1026,7 @@ void play_from_to_msf(struct cdrom_msf *msfp) cd->dsb = wait_dsb(); } -void play_from_to_track(int from, int to) +static void play_from_to_track(int from, int to) { uch play_command[8] = { c_play, }; int i; @@ -1059,7 +1053,7 @@ void play_from_to_track(int from, int to) cd->dsb = wait_dsb(); } -int get_current_q(struct cdrom_subchnl *qp) +static int get_current_q(struct cdrom_subchnl *qp) { int i; uch *q = cd->q; @@ -1093,14 +1087,14 @@ int get_current_q(struct cdrom_subchnl *qp) return 0; } -void invalidate_toc(void) +static void invalidate_toc(void) { memset(cd->toc, 0, sizeof(cd->toc)); memset(cd->disc_status, 0, sizeof(cd->disc_status)); } /* cdrom.c guarantees that cdte_format == CDROM_MSF */ -void get_toc_entry(struct cdrom_tocentry *ep) +static void get_toc_entry(struct cdrom_tocentry *ep) { uch track = normalize_track(ep->cdte_track); update_toc_entry(track); @@ -1117,8 +1111,8 @@ void get_toc_entry(struct cdrom_tocentry *ep) * upon success. Memory checking has been done by cdrom_ioctl(), the * calling function, as well as LBA/MSF sanitization. */ -int cm206_audio_ioctl(struct cdrom_device_info *cdi, unsigned int cmd, - void *arg) +static int cm206_audio_ioctl(struct cdrom_device_info *cdi, unsigned int cmd, + void *arg) { switch (cmd) { case CDROMREADTOCHDR: @@ -1189,7 +1183,7 @@ static int cm206_ioctl(struct cdrom_device_info *cdi, unsigned int cmd, } } -int cm206_media_changed(struct cdrom_device_info *cdi, int disc_nr) +static int cm206_media_changed(struct cdrom_device_info *cdi, int disc_nr) { if (cd != NULL) { int r; @@ -1204,16 +1198,9 @@ int cm206_media_changed(struct cdrom_device_info *cdi, int disc_nr) /* The new generic cdrom support. Routines should be concise, most of the logic should be in cdrom.c */ -/* returns number of times device is in use */ -int cm206_open_files(struct cdrom_device_info *cdi) -{ - if (cd) - return cd->openfiles; - return -1; -} /* controls tray movement */ -int cm206_tray_move(struct cdrom_device_info *cdi, int position) +static int cm206_tray_move(struct cdrom_device_info *cdi, int position) { if (position) { /* 1: eject */ type_0_command(c_open_tray, 1); @@ -1224,7 +1211,7 @@ int cm206_tray_move(struct cdrom_device_info *cdi, int position) } /* gives current state of the drive */ -int cm206_drive_status(struct cdrom_device_info *cdi, int slot_nr) +static int cm206_drive_status(struct cdrom_device_info *cdi, int slot_nr) { get_drive_status(); if (cd->dsb & dsb_tray_not_closed) @@ -1237,7 +1224,7 @@ int cm206_drive_status(struct cdrom_device_info *cdi, int slot_nr) } /* locks or unlocks door lock==1: lock; return 0 upon success */ -int cm206_lock_door(struct cdrom_device_info *cdi, int lock) +static int cm206_lock_door(struct cdrom_device_info *cdi, int lock) { uch command = (lock) ? c_lock_tray : c_unlock_tray; type_0_command(command, 1); /* wait and get dsb */ @@ -1248,8 +1235,8 @@ int cm206_lock_door(struct cdrom_device_info *cdi, int lock) /* Although a session start should be in LBA format, we return it in MSF format because it is slightly easier, and the new generic ioctl will take care of the necessary conversion. */ -int cm206_get_last_session(struct cdrom_device_info *cdi, - struct cdrom_multisession *mssp) +static int cm206_get_last_session(struct cdrom_device_info *cdi, + struct cdrom_multisession *mssp) { if (!FIRST_TRACK) get_disc_status(); @@ -1268,7 +1255,7 @@ int cm206_get_last_session(struct cdrom_device_info *cdi, return 0; } -int cm206_get_upc(struct cdrom_device_info *cdi, struct cdrom_mcn *mcn) +static int cm206_get_upc(struct cdrom_device_info *cdi, struct cdrom_mcn *mcn) { uch upc[10]; char *ret = mcn->medium_catalog_number; @@ -1287,7 +1274,7 @@ int cm206_get_upc(struct cdrom_device_info *cdi, struct cdrom_mcn *mcn) return 0; } -int cm206_reset(struct cdrom_device_info *cdi) +static int cm206_reset(struct cdrom_device_info *cdi) { stop_read(); reset_cm260(); @@ -1300,7 +1287,7 @@ int cm206_reset(struct cdrom_device_info *cdi) return 0; } -int cm206_select_speed(struct cdrom_device_info *cdi, int speed) +static int cm206_select_speed(struct cdrom_device_info *cdi, int speed) { int r; switch (speed) { @@ -1392,7 +1379,7 @@ static struct gendisk *cm206_gendisk; request_region, 15 bits of one port and 6 of another make things likely enough to accept the region on the first hit... */ -int __init probe_base_port(int base) +static int __init probe_base_port(int base) { int b = 0x300, e = 0x370; /* this is the range of start addresses */ volatile int fool, i; @@ -1416,7 +1403,7 @@ int __init probe_base_port(int base) #if !defined(MODULE) || defined(AUTO_PROBE_MODULE) /* Probe for irq# nr. If nr==0, probe for all possible irq's. */ -int __init probe_irq(int nr) +static int __init probe_irq(int nr) { int irqs, irq; outw(dc_normal | READ_AHEAD, r_data_control); /* disable irq-generation */ @@ -1558,7 +1545,7 @@ static void __init parse_options(void) } } -int __cm206_init(void) +static int __cm206_init(void) { parse_options(); #if !defined(AUTO_PROBE_MODULE) @@ -1567,7 +1554,7 @@ int __cm206_init(void) return cm206_init(); } -void __exit cm206_exit(void) +static void __exit cm206_exit(void) { del_gendisk(cm206_gendisk); put_disk(cm206_gendisk); diff --git a/drivers/cdrom/isp16.c b/drivers/cdrom/isp16.c index 8e68d85..db0fd9a 100644 --- a/drivers/cdrom/isp16.c +++ b/drivers/cdrom/isp16.c @@ -18,7 +18,7 @@ * * 19 June 2004 -- check_region() converted to request_region() * and return statement cleanups. - * Jesper Juhl <juhl-lkml@dif.dk> + * - Jesper Juhl * * Detect cdrom interface on ISP16 sound card. * Configure cdrom interface. diff --git a/drivers/cdrom/mcdx.c b/drivers/cdrom/mcdx.c index 07bbd24..b89420e 100644 --- a/drivers/cdrom/mcdx.c +++ b/drivers/cdrom/mcdx.c @@ -51,7 +51,7 @@ */ -#if RCS +#ifdef RCS static const char *mcdx_c_version = "$Id: mcdx.c,v 1.21 1997/01/26 07:12:59 davem Exp $"; #endif @@ -706,7 +706,7 @@ static int mcdx_open(struct cdrom_device_info *cdi, int purpose) xtrace(OPENCLOSE, "open() init irq generation\n"); if (-1 == mcdx_config(stuffp, 1)) return -EIO; -#if FALLBACK +#ifdef FALLBACK /* Set the read speed */ xwarn("AAA %x AAA\n", stuffp->readcmd); if (stuffp->readerrs) @@ -1216,7 +1216,7 @@ static int __init mcdx_init_drive(int drive) } -#if WE_KNOW_WHY +#ifdef WE_KNOW_WHY /* irq 11 -> channel register */ outb(0x50, stuffp->wreg_chn); #endif @@ -1294,7 +1294,7 @@ static int mcdx_transfer(struct s_drive_stuff *stuffp, ans = mcdx_xfer(stuffp, p, sector, nr_sectors); return ans; -#if FALLBACK +#ifdef FALLBACK if (-1 == ans) stuffp->readerrs++; else diff --git a/drivers/cdrom/optcd.c b/drivers/cdrom/optcd.c index 7e69c54..351a01d 100644 --- a/drivers/cdrom/optcd.c +++ b/drivers/cdrom/optcd.c @@ -245,7 +245,7 @@ module_param(optcd_port, short, 0); /* Busy wait until FLAG goes low. Return 0 on timeout. */ -inline static int flag_low(int flag, unsigned long timeout) +static inline int flag_low(int flag, unsigned long timeout) { int flag_high; unsigned long count = 0; @@ -381,7 +381,7 @@ static int send_seek_params(struct cdrom_msf *params) /* Wait for command execution status. Choice between busy waiting and sleeping. Return value <0 indicates timeout. */ -inline static int get_exec_status(int busy_waiting) +static inline int get_exec_status(int busy_waiting) { unsigned char exec_status; @@ -398,7 +398,7 @@ inline static int get_exec_status(int busy_waiting) /* Wait busy for extra byte of data that a command returns. Return value <0 indicates timeout. */ -inline static int get_data(int short_timeout) +static inline int get_data(int short_timeout) { unsigned char data; @@ -441,14 +441,14 @@ static int reset_drive(void) /* Facilities for asynchronous operation */ /* Read status/data availability flags FL_STEN and FL_DTEN */ -inline static int stdt_flags(void) +static inline int stdt_flags(void) { return inb(STATUS_PORT) & FL_STDT; } /* Fetch status that has previously been waited for. <0 means not available */ -inline static int fetch_status(void) +static inline int fetch_status(void) { unsigned char status; @@ -462,7 +462,7 @@ inline static int fetch_status(void) /* Fetch data that has previously been waited for. */ -inline static void fetch_data(char *buf, int n) +static inline void fetch_data(char *buf, int n) { insb(DATA_PORT, buf, n); DEBUG((DEBUG_DRIVE_IF, "fetched 0x%x bytes", n)); @@ -470,7 +470,7 @@ inline static void fetch_data(char *buf, int n) /* Flush status and data fifos */ -inline static void flush_data(void) +static inline void flush_data(void) { while ((inb(STATUS_PORT) & FL_STDT) != FL_STDT) inb(DATA_PORT); @@ -482,7 +482,7 @@ inline static void flush_data(void) /* Send a simple command and wait for response. Command codes < COMFETCH are quick response commands */ -inline static int exec_cmd(int cmd) +static inline int exec_cmd(int cmd) { int ack = send_cmd(cmd); if (ack < 0) @@ -493,7 +493,7 @@ inline static int exec_cmd(int cmd) /* Send a command with parameters. Don't wait for the response, * which consists of data blocks read from the CD. */ -inline static int exec_read_cmd(int cmd, struct cdrom_msf *params) +static inline int exec_read_cmd(int cmd, struct cdrom_msf *params) { int ack = send_cmd(cmd); if (ack < 0) @@ -503,7 +503,7 @@ inline static int exec_read_cmd(int cmd, struct cdrom_msf *params) /* Send a seek command with parameters and wait for response */ -inline static int exec_seek_cmd(int cmd, struct cdrom_msf *params) +static inline int exec_seek_cmd(int cmd, struct cdrom_msf *params) { int ack = send_cmd(cmd); if (ack < 0) @@ -516,7 +516,7 @@ inline static int exec_seek_cmd(int cmd, struct cdrom_msf *params) /* Send a command with parameters and wait for response */ -inline static int exec_long_cmd(int cmd, struct cdrom_msf *params) +static inline int exec_long_cmd(int cmd, struct cdrom_msf *params) { int ack = exec_read_cmd(cmd, params); if (ack < 0) @@ -528,7 +528,7 @@ inline static int exec_long_cmd(int cmd, struct cdrom_msf *params) /* Binary to BCD (2 digits) */ -inline static void single_bin2bcd(u_char *p) +static inline void single_bin2bcd(u_char *p) { DEBUG((DEBUG_CONV, "bin2bcd %02d", *p)); *p = (*p % 10) | ((*p / 10) << 4); @@ -565,7 +565,7 @@ static void lba2msf(int lba, struct cdrom_msf *msf) /* Two BCD digits to binary */ -inline static u_char bcd2bin(u_char bcd) +static inline u_char bcd2bin(u_char bcd) { DEBUG((DEBUG_CONV, "bcd2bin %x%02x", bcd)); return (bcd >> 4) * 10 + (bcd & 0x0f); @@ -988,7 +988,7 @@ static char buf[CD_FRAMESIZE * N_BUFS]; static volatile int buf_bn[N_BUFS], next_bn; static volatile int buf_in = 0, buf_out = NOBUF; -inline static void opt_invalidate_buffers(void) +static inline void opt_invalidate_buffers(void) { int i; diff --git a/drivers/cdrom/sonycd535.c b/drivers/cdrom/sonycd535.c index f4be7bf..9f22e8f 100644 --- a/drivers/cdrom/sonycd535.c +++ b/drivers/cdrom/sonycd535.c @@ -1605,8 +1605,7 @@ out7: put_disk(cdu_disk); out6: for (i = 0; i < sony_buffer_sectors; i++) - if (sony_buffer[i]) - kfree(sony_buffer[i]); + kfree(sony_buffer[i]); out5: kfree(sony_buffer); out4: |