summaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-06-01 03:16:17 +0000
committerRalf Baechle <ralf@linux-mips.org>1997-06-01 03:16:17 +0000
commitd8d9b8f76f22b7a16a83e261e64f89ee611f49df (patch)
tree3067bc130b80d52808e6390c9fc7fc087ec1e33c /drivers/block
parent19c9bba94152148523ba0f7ef7cffe3d45656b11 (diff)
Initial revision
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/Makefile16
-rw-r--r--drivers/block/amiflop.c5
-rw-r--r--drivers/block/ataflop.c11
-rw-r--r--drivers/block/ez.c19
-rw-r--r--drivers/block/floppy.c17
-rw-r--r--drivers/block/genhd.c40
-rw-r--r--drivers/block/hd.c5
-rw-r--r--drivers/block/ide-disk.c2
-rw-r--r--drivers/block/ide-floppy.c6
-rw-r--r--drivers/block/ide-probe.c2
-rw-r--r--drivers/block/ide-tape.c10
-rw-r--r--drivers/block/ide.c19
-rw-r--r--drivers/block/linear.c3
-rw-r--r--drivers/block/loop.c5
-rw-r--r--drivers/block/md.c3
-rw-r--r--drivers/block/ps2esdi.c12
-rw-r--r--drivers/block/rd.c32
-rw-r--r--drivers/block/xd.c31
-rw-r--r--drivers/block/z2ram.c5
19 files changed, 137 insertions, 106 deletions
diff --git a/drivers/block/Makefile b/drivers/block/Makefile
index ab00e93fc..f8ec1abd9 100644
--- a/drivers/block/Makefile
+++ b/drivers/block/Makefile
@@ -30,6 +30,22 @@ else
endif
endif
+ifeq ($(CONFIG_ATARI_ACSI),y)
+ LX_OBJS += acsi.o
+else
+ ifeq ($(CONFIG_ATARI_ACSI),m)
+ MX_OBJS += acsi.o
+ endif
+endif
+
+ifeq ($(CONFIG_ATARI_SLM),y)
+ L_OBJS += acsi_slm.o
+else
+ ifeq ($(CONFIG_ATARI_SLM),m)
+ M_OBJS += acsi_slm.o
+ endif
+endif
+
ifeq ($(CONFIG_AMIGA_Z2RAM),y)
L_OBJS += z2ram.o
else
diff --git a/drivers/block/amiflop.c b/drivers/block/amiflop.c
index 12c0fcd52..ab11b62a8 100644
--- a/drivers/block/amiflop.c
+++ b/drivers/block/amiflop.c
@@ -62,6 +62,7 @@
#include <linux/delay.h>
#include <linux/string.h>
#include <linux/mm.h>
+#include <linux/init.h>
#include <asm/setup.h>
#include <asm/uaccess.h>
@@ -1712,7 +1713,7 @@ static void fd_probe(int dev)
}
-static void probe_drives(void)
+__initfunc(static void probe_drives(void))
{
int drive,found;
@@ -1860,7 +1861,7 @@ static void fd_block_done(int irq, void *dummy, struct pt_regs *fp)
}
-int amiga_floppy_init(void)
+__initfunc(int amiga_floppy_init(void))
{
int i;
diff --git a/drivers/block/ataflop.c b/drivers/block/ataflop.c
index 3cf489712..7a08808f2 100644
--- a/drivers/block/ataflop.c
+++ b/drivers/block/ataflop.c
@@ -75,6 +75,7 @@
#include <linux/delay.h>
#include <linux/mm.h>
#include <linux/malloc.h>
+#include <linux/init.h>
#include <asm/setup.h>
#include <asm/system.h>
@@ -1777,7 +1778,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp,
/* Initialize the 'unit' variable for drive 'drive' */
-static void fd_probe( int drive )
+__initfunc(static void fd_probe( int drive ))
{
UD.connected = 0;
UDT = NULL;
@@ -1820,7 +1821,7 @@ static void fd_probe( int drive )
* declared absent.
*/
-static int fd_test_drive_present( int drive )
+__initfunc(static int fd_test_drive_present( int drive ))
{
unsigned long timeout;
unsigned char status;
@@ -1867,7 +1868,7 @@ static int fd_test_drive_present( int drive )
* floppies, additionally start the disk-change and motor-off timers.
*/
-static void config_types( void )
+__initfunc(static void config_types( void ))
{
int drive, cnt = 0;
@@ -2010,7 +2011,7 @@ static struct file_operations floppy_fops = {
floppy_revalidate, /* revalidate */
};
-int atari_floppy_init (void)
+__initfunc(int atari_floppy_init (void))
{
int i;
@@ -2070,7 +2071,7 @@ int atari_floppy_init (void)
}
-void atari_floppy_setup( char *str, int *ints )
+__initfunc(void atari_floppy_setup( char *str, int *ints ))
{
int i;
diff --git a/drivers/block/ez.c b/drivers/block/ez.c
index c6fc96a2f..82270915d 100644
--- a/drivers/block/ez.c
+++ b/drivers/block/ez.c
@@ -101,6 +101,7 @@
#include <linux/genhd.h>
#include <linux/hdreg.h>
#include <linux/ioport.h>
+#include <linux/init.h>
#include <asm/system.h>
#include <asm/io.h>
@@ -256,7 +257,7 @@ static struct file_operations ez_fops = {
ez_revalidate /* revalidate new media */
};
-int ez_init (void) /* preliminary initialisation */
+__initfunc(int ez_init (void)) /* preliminary initialisation */
{
if (register_blkdev(MAJOR_NR,"ez",&ez_fops)) {
@@ -271,7 +272,7 @@ int ez_init (void) /* preliminary initialisation */
return 0;
}
-static void ez_geninit (struct gendisk *ignored) /* real init */
+__initfunc(static void ez_geninit (struct gendisk *ignored)) /* real init */
{ int i;
@@ -507,7 +508,7 @@ void cleanup_module(void)
syntax: ez=base[,irq[,rep[,nybble]]]
*/
-void ez_setup(char *str, int *ints)
+__initfunc(void ez_setup(char *str, int *ints))
{ if (ints[0] > 0) ez_base = ints[1];
if (ints[0] > 1) ez_irq = ints[2];
@@ -748,7 +749,7 @@ static void ez_doorlock( int func )
/* ez_media_check: check for and acknowledge the MC flag */
-static void ez_media_check( void )
+__initfunc(static void ez_media_check( void ))
{ int r;
@@ -768,7 +769,7 @@ static void ez_media_check( void )
disconnect();
}
-static int ez_identify( void )
+__initfunc(static int ez_identify( void ))
{ int k, r;
@@ -800,7 +801,7 @@ static int ez_identify( void )
#define word_val(n) (ez_scratch[2*n]+256*ez_scratch[2*n+1])
-static void ez_get_capacity( void )
+__initfunc(static void ez_get_capacity( void ))
{ int ez_cylinders;
@@ -821,7 +822,7 @@ static void ez_get_capacity( void )
ez_heads,ez_sectors);
}
-static void ez_standby_off( void )
+__initfunc(static void ez_standby_off( void ))
{ connect();
wait_for(0,NULL);
@@ -830,7 +831,7 @@ static void ez_standby_off( void )
disconnect();
}
-static int ez_port_check( void ) /* check for 8-bit port */
+__initfunc(static int ez_port_check( void )) /* check for 8-bit port */
{ int r;
@@ -843,7 +844,7 @@ static int ez_port_check( void ) /* check for 8-bit port */
return 0;
}
-static int ez_detect( void )
+__initfunc(static int ez_detect( void ))
{ int j, k;
char sig[EZ_SIGLEN] = EZ_SIG;
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 9fc100ded..3f90981fd 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -140,6 +140,7 @@ static int allowed_drive_mask = 0x33;
#include <linux/mc146818rtc.h> /* CMOS defines */
#include <linux/ioport.h>
#include <linux/interrupt.h>
+#include <linux/init.h>
#include <asm/dma.h>
#include <asm/irq.h>
@@ -3727,7 +3728,7 @@ static struct file_operations floppy_fops = {
/* Determine the floppy disk controller type */
/* This routine was written by David C. Niemi */
-static char get_fdc_version(void)
+__initfunc(static char get_fdc_version(void))
{
int r;
@@ -3805,7 +3806,7 @@ static char get_fdc_version(void)
/* lilo configuration */
-static void floppy_set_flags(int *ints,int param, int param2)
+__initfunc(static void floppy_set_flags(int *ints,int param, int param2))
{
int i;
@@ -3818,7 +3819,7 @@ static void floppy_set_flags(int *ints,int param, int param2)
DPRINT("%s flag 0x%x\n", param2 ? "Setting" : "Clearing", param);
}
-static void daring(int *ints,int param, int param2)
+__initfunc(static void daring(int *ints,int param, int param2))
{
int i;
@@ -3834,7 +3835,7 @@ static void daring(int *ints,int param, int param2)
DPRINT("Assuming %s floppy hardware\n", param ? "standard" : "broken");
}
-static void set_cmos(int *ints, int dummy, int dummy2)
+__initfunc(static void set_cmos(int *ints, int dummy, int dummy2))
{
int current_drive=0;
@@ -3895,7 +3896,7 @@ static struct param_table {
{ "L40SX", 0, &print_unex, 0, 0 } };
#define FLOPPY_SETUP
-void floppy_setup(char *str, int *ints)
+__initfunc(void floppy_setup(char *str, int *ints))
{
int i;
int param;
@@ -3931,7 +3932,7 @@ void floppy_setup(char *str, int *ints)
static int have_no_fdc= -EIO;
-int floppy_init(void)
+__initfunc(int floppy_init(void))
{
int i,unit,drive;
@@ -4136,7 +4137,7 @@ extern char *get_options(char *str, int *ints);
char *floppy=NULL;
-static void parse_floppy_cfg_string(char *cfg)
+__initfunc(static void parse_floppy_cfg_string(char *cfg))
{
char *ptr;
int ints[11];
@@ -4152,7 +4153,7 @@ static void parse_floppy_cfg_string(char *cfg)
}
}
-static void mod_setup(char *pattern, void (*setup)(char *, int *))
+__initfunc(static void mod_setup(char *pattern, void (*setup)(char *, int *)))
{
unsigned long i;
char c;
diff --git a/drivers/block/genhd.c b/drivers/block/genhd.c
index aa11a3ee1..ad0e79b1b 100644
--- a/drivers/block/genhd.c
+++ b/drivers/block/genhd.c
@@ -191,7 +191,7 @@ static void extended_partition(struct gendisk *hd, kdev_t dev)
*/
bh->b_state = 0;
- if (le16_to_cpu(*(unsigned short *) (bh->b_data+510)) != MSDOS_LABEL_MAGIC)
+ if ((*(unsigned short *) (bh->b_data+510)) != cpu_to_le16(MSDOS_LABEL_MAGIC))
goto done;
p = (struct partition *) (0x1BE + bh->b_data);
@@ -316,7 +316,7 @@ read_mbr:
#ifdef CONFIG_BLK_DEV_IDE
check_table:
#endif
- if (le16_to_cpu(*(unsigned short *) (0x1fe + data)) != MSDOS_LABEL_MAGIC) {
+ if (*(unsigned short *) (0x1fe + data) != cpu_to_le16(MSDOS_LABEL_MAGIC)) {
brelse(bh);
return 0;
}
@@ -359,7 +359,7 @@ check_table:
goto read_mbr; /* start over with new MBR */
}
} else if (sig <= 0x1ae &&
- le16_to_cpu(*(unsigned short *)(data + sig)) == 0x55AA &&
+ *(unsigned short *)(data + sig) == cpu_to_le16(0x55AA) &&
(1 & *(unsigned char *)(data + sig + 2))) {
/* DM6 signature in MBR, courtesy of OnTrack */
(void) ide_xlate_1024 (dev, 0, " [DM6:MBR]");
@@ -424,7 +424,7 @@ check_table:
/*
* Check for old-style Disk Manager partition table
*/
- if (le16_to_cpu(*(unsigned short *) (data+0xfc)) == MSDOS_LABEL_MAGIC) {
+ if (*(unsigned short *) (data+0xfc) == cpu_to_le16(MSDOS_LABEL_MAGIC)) {
p = (struct partition *) (0x1be + data);
for (i = 4 ; i < 16 ; i++, current_minor++) {
p--;
@@ -573,12 +573,12 @@ static int sun_partition(struct gendisk *hd, kdev_t dev, unsigned long first_sec
spc = be16_to_cpu(label->ntrks) * be16_to_cpu(label->nsect);
for(i=0; i < 8; i++, p++) {
unsigned long st_sector;
+ int num_sectors;
- /* We register all partitions, even if zero size, so that
- * the minor numbers end up ok as per SunOS interpretation.
- */
st_sector = first_sector + be32_to_cpu(p->start_cylinder) * spc;
- add_partition(hd, current_minor, st_sector, be32_to_cpu(p->num_sectors));
+ num_sectors = be32_to_cpu(p->num_sectors);
+ if (num_sectors)
+ add_partition(hd, current_minor, st_sector, num_sectors);
current_minor++;
}
printk("\n");
@@ -660,10 +660,10 @@ static int sgi_partition(struct gendisk *hd, kdev_t dev, unsigned long first_sec
#include <asm/byteorder.h>
#include <linux/affs_hardblocks.h>
-static __inline__ __u32
-checksum_block(__u32 *m, int size)
+static __inline__ u32
+checksum_block(u32 *m, int size)
{
- __u32 sum = 0;
+ u32 sum = 0;
while (size--)
sum += htonl(*m++);
@@ -671,7 +671,7 @@ checksum_block(__u32 *m, int size)
}
static int
-amiga_partition(struct gendisk *hd, unsigned int dev, unsigned long first_sector)
+amiga_partition(struct gendisk *hd, kdev_t dev, unsigned long first_sector)
{
struct buffer_head *bh;
struct RigidDiskBlock *rdb;
@@ -686,13 +686,15 @@ amiga_partition(struct gendisk *hd, unsigned int dev, unsigned long first_sector
for (blk = 0; blk < RDB_ALLOCATION_LIMIT; blk++) {
if(!(bh = bread(dev,blk,512))) {
- printk("Dev %d: unable to read RDB block %d\n",dev,blk);
+ printk("Dev %s: unable to read RDB block %d\n",
+ kdevname(dev),blk);
goto rdb_done;
}
- if (*(__u32 *)bh->b_data == htonl(IDNAME_RIGIDDISK)) {
+ if (*(u32 *)bh->b_data == htonl(IDNAME_RIGIDDISK)) {
rdb = (struct RigidDiskBlock *)bh->b_data;
- if (checksum_block((__u32 *)bh->b_data,htonl(rdb->rdb_SummedLongs) & 0x7F)) {
- printk("Dev %d: RDB in block %d has bad checksum\n",dev,blk);
+ if (checksum_block((u32 *)bh->b_data,htonl(rdb->rdb_SummedLongs) & 0x7F)) {
+ printk("Dev %s: RDB in block %d has bad checksum\n",
+ kdevname(dev),blk);
brelse(bh);
continue;
}
@@ -701,14 +703,14 @@ amiga_partition(struct gendisk *hd, unsigned int dev, unsigned long first_sector
brelse(bh);
for (part = 1; blk > 0 && part <= 16; part++) {
if (!(bh = bread(dev,blk,512))) {
- printk("Dev %d: unable to read partition block %d\n",
- dev,blk);
+ printk("Dev %s: unable to read partition block %d\n",
+ kdevname(dev),blk);
goto rdb_done;
}
pb = (struct PartitionBlock *)bh->b_data;
blk = htonl(pb->pb_Next);
if (pb->pb_ID == htonl(IDNAME_PARTITION) && checksum_block(
- (__u32 *)pb,htonl(pb->pb_SummedLongs) & 0x7F) == 0 ) {
+ (u32 *)pb,htonl(pb->pb_SummedLongs) & 0x7F) == 0 ) {
/* Tell Kernel about it */
diff --git a/drivers/block/hd.c b/drivers/block/hd.c
index 9c4d8bb71..62e2f8da3 100644
--- a/drivers/block/hd.c
+++ b/drivers/block/hd.c
@@ -39,6 +39,7 @@
#include <linux/string.h>
#include <linux/ioport.h>
#include <linux/mc146818rtc.h> /* CMOS defines */
+#include <linux/init.h>
#define REALLY_SLOW_IO
#include <asm/system.h>
@@ -110,7 +111,7 @@ unsigned long read_timer(void)
}
#endif
-void hd_setup(char *str, int *ints)
+__initfunc(void hd_setup(char *str, int *ints))
{
int hdind = 0;
@@ -792,7 +793,7 @@ static struct file_operations hd_fops = {
block_fsync /* fsync */
};
-int hd_init(void)
+__initfunc(int hd_init(void))
{
if (register_blkdev(MAJOR_NR,"hd",&hd_fops)) {
printk("hd: unable to get major %d for harddisk\n",MAJOR_NR);
diff --git a/drivers/block/ide-disk.c b/drivers/block/ide-disk.c
index 94073d468..fbf8c3833 100644
--- a/drivers/block/ide-disk.c
+++ b/drivers/block/ide-disk.c
@@ -48,7 +48,6 @@
#include <linux/types.h>
#include <linux/string.h>
#include <linux/kernel.h>
-#include <linux/delay.h>
#include <linux/timer.h>
#include <linux/mm.h>
#include <linux/ioport.h>
@@ -59,6 +58,7 @@
#include <linux/hdreg.h>
#include <linux/genhd.h>
#include <linux/malloc.h>
+#include <linux/delay.h>
#include <asm/byteorder.h>
#include <asm/irq.h>
diff --git a/drivers/block/ide-floppy.c b/drivers/block/ide-floppy.c
index d362dfab4..5a0a603b5 100644
--- a/drivers/block/ide-floppy.c
+++ b/drivers/block/ide-floppy.c
@@ -726,7 +726,7 @@ static void idefloppy_pc_intr (ide_drive_t *drive)
return;
}
#ifdef CONFIG_BLK_DEV_TRITON
- if (clear_bit (PC_DMA_IN_PROGRESS, &pc->flags)) {
+ if (test_and_clear_bit (PC_DMA_IN_PROGRESS, &pc->flags)) {
printk (KERN_ERR "ide-floppy: The floppy wants to issue more interrupts in DMA mode\n");
printk (KERN_ERR "ide-floppy: DMA disabled, reverting to PIO\n");
HWIF(drive)->dmaproc(ide_dma_off, drive);
@@ -842,7 +842,7 @@ static void idefloppy_issue_pc (ide_drive_t *drive, idefloppy_pc_t *pc)
bcount.all=pc->request_transfer; /* Request to transfer the entire buffer at once */
#ifdef CONFIG_BLK_DEV_TRITON
- if (clear_bit (PC_DMA_ERROR, &pc->flags)) {
+ if (test_and_clear_bit (PC_DMA_ERROR, &pc->flags)) {
printk (KERN_WARNING "ide-floppy: DMA disabled, reverting to PIO\n");
HWIF(drive)->dmaproc(ide_dma_off, drive);
}
@@ -1182,7 +1182,7 @@ static int idefloppy_media_change (ide_drive_t *drive)
{
idefloppy_floppy_t *floppy = drive->driver_data;
- return clear_bit (IDEFLOPPY_MEDIA_CHANGED, &floppy->flags);
+ return test_and_clear_bit (IDEFLOPPY_MEDIA_CHANGED, &floppy->flags);
}
/*
diff --git a/drivers/block/ide-probe.c b/drivers/block/ide-probe.c
index 76e10c08f..25b3d54fa 100644
--- a/drivers/block/ide-probe.c
+++ b/drivers/block/ide-probe.c
@@ -47,7 +47,6 @@
#include <linux/types.h>
#include <linux/string.h>
#include <linux/kernel.h>
-#include <linux/delay.h>
#include <linux/timer.h>
#include <linux/mm.h>
#include <linux/ioport.h>
@@ -58,6 +57,7 @@
#include <linux/hdreg.h>
#include <linux/genhd.h>
#include <linux/malloc.h>
+#include <linux/delay.h>
#include <asm/byteorder.h>
#include <asm/irq.h>
diff --git a/drivers/block/ide-tape.c b/drivers/block/ide-tape.c
index 537c5dd82..2fc5f0b9d 100644
--- a/drivers/block/ide-tape.c
+++ b/drivers/block/ide-tape.c
@@ -1777,7 +1777,7 @@ static void idetape_pc_intr (ide_drive_t *drive)
return;
}
#ifdef CONFIG_BLK_DEV_TRITON
- if (clear_bit (PC_DMA_IN_PROGRESS, &pc->flags)) {
+ if (test_and_clear_bit (PC_DMA_IN_PROGRESS, &pc->flags)) {
printk (KERN_ERR "ide-tape: The tape wants to issue more interrupts in DMA mode\n");
printk (KERN_ERR "ide-tape: DMA disabled, reverting to PIO\n");
HWIF(drive)->dmaproc(ide_dma_off, drive);
@@ -1916,7 +1916,7 @@ static void idetape_issue_packet_command (ide_drive_t *drive, idetape_pc_t *pc)
bcount.all=pc->request_transfer; /* Request to transfer the entire buffer at once */
#ifdef CONFIG_BLK_DEV_TRITON
- if (clear_bit (PC_DMA_ERROR, &pc->flags)) {
+ if (test_and_clear_bit (PC_DMA_ERROR, &pc->flags)) {
printk (KERN_WARNING "ide-tape: DMA disabled, reverting to PIO\n");
HWIF(drive)->dmaproc(ide_dma_off, drive);
}
@@ -2248,7 +2248,7 @@ static void idetape_do_request (ide_drive_t *drive, struct request *rq, unsigned
status.all = GET_STAT();
if (!drive->dsc_overlap && rq->cmd != IDETAPE_PC_RQ2)
set_bit (IDETAPE_IGNORE_DSC, &tape->flags);
- if (!clear_bit (IDETAPE_IGNORE_DSC, &tape->flags) && !status.b.dsc) {
+ if (!test_and_clear_bit (IDETAPE_IGNORE_DSC, &tape->flags) && !status.b.dsc) {
if (postponed_rq == NULL) {
tape->dsc_polling_start = jiffies;
tape->dsc_polling_frequency = tape->best_dsc_rw_frequency;
@@ -2506,7 +2506,7 @@ static int idetape_add_chrdev_write_request (ide_drive_t *drive, int blocks)
if (!idetape_pipeline_active (tape) && tape->nr_stages >= (3 * tape->max_stages) / 4)
idetape_insert_pipeline_into_queue (drive);
- if (clear_bit (IDETAPE_PIPELINE_ERROR, &tape->flags)) /* Return a deferred error */
+ if (test_and_clear_bit (IDETAPE_PIPELINE_ERROR, &tape->flags)) /* Return a deferred error */
return -EIO;
return blocks;
}
@@ -3254,7 +3254,7 @@ static int idetape_chrdev_open (struct inode *inode, struct file *filp)
return -ENXIO;
tape = drive->driver_data;
- if (set_bit (IDETAPE_BUSY, &tape->flags))
+ if (test_and_set_bit (IDETAPE_BUSY, &tape->flags))
return -EBUSY;
MOD_INC_USE_COUNT;
idetape_create_read_position_cmd (&pc);
diff --git a/drivers/block/ide.c b/drivers/block/ide.c
index ca9456479..89759dd32 100644
--- a/drivers/block/ide.c
+++ b/drivers/block/ide.c
@@ -294,7 +294,6 @@
#include <linux/types.h>
#include <linux/string.h>
#include <linux/kernel.h>
-#include <linux/delay.h>
#include <linux/timer.h>
#include <linux/mm.h>
#include <linux/ioport.h>
@@ -307,6 +306,8 @@
#include <linux/malloc.h>
#include <linux/bios32.h>
#include <linux/pci.h>
+#include <linux/delay.h>
+#include <linux/init.h>
#include <asm/byteorder.h>
#include <asm/irq.h>
@@ -2144,7 +2145,7 @@ void ide_fixstring (byte *s, const int bytecount, const int byteswap)
* stridx() returns the offset of c within s,
* or -1 if c is '\0' or not found within s.
*/
-static int stridx (const char *s, char c)
+__initfunc(static int stridx (const char *s, char c))
{
char *i = strchr(s, c);
return (i && c) ? i - s : -1;
@@ -2162,7 +2163,7 @@ static int stridx (const char *s, char c)
* and base16 is allowed when prefixed with "0x".
* 4. otherwise, zero is returned.
*/
-static int match_parm (char *s, const char *keywords[], int vals[], int max_vals)
+__initfunc(static int match_parm (char *s, const char *keywords[], int vals[], int max_vals))
{
static const char *decimal = "0123456789";
static const char *hex = "0123456789abcdef";
@@ -2261,7 +2262,7 @@ static int match_parm (char *s, const char *keywords[], int vals[], int max_vals
* "ide0=ali14xx" : probe/support ali14xx chipsets (ALI M1439, M1443, M1445)
* "ide0=umc8672" : probe/support umc8672 chipsets
*/
-void ide_setup (char *s)
+__initfunc(void ide_setup (char *s))
{
int i, vals[3];
ide_hwif_t *hwif;
@@ -2558,7 +2559,7 @@ typedef void (ide_pci_init_proc_t)(byte, byte);
* ide_probe_pci() scans PCI for a specific vendor/device function,
* and invokes the supplied init routine for each instance detected.
*/
-static void ide_probe_pci (unsigned short vendor, unsigned short device, ide_pci_init_proc_t *init, int func_adj)
+__initfunc(static void ide_probe_pci (unsigned short vendor, unsigned short device, ide_pci_init_proc_t *init, int func_adj))
{
unsigned long flags;
unsigned index;
@@ -2581,7 +2582,7 @@ static void ide_probe_pci (unsigned short vendor, unsigned short device, ide_pci
* This routine should ideally be using pcibios_find_class() to find all
* PCI IDE interfaces, but that function causes some systems to "go weird".
*/
-static void probe_for_hwifs (void)
+__initfunc(static void probe_for_hwifs (void))
{
#ifdef CONFIG_PCI
/*
@@ -2620,7 +2621,7 @@ static void probe_for_hwifs (void)
#endif
}
-void ide_init_builtin_drivers (void)
+__initfunc(void ide_init_builtin_drivers (void))
{
/*
* Probe for special "known" interface chipsets
@@ -2889,7 +2890,7 @@ EXPORT_SYMBOL(ide_unregister);
/*
* This is gets invoked once during initialization, to set *everything* up
*/
-int ide_init (void)
+__initfunc(int ide_init (void))
{
init_ide_data ();
@@ -2904,7 +2905,7 @@ int ide_init (void)
char *options = NULL;
MODULE_PARM(options,"s");
-static void parse_options (char *line)
+__initfunc(static void parse_options (char *line))
{
char *next = line;
diff --git a/drivers/block/linear.c b/drivers/block/linear.c
index 6fc6960aa..f0f9fec79 100644
--- a/drivers/block/linear.c
+++ b/drivers/block/linear.c
@@ -21,6 +21,7 @@
#include <linux/md.h>
#include <linux/malloc.h>
+#include <linux/init.h>
#include "linear.h"
@@ -180,7 +181,7 @@ static struct md_personality linear_personality=
#ifndef MODULE
-void linear_init (void)
+__initfunc(void linear_init (void))
{
register_md_personality (LINEAR, &linear_personality);
}
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index d6af70d4f..212efece2 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -23,6 +23,7 @@
#include <linux/stat.h>
#include <linux/errno.h>
#include <linux/major.h>
+#include <linux/init.h>
#include <asm/uaccess.h>
@@ -537,8 +538,8 @@ static struct file_operations lo_fops = {
#define loop_init init_module
#endif
-int
-loop_init( void ) {
+__initfunc(int
+loop_init( void )) {
int i;
if (register_blkdev(MAJOR_NR, "loop", &lo_fops)) {
diff --git a/drivers/block/md.c b/drivers/block/md.c
index 7b4ec6313..078e1e1ee 100644
--- a/drivers/block/md.c
+++ b/drivers/block/md.c
@@ -35,6 +35,7 @@
#include <linux/kerneld.h>
#endif
#include <linux/errno.h>
+#include <linux/init.h>
#define MAJOR_NR MD_MAJOR
#define MD_DRIVER
@@ -546,7 +547,7 @@ void raid0_init (void);
void raid1_init (void);
void raid5_init (void);
-int md_init (void)
+__initfunc(int md_init (void))
{
printk ("md driver %s MAX_MD_DEV=%d, MAX_REAL=%d\n", MD_VERSION, MAX_MD_DEV, MAX_REAL);
diff --git a/drivers/block/ps2esdi.c b/drivers/block/ps2esdi.c
index 8e845e8d7..b4d5146de 100644
--- a/drivers/block/ps2esdi.c
+++ b/drivers/block/ps2esdi.c
@@ -43,6 +43,7 @@
#include <linux/ps2esdi.h>
#include <linux/blk.h>
#include <linux/mca.h>
+#include <linux/init.h>
#include <asm/system.h>
#include <asm/io.h>
@@ -176,7 +177,7 @@ static struct gendisk ps2esdi_gendisk =
};
/* initialization routine called by ll_rw_blk.c */
-int ps2esdi_init(void)
+__initfunc(int ps2esdi_init(void))
{
/* register the device - pass the name, major number and operations
@@ -197,7 +198,7 @@ int ps2esdi_init(void)
} /* ps2esdi_init */
/* handles boot time command line parameters */
-void tp720_setup(char *str, int *ints)
+__initfunc(void tp720_setup(char *str, int *ints))
{
/* no params, just sets the tp720esdi flag if it exists */
@@ -205,7 +206,7 @@ void tp720_setup(char *str, int *ints)
tp720esdi = 1;
}
-void ed_setup(char *str, int *ints)
+__initfunc(void ed_setup(char *str, int *ints))
{
int hdind = 0;
@@ -252,10 +253,9 @@ static int ps2esdi_getinfo(char *buf, int slot, void *d)
}
/* ps2 esdi specific initialization - called thru the gendisk chain */
-static void ps2esdi_geninit(struct gendisk *ignored)
+__initfunc(static void ps2esdi_geninit(struct gendisk *ignored))
{
/*
-
The first part contains the initialization code
for the ESDI disk subsystem. All we really do
is search for the POS registers of the controller
@@ -386,7 +386,7 @@ static void ps2esdi_geninit(struct gendisk *ignored)
} /* ps2esdi_geninit */
-static void ps2esdi_get_device_cfg(void)
+__initfunc(static void ps2esdi_get_device_cfg(void))
{
u_short cmd_blk[TYPE_0_CMD_BLK_LENGTH];
diff --git a/drivers/block/rd.c b/drivers/block/rd.c
index 102b19963..4ac6c0c41 100644
--- a/drivers/block/rd.c
+++ b/drivers/block/rd.c
@@ -51,9 +51,11 @@
#include <linux/ioctl.h>
#include <linux/fd.h>
#include <linux/module.h>
+#include <linux/init.h>
#include <asm/system.h>
#include <asm/uaccess.h>
+#include <asm/byteorder.h>
extern void wait_for_keypress(void);
@@ -269,7 +271,7 @@ static struct file_operations fd_fops = {
};
/* This is the registration and initialization section of the ramdisk driver */
-int rd_init(void)
+__initfunc(int rd_init(void))
{
int i;
@@ -334,8 +336,8 @@ void cleanup_module(void)
* romfs
* gzip
*/
-int
-identify_ramdisk_image(kdev_t device, struct file *fp, int start_block)
+__initfunc(int
+identify_ramdisk_image(kdev_t device, struct file *fp, int start_block))
{
const int size = 512;
struct minix_super_block *minixsb;
@@ -440,7 +442,7 @@ done:
/*
* This routine loads in the ramdisk image.
*/
-static void rd_load_image(kdev_t device,int offset)
+__initfunc(static void rd_load_image(kdev_t device,int offset))
{
struct inode inode, out_inode;
struct file infile, outfile;
@@ -527,7 +529,7 @@ done:
}
-void rd_load()
+__initfunc(void rd_load(void))
{
if (rd_doload == 0)
return;
@@ -549,7 +551,7 @@ void rd_load()
#ifdef CONFIG_BLK_DEV_INITRD
-void initrd_load(void)
+__initfunc(void initrd_load(void))
{
rd_load_image(MKDEV(MAJOR_NR, INITRD_MINOR),0);
}
@@ -608,21 +610,21 @@ static void gzip_release(void **);
#include "../../lib/inflate.c"
-static void *malloc(int size)
+__initfunc(static void *malloc(int size))
{
return kmalloc(size, GFP_KERNEL);
}
-static void free(void *where)
+__initfunc(static void free(void *where))
{
kfree(where);
}
-static void gzip_mark(void **ptr)
+__initfunc(static void gzip_mark(void **ptr))
{
}
-static void gzip_release(void **ptr)
+__initfunc(static void gzip_release(void **ptr))
{
}
@@ -631,7 +633,7 @@ static void gzip_release(void **ptr)
* Fill the input buffer. This is called only when the buffer is empty
* and at least one byte is really needed.
*/
-static int fill_inbuf()
+__initfunc(static int fill_inbuf(void))
{
if (exit_code) return -1;
@@ -648,7 +650,7 @@ static int fill_inbuf()
* Write the output window window[0..outcnt-1] and update crc and bytes_out.
* (Used for the decompressed data only.)
*/
-static void flush_window()
+__initfunc(static void flush_window(void))
{
ulg c = crc; /* temporary variable */
unsigned n;
@@ -666,14 +668,14 @@ static void flush_window()
outcnt = 0;
}
-static void error(char *x)
+__initfunc(static void error(char *x))
{
printk(KERN_ERR "%s", x);
exit_code = 1;
}
-static int
-crd_load(struct file * fp, struct file *outfp)
+__initfunc(static int
+crd_load(struct file * fp, struct file *outfp))
{
int result;
diff --git a/drivers/block/xd.c b/drivers/block/xd.c
index 603c4b142..472959603 100644
--- a/drivers/block/xd.c
+++ b/drivers/block/xd.c
@@ -30,6 +30,7 @@
#include <linux/kernel.h>
#include <linux/genhd.h>
#include <linux/hdreg.h>
+#include <linux/init.h>
#include <asm/system.h>
#include <asm/io.h>
@@ -126,7 +127,7 @@ static u_char xd_override = 0, xd_type = 0;
static u_short xd_iobase = 0;
/* xd_init: register the block device number and set up pointer tables */
-int xd_init (void)
+__initfunc(int xd_init (void))
{
if (register_blkdev(MAJOR_NR,"xd",&xd_fops)) {
printk("xd_init: unable to get major number %d\n",MAJOR_NR);
@@ -141,7 +142,7 @@ int xd_init (void)
}
/* xd_detect: scan the possible BIOS ROM locations for the signature strings */
-static u_char xd_detect (u_char *controller, unsigned int *address)
+__initfunc(static u_char xd_detect (u_char *controller, unsigned int *address))
{
u_char i,j,found = 0;
@@ -164,7 +165,7 @@ static u_char xd_detect (u_char *controller, unsigned int *address)
/* xd_geninit: grab the IRQ and DMA channel, initialise the drives */
/* and set up the "raw" device entries in the table */
-static void xd_geninit (struct gendisk *ignored)
+__initfunc(static void xd_geninit (struct gendisk *ignored))
{
u_char i,controller;
unsigned int address;
@@ -527,7 +528,7 @@ static u_int xd_command (u_char *command,u_char mode,u_char *indata,u_char *outd
return (csb & CSB_ERROR);
}
-static u_char xd_initdrives (void (*init_drive)(u_char drive))
+__initfunc(static u_char xd_initdrives (void (*init_drive)(u_char drive)))
{
u_char cmdblk[6],i,count = 0;
@@ -541,7 +542,7 @@ static u_char xd_initdrives (void (*init_drive)(u_char drive))
return (count);
}
-static void xd_dtc_init_controller (unsigned int address)
+__initfunc(static void xd_dtc_init_controller (unsigned int address))
{
switch (address) {
case 0xC8000: xd_iobase = 0x320; break;
@@ -556,7 +557,7 @@ static void xd_dtc_init_controller (unsigned int address)
outb(0,XD_RESET); /* reset the controller */
}
-static void xd_dtc_init_drive (u_char drive)
+__initfunc(static void xd_dtc_init_drive (u_char drive))
{
u_char cmdblk[6],buf[64];
@@ -581,7 +582,7 @@ static void xd_dtc_init_drive (u_char drive)
printk("xd_dtc_init_drive: error reading geometry for drive %d\n",drive);
}
-static void xd_wd_init_controller (unsigned int address)
+__initfunc(static void xd_wd_init_controller (unsigned int address))
{
switch (address) {
case 0xC8000: xd_iobase = 0x320; break;
@@ -600,7 +601,7 @@ static void xd_wd_init_controller (unsigned int address)
/* outb(0,XD_RESET); */ /* reset the controller */
}
-static void xd_wd_init_drive (u_char drive)
+__initfunc(static void xd_wd_init_drive (u_char drive))
{
u_char cmdblk[6],buf[0x200];
@@ -622,7 +623,7 @@ static void xd_wd_init_drive (u_char drive)
printk("xd_wd_init_drive: error reading geometry for drive %d\n",drive);
}
-static void xd_seagate_init_controller (unsigned int address)
+__initfunc(static void xd_seagate_init_controller (unsigned int address))
{
switch (address) {
case 0xC8000: xd_iobase = 0x320; break;
@@ -639,7 +640,7 @@ static void xd_seagate_init_controller (unsigned int address)
outb(0,XD_RESET); /* reset the controller */
}
-static void xd_seagate_init_drive (u_char drive)
+__initfunc(static void xd_seagate_init_drive (u_char drive))
{
u_char cmdblk[6],buf[0x200];
@@ -655,7 +656,7 @@ static void xd_seagate_init_drive (u_char drive)
}
/* Omti support courtesy Dirk Melchers */
-static void xd_omti_init_controller (unsigned int address)
+__initfunc(static void xd_omti_init_controller (unsigned int address))
{
switch (address) {
case 0xC8000: xd_iobase = 0x320; break;
@@ -673,7 +674,7 @@ static void xd_omti_init_controller (unsigned int address)
outb(0,XD_RESET); /* reset the controller */
}
-static void xd_omti_init_drive (u_char drive)
+__initfunc(static void xd_omti_init_drive (u_char drive))
{
/* gets infos from drive */
xd_override_init_drive(drive);
@@ -684,7 +685,7 @@ static void xd_omti_init_drive (u_char drive)
/* xd_override_init_drive: this finds disk geometry in a "binary search" style, narrowing in on the "correct" number of heads
etc. by trying values until it gets the highest successful value. Idea courtesy Salvador Abreu (spa@fct.unl.pt). */
-static void xd_override_init_drive (u_char drive)
+__initfunc(static void xd_override_init_drive (u_char drive))
{
u_short min[] = { 0,0,0 },max[] = { 16,1024,64 },test[] = { 0,0,0 };
u_char cmdblk[6],i;
@@ -707,7 +708,7 @@ static void xd_override_init_drive (u_char drive)
}
/* xd_setup: initialise from command line parameters */
-void xd_setup (char *command,int *integers)
+__initfunc(void xd_setup (char *command,int *integers))
{
xd_override = 1;
@@ -720,7 +721,7 @@ void xd_setup (char *command,int *integers)
}
/* xd_setparam: set the drive characteristics */
-static void xd_setparam (u_char command,u_char drive,u_char heads,u_short cylinders,u_short rwrite,u_short wprecomp,u_char ecc)
+__initfunc(static void xd_setparam (u_char command,u_char drive,u_char heads,u_short cylinders,u_short rwrite,u_short wprecomp,u_char ecc))
{
u_char cmdblk[14];
diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c
index 0f556752d..ac13bcff2 100644
--- a/drivers/block/z2ram.c
+++ b/drivers/block/z2ram.c
@@ -28,6 +28,7 @@
#include <linux/major.h>
#include <linux/malloc.h>
#include <linux/blk.h>
+#include <linux/init.h>
#if defined(MODULE)
#include <linux/module.h>
@@ -282,8 +283,8 @@ static struct file_operations z2_fops =
block_fsync /* fsync */
};
-int
-z2_init( void )
+__initfunc(int
+z2_init( void ))
{
if ( !MACH_IS_AMIGA )