Commit 718e92c5 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] (13/14) resync

ditto for DEVICE_INTR/CLEAR_INTR.  do_mfm/do_acsi/do_hd/... are
explicitly declared in the drivers that use DEVICE_INTR stuff;
DEVICE_INTR/CLEAR_INTR is gone from blk.h.
parent 9437b796
......@@ -983,10 +983,8 @@ static void do_stram_request(request_queue_t *q)
unsigned long len;
while (1) {
if (blk_queue_empty(QUEUE)) {
CLEAR_INTR;
if (blk_queue_empty(QUEUE))
return;
}
start = swap_start + (CURRENT->sector << 9);
len = CURRENT->current_nr_sectors << 9;
......
......@@ -155,7 +155,6 @@
#define MAJOR_NR FLOPPY_MAJOR
#define FLOPPY_DMA 0
#define DEVICE_NAME "floppy"
#define DEVICE_INTR do_floppy
#define DEVICE_NR(device) ( (minor(device) & 3) | ((minor(device) & 0x80 ) >> 5 ))
#include <linux/blk.h>
......
......@@ -114,7 +114,6 @@
#include <linux/delay.h>
#define MAJOR_NR MFM_ACORN_MAJOR
#define DEVICE_INTR do_mfm
#define DEVICE_NR(device) (minor(device) >> 6)
#include <linux/blk.h>
#include <linux/blkpg.h>
......@@ -128,6 +127,7 @@
#include <asm/ecard.h>
#include <asm/hardware/ioc.h>
static void (*do_mfm)(void) = NULL;
/*
* This sort of stuff should be in a header file shared with ide.c, hd.c, xd.c etc
*/
......@@ -572,7 +572,7 @@ static void mfm_rw_intr(void)
DBG("mfm_rw_intr: returned from cont->done\n");
} else {
/* Its going to generate another interrupt */
DEVICE_INTR = mfm_rw_intr;
do_mfm = mfm_rw_intr;
};
}
......@@ -580,7 +580,7 @@ static void mfm_setup_rw(void)
{
DBG("setting up for rw...\n");
DEVICE_INTR = mfm_rw_intr;
do_mfm = mfm_rw_intr;
issue_command(raw_cmd.cmdcode, raw_cmd.cmddata, raw_cmd.cmdlen);
}
......@@ -610,7 +610,7 @@ static void mfm_recal_intr(void)
/* Command end without seek end (see data sheet p.20) for parallel seek
- we have to send a POL command to wait for the seek */
if (mfm_status & STAT_CED) {
DEVICE_INTR = mfm_recal_intr;
do_mfm = mfm_recal_intr;
issue_command(CMD_POL, NULL, 0);
return;
}
......@@ -640,7 +640,7 @@ static void mfm_seek_intr(void)
return;
}
if (mfm_status & STAT_CED) {
DEVICE_INTR = mfm_seek_intr;
do_mfm = mfm_seek_intr;
issue_command(CMD_POL, NULL, 0);
return;
}
......@@ -698,7 +698,7 @@ static void mfm_seek(void)
DBG("seeking...\n");
if (MFM_DRV_INFO.cylinder < 0) {
DEVICE_INTR = mfm_recal_intr;
do_mfm = mfm_recal_intr;
DBG("mfm_seek: about to call specify\n");
mfm_specify (); /* DAG added this */
......@@ -714,7 +714,7 @@ static void mfm_seek(void)
cmdb[2] = raw_cmd.cylinder >> 8;
cmdb[3] = raw_cmd.cylinder;
DEVICE_INTR = mfm_seek_intr;
do_mfm = mfm_seek_intr;
issue_command(CMD_SEK, cmdb, 4);
} else
mfm_setup_rw();
......@@ -909,7 +909,7 @@ static void mfm_request(void)
if (blk_queue_empty(QUEUE)) {
printk("mfm_request: Exiting due to empty queue (pre)\n");
DEVICE_INTR = NULL;
do_mfm = NULL;
Busy = 0;
return;
}
......@@ -971,9 +971,9 @@ static void do_mfm_request(request_queue_t *q)
static void mfm_interrupt_handler(int unused, void *dev_id, struct pt_regs *regs)
{
void (*handler) (void) = DEVICE_INTR;
void (*handler) (void) = do_mfm;
DEVICE_INTR = NULL;
do_mfm = NULL;
DBG("mfm_interrupt_handler (handler=0x%p)\n", handler);
......
......@@ -45,7 +45,6 @@
#define MAJOR_NR ACSI_MAJOR
#define DEVICE_NAME "ACSI"
#define DEVICE_INTR do_acsi
#define DEVICE_NR(device) (minor(device) >> 4)
#include <linux/config.h>
......@@ -80,6 +79,7 @@ typedef void Scsi_Device; /* hack to avoid including scsi.h */
#include <asm/atari_stdma.h>
#include <asm/atari_stram.h>
static void (*do_acsi)(void) = NULL;
#define DEBUG
#undef DEBUG_DETECT
......@@ -738,9 +738,9 @@ static void acsi_print_error( const unsigned char *errblk, int dev )
static void acsi_interrupt(int irq, void *data, struct pt_regs *fp )
{ void (*acsi_irq_handler)(void) = DEVICE_INTR;
{ void (*acsi_irq_handler)(void) = do_acsi;
DEVICE_INTR = NULL;
do_acsi = NULL;
CLEAR_TIMER();
if (!acsi_irq_handler)
......@@ -841,9 +841,9 @@ static void acsi_times_out( unsigned long dummy )
{
DISABLE_IRQ();
if (!DEVICE_INTR) return;
if (!do_acsi) return;
DEVICE_INTR = NULL;
do_acsi = NULL;
printk( KERN_ERR "ACSI timeout\n" );
if (blk_queue_empty(QUEUE))
return;
......@@ -959,11 +959,11 @@ static void redo_acsi_request( void )
repeat:
CLEAR_TIMER();
if (DEVICE_INTR)
if (do_acsi)
return;
if (blk_queue_empty(QUEUE)) {
CLEAR_INTR;
do_acsi = NULL;
ENABLE_IRQ();
stdma_release();
return;
......@@ -1052,9 +1052,9 @@ static void redo_acsi_request( void )
if (buffer == acsi_buffer)
copy_to_acsibuffer();
dma_cache_maintenance( pbuffer, nsect*512, 1 );
DEVICE_INTR = write_intr;
do_acsi = write_intr;
if (!acsicmd_dma( write_cmd, buffer, nsect, 1, 1)) {
CLEAR_INTR;
do_acsi = NULL;
printk( KERN_ERR "ACSI (write): Timeout in command block\n" );
bad_rw_intr();
goto repeat;
......@@ -1066,9 +1066,9 @@ static void redo_acsi_request( void )
CMDSET_TARG_LUN( read_cmd, target, lun );
CMDSET_BLOCK( read_cmd, block );
CMDSET_LEN( read_cmd, nsect );
DEVICE_INTR = read_intr;
do_acsi = read_intr;
if (!acsicmd_dma( read_cmd, buffer, nsect, 0, 1)) {
CLEAR_INTR;
do_acsi = NULL;
printk( KERN_ERR "ACSI (read): Timeout in command block\n" );
bad_rw_intr();
goto repeat;
......
......@@ -80,7 +80,6 @@
#define MAJOR_NR FLOPPY_MAJOR
#define DEVICE_NAME "floppy"
#define DEVICE_INTR do_floppy
#define DEVICE_NR(device) ( (minor(device) & 3) | ((minor(device) & 0x80 ) >> 5 ))
#include <linux/blk.h>
......
......@@ -93,7 +93,6 @@
#define MAJOR_NR FLOPPY_MAJOR
#define DEVICE_NAME "floppy"
#define DEVICE_INTR do_floppy
#define DEVICE_NR(device) ( (minor(device) & 3) | ((minor(device) & 0x80 ) >> 5 ))
#include <linux/blk.h>
#include <linux/blkpg.h>
......
......@@ -759,10 +759,8 @@ static void do_pcd_request (request_queue_t * q)
if (pcd_busy) return;
while (1) {
if (blk_queue_empty(QUEUE)) {
CLEAR_INTR;
if (blk_queue_empty(QUEUE))
return;
}
if (rq_data_dir(CURRENT) == READ) {
unit = minor(CURRENT->rq_dev);
......
......@@ -834,10 +834,8 @@ static void do_pd_request (request_queue_t * q)
if (pd_busy) return;
repeat:
if (blk_queue_empty(QUEUE)) {
CLEAR_INTR;
if (blk_queue_empty(QUEUE))
return;
}
pd_dev = minor(CURRENT->rq_dev);
pd_unit = unit = DEVICE_NR(CURRENT->rq_dev);
......
......@@ -840,10 +840,8 @@ static void do_pf_request (request_queue_t * q)
if (pf_busy) return;
repeat:
if (blk_queue_empty(QUEUE)) {
CLEAR_INTR;
if (blk_queue_empty(QUEUE))
return;
}
pf_unit = unit = DEVICE_NR(CURRENT->rq_dev);
pf_block = CURRENT->sector;
......
......@@ -505,10 +505,8 @@ static void do_ps2esdi_request(request_queue_t * q)
/* standard procedure to ensure that requests are really on the
list + sanity checks. */
if (blk_queue_empty(QUEUE)) {
CLEAR_INTR;
if (blk_queue_empty(QUEUE))
return;
}
if (isa_virt_to_bus(CURRENT->buffer + CURRENT->current_nr_sectors * 512) > 16 * MB) {
printk("%s: DMA above 16MB not supported\n", DEVICE_NAME);
......
......@@ -34,7 +34,6 @@
#define MAJOR_NR FLOPPY_MAJOR
#define DEVICE_NAME "floppy"
#define DEVICE_INTR do_floppy
#define DEVICE_NR(device) ( (minor(device) & 3) | ((minor(device) & 0x80 ) >> 5 ))
#include <linux/blk.h>
#include <linux/devfs_fs_kernel.h>
......
......@@ -28,7 +28,6 @@
#define MAJOR_NR FLOPPY_MAJOR
#define DEVICE_NAME "floppy"
#define DEVICE_INTR do_floppy
#define DEVICE_NR(device) ( (minor(device) & 3) | ((minor(device) & 0x80 ) >> 5 ))
#include <linux/stddef.h>
......
......@@ -284,10 +284,8 @@ static void do_xd_request (request_queue_t * q)
while (1) {
code = 0;
/* do some checking on the request structure */
if (blk_queue_empty(QUEUE)) {
CLEAR_INTR;
if (blk_queue_empty(QUEUE))
return;
}
if (DEVICE_NR(CURRENT->rq_dev) < xd_drives
&& (CURRENT->flags & REQ_CMD)
......
......@@ -78,10 +78,8 @@ do_z2_request( request_queue_t * q )
while ( TRUE )
{
if (blk_queue_empty(QUEUE)) {
CLEAR_INTR;
if (blk_queue_empty(QUEUE))
return;
}
start = CURRENT->sector << 9;
len = CURRENT->current_nr_sectors << 9;
......
......@@ -1594,10 +1594,8 @@ static void do_cdu31a_request(request_queue_t * q)
* The beginning here is stolen from the hard disk driver. I hope
* it's right.
*/
if (blk_queue_empty(QUEUE)) {
CLEAR_INTR;
if (blk_queue_empty(QUEUE))
goto end_do_cdu31a_request;
}
if (!sony_spun_up) {
scd_spinup();
......
......@@ -858,10 +858,8 @@ static void do_cm206_request(request_queue_t * q)
uch *source, *dest;
while (1) { /* repeat until all requests have been satisfied */
if (blk_queue_empty(QUEUE)) {
CLEAR_INTR;
if (blk_queue_empty(QUEUE))
return;
}
if (CURRENT->cmd != READ) {
debug(("Non-read command %d on cdrom\n",
......
......@@ -280,10 +280,8 @@ static void __do_gscd_request(unsigned long dummy)
unsigned int nsect;
repeat:
if (blk_queue_empty(QUEUE)) {
CLEAR_INTR;
if (blk_queue_empty(QUEUE))
return;
}
dev = minor(CURRENT->rq_dev);
block = CURRENT->sector;
......
......@@ -563,10 +563,8 @@ void do_mcdx_request(request_queue_t * q)
again:
if (blk_queue_empty(QUEUE)) {
CLEAR_INTR;
if (blk_queue_empty(QUEUE))
return;
}
dev = minor(CURRENT->rq_dev);
stuffp = mcdx_stuffp[dev];
......
......@@ -4850,7 +4850,6 @@ static void do_sbpcd_request(request_queue_t * q)
xnr, current->pid, jiffies);
printk( "do_sbpcd_request[%do](NULL) end 0 (null), Time:%li\n",
xnr, jiffies);
CLEAR_INTR;
return;
}
......@@ -4858,10 +4857,8 @@ static void do_sbpcd_request(request_queue_t * q)
xnr, CURRENT, CURRENT->sector, CURRENT->nr_sectors, current->pid, jiffies);
#endif
if (blk_queue_empty(QUEUE)) {
CLEAR_INTR;
if (blk_queue_empty(QUEUE))
return;
}
req = CURRENT; /* take out our request so no other */
blkdev_dequeue_request(req); /* task can fuck it up GTL */
......
......@@ -135,7 +135,6 @@
#include <linux/cdrom.h>
#define MAJOR_NR CDU535_CDROM_MAJOR
#define DEVICE_INTR do_cdu535
#define DEVICE_NR(device) (minor(device))
#include <linux/blk.h>
......
......@@ -52,7 +52,6 @@
#include <asm/uaccess.h>
#define MAJOR_NR HD_MAJOR
#define DEVICE_INTR do_hd
#define DEVICE_NR(device) (minor(device)>>6)
#include <linux/blk.h>
......@@ -113,13 +112,16 @@ static int hd_sizes[MAX_HD<<6];
static struct timer_list device_timer;
#define TIMEOUT_VALUE (6*HZ)
#define SET_TIMER \
do { \
mod_timer(&device_timer, jiffies + TIMEOUT_VALUE); \
} while (0)
static void (*do_hd)(void) = NULL;
#define SET_HANDLER(x) \
if ((DEVICE_INTR = (x)) != NULL) \
if ((do_hd = (x)) != NULL) \
SET_TIMER; \
else \
del_timer(&device_timer);
......@@ -495,7 +497,7 @@ static void hd_times_out(unsigned long dummy)
{
unsigned int dev;
DEVICE_INTR = NULL;
do_hd = NULL;
if (blk_queue_empty(QUEUE))
return;
......@@ -545,14 +547,14 @@ static void hd_request(void)
{
unsigned int dev, block, nsect, sec, track, head, cyl;
if (DEVICE_INTR)
if (do_hd)
return;
repeat:
del_timer(&device_timer);
sti();
if (blk_queue_empty(QUEUE)) {
CLEAR_INTR;
do_hd = NULL;
return;
}
......@@ -701,9 +703,9 @@ static struct gendisk hd_gendisk = {
static void hd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
void (*handler)(void) = DEVICE_INTR;
void (*handler)(void) = do_hd;
DEVICE_INTR = NULL;
do_hd = NULL;
del_timer(&device_timer);
if (!handler)
handler = unexpected_hd_interrupt;
......
......@@ -1191,10 +1191,8 @@ static void do_ftl_request(request_arg_t)
do {
// sti();
if (blk_queue_empty(QUEUE)) {
CLEAR_INTR;
if (blk_queue_empty(QUEUE))
return;
}
minor = minor(CURRENT->rq_dev);
......
......@@ -397,10 +397,8 @@ static void handle_mtdblock_request(void)
unsigned int res;
for (;;) {
if (blk_queue_empty(QUEUE)) {
CLEAR_INTR;
if (blk_queue_empty(QUEUE))
return;
}
req = CURRENT;
spin_unlock_irq(QUEUE->queue_lock);
......
......@@ -114,10 +114,8 @@ static void mtdblock_request(RQFUNC_ARG)
{
/* Grab the Request and unlink it from the request list, we
will execute a return if we are done. */
if (blk_queue_empty(QUEUE)) {
CLEAR_INTR;
if (blk_queue_empty(QUEUE))
return;
}
current_request = CURRENT;
......
......@@ -837,10 +837,8 @@ void nftl_request(RQFUNC_ARG)
int res;
while (1) {
if (blk_queue_empty(QUEUE)) {
CLEAR_INTR;
if (blk_queue_empty(QUEUE))
return;
}
req = CURRENT;
......
......@@ -84,7 +84,6 @@ int xpram_major; /* must be declared before including blk.h */
devfs_handle_t xpram_devfs_handle;
#define DEVICE_NR(device) MINOR(device) /* xpram has no partition bits */
#define DEVICE_INTR xpram_intrptr /* pointer to the bottom half */
#define DEVICE_NO_RANDOM /* no entropy to contribute */
#define DEVICE_OFF(d) /* do-nothing */
......@@ -683,10 +682,8 @@ void xpram_request(request_queue_t * queue)
struct request * current_req; /* working request */
while(1) {
if (blk_queue_empty(QUEUE)) {
CLEAR_INTR;
if (blk_queue_empty(QUEUE))
return;
}
fault=0;
current_req = CURRENT;
......
......@@ -206,10 +206,8 @@ static void jsfd_do_request(request_queue_t *q)
size_t len;
for (;;) {
if (blk_queue_empty(QUEUE)) {
CLEAR_INTR;
if (blk_queue_empty(QUEUE))
return;
}
req = CURRENT;
......
......@@ -60,7 +60,6 @@ const char * osst_version = "0.9.10";
#define OSST_DEB_MSG KERN_NOTICE
#define MAJOR_NR OSST_MAJOR
#define DEVICE_INTR do_osst
#define DEVICE_NR(device) (minor(device) & 0x7f)
#include <linux/blk.h>
......
......@@ -55,7 +55,6 @@ static char *verstr = "20020205";
#endif
#define MAJOR_NR SCSI_TAPE_MAJOR
#define DEVICE_INTR do_st
#define DEVICE_NR(device) (minor(device) & 0x7f)
#include <linux/blk.h>
......
......@@ -108,13 +108,6 @@ extern inline struct request *elv_next_request(request_queue_t *q)
# define CURRENT elv_next_request(QUEUE)
#endif
#ifdef DEVICE_INTR
static void (*DEVICE_INTR)(void) = NULL;
# define CLEAR_INTR DEVICE_INTR = NULL
# else
# define CLEAR_INTR
# endif
#endif /* !defined(IDE_DRIVER) */
/*
......
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