summaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-05-12 21:05:59 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-05-12 21:05:59 +0000
commitba2dacab305c598cd4c34a604f8e276bf5bab5ff (patch)
tree78670a0139bf4d5ace617b29b7eba82bbc74d602 /drivers/block
parentb77bf69998121e689c5e86cc5630d39a0a9ee6ca (diff)
Merge with Linux 2.3.99-pre7 and various other bits.
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/DAC960.c22
-rw-r--r--drivers/block/amiflop.c12
-rw-r--r--drivers/block/cpqarray.c20
-rw-r--r--drivers/block/floppy.c33
-rw-r--r--drivers/block/loop.c1
-rw-r--r--drivers/block/paride/jumbo2
-rw-r--r--drivers/block/paride/on26.c2
-rw-r--r--drivers/block/paride/pd.c2
-rw-r--r--drivers/block/paride/pseudo.h2
-rw-r--r--drivers/block/ps2esdi.c4
-rw-r--r--drivers/block/rd.c2
-rw-r--r--drivers/block/xd.c15
-rw-r--r--drivers/block/xd.h4
13 files changed, 59 insertions, 62 deletions
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
index 87c597c31..04004d7fb 100644
--- a/drivers/block/DAC960.c
+++ b/drivers/block/DAC960.c
@@ -465,28 +465,30 @@ static void DAC960_DetectControllers(DAC960_ControllerType_T ControllerType)
unsigned char Device = DeviceFunction >> 3;
unsigned char Function = DeviceFunction & 0x7;
unsigned int IRQ_Channel = PCI_Device->irq;
- unsigned long BaseAddress0 = PCI_Device->resource[0].start;
- unsigned long BaseAddress1 = PCI_Device->resource[1].start;
+ unsigned long BaseAddress0 = pci_resource_start (PCI_Device, 0);
+ unsigned long BaseAddress1 = pci_resource_start (PCI_Device, 1);
unsigned short SubsystemVendorID, SubsystemDeviceID;
int CommandIdentifier;
- pci_read_config_word(PCI_Device, PCI_SUBSYSTEM_VENDOR_ID,
- &SubsystemVendorID);
- pci_read_config_word(PCI_Device, PCI_SUBSYSTEM_ID,
- &SubsystemDeviceID);
+
+ if (pci_enable_device(PCI_Device))
+ goto Ignore;
+
+ SubsystemVendorID = PCI_Device->subsystem_vendor;
+ SubsystemDeviceID = PCI_Device->subsystem_device;
switch (ControllerType)
{
case DAC960_V5_Controller:
if (!(SubsystemVendorID == PCI_VENDOR_ID_MYLEX &&
SubsystemDeviceID == PCI_DEVICE_ID_MYLEX_DAC960P_V5))
goto Ignore;
- PCI_Address = BaseAddress0 & PCI_BASE_ADDRESS_MEM_MASK;
+ PCI_Address = BaseAddress0;
break;
case DAC960_V4_Controller:
- PCI_Address = BaseAddress0 & PCI_BASE_ADDRESS_MEM_MASK;
+ PCI_Address = BaseAddress0;
break;
case DAC960_V3_Controller:
- IO_Address = BaseAddress0 & PCI_BASE_ADDRESS_IO_MASK;
- PCI_Address = BaseAddress1 & PCI_BASE_ADDRESS_MEM_MASK;
+ IO_Address = BaseAddress0;
+ PCI_Address = BaseAddress1;
break;
}
if (DAC960_ControllerCount == DAC960_MaxControllers)
diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c
index 0c7af176e..095fc0870 100644
--- a/drivers/block/amiflop.c
+++ b/drivers/block/amiflop.c
@@ -1824,19 +1824,16 @@ int __init amiga_floppy_init(void)
}
/* initialize variables */
- motor_on_timer.next = NULL;
- motor_on_timer.prev = NULL;
+ init_timer(&motor_on_timer);
motor_on_timer.expires = 0;
motor_on_timer.data = 0;
motor_on_timer.function = motor_on_callback;
for (i = 0; i < FD_MAX_UNITS; i++) {
- motor_off_timer[i].next = NULL;
- motor_off_timer[i].prev = NULL;
+ init_timer(&motor_off_timer[i]);
motor_off_timer[i].expires = 0;
motor_off_timer[i].data = i|0x80000000;
motor_off_timer[i].function = fd_motor_off;
- flush_track_timer[i].next = NULL;
- flush_track_timer[i].prev = NULL;
+ init_timer(&flush_track_timer[i]);
flush_track_timer[i].expires = 0;
flush_track_timer[i].data = i;
flush_track_timer[i].function = flush_track_callback;
@@ -1844,8 +1841,7 @@ int __init amiga_floppy_init(void)
unit[i].track = -1;
}
- post_write_timer.next = NULL;
- post_write_timer.prev = NULL;
+ init_timer(&post_write_timer);
post_write_timer.expires = 0;
post_write_timer.data = 0;
post_write_timer.function = post_write;
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
index 47291bef1..40e639830 100644
--- a/drivers/block/cpqarray.c
+++ b/drivers/block/cpqarray.c
@@ -312,7 +312,6 @@ EXPORT_NO_SYMBOLS;
/* This is a bit of a hack... */
int __init init_module(void)
{
- int i, j;
cpqarray_init();
if (nr_ctlr == 0)
return -EIO;
@@ -627,16 +626,15 @@ static int cpqarray_pci_init(ctlr_info_t *c, unchar bus, unchar device_fn)
for(i=0; i<6; i++)
addr[i] = pdev->resource[i].flags;
- (void) pcibios_read_config_word(bus, device_fn,
- PCI_COMMAND,&command);
- (void) pcibios_read_config_byte(bus, device_fn,
- PCI_CLASS_REVISION,&revision);
- (void) pcibios_read_config_byte(bus, device_fn,
- PCI_CACHE_LINE_SIZE, &cache_line_size);
- (void) pcibios_read_config_byte(bus, device_fn,
- PCI_LATENCY_TIMER, &latency_timer);
+ if (pci_enable_device(pdev))
+ return -1;
+
+ pci_read_config_word(pdev, PCI_COMMAND, &command);
+ pci_read_config_byte(pdev, PCI_CLASS_REVISION, &revision);
+ pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &cache_line_size);
+ pci_read_config_byte(pdev, PCI_LATENCY_TIMER, &latency_timer);
- (void) pcibios_read_config_dword(bus, device_fn, 0x2c, &board_id);
+ pci_read_config_dword(pdev, 0x2c, &board_id);
DBGINFO(
printk("vendor_id = %x\n", vendor_id);
@@ -659,7 +657,7 @@ DBGINFO(
*/
for(i=0; i<6; i++)
if (!(addr[i] & 0x1)) {
- c->paddr = pdev->resource[i].start;
+ c->paddr = pci_resource_start (pdev, i);
break;
}
c->vaddr = remap_pci_mem(c->paddr, 128);
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index f88c76781..df797a33b 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -583,8 +583,7 @@ static inline void debugt(const char *message)
}
typedef void (*timeout_fn)(unsigned long);
-static struct timer_list fd_timeout ={ NULL, NULL, 0, 0,
- (timeout_fn) floppy_shutdown };
+static struct timer_list fd_timeout ={ function: (timeout_fn) floppy_shutdown };
static const char *timeout_message;
@@ -592,7 +591,7 @@ static const char *timeout_message;
static void is_alive(const char *message)
{
/* this routine checks whether the floppy driver is "alive" */
- if (fdc_busy && command_status < 2 && !fd_timeout.prev){
+ if (fdc_busy && command_status < 2 && !timer_pending(&fd_timeout)){
DPRINT("timeout handler died: %s\n",message);
}
}
@@ -903,14 +902,14 @@ static void motor_off_callback(unsigned long nr)
}
static struct timer_list motor_off_timer[N_DRIVE] = {
- { NULL, NULL, 0, 0, motor_off_callback },
- { NULL, NULL, 0, 1, motor_off_callback },
- { NULL, NULL, 0, 2, motor_off_callback },
- { NULL, NULL, 0, 3, motor_off_callback },
- { NULL, NULL, 0, 4, motor_off_callback },
- { NULL, NULL, 0, 5, motor_off_callback },
- { NULL, NULL, 0, 6, motor_off_callback },
- { NULL, NULL, 0, 7, motor_off_callback }
+ { data: 0, function: motor_off_callback },
+ { data: 1, function: motor_off_callback },
+ { data: 2, function: motor_off_callback },
+ { data: 3, function: motor_off_callback },
+ { data: 4, function: motor_off_callback },
+ { data: 5, function: motor_off_callback },
+ { data: 6, function: motor_off_callback },
+ { data: 7, function: motor_off_callback }
};
/* schedules motor off */
@@ -976,7 +975,7 @@ static void schedule_bh( void (*handler)(void*) )
mark_bh(IMMEDIATE_BH);
}
-static struct timer_list fd_timer ={ NULL, NULL, 0, 0, 0 };
+static struct timer_list fd_timer;
static void cancel_activity(void)
{
@@ -1854,9 +1853,9 @@ static void show_floppy(void)
printk("DEVICE_INTR=%p\n", DEVICE_INTR);
if (floppy_tq.sync)
printk("floppy_tq.routine=%p\n", floppy_tq.routine);
- if (fd_timer.prev)
+ if (timer_pending(&fd_timer))
printk("fd_timer.function=%p\n", fd_timer.function);
- if (fd_timeout.prev){
+ if (timer_pending(&fd_timeout)){
printk("timer_table=%p\n",fd_timeout.function);
printk("expires=%lu\n",fd_timeout.expires-jiffies);
printk("now=%lu\n",jiffies);
@@ -4337,13 +4336,13 @@ static void floppy_release_irq_and_dma(void)
#ifdef FLOPPY_SANITY_CHECK
#ifndef __sparc__
for (drive=0; drive < N_FDC * 4; drive++)
- if (motor_off_timer[drive].next)
+ if (timer_pending(motor_off_timer + drive))
printk("motor off timer %d still active\n", drive);
#endif
- if (fd_timeout.next)
+ if (timer_pending(&fd_timeout))
printk("floppy timer still active:%s\n", timeout_message);
- if (fd_timer.next)
+ if (timer_pending(&fd_timer))
printk("auxiliary floppy timer still active\n");
if (floppy_tq.sync)
printk("task queue still active\n");
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 668cb5096..bacb62fba 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -443,6 +443,7 @@ static int loop_set_fd(struct loop_device *lo, kdev_t dev, unsigned int arg)
lo->lo_backing_file->f_flags = file->f_flags;
lo->lo_backing_file->f_owner = file->f_owner;
lo->lo_backing_file->f_dentry = file->f_dentry;
+ lo->lo_backing_file->f_vfsmnt = file->f_vfsmnt;
lo->lo_backing_file->f_op = file->f_op;
lo->lo_backing_file->private_data = file->private_data;
file_moveto(lo->lo_backing_file, file);
diff --git a/drivers/block/paride/jumbo b/drivers/block/paride/jumbo
index f4b8ebf75..e793b9cb7 100644
--- a/drivers/block/paride/jumbo
+++ b/drivers/block/paride/jumbo
@@ -26,7 +26,7 @@ UPARP=${X:-n}
echo
#
case $USMP in
- y* | Y* ) FSMP="-D__SMP__"
+ y* | Y* ) FSMP="-DCONFIG_SMP"
;;
*) FSMP=""
;;
diff --git a/drivers/block/paride/on26.c b/drivers/block/paride/on26.c
index d1905bfa2..f52f124d8 100644
--- a/drivers/block/paride/on26.c
+++ b/drivers/block/paride/on26.c
@@ -125,7 +125,7 @@ static void on26_disconnect ( PIA *pi )
static int on26_test_port( PIA *pi) /* hard reset */
-{ int i, m, d, x, y;
+{ int i, m, d, x=0, y=0;
pi->saved_r0 = r0();
pi->saved_r2 = r2();
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c
index 4676250dd..6c5a87e5c 100644
--- a/drivers/block/paride/pd.c
+++ b/drivers/block/paride/pd.c
@@ -637,7 +637,7 @@ void cleanup_module(void);
int init_module(void)
-{ int err, unit;
+{
#ifdef PARIDE_JUMBO
{ extern paride_init();
diff --git a/drivers/block/paride/pseudo.h b/drivers/block/paride/pseudo.h
index 3992f3c30..35ca3f458 100644
--- a/drivers/block/paride/pseudo.h
+++ b/drivers/block/paride/pseudo.h
@@ -49,7 +49,7 @@ static int ps_nice = 0;
static spinlock_t ps_spinlock __attribute__((unused)) = SPIN_LOCK_UNLOCKED;
-static struct timer_list ps_timer = {0,0,0,0,ps_timer_int};
+static struct timer_list ps_timer = { function: ps_timer_int };
static struct tq_struct ps_tq = {0,0,ps_tq_int,NULL};
static void ps_set_intr( void (*continuation)(void),
diff --git a/drivers/block/ps2esdi.c b/drivers/block/ps2esdi.c
index 305c89a00..766ea0a18 100644
--- a/drivers/block/ps2esdi.c
+++ b/drivers/block/ps2esdi.c
@@ -379,9 +379,9 @@ static void __init ps2esdi_geninit(void)
reset_status = 0;
reset_start = jiffies;
while (!reset_status) {
- esdi_timer.expires = HZ;
+ init_timer(&esdi_timer);
+ esdi_timer.expires = jiffies + HZ;
esdi_timer.data = 0;
- esdi_timer.next = esdi_timer.prev = NULL;
add_timer(&esdi_timer);
sleep_on(&ps2esdi_int);
}
diff --git a/drivers/block/rd.c b/drivers/block/rd.c
index 11a06ef61..5308e95fd 100644
--- a/drivers/block/rd.c
+++ b/drivers/block/rd.c
@@ -436,8 +436,8 @@ int __init rd_init (void)
#ifdef MODULE
module_init(rd_init);
-module_exit(rd_cleanup);
#endif
+module_exit(rd_cleanup);
/* loadable module support */
MODULE_PARM (rd_size, "1i");
diff --git a/drivers/block/xd.c b/drivers/block/xd.c
index 659e05c17..74df1096e 100644
--- a/drivers/block/xd.c
+++ b/drivers/block/xd.c
@@ -149,9 +149,7 @@ static int xd_geo[XD_MAXDRIVES*3] __initdata = { 0,0,0,0,0,0 };
static volatile int xdc_busy = 0;
static DECLARE_WAIT_QUEUE_HEAD(xdc_wait);
-typedef void (*timeout_fn)(unsigned long);
-static struct timer_list xd_timer = { NULL, NULL, 0, 0, (timeout_fn) xd_wakeup },
- xd_watchdog_int = { NULL, NULL, 0, 0, (timeout_fn) xd_watchdog };
+static struct timer_list xd_timer, xd_watchdog_int;
static volatile u_char xd_error;
static int nodma = XD_DONT_USE_DMA;
@@ -161,6 +159,9 @@ static devfs_handle_t devfs_handle = NULL;
/* xd_init: register the block device number and set up pointer tables */
int __init xd_init (void)
{
+ init_timer (&xd_timer); xd_timer.function = xd_wakeup;
+ init_timer (&xd_watchdog_int); xd_watchdog_int.function = xd_watchdog;
+
if (devfs_register_blkdev(MAJOR_NR,"xd",&xd_fops)) {
printk("xd: Unable to get major number %d\n",MAJOR_NR);
return -1;
@@ -551,13 +552,13 @@ static u_char *xd_build (u_char *cmdblk,u_char command,u_char drive,u_char head,
}
/* xd_wakeup is called from timer interrupt */
-static void xd_wakeup (void)
+static void xd_wakeup (unsigned long unused)
{
wake_up(&xdc_wait);
}
/* xd_wakeup is called from timer interrupt */
-static void xd_watchdog (void)
+static void xd_watchdog (unsigned long unused)
{
xd_error = 1;
wake_up(&xd_wait_int);
@@ -1136,8 +1137,8 @@ int init_module(void)
if((xd[0] = count))
do_xd_setup(xd);
- if (error = xd_init())
- return error;
+ error = xd_init();
+ if (error) return error;
printk(KERN_INFO "XD: Loaded as a module.\n");
if (!xd_drives) {
diff --git a/drivers/block/xd.h b/drivers/block/xd.h
index b07de3c34..d6fcc675a 100644
--- a/drivers/block/xd.h
+++ b/drivers/block/xd.h
@@ -122,8 +122,8 @@ static void xd_recalibrate (u_char drive);
static void xd_interrupt_handler (int irq, void *dev_id, struct pt_regs *regs);
static u_char xd_setup_dma (u_char opcode,u_char *buffer,u_int count);
static u_char *xd_build (u_char *cmdblk,u_char command,u_char drive,u_char head,u_short cylinder,u_char sector,u_char count,u_char control);
-static void xd_wakeup (void);
-static void xd_watchdog (void);
+static void xd_wakeup (unsigned long unused);
+static void xd_watchdog (unsigned long unused);
static inline u_char xd_waitport (u_short port,u_char flags,u_char mask,u_long timeout);
static u_int xd_command (u_char *command,u_char mode,u_char *indata,u_char *outdata,u_char *sense,u_long timeout);