]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] IDE 100
authorMartin Dalecki <dalecki@evision.ag>
Fri, 19 Jul 2002 02:34:06 +0000 (19:34 -0700)
committerTrond Myklebust <trond.myklebust@fys.uio.no>
Fri, 19 Jul 2002 02:34:06 +0000 (19:34 -0700)
  Trivia time:

  - C99 conforming initializations by Rusty.

  - ide__sti() -> local_irq_enable() and its friends.

58 files changed:
drivers/ide/aec62xx.c
drivers/ide/ali14xx.c
drivers/ide/alim15x3.c
drivers/ide/amd74xx.c
drivers/ide/ataraid.c
drivers/ide/cmd64x.c
drivers/ide/cs5530.c
drivers/ide/cy82c693.c
drivers/ide/device.c
drivers/ide/dtc2278.c
drivers/ide/hd.c
drivers/ide/hpt34x.c
drivers/ide/hpt366.c
drivers/ide/hptraid.c
drivers/ide/ht6560b.c
drivers/ide/ide-cd.c
drivers/ide/ide-disk.c
drivers/ide/ide-floppy.c
drivers/ide/ide-pci.c
drivers/ide/ide-pmac.c
drivers/ide/ide-tape.c
drivers/ide/ide-taskfile.c
drivers/ide/ide.c
drivers/ide/it8172.c
drivers/ide/ns87415.c
drivers/ide/opti621.c
drivers/ide/pdc202xx.c
drivers/ide/pdc4030.c
drivers/ide/pdcraid.c
drivers/ide/piix.c
drivers/ide/probe.c
drivers/ide/q40ide.c
drivers/ide/rz1000.c
drivers/ide/serverworks.c
drivers/ide/sis5513.c
drivers/ide/sl82c105.c
drivers/ide/tcq.c
drivers/ide/trm290.c
drivers/ide/umc8672.c
drivers/ide/via82cxxx.c
drivers/scsi/ide-scsi.c
include/asm-alpha/ide.h
include/asm-arm/ide.h
include/asm-cris/ide.h
include/asm-i386/ide.h
include/asm-ia64/ide.h
include/asm-m68k/ide.h
include/asm-mips/ide.h
include/asm-mips64/ide.h
include/asm-parisc/ide.h
include/asm-ppc/ide.h
include/asm-ppc64/ide.h
include/asm-s390/ide.h
include/asm-s390x/ide.h [deleted file]
include/asm-sh/ide.h
include/asm-sparc/ide.h
include/asm-sparc64/ide.h
include/asm-x86_64/ide.h

index 855139e39ac3159bc0722c7e0ae4d4e8e6efcca0..d2dca5e1a1a4d2468cac5d4930aafd13d3a8a794 100644 (file)
 #define AEC_CABLEPINS_INPUT    0x10
 
 static unsigned char aec_cyc2udma[9] = { 5, 5, 5, 4, 3, 2, 2, 1, 1 };
-static unsigned char aec_cyc2act[16] = { 1, 1, 2, 3, 4, 5, 6, 0, 0, 7,  7,  7, 7,  7,  7,  7 };
-static unsigned char aec_cyc2rec[16] = { 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 12, 13, 14 };
+static unsigned char aec_cyc2act[16] =
+    { 1, 1, 2, 3, 4, 5, 6, 0, 0, 7, 7, 7, 7, 7, 7, 7 };
+static unsigned char aec_cyc2rec[16] =
+    { 1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 12, 13, 14 };
 
 /*
  * aec_set_speed_old() writes timing values to
  * the chipset registers for ATP850UF
  */
 
-static void aec_set_speed_old(struct pci_dev *dev, unsigned char dn, struct ata_timing *timing)
+static void aec_set_speed_old(struct pci_dev *dev, unsigned char dn,
+                             struct ata_timing *timing)
 {
        unsigned char t;
 
        pci_write_config_byte(dev, AEC_DRIVE_TIMING + (dn << 1),
-               aec_cyc2act[FIT(timing->active, 0, 15)]);
+                             aec_cyc2act[FIT(timing->active, 0, 15)]);
        pci_write_config_byte(dev, AEC_DRIVE_TIMING + (dn << 1) + 1,
-               aec_cyc2rec[FIT(timing->recover, 0, 15)]);
+                             aec_cyc2rec[FIT(timing->recover, 0, 15)]);
 
        pci_read_config_byte(dev, AEC_UDMA_OLD, &t);
        t &= ~(3 << (dn << 1));
@@ -90,19 +93,22 @@ static void aec_set_speed_old(struct pci_dev *dev, unsigned char dn, struct ata_
  * other Artop chips
  */
 
-static void aec_set_speed_new(struct pci_dev *dev, unsigned char dn, struct ata_timing *timing)
+static void aec_set_speed_new(struct pci_dev *dev, unsigned char dn,
+                             struct ata_timing *timing)
 {
        unsigned char t;
 
        pci_write_config_byte(dev, AEC_DRIVE_TIMING + dn,
-               (aec_cyc2act[FIT(timing->active, 0, 15)] << 4)
-               | aec_cyc2rec[FIT(timing->recover, 0, 15)]);
+                             (aec_cyc2act[FIT(timing->active, 0, 15)] <<
+                              4)
+                             | aec_cyc2rec[FIT(timing->recover, 0, 15)]);
 
        pci_read_config_byte(dev, AEC_UDMA_NEW + (dn >> 1), &t);
        t &= ~(0xf << ((dn & 1) << 2));
        if (timing->udma) {
                if (timing->udma >= 2)
-                       t |= aec_cyc2udma[FIT(timing->udma, 2, 8)] << ((dn & 1) << 2);
+                       t |= aec_cyc2udma[FIT(timing->udma, 2, 8)] <<
+                           ((dn & 1) << 2);
                if (timing->mode == XFER_UDMA_5)
                        t |= 6;
                if (timing->mode == XFER_UDMA_6)
@@ -123,12 +129,15 @@ static int aec_set_drive(struct ata_device *drive, unsigned char speed)
        int T, UT;
        int aec_old;
 
-       aec_old = (drive->channel->pci_dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF);
+       aec_old =
+           (drive->channel->pci_dev->device ==
+            PCI_DEVICE_ID_ARTOP_ATP850UF);
 
        if (speed != XFER_PIO_SLOW && speed != drive->current_speed)
                if (ide_config_drive_speed(drive, speed))
-                       printk(KERN_WARNING "ide%d: Drive %d didn't accept speed setting. Oh, well.\n",
-                               drive->dn >> 1, drive->dn & 1);
+                       printk(KERN_WARNING
+                              "ide%d: Drive %d didn't accept speed setting. Oh, well.\n",
+                              drive->dn >> 1, drive->dn & 1);
 
        T = 1000000000 / system_bus_speed;
        UT = T / (aec_old ? 1 : 2);
@@ -152,7 +161,9 @@ static int aec_set_drive(struct ata_device *drive, unsigned char speed)
 static void aec62xx_tune_drive(struct ata_device *drive, unsigned char pio)
 {
        if (pio == 255) {
-               aec_set_drive(drive, ata_timing_mode(drive, XFER_PIO | XFER_EPIO));
+               aec_set_drive(drive,
+                             ata_timing_mode(drive,
+                                             XFER_PIO | XFER_EPIO));
                return;
        }
 
@@ -169,14 +180,17 @@ static int __init aec62xx_modes_map(struct ata_channel *ch)
 
        if (ch->udma_four)
                switch (ch->pci_dev->device) {
-                       case PCI_DEVICE_ID_ARTOP_ATP865R:
-                       case PCI_DEVICE_ID_ARTOP_ATP865:
-                               /* Can't use these modes simultaneously,
-                                  based on which PLL clock was chosen. */
-                               map |= inb (bmide + AEC_BM_STAT_PCH) & AEC_PLLCLK_ATA133 ? XFER_UDMA_133 : XFER_UDMA_100;
-                       case PCI_DEVICE_ID_ARTOP_ATP860R:
-                       case PCI_DEVICE_ID_ARTOP_ATP860:
-                               map |= XFER_UDMA_66;
+               case PCI_DEVICE_ID_ARTOP_ATP865R:
+               case PCI_DEVICE_ID_ARTOP_ATP865:
+                       /* Can't use these modes simultaneously,
+                          based on which PLL clock was chosen. */
+                       map |=
+                           inb(bmide +
+                               AEC_BM_STAT_PCH) & AEC_PLLCLK_ATA133 ?
+                           XFER_UDMA_133 : XFER_UDMA_100;
+               case PCI_DEVICE_ID_ARTOP_ATP860R:
+               case PCI_DEVICE_ID_ARTOP_ATP860:
+                       map |= XFER_UDMA_66;
                }
 
        return map;
@@ -200,27 +214,28 @@ static unsigned int __init aec62xx_init_chipset(struct pci_dev *dev)
 
        switch (dev->device) {
 
-               case PCI_DEVICE_ID_ARTOP_ATP865R:
-               case PCI_DEVICE_ID_ARTOP_ATP865:
+       case PCI_DEVICE_ID_ARTOP_ATP865R:
+       case PCI_DEVICE_ID_ARTOP_ATP865:
 
-                       /* Clear reset and test bits. */
-                       pci_read_config_byte(dev, AEC_MISC, &t);
-                       pci_write_config_byte(dev, AEC_MISC, t & ~0x30);
+               /* Clear reset and test bits. */
+               pci_read_config_byte(dev, AEC_MISC, &t);
+               pci_write_config_byte(dev, AEC_MISC, t & ~0x30);
 
-                       /* Enable chip interrupt output. */
-                       pci_read_config_byte(dev, AEC_IDE_ENABLE, &t);
-                       pci_write_config_byte(dev, AEC_IDE_ENABLE, t & ~0x01);
+               /* Enable chip interrupt output. */
+               pci_read_config_byte(dev, AEC_IDE_ENABLE, &t);
+               pci_write_config_byte(dev, AEC_IDE_ENABLE, t & ~0x01);
 
 #ifdef CONFIG_AEC6280_BURST
-                       /* Must be greater than 0x80 for burst mode. */
-                       pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x90);
+               /* Must be greater than 0x80 for burst mode. */
+               pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x90);
 
-                       /* Enable burst mode. */
-                       pci_read_config_byte(dev, AEC_IDE_ENABLE, &t);
-                       pci_write_config_byte(dev, AEC_IDE_ENABLE, t | 0x80);
+               /* Enable burst mode. */
+               pci_read_config_byte(dev, AEC_IDE_ENABLE, &t);
+               pci_write_config_byte(dev, AEC_IDE_ENABLE, t | 0x80);
 #endif
-                       /* switch cable detection pins to input-only. */
-                       outb (inb (bmide + AEC_BM_STAT_SCH) | AEC_CABLEPINS_INPUT, bmide + AEC_BM_STAT_SCH);
+               /* switch cable detection pins to input-only. */
+               outb(inb(bmide + AEC_BM_STAT_SCH) | AEC_CABLEPINS_INPUT,
+                    bmide + AEC_BM_STAT_SCH);
        }
 
 /*
@@ -229,7 +244,7 @@ static unsigned int __init aec62xx_init_chipset(struct pci_dev *dev)
 
        pci_read_config_byte(dev, PCI_REVISION_ID, &t);
        printk(KERN_INFO "AEC_IDE: %s (rev %02x) controller on pci%s\n",
-               dev->name, t, dev->slot_name);
+              dev->name, t, dev->slot_name);
 
        return dev->irq;
 }
@@ -274,7 +289,8 @@ static void __init aec62xx_init_channel(struct ata_channel *ch)
 /*
  * We allow the BM-DMA driver only work on enabled interfaces.
  */
-static void __init aec62xx_init_dma(struct ata_channel *ch, unsigned long dmabase)
+static void __init aec62xx_init_dma(struct ata_channel *ch,
+                                   unsigned long dmabase)
 {
        unsigned char t;
 
@@ -286,50 +302,49 @@ static void __init aec62xx_init_dma(struct ata_channel *ch, unsigned long dmabas
 /* module data table */
 static struct ata_pci_device chipsets[] __initdata = {
        {
-               vendor: PCI_VENDOR_ID_ARTOP,
-               device: PCI_DEVICE_ID_ARTOP_ATP850UF,
-               init_chipset: aec62xx_init_chipset,
-               init_channel: aec62xx_init_channel,
-               init_dma: aec62xx_init_dma,
-               enablebits: { {0x4a,0x02,0x02}, {0x4a,0x04,0x04} },
-               bootable: OFF_BOARD,
-               flags: ATA_F_SER | ATA_F_IRQ | ATA_F_DMA
+               .vendor = PCI_VENDOR_ID_ARTOP,
+               .device = PCI_DEVICE_ID_ARTOP_ATP850UF,
+               .init_chipset = aec62xx_init_chipset,
+               .init_channel = aec62xx_init_channel,
+               .init_dma = aec62xx_init_dma,
+               .enablebits = {{0x4a, 0x02, 0x02}, {0x4a, 0x04, 0x04}},
+               .bootable = OFF_BOARD,
+               .flags = ATA_F_SER | ATA_F_IRQ | ATA_F_DMA
        },
        {
-               vendor: PCI_VENDOR_ID_ARTOP,
-               device: PCI_DEVICE_ID_ARTOP_ATP860,
-               init_chipset: aec62xx_init_chipset,
-               init_channel: aec62xx_init_channel,
-               enablebits: { {0x4a,0x02,0x02}, {0x4a,0x04,0x04} },
-               bootable: NEVER_BOARD,
-               flags: ATA_F_IRQ | ATA_F_DMA
+               .vendor = PCI_VENDOR_ID_ARTOP,
+               .device = PCI_DEVICE_ID_ARTOP_ATP860,
+               .init_chipset = aec62xx_init_chipset,
+               .init_channel = aec62xx_init_channel,
+               .enablebits = {{0x4a, 0x02, 0x02}, {0x4a, 0x04, 0x04}},
+               .bootable = NEVER_BOARD,
+               .flags = ATA_F_IRQ | ATA_F_DMA
        },
        {
-               vendor: PCI_VENDOR_ID_ARTOP,
-               device: PCI_DEVICE_ID_ARTOP_ATP860R,
-               init_chipset: aec62xx_init_chipset,
-               init_channel: aec62xx_init_channel,
-               enablebits: { {0x4a,0x02,0x02}, {0x4a,0x04,0x04} },
-               bootable: OFF_BOARD,
-               flags: ATA_F_IRQ | ATA_F_DMA
-       },
+               .vendor = PCI_VENDOR_ID_ARTOP,
+               .device = PCI_DEVICE_ID_ARTOP_ATP860R,
+               .init_chipset = aec62xx_init_chipset,
+               .init_channel = aec62xx_init_channel,
+               .enablebits = {{0x4a, 0x02, 0x02}, {0x4a, 0x04, 0x04}},
+               .bootable = OFF_BOARD,
+               .flags = ATA_F_IRQ | ATA_F_DMA},
        {
-               vendor: PCI_VENDOR_ID_ARTOP,
-               device: PCI_DEVICE_ID_ARTOP_ATP865,
-               init_chipset: aec62xx_init_chipset,
-               init_channel: aec62xx_init_channel,
-               enablebits: { {0x4a,0x02,0x02}, {0x4a,0x04,0x04} },
-               bootable: NEVER_BOARD,
-               flags: ATA_F_IRQ | ATA_F_DMA
+               .vendor = PCI_VENDOR_ID_ARTOP,
+               .device = PCI_DEVICE_ID_ARTOP_ATP865,
+               .init_chipset = aec62xx_init_chipset,
+               .init_channel = aec62xx_init_channel,
+               .enablebits = {{0x4a, 0x02, 0x02}, {0x4a, 0x04, 0x04}},
+               .bootable = NEVER_BOARD,
+               .flags = ATA_F_IRQ | ATA_F_DMA
        },
        {
-               vendor: PCI_VENDOR_ID_ARTOP,
-               device: PCI_DEVICE_ID_ARTOP_ATP865R,
-               init_chipset: aec62xx_init_chipset,
-               init_channel: aec62xx_init_channel,
-               enablebits: { {0x4a,0x02,0x02}, {0x4a,0x04,0x04} },
-               bootable: OFF_BOARD,
-               flags: ATA_F_IRQ | ATA_F_DMA
+               .vendor = PCI_VENDOR_ID_ARTOP,
+               .device = PCI_DEVICE_ID_ARTOP_ATP865R,
+               .init_chipset = aec62xx_init_chipset,
+               .init_channel = aec62xx_init_channel,
+               .enablebits = {{0x4a, 0x02, 0x02}, {0x4a, 0x04, 0x04}},
+               .bootable = OFF_BOARD,
+               .flags = ATA_F_IRQ | ATA_F_DMA
        }
 };
 
index a60910c7976880217f07d4556d78d87003cd5c2c..33f175c92e0bcfe8384088800082cdc40640c2ff 100644 (file)
 
 /* port addresses for auto-detection */
 #define ALI_NUM_PORTS 4
-static int ports[ALI_NUM_PORTS] __initdata = { 0x074, 0x0f4, 0x034, 0x0e4 };
+static int ports[ALI_NUM_PORTS] __initdata =
+    { 0x074, 0x0f4, 0x034, 0x0e4 };
 
 /* register initialization data */
 struct reg_initializer {
-       u8 reg, data; 
+       u8 reg, data;
 };
 
 static struct reg_initializer init_data[] __initdata = {
@@ -67,17 +68,21 @@ static struct reg_initializer init_data[] __initdata = {
 static struct {
        u8 reg1, reg2, reg3, reg4;
 } reg_tab[4] = {
-       { 0x03, 0x26, 0x04, 0x27 },     /* drive 0 */
-       { 0x05, 0x28, 0x06, 0x29 },     /* drive 1 */
-       { 0x2b, 0x30, 0x2c, 0x31 },     /* drive 2 */
-       { 0x2d, 0x32, 0x2e, 0x33 },     /* drive 3 */
+       {
+       0x03, 0x26, 0x04, 0x27},        /* drive 0 */
+       {
+       0x05, 0x28, 0x06, 0x29},        /* drive 1 */
+       {
+       0x2b, 0x30, 0x2c, 0x31},        /* drive 2 */
+       {
+       0x2d, 0x32, 0x2e, 0x33},        /* drive 3 */
 };
 
-static int base_port;  /* base port address */
-static int reg_port;   /* port for register number */
-static int data_port;  /* port for register data */
-static u8 reg_on;      /* output to base port to access registers */
-static u8 reg_off;     /* output to base port to close registers */
+static int base_port;          /* base port address */
+static int reg_port;           /* port for register number */
+static int data_port;          /* port for register data */
+static u8 reg_on;              /* output to base port to access registers */
+static u8 reg_off;             /* output to base port to close registers */
 
 /*
  * Read a controller register.
@@ -121,13 +126,16 @@ static void ali14xx_tune_drive(struct ata_device *drive, u8 pio)
        time1 = t->cycle;
        time2 = t->active;
        param3 = param1 = (time2 * system_bus_speed + 999999) / 1000000;
-       param4 = param2 = (time1 * system_bus_speed + 999999) / 1000000 - param1;
+       param4 = param2 =
+           (time1 * system_bus_speed + 999999) / 1000000 - param1;
        if (pio < XFER_PIO_3) {
                param3 += 8;
                param4 += 8;
        }
-       printk(KERN_DEBUG "%s: PIO mode%d, t1=%dns, t2=%dns, cycles = %d+%d, %d+%d\n",
-               drive->name, pio - XFER_PIO_0, time1, time2, param1, param2, param3, param4);
+       printk(KERN_DEBUG
+              "%s: PIO mode%d, t1=%dns, t2=%dns, cycles = %d+%d, %d+%d\n",
+              drive->name, pio - XFER_PIO_0, time1, time2, param1, param2,
+              param3, param4);
 
        /* stuff timing parameters into controller registers */
        drive_num = (drive->channel->index << 1) + drive->select.b.unit;
@@ -150,8 +158,7 @@ static int __init find_port(void)
        int i;
        unsigned long flags;
 
-       __save_flags(flags);    /* local CPU only */
-       __cli();                /* local CPU only */
+       local_irq_save(flags);
        for (i = 0; i < ALI_NUM_PORTS; i++) {
                base_port = ports[i];
                reg_off = inb(base_port);
@@ -163,7 +170,7 @@ static int __init find_port(void)
                                data_port = base_port + 8;
                                t = in_reg(0) & 0xf0;
                                outb_p(reg_off, base_port);
-                               __restore_flags(flags); /* local CPU only */
+                               local_irq_restore(flags);
                                if (t != 0x50)
                                        return 0;
                                return 1;       /* success */
@@ -171,7 +178,8 @@ static int __init find_port(void)
                }
                outb_p(reg_off, base_port);
        }
-       __restore_flags(flags); /* local CPU only */
+       local_irq_restore(flags);
+
        return 0;
 }
 
@@ -184,15 +192,15 @@ static int __init init_registers(void)
        unsigned long flags;
        u8 t;
 
-       __save_flags(flags);    /* local CPU only */
-       __cli();                /* local CPU only */
+       local_irq_save(flags);
        outb_p(reg_on, base_port);
        for (p = init_data; p->reg != 0; ++p)
                out_reg(p->data, p->reg);
        outb_p(0x01, reg_port);
        t = inb(reg_port) & 0x01;
        outb_p(reg_off, base_port);
-       __restore_flags(flags); /* local CPU only */
+       local_irq_restore(flags);
+
        return t;
 }
 
@@ -205,7 +213,7 @@ void __init init_ali14xx(void)
        }
 
        printk(KERN_DEBUG "ali14xx: base=%#03x, reg_on=%#02x\n",
-               base_port, reg_on);
+              base_port, reg_on);
        ide_hwifs[0].chipset = ide_ali14xx;
        ide_hwifs[1].chipset = ide_ali14xx;
        ide_hwifs[0].tuneproc = &ali14xx_tune_drive;
index 63ccfd52a64d60c29d0efaa5696515126dddf09c..f8422ad5e897d8730c7ff5e23b3a080a089def70 100644 (file)
@@ -73,10 +73,10 @@ static void ali15x3_tune_drive(struct ata_device *drive, byte pio)
                if (r_clc >= 16)
                        r_clc = 0;
        }
-       __save_flags(flags);
-       __cli();
-       
-       /* 
+
+       local_irq_save(flags);
+
+       /*
         * PIO mode => ATA FIFO on, ATAPI FIFO off
         */
        pci_read_config_byte(dev, portFIFO, &cd_dma_fifo);
@@ -96,7 +96,8 @@ static void ali15x3_tune_drive(struct ata_device *drive, byte pio)
 
        pci_write_config_byte(dev, port, s_clc);
        pci_write_config_byte(dev, port+drive->select.b.unit+2, (a_clc << 4) | r_clc);
-       __restore_flags(flags);
+
+       local_irq_restore(flags);
 }
 
 static int ali15x3_tune_chipset(struct ata_device *drive, byte speed)
@@ -216,8 +217,7 @@ static unsigned int __init ali15x3_ata66_check(struct ata_channel *hwif)
        unsigned long flags;
        byte tmpbyte;
 
-       __save_flags(flags);
-       __cli();
+       local_irq_save(flags);
 
        if (m5229_revision >= 0xC2) {
                /*
@@ -297,9 +297,9 @@ static unsigned int __init ali15x3_ata66_check(struct ata_channel *hwif)
 
        pci_write_config_byte(dev, 0x53, tmpbyte);
 
-       __restore_flags(flags);
+       local_irq_restore(flags);
 
-       return(ata66);
+       return (ata66);
 }
 
 static void __init ali15x3_init_channel(struct ata_channel *hwif)
@@ -374,22 +374,22 @@ static void __init ali15x3_init_dma(struct ata_channel *ch, unsigned long dmabas
 /* module data table */
 static struct ata_pci_device chipsets[] __initdata = {
        {
-               vendor: PCI_VENDOR_ID_AL,
-               device: PCI_DEVICE_ID_AL_M5219,
+               .vendor = PCI_VENDOR_ID_AL,
+               .device = PCI_DEVICE_ID_AL_M5219,
                /* FIXME: Perhaps we should use the same init routines
                 * as below here. */
-               enablebits: { {0x00,0x00,0x00}, {0x00,0x00,0x00} },
-               bootable: ON_BOARD,
-               flags: ATA_F_SIMPLEX
+               .enablebits = { {0x00,0x00,0x00}, {0x00,0x00,0x00} },
+               .bootable = ON_BOARD,
+               .flags = ATA_F_SIMPLEX
        },
        {
-               vendor: PCI_VENDOR_ID_AL,
-               device: PCI_DEVICE_ID_AL_M5229,
-               init_chipset: ali15x3_init_chipset,
-               init_channel: ali15x3_init_channel,
-               init_dma: ali15x3_init_dma,
-               enablebits: { {0x00,0x00,0x00}, {0x00,0x00,0x00} },
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_AL,
+               .device = PCI_DEVICE_ID_AL_M5229,
+               .init_chipset = ali15x3_init_chipset,
+               .init_channel = ali15x3_init_channel,
+               .init_dma = ali15x3_init_dma,
+               .enablebits = { {0x00,0x00,0x00}, {0x00,0x00,0x00} },
+               .bootable = ON_BOARD
        }
 };
 
@@ -397,9 +397,8 @@ int __init init_ali15x3(void)
 {
        int i;
 
-       for (i = 0; i < ARRAY_SIZE(chipsets); ++i) {
+       for (i = 0; i < ARRAY_SIZE(chipsets); ++i)
                ata_register_chipset(&chipsets[i]);
-       }
 
         return 0;
 }
index 49a2bb3fb9dd9052ec1c7e802a873899ced1e8b8..485f31e3f4cbe93924b4c0e9f45561394941abfc 100644 (file)
@@ -303,59 +303,59 @@ static void __init amd74xx_init_dma(struct ata_channel *ch, unsigned long dmabas
 /* module data table */
 static struct ata_pci_device chipsets[] __initdata = {
        {
-               vendor: PCI_VENDOR_ID_AMD,
-               device: PCI_DEVICE_ID_AMD_COBRA_7401,
-               init_chipset: amd74xx_init_chipset,
-               init_channel: amd74xx_init_channel,
-               init_dma: amd74xx_init_dma,
-               enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_AMD,
+               .device = PCI_DEVICE_ID_AMD_COBRA_7401,
+               .init_chipset = amd74xx_init_chipset,
+               .init_channel = amd74xx_init_channel,
+               .init_dma = amd74xx_init_dma,
+               .enablebits = {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
+               .bootable = ON_BOARD
        },
        {
-               vendor: PCI_VENDOR_ID_AMD,
-               device: PCI_DEVICE_ID_AMD_VIPER_7409,
-               init_chipset: amd74xx_init_chipset,
-               init_channel: amd74xx_init_channel,
-               init_dma: amd74xx_init_dma,
-               enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
-               bootable: ON_BOARD,
-               flags: ATA_F_SIMPLEX
+               .vendor = PCI_VENDOR_ID_AMD,
+               .device = PCI_DEVICE_ID_AMD_VIPER_7409,
+               .init_chipset = amd74xx_init_chipset,
+               .init_channel = amd74xx_init_channel,
+               .init_dma = amd74xx_init_dma,
+               .enablebits = {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
+               .bootable = ON_BOARD,
+               .flags = ATA_F_SIMPLEX
        },
        {
-               vendor: PCI_VENDOR_ID_AMD,
-               device: PCI_DEVICE_ID_AMD_VIPER_7411,
-               init_chipset: amd74xx_init_chipset,
-               init_channel: amd74xx_init_channel,
-               init_dma: amd74xx_init_dma,
-               enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_AMD,
+               .device = PCI_DEVICE_ID_AMD_VIPER_7411,
+               .init_chipset = amd74xx_init_chipset,
+               .init_channel = amd74xx_init_channel,
+               .init_dma = amd74xx_init_dma,
+               .enablebits = {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
+               .bootable = ON_BOARD
        },
        {
-               vendor: PCI_VENDOR_ID_AMD,
-               device: PCI_DEVICE_ID_AMD_OPUS_7441,
-               init_chipset: amd74xx_init_chipset,
-               init_channel: amd74xx_init_channel,
-               init_dma: amd74xx_init_dma,
-               enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_AMD,
+               .device = PCI_DEVICE_ID_AMD_OPUS_7441,
+               .init_chipset = amd74xx_init_chipset,
+               .init_channel = amd74xx_init_channel,
+               .init_dma = amd74xx_init_dma,
+               .enablebits = {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
+               .bootable = ON_BOARD
        },
        {
-               vendor: PCI_VENDOR_ID_AMD,
-               device: PCI_DEVICE_ID_AMD_8111_IDE,
-               init_chipset: amd74xx_init_chipset,
-               init_channel: amd74xx_init_channel,
-               init_dma: amd74xx_init_dma,
-               enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_AMD,
+               .device = PCI_DEVICE_ID_AMD_8111_IDE,
+               .init_chipset = amd74xx_init_chipset,
+               .init_channel = amd74xx_init_channel,
+               .init_dma = amd74xx_init_dma,
+               .enablebits = {{0x40,0x01,0x01}, {0x40,0x02,0x02}},
+               .bootable = ON_BOARD
        },
        {
-               vendor: PCI_VENDOR_ID_NVIDIA,
-               device: PCI_DEVICE_ID_NVIDIA_NFORCE_IDE,
-               init_chipset: amd74xx_init_chipset,
-               init_channel: amd74xx_init_channel,
-               init_dma: amd74xx_init_dma,
-               enablebits: {{0x50,0x01,0x01}, {0x50,0x02,0x02}},
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_NVIDIA,
+               .device = PCI_DEVICE_ID_NVIDIA_NFORCE_IDE,
+               .init_chipset = amd74xx_init_chipset,
+               .init_channel = amd74xx_init_channel,
+               .init_dma = amd74xx_init_dma,
+               .enablebits = {{0x50,0x01,0x01}, {0x50,0x02,0x02}},
+               .bootable = ON_BOARD
        },
 };
 
@@ -363,9 +363,8 @@ int __init init_amd74xx(void)
 {
        int i;
 
-       for (i = 0; i < ARRAY_SIZE(chipsets); ++i) {
+       for (i = 0; i < ARRAY_SIZE(chipsets); ++i)
                ata_register_chipset(&chipsets[i]);
-       }
 
         return 0;
 }
index a4c5704ff27a56799cfbf9f03308121fcd76d864..04520f4e3fbf7f0b46c70195d119a8cfa4fe2847 100644 (file)
 
 #include "ataraid.h"
 
-static struct raid_device_operationsataraid_ops[16];
+static struct raid_device_operations *ataraid_ops[16];
 
-static int ataraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg);
-static int ataraid_open(struct inode * inode, struct file * filp);
-static int ataraid_release(struct inode * inode, struct file * filp);
-static void ataraid_split_request(request_queue_t *q, int rw, struct buffer_head * bh);
+static int ataraid_ioctl(struct inode *inode, struct file *file,
+                        unsigned int cmd, unsigned long arg);
+static int ataraid_open(struct inode *inode, struct file *filp);
+static int ataraid_release(struct inode *inode, struct file *filp);
+static void ataraid_split_request(request_queue_t * q, int rw,
+                                 struct buffer_head *bh);
 
 
 struct gendisk ataraid_gendisk;
@@ -47,12 +49,12 @@ static int ataraid_gendisk_sizes[256];
 static int ataraid_readahead[256];
 
 static struct block_device_operations ataraid_fops = {
-       owner:                  THIS_MODULE,
-       open:                   ataraid_open,
-       release:                ataraid_release,
-       ioctl:                  ataraid_ioctl,
+       .owner = THIS_MODULE,
+       .open = ataraid_open,
+       .release = ataraid_release,
+       .ioctl = ataraid_ioctl,
 };
-                
+
 
 
 static DECLARE_MUTEX(ataraid_sem);
@@ -63,48 +65,50 @@ static unsigned int ataraiduse;
 
 /* stub fops functions */
 
-static int ataraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)  
+static int ataraid_ioctl(struct inode *inode, struct file *file,
+                        unsigned int cmd, unsigned long arg)
 {
        int minor;
-       minor = minor(inode->i_rdev)>>SHIFT;
-       
-       if ((ataraid_ops[minor])&&(ataraid_ops[minor]->ioctl))
-               return (ataraid_ops[minor]->ioctl)(inode,file,cmd,arg);
+       minor = minor(inode->i_rdev) >> SHIFT;
+
+       if ((ataraid_ops[minor]) && (ataraid_ops[minor]->ioctl))
+               return (ataraid_ops[minor]->ioctl) (inode, file, cmd, arg);
        return -EINVAL;
 }
 
-static int ataraid_open(struct inode * inode, struct file * filp)
+static int ataraid_open(struct inode *inode, struct file *filp)
 {
        int minor;
-       minor = minor(inode->i_rdev)>>SHIFT;
+       minor = minor(inode->i_rdev) >> SHIFT;
 
-       if ((ataraid_ops[minor])&&(ataraid_ops[minor]->open))
-               return (ataraid_ops[minor]->open)(inode,filp);
+       if ((ataraid_ops[minor]) && (ataraid_ops[minor]->open))
+               return (ataraid_ops[minor]->open) (inode, filp);
        return -EINVAL;
 }
 
 
-static int ataraid_release(struct inode * inode, struct file * filp)
+static int ataraid_release(struct inode *inode, struct file *filp)
 {
        int minor;
-       minor = minor(inode->i_rdev)>>SHIFT;
+       minor = minor(inode->i_rdev) >> SHIFT;
 
-       if ((ataraid_ops[minor])&&(ataraid_ops[minor]->release))
-               return (ataraid_ops[minor]->release)(inode,filp);
+       if ((ataraid_ops[minor]) && (ataraid_ops[minor]->release))
+               return (ataraid_ops[minor]->release) (inode, filp);
        return -EINVAL;
 }
 
-static int ataraid_make_request (request_queue_t *q, int rw, struct buffer_head * bh)
+static int ataraid_make_request(request_queue_t * q, int rw,
+                               struct buffer_head *bh)
 {
        int minor;
        int retval;
-       minor = minor(bh->b_rdev)>>SHIFT;
+       minor = minor(bh->b_rdev) >> SHIFT;
+
+       if ((ataraid_ops[minor]) && (ataraid_ops[minor]->make_request)) {
 
-       if ((ataraid_ops[minor])&&(ataraid_ops[minor]->make_request)) {
-               
-               retval= (ataraid_ops[minor]->make_request)(q,rw,bh);
+               retval = (ataraid_ops[minor]->make_request) (q, rw, bh);
                if (retval == -1) {
-                       ataraid_split_request(q,rw,bh);         
+                       ataraid_split_request(q, rw, bh);
                        return 0;
                } else
                        return retval;
@@ -116,7 +120,7 @@ struct buffer_head *ataraid_get_bhead(void)
 {
        void *ptr = NULL;
        while (!ptr) {
-               ptr=kmalloc(sizeof(struct buffer_head),GFP_NOIO);
+               ptr = kmalloc(sizeof(struct buffer_head), GFP_NOIO);
                if (!ptr)
                        yield();
        }
@@ -129,7 +133,7 @@ struct ataraid_bh_private *ataraid_get_private(void)
 {
        void *ptr = NULL;
        while (!ptr) {
-               ptr=kmalloc(sizeof(struct ataraid_bh_private),GFP_NOIO);
+               ptr = kmalloc(sizeof(struct ataraid_bh_private), GFP_NOIO);
                if (!ptr)
                        yield();
        }
@@ -142,11 +146,11 @@ void ataraid_end_request(struct buffer_head *bh, int uptodate)
 {
        struct ataraid_bh_private *private = bh->b_private;
 
-       if (private==NULL)
+       if (private == NULL)
                BUG();
 
        if (atomic_dec_and_test(&private->count)) {
-               private->parent->b_end_io(private->parent,uptodate);
+               private->parent->b_end_io(private->parent, uptodate);
                private->parent = NULL;
                kfree(private);
        }
@@ -155,23 +159,24 @@ void ataraid_end_request(struct buffer_head *bh, int uptodate)
 
 EXPORT_SYMBOL(ataraid_end_request);
 
-static void ataraid_split_request(request_queue_t *q, int rw, struct buffer_head * bh)
+static void ataraid_split_request(request_queue_t * q, int rw,
+                                 struct buffer_head *bh)
 {
-       struct buffer_head *bh1,*bh2;
+       struct buffer_head *bh1, *bh2;
        struct ataraid_bh_private *private;
-       bh1=ataraid_get_bhead();
-       bh2=ataraid_get_bhead();
+       bh1 = ataraid_get_bhead();
+       bh2 = ataraid_get_bhead();
 
        /* If either of those ever fails we're doomed */
-       if ((!bh1)||(!bh2))
+       if ((!bh1) || (!bh2))
                BUG();
        private = ataraid_get_private();
-       if (private==NULL)
+       if (private == NULL)
                BUG();
-       
+
        memcpy(bh1, bh, sizeof(*bh));
        memcpy(bh2, bh, sizeof(*bh));
-       
+
        bh1->b_end_io = ataraid_end_request;
        bh2->b_end_io = ataraid_end_request;
 
@@ -182,12 +187,12 @@ static void ataraid_split_request(request_queue_t *q, int rw, struct buffer_head
 
        bh1->b_private = private;
        bh2->b_private = private;
-       atomic_set(&private->count,2);
+       atomic_set(&private->count, 2);
 
-       bh2->b_data +=  bh->b_size/2;
+       bh2->b_data += bh->b_size / 2;
 
-       generic_make_request(rw,bh1);
-       generic_make_request(rw,bh2);
+       generic_make_request(rw, bh1);
+       generic_make_request(rw, bh2);
 }
 
 
@@ -200,12 +205,12 @@ int ataraid_get_device(struct raid_device_operations *fops)
 {
        int bit;
        down(&ataraid_sem);
-       if (ataraiduse==~0U) {
+       if (ataraiduse == ~0U) {
                up(&ataraid_sem);
                return -ENODEV;
        }
-       bit=ffz(ataraiduse); 
-       ataraiduse |= 1<<bit;
+       bit = ffz(ataraiduse);
+       ataraiduse |= 1 << bit;
        ataraid_ops[bit] = fops;
        up(&ataraid_sem);
        return bit;
@@ -214,58 +219,63 @@ int ataraid_get_device(struct raid_device_operations *fops)
 void ataraid_release_device(int device)
 {
        down(&ataraid_sem);
-       
-       if ((ataraiduse & (1<<device))==0)
-               BUG();  /* device wasn't registered at all */
-       
-       ataraiduse &= ~(1<<device);
+
+       if ((ataraiduse & (1 << device)) == 0)
+               BUG();          /* device wasn't registered at all */
+
+       ataraiduse &= ~(1 << device);
        ataraid_ops[device] = NULL;
        up(&ataraid_sem);
 }
 
-void ataraid_register_disk(int device,long size)
+void ataraid_register_disk(int device, long size)
 {
-       register_disk(&ataraid_gendisk, mk_kdev(ATAMAJOR,16*device),16,
-               &ataraid_fops,size);
+       register_disk(&ataraid_gendisk, mk_kdev(ATAMAJOR, 16 * device), 16,
+                     &ataraid_fops, size);
 
 }
 
-static __init int ataraid_init(void) 
+static __init int ataraid_init(void)
 {
        int i;
-        for(i=0;i<256;i++)
+       for (i = 0; i < 256; i++)
                ataraid_readahead[i] = 1023;
-       
-       /* setup the gendisk structure */       
-       ataraid_gendisk.part = kmalloc(256 * sizeof(struct hd_struct),GFP_KERNEL);
-       if (ataraid_gendisk.part==NULL) {
-               printk(KERN_ERR "ataraid: Couldn't allocate memory, aborting \n");
+
+       /* setup the gendisk structure */
+       ataraid_gendisk.part =
+           kmalloc(256 * sizeof(struct hd_struct), GFP_KERNEL);
+       if (ataraid_gendisk.part == NULL) {
+               printk(KERN_ERR
+                      "ataraid: Couldn't allocate memory, aborting \n");
                return -1;
        }
-       
-       memset(&ataraid_gendisk.part[0],0,256*sizeof(struct hd_struct));
-       
-       
-       ataraid_gendisk.major       = ATAMAJOR;
-       ataraid_gendisk.major_name  = "ataraid";
+
+       memset(&ataraid_gendisk.part[0], 0,
+              256 * sizeof(struct hd_struct));
+
+
+       ataraid_gendisk.major = ATAMAJOR;
+       ataraid_gendisk.major_name = "ataraid";
        ataraid_gendisk.minor_shift = 4;
-       ataraid_gendisk.sizes       = &ataraid_gendisk_sizes[0];
-       ataraid_gendisk.nr_real     = 16;
-       ataraid_gendisk.fops        = &ataraid_fops;
-       
-       
+       ataraid_gendisk.sizes = &ataraid_gendisk_sizes[0];
+       ataraid_gendisk.nr_real = 16;
+       ataraid_gendisk.fops = &ataraid_fops;
+
+
        add_gendisk(&ataraid_gendisk);
-                       
+
        if (register_blkdev(ATAMAJOR, "ataraid", &ataraid_fops)) {
-               printk(KERN_ERR "ataraid: Could not get major %d \n",ATAMAJOR);
+               printk(KERN_ERR "ataraid: Could not get major %d \n",
+                      ATAMAJOR);
                return -1;
        }
-       
-                       
-       
-       blk_queue_make_request(BLK_DEFAULT_QUEUE(ATAMAJOR),ataraid_make_request);
-                                                                                       
-       return 0;                                                               
+
+
+
+       blk_queue_make_request(BLK_DEFAULT_QUEUE(ATAMAJOR),
+                              ataraid_make_request);
+
+       return 0;
 }
 
 
@@ -275,7 +285,7 @@ static void __exit ataraid_exit(void)
        blk_size[ATAMAJOR] = NULL;
 
        del_gendisk(&ataraid_gendisk);
-        
+
        if (ataraid_gendisk.part) {
                kfree(ataraid_gendisk.part);
                ataraid_gendisk.part = NULL;
@@ -292,4 +302,3 @@ EXPORT_SYMBOL(ataraid_release_device);
 EXPORT_SYMBOL(ataraid_gendisk);
 EXPORT_SYMBOL(ataraid_register_disk);
 MODULE_LICENSE("GPL");
-
index c6adb2014380938d38674ea7ae550410845c4ddd..188aeac9074cae0d8e1c980c6e491c3c9c927bcc 100644 (file)
@@ -135,8 +135,7 @@ static void program_drive_counts(struct ata_device *drive, int setup_count, int
        /*
         * Now that everything is ready, program the new timings
         */
-       __save_flags (flags);
-       __cli();
+       local_irq_save(flags);
        /*
         * Program the address_setup clocks into ARTTIM reg,
         * and then the active/recovery counts into the DRWTIM reg
@@ -148,7 +147,7 @@ static void program_drive_counts(struct ata_device *drive, int setup_count, int
                (byte) ((active_count << 4) | recovery_count));
        cmdprintk ("Write %x to %x\n", ((byte) setup_count) | (temp_b & 0x3f), arttim_regs[channel][slave]);
        cmdprintk ("Write %x to %x\n", (byte) ((active_count << 4) | recovery_count), drwtim_regs[channel][slave]);
-       __restore_flags(flags);
+       local_irq_restore(flags);
 }
 
 /*
@@ -808,45 +807,45 @@ static void __init cmd64x_init_channel(struct ata_channel *hwif)
 /* module data table */
 static struct ata_pci_device chipsets[] __initdata = {
        {
-               vendor: PCI_VENDOR_ID_CMD,
-               device: PCI_DEVICE_ID_CMD_643,
-               init_chipset: cmd64x_init_chipset,
-               init_channel: cmd64x_init_channel,
-               bootable: ON_BOARD,
-               flags: ATA_F_SIMPLEX,
+               .vendor = PCI_VENDOR_ID_CMD,
+               .device = PCI_DEVICE_ID_CMD_643,
+               .init_chipset = cmd64x_init_chipset,
+               .init_channel = cmd64x_init_channel,
+               .bootable = ON_BOARD,
+               .flags = ATA_F_SIMPLEX,
        },
        {
-               vendor: PCI_VENDOR_ID_CMD,
-               device: PCI_DEVICE_ID_CMD_646,
-               init_chipset: cmd64x_init_chipset,
-               init_channel: cmd64x_init_channel,
-               enablebits: {{0x00,0x00,0x00}, {0x51,0x80,0x80}},
-               bootable: ON_BOARD,
-               flags: ATA_F_DMA
+               .vendor = PCI_VENDOR_ID_CMD,
+               .device = PCI_DEVICE_ID_CMD_646,
+               .init_chipset = cmd64x_init_chipset,
+               .init_channel = cmd64x_init_channel,
+               .enablebits = {{0x00,0x00,0x00}, {0x51,0x80,0x80}},
+               .bootable = ON_BOARD,
+               .flags = ATA_F_DMA
        },
        {
-               vendor: PCI_VENDOR_ID_CMD,
-               device: PCI_DEVICE_ID_CMD_648,
-               init_chipset: cmd64x_init_chipset,
-               init_channel: cmd64x_init_channel,
-               bootable: ON_BOARD,
-               flags: ATA_F_DMA
+               .vendor = PCI_VENDOR_ID_CMD,
+               .device = PCI_DEVICE_ID_CMD_648,
+               .init_chipset = cmd64x_init_chipset,
+               .init_channel = cmd64x_init_channel,
+               .bootable = ON_BOARD,
+               .flags = ATA_F_DMA
        },
        {
-               vendor: PCI_VENDOR_ID_CMD,
-               device: PCI_DEVICE_ID_CMD_649,
-               init_chipset: cmd64x_init_chipset,
-               init_channel: cmd64x_init_channel,
-               bootable: ON_BOARD,
-               flags: ATA_F_DMA
+               .vendor = PCI_VENDOR_ID_CMD,
+               .device = PCI_DEVICE_ID_CMD_649,
+               .init_chipset = cmd64x_init_chipset,
+               .init_channel = cmd64x_init_channel,
+               .bootable = ON_BOARD,
+               .flags = ATA_F_DMA
        },
        {
-               vendor: PCI_VENDOR_ID_CMD,
-               device: PCI_DEVICE_ID_CMD_680,
-               init_chipset: cmd64x_init_chipset,
-               init_channel: cmd64x_init_channel,
-               bootable: ON_BOARD,
-               flags: ATA_F_DMA
+               .vendor = PCI_VENDOR_ID_CMD,
+               .device = PCI_DEVICE_ID_CMD_680,
+               .init_chipset = cmd64x_init_chipset,
+               .init_channel = cmd64x_init_channel,
+               .bootable = ON_BOARD,
+               .flags = ATA_F_DMA
        },
 };
 
index 13913e0e1cad699e658c364464c7fe159f9567bf..b761e7896385098ce4c7feae42f7d0c2bf926116 100644 (file)
@@ -314,12 +314,12 @@ static void __init ide_init_cs5530(struct ata_channel *hwif)
 
 /* module data table */
 static struct ata_pci_device chipset __initdata = {
-       vendor: PCI_VENDOR_ID_CYRIX,
-       device: PCI_DEVICE_ID_CYRIX_5530_IDE,
-       init_chipset: pci_init_cs5530,
-       init_channel: ide_init_cs5530,
-       bootable: ON_BOARD,
-       flags: ATA_F_DMA
+       .vendor = PCI_VENDOR_ID_CYRIX,
+       .device = PCI_DEVICE_ID_CYRIX_5530_IDE,
+       .init_chipset = pci_init_cs5530,
+       .init_channel = ide_init_cs5530,
+       .bootable = ON_BOARD,
+       .flags = ATA_F_DMA
 };
 
 int __init init_cs5530(void)
index 9c22b523392e04cda0b5809c84937e69818809fd..297b55d18ce27d570e63fe5aac752b140790dd88 100644 (file)
@@ -426,12 +426,12 @@ static void __init ide_init_cy82c693(struct ata_channel *hwif)
 
 /* module data table */
 static struct ata_pci_device chipset __initdata = {
-       vendor: PCI_VENDOR_ID_CONTAQ,
-       device: PCI_DEVICE_ID_CONTAQ_82C693,
-       init_chipset: pci_init_cy82c693,
-       init_channel: ide_init_cy82c693,
-       bootable: ON_BOARD,
-       flags: ATA_F_DMA
+       .vendor = PCI_VENDOR_ID_CONTAQ,
+       .device = PCI_DEVICE_ID_CONTAQ_82C693,
+       .init_chipset = pci_init_cy82c693,
+       .init_channel = ide_init_cy82c693,
+       .bootable = ON_BOARD,
+       .flags = ATA_F_DMA
 };
 
 int __init init_cy82c693(void)
index 5cdf3f957094078d29d6250e5dbf28b7dd35d50f..ca1c04f6f34c1aa8381341b650cba3aa49e5b852 100644 (file)
@@ -151,7 +151,7 @@ int ata_status_poll(struct ata_device *drive, u8 good, u8 bad,
                unsigned long flags;
 
                __save_flags(flags);
-               ide__sti();
+               local_irq_enable();
                timeout += jiffies;
                while (!ata_status(drive, 0, BUSY_STAT)) {
                        if (time_after(jiffies, timeout)) {
index a95a9f70f0ad2db41da781bb745dfe52f30af1ed..45cd4d9c7f8184144a460dba7486cb3406e1de86 100644 (file)
@@ -95,8 +95,7 @@ void __init init_dtc2278 (void)
 {
        unsigned long flags;
 
-       __save_flags(flags);    /* local CPU only */
-       __cli();                /* local CPU only */
+       local_irq_save(flags);
        /*
         * This enables the second interface
         */
@@ -112,7 +111,7 @@ void __init init_dtc2278 (void)
        sub22(1,0xc3);
        sub22(0,0xa0);
 #endif
-       __restore_flags(flags); /* local CPU only */
+       local_irq_restore(flags);
 
        ide_hwifs[0].serialized = 1;
        ide_hwifs[1].serialized = 1;
index 7a1663772b8754e9c74eb716b64a2dd787814776..a34945a2382fee9c12079bd46580827c284f79ac 100644 (file)
@@ -693,12 +693,12 @@ static int hd_release(struct inode * inode, struct file * file)
 extern struct block_device_operations hd_fops;
 
 static struct gendisk hd_gendisk = {
-       major:          MAJOR_NR,
-       major_name:     "hd",
-       minor_shift:    6,
-       part:           hd,
-       sizes:          hd_sizes,
-       fops:           &hd_fops,
+       .major =        MAJOR_NR,
+       .major_name =   "hd",
+       .minor_shift =  6,
+       .part =         hd,
+       .sizes =        hd_sizes,
+       .fops =         &hd_fops,
 };
        
 static void hd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
@@ -714,9 +714,9 @@ static void hd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 }
 
 static struct block_device_operations hd_fops = {
-       open:           hd_open,
-       release:        hd_release,
-       ioctl:          hd_ioctl,
+       .open =         hd_open,
+       .release =      hd_release,
+       .ioctl =        hd_ioctl,
 };
 
 /*
index e7dad9da10a722515a53516d380ba0ddfcd6e3cd..9f5d08d42f2cb250c928244943da46d56385a601 100644 (file)
@@ -135,8 +135,7 @@ static unsigned int __init pci_init_hpt34x(struct pci_dev *dev)
        unsigned short cmd;
        unsigned long flags;
 
-       __save_flags(flags);    /* local CPU only */
-       __cli();                /* local CPU only */
+       local_irq_save(flags);
 
        pci_write_config_byte(dev, HPT34X_PCI_INIT_REG, 0x00);
        pci_read_config_word(dev, PCI_COMMAND, &cmd);
@@ -167,7 +166,7 @@ static unsigned int __init pci_init_hpt34x(struct pci_dev *dev)
        pci_write_config_dword(dev, PCI_BASE_ADDRESS_3, dev->resource[3].start);
        pci_write_config_word(dev, PCI_COMMAND, cmd);
 
-       __restore_flags(flags); /* local CPU only */
+       local_irq_restore(flags);
 
        return dev->irq;
 }
@@ -202,13 +201,13 @@ static void __init ide_init_hpt34x(struct ata_channel *hwif)
 
 /* module data table */
 static struct ata_pci_device chipset __initdata = {
-       vendor: PCI_VENDOR_ID_TTI,
-       device: PCI_DEVICE_ID_TTI_HPT343,
-       init_chipset: pci_init_hpt34x,
-       init_channel:   ide_init_hpt34x,
-       bootable: NEVER_BOARD,
-       extra: 16,
-       flags: ATA_F_DMA
+       .vendor = PCI_VENDOR_ID_TTI,
+       .device = PCI_DEVICE_ID_TTI_HPT343,
+       .init_chipset = pci_init_hpt34x,
+       .init_channel = ide_init_hpt34x,
+       .bootable = NEVER_BOARD,
+       .extra = 16,
+       .flags = ATA_F_DMA
 };
 
 int __init init_hpt34x(void)
index 0afee25c128905f14356cb5fa9dce5dc3863d7c9..a24e170bee2eae809558a12ed914ac7c83b5f0c6 100644 (file)
@@ -1222,34 +1222,34 @@ static void __init hpt366_init_dma(struct ata_channel *ch, unsigned long dmabase
 /* module data table */
 static struct ata_pci_device chipsets[] __initdata = {
        {
-               vendor: PCI_VENDOR_ID_TTI,
-               device: PCI_DEVICE_ID_TTI_HPT366,
-               init_chipset: hpt366_init_chipset,
-               init_channel: hpt366_init_channel,
-               init_dma: hpt366_init_dma,
-               bootable: OFF_BOARD,
-               extra: 240,
-               flags: ATA_F_IRQ | ATA_F_HPTHACK | ATA_F_DMA
+               .vendor = PCI_VENDOR_ID_TTI,
+               .device = PCI_DEVICE_ID_TTI_HPT366,
+               .init_chipset = hpt366_init_chipset,
+               .init_channel = hpt366_init_channel,
+               .init_dma = hpt366_init_dma,
+               .bootable = OFF_BOARD,
+               .extra = 240,
+               .flags = ATA_F_IRQ | ATA_F_HPTHACK | ATA_F_DMA
        },
        {
-               vendor: PCI_VENDOR_ID_TTI,
-               device: PCI_DEVICE_ID_TTI_HPT372,
-               init_chipset: hpt366_init_chipset,
-               init_channel: hpt366_init_channel,
-               init_dma: hpt366_init_dma,
-               bootable: OFF_BOARD,
-               extra: 0,
-               flags: ATA_F_IRQ | ATA_F_HPTHACK | ATA_F_DMA
+               .vendor = PCI_VENDOR_ID_TTI,
+               .device = PCI_DEVICE_ID_TTI_HPT372,
+               .init_chipset = hpt366_init_chipset,
+               .init_channel = hpt366_init_channel,
+               .init_dma = hpt366_init_dma,
+               .bootable = OFF_BOARD,
+               .extra = 0,
+               .flags = ATA_F_IRQ | ATA_F_HPTHACK | ATA_F_DMA
        },
        {
-               vendor: PCI_VENDOR_ID_TTI,
-               device: PCI_DEVICE_ID_TTI_HPT374,
-               init_chipset: hpt366_init_chipset,
-               init_channel: hpt366_init_channel,
-               init_dma: hpt366_init_dma,
-               bootable: OFF_BOARD,
-               extra: 0,
-               flags: ATA_F_IRQ | ATA_F_HPTHACK | ATA_F_DMA
+               .vendor = PCI_VENDOR_ID_TTI,
+               .device = PCI_DEVICE_ID_TTI_HPT374,
+               .init_chipset = hpt366_init_chipset,
+               .init_channel = hpt366_init_channel,
+               .init_dma = hpt366_init_dma,
+               .bootable = OFF_BOARD,
+               .extra = 0,
+               .flags = ATA_F_IRQ | ATA_F_HPTHACK | ATA_F_DMA
        },
 };
 
index 9414f4821a6babb3666d8c6d0b96fe692d43832b..9e8e07b35a2fa74a60180f34e50c61d1a99389a0 100644 (file)
 
 #include "ataraid.h"
 
-static int hptraid_open(struct inode * inode, struct file * filp);
-static int hptraid_release(struct inode * inode, struct file * filp);
-static int hptraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg);
-static int hptraid_make_request (request_queue_t *q, int rw, struct buffer_head * bh);
+static int hptraid_open(struct inode *inode, struct file *filp);
+static int hptraid_release(struct inode *inode, struct file *filp);
+static int hptraid_ioctl(struct inode *inode, struct file *file,
+                        unsigned int cmd, unsigned long arg);
+static int hptraid_make_request(request_queue_t * q, int rw,
+                               struct buffer_head *bh);
 
 
 
 struct hptdisk {
-       kdev_t  device;
+       kdev_t device;
        unsigned long sectors;
        struct block_device *bdev;
 };
@@ -53,79 +55,93 @@ struct hptraid {
        unsigned int disks;
        unsigned long sectors;
        struct geom geom;
-       
+
        struct hptdisk disk[8];
-       
+
        unsigned long cutoff[8];
-       unsigned int cutoff_disks[8];   
+       unsigned int cutoff_disks[8];
 };
 
 static struct raid_device_operations hptraid_ops = {
-       open:                   hptraid_open,
-       release:                hptraid_release,
-       ioctl:                  hptraid_ioctl,
-       make_request:           hptraid_make_request
+       .open = hptraid_open,
+       .release = hptraid_release,
+       .ioctl = hptraid_ioctl,
+       .make_request = hptraid_make_request
 };
 
 static struct hptraid raid[16];
 
-static int hptraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
+static int hptraid_ioctl(struct inode *inode, struct file *file,
+                        unsigned int cmd, unsigned long arg)
 {
        unsigned int minor;
        unsigned char val;
        unsigned long sectors;
-       
+
        if (!inode || kdev_none(inode->i_rdev))
                return -EINVAL;
 
-       minor = minor(inode->i_rdev)>>SHIFT;
-       
+       minor = minor(inode->i_rdev) >> SHIFT;
+
        switch (cmd) {
-               case BLKGETSIZE:   /* Return device size */
-                       if (!arg)  return -EINVAL;
-                       sectors = ataraid_gendisk.part[minor(inode->i_rdev)].nr_sects;
-                       if (minor(inode->i_rdev)&15)
-                               return put_user(sectors, (unsigned long *) arg);
-                       return put_user(raid[minor].sectors , (unsigned long *) arg);
-                       break;
-                       
+       case BLKGETSIZE:        /* Return device size */
+               if (!arg)
+                       return -EINVAL;
+               sectors =
+                   ataraid_gendisk.part[minor(inode->i_rdev)].nr_sects;
+               if (minor(inode->i_rdev) & 15)
+                       return put_user(sectors, (unsigned long *) arg);
+               return put_user(raid[minor].sectors,
+                               (unsigned long *) arg);
+               break;
+
 
-               case HDIO_GETGEO:
+       case HDIO_GETGEO:
                {
-                       struct hd_geometry *loc = (struct hd_geometry *) arg;
+                       struct hd_geometry *loc =
+                           (struct hd_geometry *) arg;
                        unsigned short bios_cyl;
-                       
-                       if (!loc) return -EINVAL;
+
+                       if (!loc)
+                               return -EINVAL;
                        val = 255;
-                       if (put_user(val, (byte *) &loc->heads)) return -EFAULT;
-                       val=63;
-                       if (put_user(val, (byte *) &loc->sectors)) return -EFAULT;
-                       bios_cyl = raid[minor].sectors/63/255;
-                       if (put_user(bios_cyl, (unsigned short *) &loc->cylinders)) return -EFAULT;
-                       if (put_user((unsigned)ataraid_gendisk.part[minor(inode->i_rdev)].start_sect,
-                               (unsigned long *) &loc->start)) return -EFAULT;
+                       if (put_user(val, (byte *) & loc->heads))
+                               return -EFAULT;
+                       val = 63;
+                       if (put_user(val, (byte *) & loc->sectors))
+                               return -EFAULT;
+                       bios_cyl = raid[minor].sectors / 63 / 255;
+                       if (put_user
+                           (bios_cyl, (unsigned short *) &loc->cylinders))
+                               return -EFAULT;
+                       if (put_user
+                           ((unsigned) ataraid_gendisk.
+                            part[minor(inode->i_rdev)].start_sect,
+                            (unsigned long *) &loc->start))
+                               return -EFAULT;
                        return 0;
                }
 
-               case BLKROSET:
-               case BLKROGET:
-               case BLKSSZGET:
-                       return blk_ioctl(inode->i_bdev, cmd, arg);
+       case BLKROSET:
+       case BLKROGET:
+       case BLKSSZGET:
+               return blk_ioctl(inode->i_bdev, cmd, arg);
 
-               default:
-                       return -EINVAL;
+       default:
+               return -EINVAL;
        };
 
        return 0;
 }
 
 
-static int hptraid_make_request (request_queue_t *q, int rw, struct buffer_head * bh)
+static int hptraid_make_request(request_queue_t * q, int rw,
+                               struct buffer_head *bh)
 {
        unsigned long rsect;
-       unsigned long rsect_left,rsect_accum = 0;
+       unsigned long rsect_left, rsect_accum = 0;
        unsigned long block;
-       unsigned int disk=0,real_disk=0;
+       unsigned int disk = 0, real_disk = 0;
        int i;
        int device;
        struct hptraid *thisraid;
@@ -143,61 +159,70 @@ static int hptraid_make_request (request_queue_t *q, int rw, struct buffer_head
         * a disk falls out of the "higher" count, we mark the max sector. So once we pass a cutoff
         * point, we have to divide by one less.
         */
-       
-       device = (bh->b_rdev >> SHIFT)&MAJOR_MASK;
+
+       device = (bh->b_rdev >> SHIFT) & MAJOR_MASK;
        thisraid = &raid[device];
-       if (thisraid->stride==0)
-               thisraid->stride=1;
+       if (thisraid->stride == 0)
+               thisraid->stride = 1;
 
        /* Partitions need adding of the start sector of the partition to the requested sector */
-       
+
        rsect += ataraid_gendisk.part[minor(bh->b_rdev)].start_sect;
 
        /* Woops we need to split the request to avoid crossing a stride barrier */
-       if ((rsect/thisraid->stride) != ((rsect+(bh->b_size/512)-1)/thisraid->stride)) {
+       if ((rsect / thisraid->stride) !=
+           ((rsect + (bh->b_size / 512) - 1) / thisraid->stride)) {
                return -1;
        }
-                       
+
        rsect_left = rsect;
-       
-       for (i=0;i<8;i++) {
-               if (thisraid->cutoff_disks[i]==0)
+
+       for (i = 0; i < 8; i++) {
+               if (thisraid->cutoff_disks[i] == 0)
                        break;
                if (rsect > thisraid->cutoff[i]) {
                        /* we're in the wrong area so far */
                        rsect_left -= thisraid->cutoff[i];
-                       rsect_accum += thisraid->cutoff[i]/thisraid->cutoff_disks[i];
+                       rsect_accum +=
+                           thisraid->cutoff[i] /
+                           thisraid->cutoff_disks[i];
                } else {
                        block = rsect_left / thisraid->stride;
                        disk = block % thisraid->cutoff_disks[i];
-                       block = (block / thisraid->cutoff_disks[i]) * thisraid->stride;
-                       rsect = rsect_accum + (rsect_left % thisraid->stride) + block;
+                       block =
+                           (block / thisraid->cutoff_disks[i]) *
+                           thisraid->stride;
+                       rsect =
+                           rsect_accum + (rsect_left % thisraid->stride) +
+                           block;
                        break;
                }
        }
-       
-       for (i=0;i<8;i++) {
-               if ((disk==0) && (thisraid->disk[i].sectors > rsect_accum)) {
+
+       for (i = 0; i < 8; i++) {
+               if ((disk == 0)
+                   && (thisraid->disk[i].sectors > rsect_accum)) {
                        real_disk = i;
                        break;
                }
-               if ((disk>0) && (thisraid->disk[i].sectors >= rsect_accum)) {
+               if ((disk > 0)
+                   && (thisraid->disk[i].sectors >= rsect_accum)) {
                        disk--;
                }
-               
+
        }
        disk = real_disk;
-       
+
        /* All but the first disk have a 10 sector offset */
-       if (i>0)
-               rsect+=10;
-               
-       
+       if (i > 0)
+               rsect += 10;
+
+
        /*
         * The new BH_Lock semantics in ll_rw_blk.c guarantee that this
         * is the only IO operation happening on this bh.
         */
-        
+
        bh->b_rdev = thisraid->disk[disk].device;
        bh->b_rsector = rsect;
 
@@ -211,7 +236,7 @@ static int hptraid_make_request (request_queue_t *q, int rw, struct buffer_head
 #include "hptraid.h"
 
 static int __init read_disk_sb(struct block_device *bdev,
-                               struct highpoint_raid_conf *buf)
+                              struct highpoint_raid_conf *buf)
 {
        /* Superblock is at 9*512 bytes */
        Sector sect;
@@ -226,22 +251,22 @@ static int __init read_disk_sb(struct block_device *bdev,
        return -1;
 }
 
-static unsigned long maxsectors (int major,int minor)
+static unsigned long maxsectors(int major, int minor)
 {
        unsigned long lba = 0;
        kdev_t dev;
        struct ata_device *ideinfo;
 
-       dev = mk_kdev(major,minor);
-       ideinfo = get_info_ptr (dev);
-       if (ideinfo==NULL)
+       dev = mk_kdev(major, minor);
+       ideinfo = get_info_ptr(dev);
+       if (ideinfo == NULL)
                return 0;
 
 
        /* first sector of the last cluster */
-       if (ideinfo->head==0) 
+       if (ideinfo->head == 0)
                return 0;
-       if (ideinfo->sect==0)
+       if (ideinfo->sect == 0)
                return 0;
        lba = (ideinfo->capacity);
 
@@ -249,131 +274,136 @@ static unsigned long maxsectors (int major,int minor)
 }
 
 static struct highpoint_raid_conf __initdata prom;
-static void __init probedisk(int major, int minor,int device)
+static void __init probedisk(int major, int minor, int device)
 {
        int i;
-       struct block_device *bdev = bdget(mk_kdev(major,minor));
+       struct block_device *bdev = bdget(mk_kdev(major, minor));
        struct gendisk *gd;
 
        if (!bdev)
                return;
 
-       if (blkdev_get(bdev,FMODE_READ|FMODE_WRITE,0,BDEV_RAW) < 0)
+       if (blkdev_get(bdev, FMODE_READ | FMODE_WRITE, 0, BDEV_RAW) < 0)
                return;
 
-       if (maxsectors(major,minor)==0)
+       if (maxsectors(major, minor) == 0)
                goto out;
 
-        if (read_disk_sb(bdev, &prom))
-               goto out;
+       if (read_disk_sb(bdev, &prom))
+               goto out;
 
-        if (prom.magic!=  0x5a7816f0)
-               goto out;
-        if (prom.type) {
-               printk(KERN_INFO "hptraid: only RAID0 is supported currently\n");
-               goto out;
-        }
+       if (prom.magic != 0x5a7816f0)
+               goto out;
+       if (prom.type) {
+               printk(KERN_INFO
+                      "hptraid: only RAID0 is supported currently\n");
+               goto out;
+       }
 
        i = prom.disk_number;
-       if (i<0)
+       if (i < 0)
                goto out;
-       if (i>8) 
+       if (i > 8)
                goto out;
 
        raid[device].disk[i].bdev = bdev;
        /* This is supposed to prevent others from stealing our underlying disks */
        /* now blank the /proc/partitions table for the wrong partition table,
           so that scripts don't accidentally mount it and crash the kernel */
-        /* XXX: the 0 is an utter hack  --hch */
-       gd=get_gendisk(mk_kdev(major, 0));
-       if (gd!=NULL) {
+       /* XXX: the 0 is an utter hack  --hch */
+       gd = get_gendisk(mk_kdev(major, 0));
+       if (gd != NULL) {
                int j;
-               for (j=1+(minor<<gd->minor_shift);j<((minor+1)<<gd->minor_shift);j++) 
-                       gd->part[j].nr_sects=0;                                 
+               for (j = 1 + (minor << gd->minor_shift);
+                    j < ((minor + 1) << gd->minor_shift); j++)
+                       gd->part[j].nr_sects = 0;
        }
 
-       raid[device].disk[i].device = mk_kdev(major,minor);
-       raid[device].disk[i].sectors = maxsectors(major,minor);
-       raid[device].stride = (1<<prom.raid0_shift);
+       raid[device].disk[i].device = mk_kdev(major, minor);
+       raid[device].disk[i].sectors = maxsectors(major, minor);
+       raid[device].stride = (1 << prom.raid0_shift);
        raid[device].disks = prom.raid_disks;
        raid[device].sectors = prom.total_secs;
        return;
-out:
+      out:
        blkdev_put(bdev);
 }
 
 static void __init fill_cutoff(int device)
 {
-       int i,j;
+       int i, j;
        unsigned long smallest;
        unsigned long bar;
        int count;
-       
+
        bar = 0;
-       for (i=0;i<8;i++) {
+       for (i = 0; i < 8; i++) {
                smallest = ~0;
-               for (j=0;j<8;j++) 
-                       if ((raid[device].disk[j].sectors < smallest) && (raid[device].disk[j].sectors>bar))
+               for (j = 0; j < 8; j++)
+                       if ((raid[device].disk[j].sectors < smallest)
+                           && (raid[device].disk[j].sectors > bar))
                                smallest = raid[device].disk[j].sectors;
                count = 0;
-               for (j=0;j<8;j++) 
+               for (j = 0; j < 8; j++)
                        if (raid[device].disk[j].sectors >= smallest)
                                count++;
-               
-               smallest = smallest * count;            
+
+               smallest = smallest * count;
                bar = smallest;
                raid[device].cutoff[i] = smallest;
                raid[device].cutoff_disks[i] = count;
-               
+
        }
 }
 
 
 static __init int hptraid_init_one(int device)
 {
-       int i,count;
+       int i, count;
 
-       probedisk(IDE0_MAJOR,  0, device);
+       probedisk(IDE0_MAJOR, 0, device);
        probedisk(IDE0_MAJOR, 64, device);
-       probedisk(IDE1_MAJOR,  0, device);
+       probedisk(IDE1_MAJOR, 0, device);
        probedisk(IDE1_MAJOR, 64, device);
-       probedisk(IDE2_MAJOR,  0, device);
+       probedisk(IDE2_MAJOR, 0, device);
        probedisk(IDE2_MAJOR, 64, device);
-       probedisk(IDE3_MAJOR,  0, device);
+       probedisk(IDE3_MAJOR, 0, device);
        probedisk(IDE3_MAJOR, 64, device);
-                                                                       
+
        fill_cutoff(device);
-       
+
        /* Initialize the gendisk structure */
-       
-       ataraid_register_disk(device,raid[device].sectors);
-
-       count=0;
-       printk(KERN_INFO "Highpoint HPT370 Softwareraid driver for linux version 0.01\n");
-               
-       for (i=0;i<8;i++) {
-               if (raid[device].disk[i].device!=0) {
+
+       ataraid_register_disk(device, raid[device].sectors);
+
+       count = 0;
+       printk(KERN_INFO
+              "Highpoint HPT370 Softwareraid driver for linux version 0.01\n");
+
+       for (i = 0; i < 8; i++) {
+               if (raid[device].disk[i].device != 0) {
                        printk(KERN_INFO "Drive %i is %li Mb \n",
-                               i,raid[device].disk[i].sectors/2048);
+                              i, raid[device].disk[i].sectors / 2048);
                        count++;
                }
        }
        if (count) {
-               printk(KERN_INFO "Raid array consists of %i drives. \n",count);
+               printk(KERN_INFO "Raid array consists of %i drives. \n",
+                      count);
                return 0;
        } else {
                printk(KERN_INFO "No raid array found\n");
                return -ENODEV;
        }
-       
+
 }
 
 static __init int hptraid_init(void)
 {
-       int retval,device;
-       
-       device=ataraid_get_device(&hptraid_ops);
-       if (device<0)
+       int retval, device;
+
+       device = ataraid_get_device(&hptraid_ops);
+       if (device < 0)
                return -ENODEV;
        retval = hptraid_init_one(device);
        if (retval)
@@ -381,28 +411,29 @@ static __init int hptraid_init(void)
        return retval;
 }
 
-static void __exit hptraid_exit (void)
+static void __exit hptraid_exit(void)
 {
-       int i,device;
-       for (device = 0; device<16; device++) {
-               for (i=0;i<8;i++)  {
-                       struct block_device *bdev = raid[device].disk[i].bdev;
+       int i, device;
+       for (device = 0; device < 16; device++) {
+               for (i = 0; i < 8; i++) {
+                       struct block_device *bdev =
+                           raid[device].disk[i].bdev;
                        raid[device].disk[i].bdev = NULL;
                        if (bdev)
                                blkdev_put(bdev, BDEV_RAW);
-               }       
+               }
                if (raid[device].sectors)
                        ataraid_release_device(device);
        }
 }
 
-static int hptraid_open(struct inode * inode, struct file * filp) 
+static int hptraid_open(struct inode *inode, struct file *filp)
 {
        MOD_INC_USE_COUNT;
        return 0;
 }
-static int hptraid_release(struct inode * inode, struct file * filp)
-{      
+static int hptraid_release(struct inode *inode, struct file *filp)
+{
        MOD_DEC_USE_COUNT;
        return 0;
 }
index ff785d6514d84d14d8c173f66531f17a3a146617..55f39b8c506e2a25e3331d429ccae832bda888bc 100644 (file)
@@ -127,8 +127,7 @@ static void ht6560b_selectproc(struct ata_device *drive)
        static u8 current_timing = 0;
        u8 select, timing;
 
-       __save_flags (flags);   /* local CPU only */
-       __cli();                /* local CPU only */
+       local_irq_save(flags);
 
        select = HT_CONFIG(drive);
        timing = HT_TIMING(drive);
@@ -152,7 +151,7 @@ static void ht6560b_selectproc(struct ata_device *drive)
                printk("ht6560b: %s: select=%#x timing=%#x\n", drive->name, select, timing);
 #endif
        }
-       __restore_flags (flags);        /* local CPU only */
+       local_irq_restore(flags);
 }
 
 /*
index 70917c42b27f8a0a49554eab9bdd343d556c192d..166971c7307decb2b145583b88402be51320d6a7 100644 (file)
@@ -2453,26 +2453,26 @@ void ide_cdrom_release_real (struct cdrom_device_info *cdi)
  * Device initialization.
  */
 static struct cdrom_device_ops ide_cdrom_dops = {
-       open:                   ide_cdrom_open_real,
-       release:                ide_cdrom_release_real,
-       drive_status:           ide_cdrom_drive_status,
-       media_changed:          ide_cdrom_check_media_change_real,
-       tray_move:              ide_cdrom_tray_move,
-       lock_door:              ide_cdrom_lock_door,
-       select_speed:           ide_cdrom_select_speed,
-       get_last_session:       ide_cdrom_get_last_session,
-       get_mcn:                ide_cdrom_get_mcn,
-       reset:                  ide_cdrom_reset,
-       audio_ioctl:            ide_cdrom_audio_ioctl,
-       dev_ioctl:              ide_cdrom_dev_ioctl,
-       capability:             CDC_CLOSE_TRAY | CDC_OPEN_TRAY | CDC_LOCK |
+       .open =                 ide_cdrom_open_real,
+       .release =              ide_cdrom_release_real,
+       .drive_status =         ide_cdrom_drive_status,
+       .media_changed =        ide_cdrom_check_media_change_real,
+       .tray_move =            ide_cdrom_tray_move,
+       .lock_door =            ide_cdrom_lock_door,
+       .select_speed =         ide_cdrom_select_speed,
+       .get_last_session =     ide_cdrom_get_last_session,
+       .get_mcn =              ide_cdrom_get_mcn,
+       .reset =                ide_cdrom_reset,
+       .audio_ioctl =          ide_cdrom_audio_ioctl,
+       .dev_ioctl =            ide_cdrom_dev_ioctl,
+       .capability =           CDC_CLOSE_TRAY | CDC_OPEN_TRAY | CDC_LOCK |
                                CDC_SELECT_SPEED | CDC_SELECT_DISC |
                                CDC_MULTI_SESSION | CDC_MCN |
                                CDC_MEDIA_CHANGED | CDC_PLAY_AUDIO | CDC_RESET |
                                CDC_IOCTLS | CDC_DRIVE_STATUS | CDC_CD_R |
                                CDC_CD_RW | CDC_DVD | CDC_DVD_R| CDC_DVD_RAM |
                                CDC_GENERIC_PACKET,
-       generic_packet:         ide_cdrom_packet,
+       .generic_packet =       ide_cdrom_packet,
 };
 
 static int ide_cdrom_register(struct ata_device *drive, int nslots)
@@ -2932,18 +2932,18 @@ int ide_cdrom_cleanup(struct ata_device *drive)
 static void ide_cdrom_attach(struct ata_device *drive);
 
 static struct ata_operations ide_cdrom_driver = {
-       owner:                  THIS_MODULE,
-       attach:                 ide_cdrom_attach,
-       cleanup:                ide_cdrom_cleanup,
-       standby:                NULL,
-       do_request:             ide_cdrom_do_request,
-       end_request:            NULL,
-       ioctl:                  ide_cdrom_ioctl,
-       open:                   ide_cdrom_open,
-       release:                ide_cdrom_release,
-       check_media_change:     ide_cdrom_check_media_change,
-       revalidate:             ide_cdrom_revalidate,
-       capacity:               ide_cdrom_capacity,
+       .owner =                THIS_MODULE,
+       .attach =               ide_cdrom_attach,
+       .cleanup =              ide_cdrom_cleanup,
+       .standby =              NULL,
+       .do_request =           ide_cdrom_do_request,
+       .end_request =          NULL,
+       .ioctl =                ide_cdrom_ioctl,
+       .open =                 ide_cdrom_open,
+       .release =              ide_cdrom_release,
+       .check_media_change =   ide_cdrom_check_media_change,
+       .revalidate =           ide_cdrom_revalidate,
+       .capacity =             ide_cdrom_capacity,
 };
 
 /* options */
index 8ebd46f0e963863f59de41d6f8281b21aaf92209..cd3fd43b4b237228ce331c1857418563820860d0 100644 (file)
@@ -1443,18 +1443,18 @@ static void idedisk_attach(struct ata_device *drive);
  * Subdriver functions.
  */
 static struct ata_operations idedisk_driver = {
-       owner:                  THIS_MODULE,
-       attach:                 idedisk_attach,
-       cleanup:                idedisk_cleanup,
-       standby:                idedisk_standby,
-       do_request:             idedisk_do_request,
-       end_request:            NULL,
-       ioctl:                  idedisk_ioctl,
-       open:                   idedisk_open,
-       release:                idedisk_release,
-       check_media_change:     idedisk_check_media_change,
-       revalidate:             NULL, /* use default method */
-       capacity:               idedisk_capacity,
+       .owner =                THIS_MODULE,
+       .attach =               idedisk_attach,
+       .cleanup =              idedisk_cleanup,
+       .standby =              idedisk_standby,
+       .do_request =           idedisk_do_request,
+       .end_request =          NULL,
+       .ioctl =                idedisk_ioctl,
+       .open =                 idedisk_open,
+       .release =              idedisk_release,
+       .check_media_change =   idedisk_check_media_change,
+       .revalidate =           NULL, /* use default method */
+       .capacity =             idedisk_capacity,
 };
 
 static void idedisk_attach(struct ata_device *drive)
index 9dca9511a4173f9d83c0d3f9360c495669c0138c..a05c8b00c9ce17359c93b83ece022b22f18f6513 100644 (file)
@@ -593,9 +593,9 @@ static ide_startstop_t idefloppy_pc_intr(struct ata_device *drive, struct reques
 #if IDEFLOPPY_DEBUG_LOG
                printk (KERN_INFO "Packet command completed, %d bytes transferred\n", pc->actually_transferred);
 #endif /* IDEFLOPPY_DEBUG_LOG */
-               clear_bit (PC_DMA_IN_PROGRESS, &pc->flags);
+               clear_bit(PC_DMA_IN_PROGRESS, &pc->flags);
 
-               ide__sti();     /* local CPU only */
+               local_irq_enable();
 
                if (status.b.check || test_bit(PC_DMA_ERROR, &pc->flags)) {     /* Error detected */
 #if IDEFLOPPY_DEBUG_LOG
@@ -1345,18 +1345,18 @@ static int idefloppy_get_format_progress(struct ata_device *drive,
                        progress_indication=floppy->progress_indication;
                }
                /* Else assume format_unit has finished, and we're
-               ** at 0x10000 */
+                * at 0x10000
+                */
        }
        else
        {
                atapi_status_reg_t status;
                unsigned long flags;
 
-               __save_flags(flags);
-               __cli();
+               local_irq_save(flags);
                ata_status(drive, 0, 0);
                status.all = drive->status;
-               __restore_flags(flags);
+               local_irq_restore(flags);
 
                progress_indication= !status.b.dsc ? 0:0x10000;
        }
@@ -1735,18 +1735,18 @@ static void idefloppy_attach(struct ata_device *drive);
  *     IDE subdriver functions, registered with ide.c
  */
 static struct ata_operations idefloppy_driver = {
-       owner:                  THIS_MODULE,
-       attach:                 idefloppy_attach,
-       cleanup:                idefloppy_cleanup,
-       standby:                NULL,
-       do_request:             idefloppy_do_request,
-       end_request:            idefloppy_end_request,
-       ioctl:                  idefloppy_ioctl,
-       open:                   idefloppy_open,
-       release:                idefloppy_release,
-       check_media_change:     idefloppy_check_media_change,
-       revalidate:             NULL, /* use default method */
-       capacity:               idefloppy_capacity,
+       .owner =                THIS_MODULE,
+       .attach =               idefloppy_attach,
+       .cleanup =              idefloppy_cleanup,
+       .standby =              NULL,
+       .do_request =           idefloppy_do_request,
+       .end_request =          idefloppy_end_request,
+       .ioctl =                idefloppy_ioctl,
+       .open =                 idefloppy_open,
+       .release =              idefloppy_release,
+       .check_media_change =   idefloppy_check_media_change,
+       .revalidate =           NULL, /* use default method */
+       .capacity =             idefloppy_capacity,
 };
 
 static void idefloppy_attach(struct ata_device *drive)
index fc6ccc4f6a8f76eed6a241b6751a88347af6dcd3..e9076cb4869cf27107138fb4fc054f20583c5d08 100644 (file)
@@ -697,75 +697,75 @@ void __init ide_scan_pcibus(int scan_direction)
  */
 static struct ata_pci_device chipsets[] __initdata = {
        {
-               vendor: PCI_VENDOR_ID_PCTECH,
-               device: PCI_DEVICE_ID_PCTECH_SAMURAI_IDE,
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_PCTECH,
+               .device = PCI_DEVICE_ID_PCTECH_SAMURAI_IDE,
+               .bootable = ON_BOARD
        },
        {
-               vendor: PCI_VENDOR_ID_CMD,
-               device: PCI_DEVICE_ID_CMD_640,
-               init_channel: ATA_PCI_IGNORE,
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_CMD,
+               .device = PCI_DEVICE_ID_CMD_640,
+               .init_channel = ATA_PCI_IGNORE,
+               .bootable = ON_BOARD
        },
        {
-               vendor: PCI_VENDOR_ID_NS,
-               device: PCI_DEVICE_ID_NS_87410,
-               enablebits: {{0x43,0x08,0x08}, {0x47,0x08,0x08}},
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_NS,
+               .device = PCI_DEVICE_ID_NS_87410,
+               .enablebits = {{0x43,0x08,0x08}, {0x47,0x08,0x08}},
+               .bootable = ON_BOARD
        },
        {
-               vendor: PCI_VENDOR_ID_HINT,
-               device: PCI_DEVICE_ID_HINT_VXPROII_IDE,
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_HINT,
+               .device = PCI_DEVICE_ID_HINT_VXPROII_IDE,
+               .bootable = ON_BOARD
        },
        {
-               vendor: PCI_VENDOR_ID_HOLTEK,
-               device: PCI_DEVICE_ID_HOLTEK_6565,
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_HOLTEK,
+               .device = PCI_DEVICE_ID_HOLTEK_6565,
+               .bootable = ON_BOARD
        },
        {
-               vendor: PCI_VENDOR_ID_INTEL,
-               device: PCI_DEVICE_ID_INTEL_82371MX,
-               enablebits: {{0x6D,0x80,0x80}, {0x00,0x00,0x00}},
-               bootable: ON_BOARD,
-               flags: ATA_F_NODMA
+               .vendor = PCI_VENDOR_ID_INTEL,
+               .device = PCI_DEVICE_ID_INTEL_82371MX,
+               .enablebits = {{0x6D,0x80,0x80}, {0x00,0x00,0x00}},
+               .bootable = ON_BOARD,
+               .flags = ATA_F_NODMA
        },
        {
-               vendor: PCI_VENDOR_ID_UMC,
-               device: PCI_DEVICE_ID_UMC_UM8673F,
-               bootable: ON_BOARD,
-               flags: ATA_F_FIXIRQ
+               .vendor = PCI_VENDOR_ID_UMC,
+               .device = PCI_DEVICE_ID_UMC_UM8673F,
+               .bootable = ON_BOARD,
+               .flags = ATA_F_FIXIRQ
        },
        {
-               vendor: PCI_VENDOR_ID_UMC,
-               device: PCI_DEVICE_ID_UMC_UM8886A,
-               bootable: ON_BOARD,
-               flags: ATA_F_FIXIRQ
+               .vendor = PCI_VENDOR_ID_UMC,
+               .device = PCI_DEVICE_ID_UMC_UM8886A,
+               .bootable = ON_BOARD,
+               .flags = ATA_F_FIXIRQ
        },
        {
-               vendor: PCI_VENDOR_ID_UMC,
-               device: PCI_DEVICE_ID_UMC_UM8886BF,
-               bootable: ON_BOARD,
-               flags: ATA_F_FIXIRQ
+               .vendor = PCI_VENDOR_ID_UMC,
+               .device = PCI_DEVICE_ID_UMC_UM8886BF,
+               .bootable = ON_BOARD,
+               .flags = ATA_F_FIXIRQ
        },
        {
-               vendor: PCI_VENDOR_ID_VIA,
-               device: PCI_DEVICE_ID_VIA_82C561,
-               bootable: ON_BOARD,
-               flags: ATA_F_NOADMA
+               .vendor = PCI_VENDOR_ID_VIA,
+               .device = PCI_DEVICE_ID_VIA_82C561,
+               .bootable = ON_BOARD,
+               .flags = ATA_F_NOADMA
        },
        {
-               vendor: PCI_VENDOR_ID_VIA,
-               device: PCI_DEVICE_ID_VIA_82C586_1,
-               bootable: ON_BOARD,
-               flags: ATA_F_NOADMA
+               .vendor = PCI_VENDOR_ID_VIA,
+               .device = PCI_DEVICE_ID_VIA_82C586_1,
+               .bootable = ON_BOARD,
+               .flags = ATA_F_NOADMA
        },
        {
-               vendor: PCI_VENDOR_ID_TTI,
-               device: PCI_DEVICE_ID_TTI_HPT366,
-               bootable: OFF_BOARD,
-               extra: 240,
-               flags: ATA_F_IRQ | ATA_F_HPTHACK
+               .vendor = PCI_VENDOR_ID_TTI,
+               .device = PCI_DEVICE_ID_TTI_HPT366,
+               .bootable = OFF_BOARD,
+               .extra = 240,
+               .flags = ATA_F_IRQ | ATA_F_HPTHACK
        }
 };
 
index b66b002b7223744507fdc0b2fee6018e7f41ade4..b3089a4bca4709cd95fabebe7d1386c02fdbea33 100644 (file)
@@ -419,10 +419,10 @@ pmac_ide_do_setfeature(struct ata_device *drive, u8 command)
        OUT_BYTE(SETFEATURES_XFER, IDE_FEATURE_REG);
        OUT_BYTE(WIN_SETFEATURES, IDE_COMMAND_REG);
        udelay(1);
-       __save_flags(flags);    /* local CPU only */
-       ide__sti();             /* local CPU only -- for jiffies */
+       __save_flags(flags);
+       local_irq_enable();
        result = wait_for_ready(drive);
-       __restore_flags(flags); /* local CPU only */
+       __restore_flags(flags);
        ata_irq_enable(drive, 1);
        if (result)
                printk(KERN_ERR "pmac_ide_do_setfeature disk not ready after SET_FEATURE !\n");
index 70e052d6097db64c65402ba6bc87777bff96788b..2c1fe77c4cb2ece114541ea464e059fc417686f6 100644 (file)
@@ -1881,9 +1881,9 @@ static ide_startstop_t idetape_pc_intr(struct ata_device *drive, struct request
                if (tape->debug_level >= 2)
                        printk (KERN_INFO "ide-tape: Packet command completed, %d bytes transferred\n", pc->actually_transferred);
 #endif
-               clear_bit (PC_DMA_IN_PROGRESS, &pc->flags);
+               clear_bit(PC_DMA_IN_PROGRESS, &pc->flags);
 
-               ide__sti();     /* local CPU only */
+               local_irq_enable();
 
 #if SIMULATE_ERRORS
                if ((pc->c[0] == IDETAPE_WRITE_CMD || pc->c[0] == IDETAPE_READ_CMD) && (++error_sim_count % 100) == 0) {
@@ -5926,17 +5926,17 @@ static void idetape_revalidate(struct ata_device *_dummy)
 static void idetape_attach(struct ata_device *);
 
 static struct ata_operations idetape_driver = {
-       owner:                  THIS_MODULE,
-       attach:                 idetape_attach,
-       cleanup:                idetape_cleanup,
-       standby:                NULL,
-       do_request:             idetape_do_request,
-       end_request:            idetape_end_request,
-       ioctl:                  idetape_blkdev_ioctl,
-       open:                   idetape_blkdev_open,
-       release:                idetape_blkdev_release,
-       check_media_change:     NULL,
-       revalidate:             idetape_revalidate,
+       .owner =                THIS_MODULE,
+       .attach =               idetape_attach,
+       .cleanup =              idetape_cleanup,
+       .standby =              NULL,
+       .do_request =           idetape_do_request,
+       .end_request =          idetape_end_request,
+       .ioctl =                idetape_blkdev_ioctl,
+       .open =                 idetape_blkdev_open,
+       .release =              idetape_blkdev_release,
+       .check_media_change =   NULL,
+       .revalidate =           idetape_revalidate,
 };
 
 
@@ -5945,12 +5945,12 @@ static struct ata_operations idetape_driver = {
  *     Our character device supporting functions, passed to register_chrdev.
  */
 static struct file_operations idetape_fops = {
-       owner:          THIS_MODULE,
-       read:           idetape_chrdev_read,
-       write:          idetape_chrdev_write,
-       ioctl:          idetape_chrdev_ioctl,
-       open:           idetape_chrdev_open,
-       release:        idetape_chrdev_release,
+       .owner =        THIS_MODULE,
+       .read =         idetape_chrdev_read,
+       .write =        idetape_chrdev_write,
+       .ioctl =        idetape_chrdev_ioctl,
+       .open =         idetape_chrdev_open,
+       .release =      idetape_chrdev_release,
 };
 
 static void idetape_attach(struct ata_device *drive)
index 2699a3f5de9a9b14db96d5cba20daaf16e0aa001..f05ea73895b4915b9f2f4fbf3ac68347c1c066a5 100644 (file)
@@ -143,7 +143,7 @@ static ide_startstop_t special_intr(struct ata_device *drive, struct request *rq
        struct ata_taskfile *ar = rq->special;
        ide_startstop_t ret = ATA_OP_FINISHED;
 
-       ide__sti();
+       local_irq_enable();
 
        if (rq->buffer && ar->taskfile.sector_number) {
                if (!ata_status(drive, 0, DRQ_STAT) && ar->taskfile.sector_number) {
index 851ac69d6a8d2a071710a24c4b6d1f60e0b4903f..a83f8e7ee6d62aff29036049a2938b8092ef5152 100644 (file)
@@ -288,8 +288,8 @@ u8 ata_dump(struct ata_device *drive, struct request * rq, const char *msg)
        u8 err = 0;
 
        /* FIXME:  --bzolnier */
-       __save_flags (flags);   /* local CPU only */
-       ide__sti();             /* local CPU only */
+       __save_flags(flags);
+       local_irq_enable();
 
        printk("%s: %s: status=0x%02x", drive->name, msg, drive->status);
        dump_bits(ata_status_msgs, ARRAY_SIZE(ata_status_msgs), drive->status);
@@ -337,7 +337,8 @@ u8 ata_dump(struct ata_device *drive, struct request * rq, const char *msg)
 #endif
                printk("\n");
        }
-       __restore_flags (flags);        /* local CPU only */
+       __restore_flags (flags);
+
        return err;
 }
 
@@ -522,7 +523,7 @@ static void do_request(struct ata_channel *channel)
        unsigned int unit;
        ide_startstop_t ret;
 
-       __cli();        /* necessary paranoia: ensure IRQs are masked on local CPU */
+       local_irq_disable();    /* necessary paranoia */
 
        /*
         * Select the next device which will be serviced.  This selects
@@ -683,7 +684,8 @@ static void do_request(struct ata_channel *channel)
                drive->rq = rq;
 
                spin_unlock(ch->lock);
-               ide__sti();     /* allow other IRQs while we start this request */
+               /* allow other IRQs while we start this request */
+               local_irq_enable();
 
                /*
                 * This initiates handling of a new I/O request.
@@ -837,8 +839,8 @@ void ide_timer_expiry(unsigned long data)
 #else
                disable_irq(ch->irq);   /* disable_irq_nosync ?? */
 #endif
-               /* FIXME: IRQs are already disabled by spin_lock_irqsave()  --bzolnier */
-               __cli();        /* local CPU only, as if we were handling an interrupt */
+
+               local_irq_disable();
                if (ch->poll_timeout) {
                        ret = handler(drive, drive->rq);
                } else if (ata_status_irq(drive)) {
@@ -906,7 +908,7 @@ void ide_timer_expiry(unsigned long data)
  * drive enters "idle", "standby", or "sleep" mode, so if the status looks
  * "good", we just ignore the interrupt completely.
  *
- * This routine assumes __cli() is in effect when called.
+ * This routine assumes IRQ are disabled on entry.
  *
  * If an unexpected interrupt happens on irq15 while we are handling irq14
  * and if the two interfaces are "serialized" (CMD640), then it looks like
@@ -955,7 +957,7 @@ static void unexpected_irq(int irq)
 }
 
 /*
- * Entry point for all interrupts, caller does __cli() for us.
+ * Entry point for all interrupts. Aussumes disabled IRQs.
  */
 void ata_irq_request(int irq, void *data, struct pt_regs *regs)
 {
@@ -1024,7 +1026,7 @@ void ata_irq_request(int irq, void *data, struct pt_regs *regs)
        spin_unlock(ch->lock);
 
        if (ch->unmask)
-               ide__sti();
+               local_irq_enable();
 
        /*
         * Service this interrupt, this may setup handler for next interrupt.
@@ -1185,12 +1187,12 @@ static int ide_check_media_change(kdev_t i_rdev)
 }
 
 struct block_device_operations ide_fops[] = {{
-       owner:                  THIS_MODULE,
-       open:                   ide_open,
-       release:                ide_release,
-       ioctl:                  ata_ioctl,
-       check_media_change:     ide_check_media_change,
-       revalidate:             ata_revalidate
+       .owner =                THIS_MODULE,
+       .open =                 ide_open,
+       .release =              ide_release,
+       .ioctl =                ata_ioctl,
+       .check_media_change =   ide_check_media_change,
+       .revalidate =           ata_revalidate
 }};
 
 EXPORT_SYMBOL(ide_fops);
index 1c18bae107ef3bd297947262be1c53f336ee9c5c..002dc1766fd0c966f7ad2d9321db73e2248adc28 100644 (file)
@@ -225,12 +225,12 @@ static void __init ide_init_it8172(struct ata_channel *hwif)
 
 /* module data table */
 static struct ata_pci_device chipset __initdata = {
-        vendor:        PCI_VENDOR_ID_ITE,
-       device: PCI_DEVICE_ID_ITE_IT8172G,
-       init_chipset: pci_init_it8172,
-       init_channel: ide_init_it8172,
-       exnablebits: {{0x00,0x00,0x00}, {0x40,0x00,0x01} },
-       bootable: ON_BOARD
+        .vendor = PCI_VENDOR_ID_ITE,
+       .device = PCI_DEVICE_ID_ITE_IT8172G,
+       .init_chipset = pci_init_it8172,
+       .init_channel = ide_init_it8172,
+       .exnablebits = {{0x00,0x00,0x00}, {0x40,0x00,0x01} },
+       .bootable = ON_BOARD
 };
 
 int __init init_it8172(void)
index 0431c648b7206f1d723ff86c652454f3228b8a2b..379bde73032df49e8781bb0f51f01c3094beffa3 100644 (file)
@@ -40,8 +40,7 @@ static void ns87415_prepare_drive(struct ata_device *drive, unsigned int use_dma
        struct pci_dev *dev = hwif->pci_dev;
        unsigned long flags;
 
-       __save_flags(flags);    /* local CPU only */
-       __cli();                /* local CPU only */
+       local_irq_save(flags);
        new = *old;
 
        /* Adjust IRQ enable bit */
@@ -75,7 +74,7 @@ static void ns87415_prepare_drive(struct ata_device *drive, unsigned int use_dma
                udelay(10);
        }
 
-       __restore_flags(flags); /* local CPU only */
+       local_irq_restore(flags);
 }
 
 static void ns87415_selectproc(struct ata_device *drive)
@@ -215,10 +214,10 @@ static void __init ide_init_ns87415(struct ata_channel *hwif)
 
 /* module data table */
 static struct ata_pci_device chipset __initdata = {
-       vendor: PCI_VENDOR_ID_NS,
-       device: PCI_DEVICE_ID_NS_87415,
-       init_channel: ide_init_ns87415,
-       bootable: ON_BOARD,
+       .vendor = PCI_VENDOR_ID_NS,
+       .device = PCI_DEVICE_ID_NS_87415,
+       .init_channel = ide_init_ns87415,
+       .bootable = ON_BOARD,
 };
 
 int __init init_ns87415(void)
index b77ba88ff4c845285b4cccb5b267d6e0a2d904df..6b025f3e93ce78e86fa3277103374c22df012888 100644 (file)
@@ -323,18 +323,18 @@ static void __init ide_init_opti621(struct ata_channel *hwif)
 /* module data table */
 static struct ata_pci_device chipsets[] __initdata = {
        {
-               vendor: PCI_VENDOR_ID_OPTI,
-               device: PCI_DEVICE_ID_OPTI_82C621,
-               init_channel: ide_init_opti621,
-               enablebits: {{0x45,0x80,0x00}, {0x40,0x08,0x00}},
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_OPTI,
+               .device = PCI_DEVICE_ID_OPTI_82C621,
+               .init_channel = ide_init_opti621,
+               .enablebits = {{0x45,0x80,0x00}, {0x40,0x08,0x00}},
+               .bootable = ON_BOARD
        },
        {
-               vendor: PCI_VENDOR_ID_OPTI,
-               device: PCI_DEVICE_ID_OPTI_82C825,
-               init_channel: ide_init_opti621,
-               enablebits: {{0x45,0x80,0x00}, {0x40,0x08,0x00}},
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_OPTI,
+               .device = PCI_DEVICE_ID_OPTI_82C825,
+               .init_channel = ide_init_opti621,
+               .enablebits = {{0x45,0x80,0x00}, {0x40,0x08,0x00}},
+               .bootable = ON_BOARD
        },
 };
 
index 940ce70f6e305969b0f7afa868bcdbf7253ec953..28f888d4a9c458e6657d5db4e67847cd4e43e464 100644 (file)
@@ -84,24 +84,24 @@ struct pdc_bit_messages {
 };
 
 static struct pdc_bit_messages pdc_reg_A[] = {
-       { 0x80, "SYNC_IN" },
-       { 0x40, "ERRDY_EN" },
-       { 0x20, "IORDY_EN" },
-       { 0x10, "PREFETCH_EN" },
+       {0x80, "SYNC_IN"},
+       {0x40, "ERRDY_EN"},
+       {0x20, "IORDY_EN"},
+       {0x10, "PREFETCH_EN"},
        /* PA3-PA0 - PIO "A" timing */
 };
 
 static struct pdc_bit_messages pdc_reg_B[] = {
        /* MB2-MB0 - DMA "B" timing */
-       { 0x10, "PIO_FORCED/PB4" },     /* PIO_FORCE 1:0 */
+       {0x10, "PIO_FORCED/PB4"},       /* PIO_FORCE 1:0 */
        /* PB3-PB0 - PIO "B" timing */
 };
 
 static struct pdc_bit_messages pdc_reg_C[] = {
-       { 0x80, "DMARQp" },
-       { 0x40, "IORDYp" },
-       { 0x20, "DMAR_EN" },
-       { 0x10, "DMAW_EN" },
+       {0x80, "DMARQp"},
+       {0x40, "IORDYp"},
+       {0x20, "DMAR_EN"},
+       {0x10, "DMAW_EN"},
        /* MC3-MC0 - DMA "C" timing */
 };
 
@@ -117,9 +117,9 @@ static void pdc_dump_bits(struct pdc_bit_messages *msgs, byte bits)
 
        printk(KERN_DEBUG " }\n");
 }
-#endif /* PDC202XX_DECODE_REGISTER_INFO */
+#endif                         /* PDC202XX_DECODE_REGISTER_INFO */
 
-static struct ata_devicedrives[4];
+static struct ata_device *drives[4];
 
 int check_in_drive_lists(struct ata_device *drive)
 {
@@ -135,7 +135,7 @@ int check_in_drive_lists(struct ata_device *drive)
                NULL
        };
 
-       const char**list = pdc_quirk_drives;
+       const char **list = pdc_quirk_drives;
        struct hd_driveid *id = drive->id;
 
        while (*list)
@@ -148,25 +148,27 @@ static int __init pdc202xx_modes_map(struct ata_channel *ch)
 {
        int map = XFER_EPIO | XFER_SWDMA | XFER_MWDMA | XFER_UDMA;
 
-       switch(ch->pci_dev->device) {
-               case PCI_DEVICE_ID_PROMISE_20276:
-               case PCI_DEVICE_ID_PROMISE_20275:
-               case PCI_DEVICE_ID_PROMISE_20271:
-               case PCI_DEVICE_ID_PROMISE_20269:
-                       map |= XFER_UDMA_133;
-               case PCI_DEVICE_ID_PROMISE_20268R:
-               case PCI_DEVICE_ID_PROMISE_20268:
-                       map &= ~XFER_SWDMA;
-               case PCI_DEVICE_ID_PROMISE_20267:
-               case PCI_DEVICE_ID_PROMISE_20265:
-                       map |= XFER_UDMA_100;
-               case PCI_DEVICE_ID_PROMISE_20262:
-                       map |= XFER_UDMA_66;
-
-                       if (!ch->udma_four) {
-                               printk(KERN_WARNING "%s: 40-pin cable, speed reduced to UDMA(33) mode.\n", ch->name);
-                               map &= ~XFER_UDMA_80W;
-                       }
+       switch (ch->pci_dev->device) {
+       case PCI_DEVICE_ID_PROMISE_20276:
+       case PCI_DEVICE_ID_PROMISE_20275:
+       case PCI_DEVICE_ID_PROMISE_20271:
+       case PCI_DEVICE_ID_PROMISE_20269:
+               map |= XFER_UDMA_133;
+       case PCI_DEVICE_ID_PROMISE_20268R:
+       case PCI_DEVICE_ID_PROMISE_20268:
+               map &= ~XFER_SWDMA;
+       case PCI_DEVICE_ID_PROMISE_20267:
+       case PCI_DEVICE_ID_PROMISE_20265:
+               map |= XFER_UDMA_100;
+       case PCI_DEVICE_ID_PROMISE_20262:
+               map |= XFER_UDMA_66;
+
+               if (!ch->udma_four) {
+                       printk(KERN_WARNING
+                              "%s: 40-pin cable, speed reduced to UDMA(33) mode.\n",
+                              ch->name);
+                       map &= ~XFER_UDMA_80W;
+               }
        }
 
        return map;
@@ -191,38 +193,89 @@ static int pdc202xx_tune_chipset(struct ata_device *drive, byte speed)
        pci_read_config_byte(dev, drive_pci + 1, &BP);
        pci_read_config_byte(dev, drive_pci + 2, &CP);
 
-       switch(speed) {
+       switch (speed) {
 #ifdef CONFIG_BLK_DEV_IDEDMA
-               case XFER_UDMA_5:
-               case XFER_UDMA_4:       TB = 0x20; TC = 0x01; break;
-               case XFER_UDMA_3:       TB = 0x40; TC = 0x02; break;
-               case XFER_UDMA_2:       TB = 0x20; TC = 0x01; break;
-               case XFER_UDMA_1:       TB = 0x40; TC = 0x02; break;
-               case XFER_UDMA_0:       TB = 0x60; TC = 0x03; break;
-               case XFER_MW_DMA_2:     TB = 0x60; TC = 0x03; break;
-               case XFER_MW_DMA_1:     TB = 0x60; TC = 0x04; break;
-               case XFER_MW_DMA_0:     TB = 0x60; TC = 0x05; break;
-               case XFER_SW_DMA_2:     TB = 0x60; TC = 0x05; break;
-               case XFER_SW_DMA_1:     TB = 0x80; TC = 0x06; break;
-               case XFER_SW_DMA_0:     TB = 0xC0; TC = 0x0B; break;
+       case XFER_UDMA_5:
+       case XFER_UDMA_4:
+               TB = 0x20;
+               TC = 0x01;
+               break;
+       case XFER_UDMA_3:
+               TB = 0x40;
+               TC = 0x02;
+               break;
+       case XFER_UDMA_2:
+               TB = 0x20;
+               TC = 0x01;
+               break;
+       case XFER_UDMA_1:
+               TB = 0x40;
+               TC = 0x02;
+               break;
+       case XFER_UDMA_0:
+               TB = 0x60;
+               TC = 0x03;
+               break;
+       case XFER_MW_DMA_2:
+               TB = 0x60;
+               TC = 0x03;
+               break;
+       case XFER_MW_DMA_1:
+               TB = 0x60;
+               TC = 0x04;
+               break;
+       case XFER_MW_DMA_0:
+               TB = 0x60;
+               TC = 0x05;
+               break;
+       case XFER_SW_DMA_2:
+               TB = 0x60;
+               TC = 0x05;
+               break;
+       case XFER_SW_DMA_1:
+               TB = 0x80;
+               TC = 0x06;
+               break;
+       case XFER_SW_DMA_0:
+               TB = 0xC0;
+               TC = 0x0B;
+               break;
 #endif
-               case XFER_PIO_4:        TA = 0x01; TB = 0x04; break;
-               case XFER_PIO_3:        TA = 0x02; TB = 0x06; break;
-               case XFER_PIO_2:        TA = 0x03; TB = 0x08; break;
-               case XFER_PIO_1:        TA = 0x05; TB = 0x0C; break;
-               case XFER_PIO_0:
-               default:                TA = 0x09; TB = 0x13; break;
+       case XFER_PIO_4:
+               TA = 0x01;
+               TB = 0x04;
+               break;
+       case XFER_PIO_3:
+               TA = 0x02;
+               TB = 0x06;
+               break;
+       case XFER_PIO_2:
+               TA = 0x03;
+               TB = 0x08;
+               break;
+       case XFER_PIO_1:
+               TA = 0x05;
+               TB = 0x0C;
+               break;
+       case XFER_PIO_0:
+       default:
+               TA = 0x09;
+               TB = 0x13;
+               break;
        }
 
 #ifdef CONFIG_BLK_DEV_IDEDMA
-        if (speed >= XFER_SW_DMA_0) {
-               pci_write_config_byte(dev, drive_pci + 1, (BP & ~0xf0) | TB);
-               pci_write_config_byte(dev, drive_pci + 2, (CP & ~0x0f) | TC);
+       if (speed >= XFER_SW_DMA_0) {
+               pci_write_config_byte(dev, drive_pci + 1,
+                                     (BP & ~0xf0) | TB);
+               pci_write_config_byte(dev, drive_pci + 2,
+                                     (CP & ~0x0f) | TC);
        } else
 #endif
        {
                pci_write_config_byte(dev, drive_pci, (AP & ~0x0f) | TA);
-               pci_write_config_byte(dev, drive_pci + 1, (BP & ~0x07) | TB);
+               pci_write_config_byte(dev, drive_pci + 1,
+                                     (BP & ~0x07) | TB);
        }
 
 #if PDC202XX_DECODE_REGISTER_INFO
@@ -235,7 +288,7 @@ static int pdc202xx_tune_chipset(struct ata_device *drive, byte speed)
        pdc_dump_bits(pdc_reg_A, AP);
 
        printk(KERN_DEBUG "BP(%x): DMA(B) = %d PIO(B) = %d\n",
-                         BP, (BP & 0xe0) >> 5, BP & 0x0f);
+              BP, (BP & 0xe0) >> 5, BP & 0x0f);
        pdc_dump_bits(pdc_reg_B, BP);
 
        printk(KERN_DEBUG "CP(%x): DMA(C) = %d\n", CP, CP & 0x0f);
@@ -246,9 +299,8 @@ static int pdc202xx_tune_chipset(struct ata_device *drive, byte speed)
 
 #if PDC202XX_DEBUG_DRIVE_INFO
        printk("%s: %02x drive%d 0x%08x ",
-               drive->name, speed,
-               drive->dn, drive_conf);
-               pci_read_config_dword(dev, drive_pci, &drive_conf);
+              drive->name, speed, drive->dn, drive_conf);
+       pci_read_config_dword(dev, drive_pci, &drive_conf);
        printk("0x%08x\n", drive_conf);
 #endif
 
@@ -282,9 +334,9 @@ static int pdc202xx_new_tune_chipset(struct ata_device *drive, byte speed)
        }
 #endif
 
-       for (i = 0 ; i < 2 ; i++)
+       for (i = 0; i < 2; i++)
                if (hwif->drives[i].present)
-                       drives[i+j] = &hwif->drives[i];
+                       drives[i + j] = &hwif->drives[i];
 
        err = ide_config_drive_speed(drive, speed);
 
@@ -293,7 +345,7 @@ static int pdc202xx_new_tune_chipset(struct ata_device *drive, byte speed)
                return err;
 
        /* We need to adjust timings to ATA133 clock if ATA133 drives exist */
-       for (i = 0 ; i < 4 ; i++) {
+       for (i = 0; i < 4; i++) {
                if (!drives[i])
                        continue;
 
@@ -306,81 +358,81 @@ static int pdc202xx_new_tune_chipset(struct ata_device *drive, byte speed)
 
                switch (drives[i]->current_speed) {
 #ifdef CONFIG_BLK_DEV_IDEDMA
-                       case XFER_UDMA_6:
-                               set_2regs(0x10, 0x1a);
-                               set_2regs(0x11, 0x01);
-                               set_2regs(0x12, 0xcb);
-                               break;
-                       case XFER_UDMA_5:
-                               set_2regs(0x10, 0x1a);
-                               set_2regs(0x11, 0x02);
-                               set_2regs(0x12, 0xcb);
-                               break;
-                       case XFER_UDMA_4:
-                               set_2regs(0x10, 0x1a);
-                               set_2regs(0x11, 0x03);
-                               set_2regs(0x12, 0xcd);
-                               break;
-                       case XFER_UDMA_3:
-                               set_2regs(0x10, 0x1a);
-                               set_2regs(0x11, 0x05);
-                               set_2regs(0x12, 0xcd);
-                               break;
-                       case XFER_UDMA_2:
-                               set_2regs(0x10, 0x2a);
-                               set_2regs(0x11, 0x07);
-                               set_2regs(0x12, 0xcd);
-                               break;
-                       case XFER_UDMA_1:
-                               set_2regs(0x10, 0x3a);
-                               set_2regs(0x11, 0x0a);
-                               set_2regs(0x12, 0xd0);
-                               break;
-                       case XFER_UDMA_0:
-                               set_2regs(0x10, 0x4a);
-                               set_2regs(0x11, 0x0f);
-                               set_2regs(0x12, 0xd5);
-                               break;
-                       case XFER_MW_DMA_2:
-                               set_2regs(0x0e, 0x69);
-                               set_2regs(0x0f, 0x25);
-                               break;
-                       case XFER_MW_DMA_1:
-                               set_2regs(0x0e, 0x6b);
-                               set_2regs(0x0f, 0x27);
-                               break;
-                       case XFER_MW_DMA_0:
-                               set_2regs(0x0e, 0xdf);
-                               set_2regs(0x0f, 0x5f);
-                               break;
+               case XFER_UDMA_6:
+                       set_2regs(0x10, 0x1a);
+                       set_2regs(0x11, 0x01);
+                       set_2regs(0x12, 0xcb);
+                       break;
+               case XFER_UDMA_5:
+                       set_2regs(0x10, 0x1a);
+                       set_2regs(0x11, 0x02);
+                       set_2regs(0x12, 0xcb);
+                       break;
+               case XFER_UDMA_4:
+                       set_2regs(0x10, 0x1a);
+                       set_2regs(0x11, 0x03);
+                       set_2regs(0x12, 0xcd);
+                       break;
+               case XFER_UDMA_3:
+                       set_2regs(0x10, 0x1a);
+                       set_2regs(0x11, 0x05);
+                       set_2regs(0x12, 0xcd);
+                       break;
+               case XFER_UDMA_2:
+                       set_2regs(0x10, 0x2a);
+                       set_2regs(0x11, 0x07);
+                       set_2regs(0x12, 0xcd);
+                       break;
+               case XFER_UDMA_1:
+                       set_2regs(0x10, 0x3a);
+                       set_2regs(0x11, 0x0a);
+                       set_2regs(0x12, 0xd0);
+                       break;
+               case XFER_UDMA_0:
+                       set_2regs(0x10, 0x4a);
+                       set_2regs(0x11, 0x0f);
+                       set_2regs(0x12, 0xd5);
+                       break;
+               case XFER_MW_DMA_2:
+                       set_2regs(0x0e, 0x69);
+                       set_2regs(0x0f, 0x25);
+                       break;
+               case XFER_MW_DMA_1:
+                       set_2regs(0x0e, 0x6b);
+                       set_2regs(0x0f, 0x27);
+                       break;
+               case XFER_MW_DMA_0:
+                       set_2regs(0x0e, 0xdf);
+                       set_2regs(0x0f, 0x5f);
+                       break;
 #endif
-                       case XFER_PIO_4:
-                               set_2regs(0x0c, 0x23);
-                               set_2regs(0x0d, 0x09);
-                               set_2regs(0x13, 0x25);
-                               break;
-                       case XFER_PIO_3:
-                               set_2regs(0x0c, 0x27);
-                               set_2regs(0x0d, 0x0d);
-                               set_2regs(0x13, 0x35);
-                               break;
-                       case XFER_PIO_2:
-                               set_2regs(0x0c, 0x23);
-                               set_2regs(0x0d, 0x26);
-                               set_2regs(0x13, 0x64);
-                               break;
-                       case XFER_PIO_1:
-                               set_2regs(0x0c, 0x46);
-                               set_2regs(0x0d, 0x29);
-                               set_2regs(0x13, 0xa4);
-                               break;
-                       case XFER_PIO_0:
-                               set_2regs(0x0c, 0xfb);
-                               set_2regs(0x0d, 0x2b);
-                               set_2regs(0x13, 0xac);
-                               break;
-                       default:
-                               ;
+               case XFER_PIO_4:
+                       set_2regs(0x0c, 0x23);
+                       set_2regs(0x0d, 0x09);
+                       set_2regs(0x13, 0x25);
+                       break;
+               case XFER_PIO_3:
+                       set_2regs(0x0c, 0x27);
+                       set_2regs(0x0d, 0x0d);
+                       set_2regs(0x13, 0x35);
+                       break;
+               case XFER_PIO_2:
+                       set_2regs(0x0c, 0x23);
+                       set_2regs(0x0d, 0x26);
+                       set_2regs(0x13, 0x64);
+                       break;
+               case XFER_PIO_1:
+                       set_2regs(0x0c, 0x46);
+                       set_2regs(0x0d, 0x29);
+                       set_2regs(0x13, 0xa4);
+                       break;
+               case XFER_PIO_0:
+                       set_2regs(0x0c, 0xfb);
+                       set_2regs(0x0d, 0x2b);
+                       set_2regs(0x13, 0xac);
+                       break;
+               default:
+                       ;
                }
        }
 
@@ -400,7 +452,8 @@ static void pdc202xx_tune_drive(struct ata_device *drive, u8 pio)
 
        if (pio == 255)
                speed = ata_best_pio_mode(drive);
-       else    speed = XFER_PIO_0 + min_t(byte, pio, 4);
+       else
+               speed = XFER_PIO_0 + min_t(byte, pio, 4);
 
        pdc202xx_tune_chipset(drive, speed);
 }
@@ -419,7 +472,7 @@ static int pdc202xx_tx_udma_setup(struct ata_device *drive, int map)
 
        /* IORDY_EN & PREFETCH_EN */
        if (id->capability & 4)
-               set_2regs(0x13, (IN_BYTE(datareg)|0x03));
+               set_2regs(0x13, (IN_BYTE(datareg) | 0x03));
 
        return udma_generic_setup(drive, map);
 }
@@ -428,7 +481,7 @@ static int pdc202xx_udma_setup(struct ata_device *drive, int map)
 {
        struct hd_driveid *id = drive->id;
        struct ata_channel *hwif = drive->channel;
-       struct hd_driveid *mate_id = hwif->drives[!(drive->dn%2)].id;
+       struct hd_driveid *mate_id = hwif->drives[!(drive->dn % 2)].id;
        struct pci_dev *dev = hwif->pci_dev;
        u32 high_16 = pci_resource_start(dev, 4);
        u32 drive_conf;
@@ -467,30 +520,32 @@ static int pdc202xx_udma_setup(struct ata_device *drive, int map)
                goto chipset_is_set;
 
        /* FIXME: what if SYNC_ERRDY is enabled for slave
-                 and disabled for master? --bkz */
+          and disabled for master? --bkz */
        pci_read_config_byte(dev, drive_pci, &AP);
        /* enable SYNC_ERRDY for master and slave (if enabled for master) */
        if (!(AP & SYNC_ERRDY_EN)) {
                if (!(drive->dn % 2)) {
-                       pci_write_config_byte(dev, drive_pci, AP|SYNC_ERRDY_EN);
+                       pci_write_config_byte(dev, drive_pci,
+                                             AP | SYNC_ERRDY_EN);
                } else {
                        pci_read_config_byte(dev, drive_pci - 4, &tmp);
                        if (tmp & SYNC_ERRDY_EN)
-                               pci_write_config_byte(dev, drive_pci, AP|SYNC_ERRDY_EN);
+                               pci_write_config_byte(dev, drive_pci,
+                                                     AP | SYNC_ERRDY_EN);
                }
        }
 
-chipset_is_set:
+      chipset_is_set:
 
        if (drive->type != ATA_DISK)
                return 0;
 
        pci_read_config_byte(dev, drive_pci, &AP);
-       if (id->capability & 4)         /* IORDY_EN */
-               pci_write_config_byte(dev, drive_pci, AP|IORDY_EN);
+       if (id->capability & 4) /* IORDY_EN */
+               pci_write_config_byte(dev, drive_pci, AP | IORDY_EN);
        pci_read_config_byte(dev, drive_pci, &AP);
        if (drive->type == ATA_DISK)    /* PREFETCH_EN */
-               pci_write_config_byte(dev, drive_pci, AP|PREFETCH_EN);
+               pci_write_config_byte(dev, drive_pci, AP | PREFETCH_EN);
 
        map = hwif->modes_map;
 
@@ -507,7 +562,8 @@ chipset_is_set:
        return udma_generic_setup(drive, map);
 }
 
-static void pdc202xx_udma_start(struct ata_device *drive, struct request *rq)
+static void pdc202xx_udma_start(struct ata_device *drive,
+                               struct request *rq)
 {
        struct ata_channel *ch = drive->channel;
        u32 high_16 = pci_resource_start(ch->pci_dev, 4);
@@ -521,7 +577,8 @@ static void pdc202xx_udma_start(struct ata_device *drive, struct request *rq)
 
                OUT_BYTE(clock | (ch->unit ? 0x08 : 0x02), clockreg);
                word_count = (rq->nr_sectors << 8);
-               hankval = (rq_data_dir(rq) == READ) ? 0x05 << 24 : 0x06 << 24;
+               hankval =
+                   (rq_data_dir(rq) == READ) ? 0x05 << 24 : 0x06 << 24;
                hankval |= word_count;
                outl(hankval, atapi_port);
        }
@@ -531,7 +588,7 @@ static void pdc202xx_udma_start(struct ata_device *drive, struct request *rq)
         * when we do this part before issuing the drive cmd.
         */
 
-       outb(inb(ch->dma_base) | 1, ch->dma_base); /* start DMA */
+       outb(inb(ch->dma_base) | 1, ch->dma_base);      /* start DMA */
 }
 
 static int pdc202xx_udma_stop(struct ata_device *drive)
@@ -547,15 +604,15 @@ static int pdc202xx_udma_stop(struct ata_device *drive)
                u32 clockreg = high_16 + PDC_CLK;
                u8 clock;
 
-               outl(0, atapi_port);            /* zero out extra */
+               outl(0, atapi_port);    /* zero out extra */
                clock = IN_BYTE(clockreg);
                OUT_BYTE(clock & ~(ch->unit ? 0x08 : 0x02), clockreg);
        }
 
-       outb(inb(dma_base)&~1, dma_base);       /* stop DMA */
-       dma_stat = inb(dma_base+2);             /* get DMA status */
-       outb(dma_stat|6, dma_base+2);           /* clear the INTR & ERROR bits */
-       udma_destroy_table(ch);                 /* purge DMA mappings */
+       outb(inb(dma_base) & ~1, dma_base);     /* stop DMA */
+       dma_stat = inb(dma_base + 2);   /* get DMA status */
+       outb(dma_stat | 6, dma_base + 2);       /* clear the INTR & ERROR bits */
+       udma_destroy_table(ch); /* purge DMA mappings */
 
        return (dma_stat & 7) != 4 ? (0x10 | dma_stat) : 0;     /* verify good DMA status */
 }
@@ -577,7 +634,7 @@ static void pdc202xx_reset(struct ata_device *drive)
        udelay(10);
        outb(0x00, drive->channel->io_ports[IDE_CONTROL_OFFSET]);
        printk(KERN_INFO "PDC202XX: %s channel reset.\n",
-                        drive->channel->unit ? "Secondary" : "Primary");
+              drive->channel->unit ? "Secondary" : "Primary");
 }
 
 /*
@@ -623,28 +680,33 @@ static unsigned int __init pdc202xx_init_chipset(struct pci_dev *dev)
        set_reg_and_wait(burst & ~0x10, burstreg, 2000);
 
        if (dev->resource[PCI_ROM_RESOURCE].start) {
-               pci_write_config_dword(dev, PCI_ROM_ADDRESS, dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
-               printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n", dev->name, dev->resource[PCI_ROM_RESOURCE].start);
+               pci_write_config_dword(dev, PCI_ROM_ADDRESS,
+                                      dev->resource[PCI_ROM_RESOURCE].
+                                      start | PCI_ROM_ADDRESS_ENABLE);
+               printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n", dev->name,
+                      dev->resource[PCI_ROM_RESOURCE].start);
        }
-
 #if 0
        switch (dev->device) {
-               case PCI_DEVICE_ID_PROMISE_20267:
-               case PCI_DEVICE_ID_PROMISE_20265:
-               case PCI_DEVICE_ID_PROMISE_20262:
-                       pdc202xx_reset_host(dev);
-                       break;
-               default:
-                       if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE) {
-                               byte irq = 0, irq2 = 0;
-                               pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq);
-                               pci_read_config_byte(dev, (PCI_INTERRUPT_LINE)|0x80, &irq2);    /* 0xbc */
-                               if (irq != irq2) {
-                                       pci_write_config_byte(dev, (PCI_INTERRUPT_LINE)|0x80, irq);     /* 0xbc */
-                                       printk("%s: pci-config space interrupt mirror fixed.\n", dev->name);
-                               }
+       case PCI_DEVICE_ID_PROMISE_20267:
+       case PCI_DEVICE_ID_PROMISE_20265:
+       case PCI_DEVICE_ID_PROMISE_20262:
+               pdc202xx_reset_host(dev);
+               break;
+       default:
+               if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE) {
+                       byte irq = 0, irq2 = 0;
+                       pci_read_config_byte(dev, PCI_INTERRUPT_LINE,
+                                            &irq);
+                       pci_read_config_byte(dev, (PCI_INTERRUPT_LINE) | 0x80, &irq2);  /* 0xbc */
+                       if (irq != irq2) {
+                               pci_write_config_byte(dev, (PCI_INTERRUPT_LINE) | 0x80, irq);   /* 0xbc */
+                               printk
+                                   ("%s: pci-config space interrupt mirror fixed.\n",
+                                    dev->name);
                        }
-                       break;
+               }
+               break;
        }
 #endif
 
@@ -656,10 +718,10 @@ static unsigned int __init pdc202xx_init_chipset(struct pci_dev *dev)
        }
 #endif
        printk(KERN_INFO "%s: (U)DMA BURST %sabled, "
-                        "primary %s mode, secondary %s mode.\n",
+              "primary %s mode, secondary %s mode.\n",
               dev->name, (burst & 1) ? "en" : "dis",
               (IN_BYTE(high_16 + PDC_PRIMARY) & 1) ? "MASTER" : "PCI",
-              (IN_BYTE(high_16 + PDC_SECONDARY) & 1) ? "MASTER" : "PCI" );
+              (IN_BYTE(high_16 + PDC_SECONDARY) & 1) ? "MASTER" : "PCI");
 
        return dev->irq;
 }
@@ -669,8 +731,11 @@ static unsigned int __init pdc202xx_init_chipset(struct pci_dev *dev)
 static unsigned int __init pdc202xx_tx_init_chipset(struct pci_dev *dev)
 {
        if (dev->resource[PCI_ROM_RESOURCE].start) {
-               pci_write_config_dword(dev, PCI_ROM_ADDRESS, dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
-               printk(KERN_INFO "%s: ROM enabled at 0x%08lx.\n", dev->name, dev->resource[PCI_ROM_RESOURCE].start);
+               pci_write_config_dword(dev, PCI_ROM_ADDRESS,
+                                      dev->resource[PCI_ROM_RESOURCE].
+                                      start | PCI_ROM_ADDRESS_ENABLE);
+               printk(KERN_INFO "%s: ROM enabled at 0x%08lx.\n",
+                      dev->name, dev->resource[PCI_ROM_RESOURCE].start);
        }
        return dev->irq;
 }
@@ -693,46 +758,46 @@ static unsigned int __init pdc202xx_tx_ata66_check(struct ata_channel *ch)
 
 static void __init ide_init_pdc202xx(struct ata_channel *hwif)
 {
-       hwif->tuneproc  = &pdc202xx_tune_drive;
+       hwif->tuneproc = &pdc202xx_tune_drive;
        hwif->quirkproc = &check_in_drive_lists;
        hwif->resetproc = &pdc202xx_reset;
 
-        switch(hwif->pci_dev->device) {
-               case PCI_DEVICE_ID_PROMISE_20276:
-               case PCI_DEVICE_ID_PROMISE_20275:
-               case PCI_DEVICE_ID_PROMISE_20271:
-               case PCI_DEVICE_ID_PROMISE_20269:
-               case PCI_DEVICE_ID_PROMISE_20268:
-               case PCI_DEVICE_ID_PROMISE_20268R:
-                       hwif->udma_four = pdc202xx_tx_ata66_check(hwif);
+       switch (hwif->pci_dev->device) {
+       case PCI_DEVICE_ID_PROMISE_20276:
+       case PCI_DEVICE_ID_PROMISE_20275:
+       case PCI_DEVICE_ID_PROMISE_20271:
+       case PCI_DEVICE_ID_PROMISE_20269:
+       case PCI_DEVICE_ID_PROMISE_20268:
+       case PCI_DEVICE_ID_PROMISE_20268R:
+               hwif->udma_four = pdc202xx_tx_ata66_check(hwif);
 
-                       hwif->speedproc = &pdc202xx_new_tune_chipset;
+               hwif->speedproc = &pdc202xx_new_tune_chipset;
 #ifdef CONFIG_BLK_DEV_IDEDMA
-                       if (hwif->dma_base)
-                               hwif->udma_setup = pdc202xx_tx_udma_setup;
+               if (hwif->dma_base)
+                       hwif->udma_setup = pdc202xx_tx_udma_setup;
 #endif
-                       break;
-               case PCI_DEVICE_ID_PROMISE_20267:
-               case PCI_DEVICE_ID_PROMISE_20265:
+               break;
+       case PCI_DEVICE_ID_PROMISE_20267:
+       case PCI_DEVICE_ID_PROMISE_20265:
 #ifdef CONFIG_BLK_DEV_IDEDMA
-                       /* we need special functions for lba48 */
-                       if (hwif->dma_base) {
-                               hwif->udma_start = pdc202xx_udma_start;
-                               hwif->udma_stop = pdc202xx_udma_stop;
-                       }
+               /* we need special functions for lba48 */
+               if (hwif->dma_base) {
+                       hwif->udma_start = pdc202xx_udma_start;
+                       hwif->udma_stop = pdc202xx_udma_stop;
+               }
 #endif
                /* PDC20262 doesn't support LBA48 */
-               case PCI_DEVICE_ID_PROMISE_20262:
-                       hwif->udma_four = pdc202xx_ata66_check(hwif);
+       case PCI_DEVICE_ID_PROMISE_20262:
+               hwif->udma_four = pdc202xx_ata66_check(hwif);
 
-               case PCI_DEVICE_ID_PROMISE_20246:
+       case PCI_DEVICE_ID_PROMISE_20246:
 #ifdef CONFIG_BLK_DEV_IDEDMA
-                       if (hwif->dma_base)
-                               hwif->udma_setup = pdc202xx_udma_setup;
+               if (hwif->dma_base)
+                       hwif->udma_setup = pdc202xx_udma_setup;
 #endif
-                       hwif->speedproc = &pdc202xx_tune_chipset;
-               default:
-                       break;
+               hwif->speedproc = &pdc202xx_tune_chipset;
+       default:
+               break;
        }
 
 #ifdef CONFIG_BLK_DEV_IDEDMA
@@ -753,107 +818,97 @@ static void __init ide_init_pdc202xx(struct ata_channel *hwif)
 /* module data table */
 static struct ata_pci_device chipsets[] __initdata = {
        {
-               vendor: PCI_VENDOR_ID_PROMISE,
-               device: PCI_DEVICE_ID_PROMISE_20246,
-               init_chipset: pdc202xx_init_chipset,
-               init_channel: ide_init_pdc202xx,
+        .vendor = PCI_VENDOR_ID_PROMISE,
+        .device = PCI_DEVICE_ID_PROMISE_20246,
+        .init_chipset = pdc202xx_init_chipset,
+        .init_channel = ide_init_pdc202xx,
 #ifndef CONFIG_PDC202XX_FORCE
-               enablebits: {{0x50,0x02,0x02}, {0x50,0x04,0x04}},
+        .enablebits = {{0x50, 0x02, 0x02}, {0x50, 0x04, 0x04}},
 #endif
-               bootable: OFF_BOARD,
-               extra: 16,
-               flags: ATA_F_IRQ | ATA_F_DMA
-       },
+        .bootable = OFF_BOARD,
+        .extra = 16,
+        .flags = ATA_F_IRQ | ATA_F_DMA},
        {
-               vendor: PCI_VENDOR_ID_PROMISE,
-               device: PCI_DEVICE_ID_PROMISE_20262,
-               init_chipset: pdc202xx_init_chipset,
-               init_channel: ide_init_pdc202xx,
+        .vendor = PCI_VENDOR_ID_PROMISE,
+        .device = PCI_DEVICE_ID_PROMISE_20262,
+        .init_chipset = pdc202xx_init_chipset,
+        .init_channel = ide_init_pdc202xx,
 #ifndef CONFIG_PDC202XX_FORCE
-               enablebits: {{0x50,0x02,0x02}, {0x50,0x04,0x04}},
+        .enablebits = {{0x50, 0x02, 0x02}, {0x50, 0x04, 0x04}},
 #endif
-               bootable: OFF_BOARD,
-               extra: 48,
-               flags: ATA_F_IRQ | ATA_F_PHACK | ATA_F_DMA
-       },
+        .bootable = OFF_BOARD,
+        .extra = 48,
+        .flags = ATA_F_IRQ | ATA_F_PHACK | ATA_F_DMA},
        {
-               vendor: PCI_VENDOR_ID_PROMISE,
-               device: PCI_DEVICE_ID_PROMISE_20265,
-               init_chipset: pdc202xx_init_chipset,
-               init_channel: ide_init_pdc202xx,
+        .vendor = PCI_VENDOR_ID_PROMISE,
+        .device = PCI_DEVICE_ID_PROMISE_20265,
+        .init_chipset = pdc202xx_init_chipset,
+        .init_channel = ide_init_pdc202xx,
 #ifndef CONFIG_PDC202XX_FORCE
-               enablebits: {{0x50,0x02,0x02}, {0x50,0x04,0x04}},
-               bootable: OFF_BOARD,
+        .enablebits = {{0x50, 0x02, 0x02}, {0x50, 0x04, 0x04}},
+        .bootable = OFF_BOARD,
 #else
-               bootable: ON_BOARD,
+        .bootable = ON_BOARD,
 #endif
-               extra: 48,
-               flags: ATA_F_IRQ | ATA_F_PHACK  | ATA_F_DMA
-       },
+        .extra = 48,
+        .flags = ATA_F_IRQ | ATA_F_PHACK | ATA_F_DMA},
        {
-               vendor: PCI_VENDOR_ID_PROMISE,
-               device: PCI_DEVICE_ID_PROMISE_20267,
-               init_chipset: pdc202xx_init_chipset,
-               init_channel: ide_init_pdc202xx,
+        .vendor = PCI_VENDOR_ID_PROMISE,
+        .device = PCI_DEVICE_ID_PROMISE_20267,
+        .init_chipset = pdc202xx_init_chipset,
+        .init_channel = ide_init_pdc202xx,
 #ifndef CONFIG_PDC202XX_FORCE
-               enablebits: {{0x50,0x02,0x02}, {0x50,0x04,0x04}},
+        .enablebits = {{0x50, 0x02, 0x02}, {0x50, 0x04, 0x04}},
 #endif
-               bootable: OFF_BOARD,
-               extra: 48,
-               flags: ATA_F_IRQ  | ATA_F_DMA
-       },
+        .bootable = OFF_BOARD,
+        .extra = 48,
+        .flags = ATA_F_IRQ | ATA_F_DMA},
        {
-               vendor: PCI_VENDOR_ID_PROMISE,
-               device: PCI_DEVICE_ID_PROMISE_20268,
-               init_chipset: pdc202xx_init_chipset,
-               init_channel: ide_init_pdc202xx,
-               bootable: OFF_BOARD,
-               flags: ATA_F_IRQ | ATA_F_DMA
-       },
+        .vendor = PCI_VENDOR_ID_PROMISE,
+        .device = PCI_DEVICE_ID_PROMISE_20268,
+        .init_chipset = pdc202xx_init_chipset,
+        .init_channel = ide_init_pdc202xx,
+        .bootable = OFF_BOARD,
+        .flags = ATA_F_IRQ | ATA_F_DMA},
        /* Promise used a different PCI identification for the raid card
         * apparently to try and prevent Linux detecting it and using our own
         * raid code. We want to detect it for the ataraid drivers, so we have
         * to list both here.. */
        {
-               vendor: PCI_VENDOR_ID_PROMISE,
-               device: PCI_DEVICE_ID_PROMISE_20268R,
-               init_chipset: pdc202xx_init_chipset,
-               init_channel: ide_init_pdc202xx,
-               bootable: OFF_BOARD,
-               flags: ATA_F_IRQ  | ATA_F_DMA
-       },
+        .vendor = PCI_VENDOR_ID_PROMISE,
+        .device = PCI_DEVICE_ID_PROMISE_20268R,
+        .init_chipset = pdc202xx_init_chipset,
+        .init_channel = ide_init_pdc202xx,
+        .bootable = OFF_BOARD,
+        .flags = ATA_F_IRQ | ATA_F_DMA},
        {
-               vendor: PCI_VENDOR_ID_PROMISE,
-               device: PCI_DEVICE_ID_PROMISE_20269,
-               init_chipset: pdc202xx_init_chipset,
-               init_channel: ide_init_pdc202xx,
-               bootable: OFF_BOARD,
-               flags: ATA_F_IRQ | ATA_F_DMA
-       },
+        .vendor = PCI_VENDOR_ID_PROMISE,
+        .device = PCI_DEVICE_ID_PROMISE_20269,
+        .init_chipset = pdc202xx_init_chipset,
+        .init_channel = ide_init_pdc202xx,
+        .bootable = OFF_BOARD,
+        .flags = ATA_F_IRQ | ATA_F_DMA},
        {
-               vendor: PCI_VENDOR_ID_PROMISE,
-               device: PCI_DEVICE_ID_PROMISE_20271,
-               init_chipset: pdc202xx_init_chipset,
-               init_channel: ide_init_pdc202xx,
-               bootable: OFF_BOARD,
-               flags: ATA_F_IRQ | ATA_F_DMA
-       },
+        .vendor = PCI_VENDOR_ID_PROMISE,
+        .device = PCI_DEVICE_ID_PROMISE_20271,
+        .init_chipset = pdc202xx_init_chipset,
+        .init_channel = ide_init_pdc202xx,
+        .bootable = OFF_BOARD,
+        .flags = ATA_F_IRQ | ATA_F_DMA},
        {
-               vendor: PCI_VENDOR_ID_PROMISE,
-               device: PCI_DEVICE_ID_PROMISE_20275,
-               init_chipset: pdc202xx_init_chipset,
-               init_channel: ide_init_pdc202xx,
-               bootable: OFF_BOARD,
-               flags: ATA_F_IRQ | ATA_F_DMA
-       },
+        .vendor = PCI_VENDOR_ID_PROMISE,
+        .device = PCI_DEVICE_ID_PROMISE_20275,
+        .init_chipset = pdc202xx_init_chipset,
+        .init_channel = ide_init_pdc202xx,
+        .bootable = OFF_BOARD,
+        .flags = ATA_F_IRQ | ATA_F_DMA},
        {
-               vendor: PCI_VENDOR_ID_PROMISE,
-               device: PCI_DEVICE_ID_PROMISE_20276,
-               init_chipset: pdc202xx_init_chipset,
-               init_channel: ide_init_pdc202xx,
-               bootable: OFF_BOARD,
-               flags: ATA_F_IRQ | ATA_F_DMA
-       },
+        .vendor = PCI_VENDOR_ID_PROMISE,
+        .device = PCI_DEVICE_ID_PROMISE_20276,
+        .init_chipset = pdc202xx_init_chipset,
+        .init_channel = ide_init_pdc202xx,
+        .bootable = OFF_BOARD,
+        .flags = ATA_F_IRQ | ATA_F_DMA},
 };
 
 int __init init_pdc202xx(void)
@@ -863,5 +918,5 @@ int __init init_pdc202xx(void)
        for (i = 0; i < ARRAY_SIZE(chipsets); ++i)
                ata_register_chipset(&chipsets[i]);
 
-        return 0;
+       return 0;
 }
index 5fff033d2891137f72d7d88c5238f30cd9720ba0..323be48b0e30d13c59482e122dd534a43d8da0aa 100644 (file)
@@ -106,26 +106,24 @@ static void read_vlb(struct ata_device *drive, void *buffer, unsigned int wcount
 {
        unsigned long flags;
 
-       __save_flags(flags);    /* local CPU only */
-       __cli();                /* local CPU only */
+       local_irq_save(flags);
        inb(IDE_NSECTOR_REG);
        inb(IDE_NSECTOR_REG);
        inb(IDE_NSECTOR_REG);
        insl(IDE_DATA_REG, buffer, wcount);
-       __restore_flags(flags); /* local CPU only */
+       local_irq_restore(flags);
 }
 
 static void write_vlb(struct ata_device *drive, void *buffer, unsigned int wcount)
 {
        unsigned long flags;
 
-       __save_flags(flags);    /* local CPU only */
-       __cli();                /* local CPU only */
+       local_irq_save(flags);
        inb(IDE_NSECTOR_REG);
        inb(IDE_NSECTOR_REG);
        inb(IDE_NSECTOR_REG);
        outsl(IDE_DATA_REG, buffer, wcount);
-       __restore_flags(flags); /* local CPU only */
+       local_irq_restore(flags);
 }
 
 static void read_16(struct ata_device *drive, void *buffer, unsigned int wcount)
@@ -701,7 +699,7 @@ ide_startstop_t do_pdc4030_io(struct ata_device *drive, struct ata_taskfile *arg
                        return ret;
                }
                if (!drive->channel->unmask)
-                       __cli();        /* local CPU only */
+                       local_irq_disable();
 
                return promise_do_write(drive, rq);
        }
index c10d825150016c231bbe3c7cbeba6cfd3a3c9ab9..4d6f81507582467314989b2709f06c18b35c3534 100644 (file)
 
 #include "ataraid.h"
 
-static int pdcraid_open(struct inode * inode, struct file * filp);
-static int pdcraid_release(struct inode * inode, struct file * filp);
-static int pdcraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg);
-static int pdcraid0_make_request (request_queue_t *q, int rw, struct buffer_head * bh);
-static int pdcraid1_make_request (request_queue_t *q, int rw, struct buffer_head * bh);
+static int pdcraid_open(struct inode *inode, struct file *filp);
+static int pdcraid_release(struct inode *inode, struct file *filp);
+static int pdcraid_ioctl(struct inode *inode, struct file *file,
+                        unsigned int cmd, unsigned long arg);
+static int pdcraid0_make_request(request_queue_t * q, int rw,
+                                struct buffer_head *bh);
+static int pdcraid1_make_request(request_queue_t * q, int rw,
+                                struct buffer_head *bh);
 
 struct disk_dev {
        int major;
@@ -43,26 +46,26 @@ struct disk_dev {
        int device;
 };
 
-static struct disk_dev devlist[]= {
-       {IDE0_MAJOR,  0,  -1 },
-       {IDE0_MAJOR, 64,  -1 },
-       {IDE1_MAJOR,  0,  -1 },
-       {IDE1_MAJOR, 64,  -1 },
-       {IDE2_MAJOR,  0,  -1 },
-       {IDE2_MAJOR, 64,  -1 },
-       {IDE3_MAJOR,  0,  -1 },
-       {IDE3_MAJOR, 64,  -1 },
-       {IDE4_MAJOR,  0,  -1 },
-       {IDE4_MAJOR, 64,  -1 },
-       {IDE5_MAJOR,  0,  -1 },
-       {IDE5_MAJOR, 64,  -1 },
-       {IDE6_MAJOR,  0,  -1 },
-       {IDE6_MAJOR, 64,  -1 },
+static struct disk_dev devlist[] = {
+       {IDE0_MAJOR, 0, -1},
+       {IDE0_MAJOR, 64, -1},
+       {IDE1_MAJOR, 0, -1},
+       {IDE1_MAJOR, 64, -1},
+       {IDE2_MAJOR, 0, -1},
+       {IDE2_MAJOR, 64, -1},
+       {IDE3_MAJOR, 0, -1},
+       {IDE3_MAJOR, 64, -1},
+       {IDE4_MAJOR, 0, -1},
+       {IDE4_MAJOR, 64, -1},
+       {IDE5_MAJOR, 0, -1},
+       {IDE5_MAJOR, 64, -1},
+       {IDE6_MAJOR, 0, -1},
+       {IDE6_MAJOR, 64, -1},
 };
 
 
 struct pdcdisk {
-       kdev_t  device;
+       kdev_t device;
        unsigned long sectors;
        struct block_device *bdev;
        unsigned long last_pos;
@@ -73,133 +76,163 @@ struct pdcraid {
        unsigned int disks;
        unsigned long sectors;
        struct geom geom;
-       
+
        struct pdcdisk disk[8];
-       
+
        unsigned long cutoff[8];
        unsigned int cutoff_disks[8];
 };
 
 static struct raid_device_operations pdcraid0_ops = {
-        open:                   pdcraid_open,
-       release:                pdcraid_release,
-       ioctl:                  pdcraid_ioctl,
-       make_request:           pdcraid0_make_request
+       .open = pdcraid_open,
+       .release = pdcraid_release,
+       .ioctl = pdcraid_ioctl,
+       .make_request = pdcraid0_make_request
 };
 
 static struct raid_device_operations pdcraid1_ops = {
-        open:                   pdcraid_open,
-       release:                pdcraid_release,
-       ioctl:                  pdcraid_ioctl,
-       make_request:           pdcraid1_make_request
+       .open = pdcraid_open,
+       .release = pdcraid_release,
+       .ioctl = pdcraid_ioctl,
+       .make_request = pdcraid1_make_request
 };
 
 static struct pdcraid raid[16];
 
 
-static int pdcraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
+static int pdcraid_ioctl(struct inode *inode, struct file *file,
+                        unsigned int cmd, unsigned long arg)
 {
        unsigned int minor;
-       unsigned long sectors;
+       unsigned long sectors;
 
-       if (!inode || kdev_none(inode->i_rdev)) 
+       if (!inode || kdev_none(inode->i_rdev))
                return -EINVAL;
 
-       minor = minor(inode->i_rdev)>>SHIFT;
-       
+       minor = minor(inode->i_rdev) >> SHIFT;
+
        switch (cmd) {
 
-               case BLKGETSIZE:   /* Return device size */
-                       if (!arg)  return -EINVAL;
-                       sectors = ataraid_gendisk.part[minor(inode->i_rdev)].nr_sects;
-                       if (minor(inode->i_rdev)&15)
-                               return put_user(sectors, (unsigned long *) arg);
-                       return put_user(raid[minor].sectors , (unsigned long *) arg);
-                       break;
-                       
+       case BLKGETSIZE:        /* Return device size */
+               if (!arg)
+                       return -EINVAL;
+               sectors =
+                   ataraid_gendisk.part[minor(inode->i_rdev)].nr_sects;
+               if (minor(inode->i_rdev) & 15)
+                       return put_user(sectors, (unsigned long *) arg);
+               return put_user(raid[minor].sectors,
+                               (unsigned long *) arg);
+               break;
+
 
-               case HDIO_GETGEO:
+       case HDIO_GETGEO:
                {
-                       struct hd_geometry *loc = (struct hd_geometry *) arg;
-                       unsigned short bios_cyl = raid[minor].geom.cylinders; /* truncate */
-                       
-                       if (!loc) return -EINVAL;
-                       if (put_user(raid[minor].geom.heads, (byte *) &loc->heads)) return -EFAULT;
-                       if (put_user(raid[minor].geom.sectors, (byte *) &loc->sectors)) return -EFAULT;
-                       if (put_user(bios_cyl, (unsigned short *) &loc->cylinders)) return -EFAULT;
-                       if (put_user((unsigned)ataraid_gendisk.part[minor(inode->i_rdev)].start_sect,
-                               (unsigned long *) &loc->start)) return -EFAULT;
+                       struct hd_geometry *loc =
+                           (struct hd_geometry *) arg;
+                       unsigned short bios_cyl = raid[minor].geom.cylinders;   /* truncate */
+
+                       if (!loc)
+                               return -EINVAL;
+                       if (put_user
+                           (raid[minor].geom.heads,
+                            (byte *) & loc->heads))
+                               return -EFAULT;
+                       if (put_user
+                           (raid[minor].geom.sectors,
+                            (byte *) & loc->sectors))
+                               return -EFAULT;
+                       if (put_user
+                           (bios_cyl, (unsigned short *) &loc->cylinders))
+                               return -EFAULT;
+                       if (put_user
+                           ((unsigned) ataraid_gendisk.
+                            part[minor(inode->i_rdev)].start_sect,
+                            (unsigned long *) &loc->start))
+                               return -EFAULT;
                        return 0;
                }
 
-               case BLKROSET:
-               case BLKROGET:
-               case BLKSSZGET:
-                       return blk_ioctl(inode->i_bdev, cmd, arg);
+       case BLKROSET:
+       case BLKROGET:
+       case BLKSSZGET:
+               return blk_ioctl(inode->i_bdev, cmd, arg);
 
-               default:
-                       printk("Invalid ioctl \n");
-                       return -EINVAL;
+       default:
+               printk("Invalid ioctl \n");
+               return -EINVAL;
        };
 
        return 0;
 }
 
 
-unsigned long partition_map_normal(unsigned long block, unsigned long partition_off, unsigned long partition_size, int stride)
+unsigned long partition_map_normal(unsigned long block,
+                                  unsigned long partition_off,
+                                  unsigned long partition_size,
+                                  int stride)
 {
        return block + partition_off;
 }
 
-unsigned long partition_map_linux(unsigned long block, unsigned long partition_off, unsigned long partition_size, int stride)
+unsigned long partition_map_linux(unsigned long block,
+                                 unsigned long partition_off,
+                                 unsigned long partition_size, int stride)
 {
        unsigned long newblock;
-       
-       newblock = stride - (partition_off%stride); if (newblock == stride) newblock = 0;
+
+       newblock = stride - (partition_off % stride);
+       if (newblock == stride)
+               newblock = 0;
        newblock += block;
        newblock = newblock % partition_size;
        newblock += partition_off;
-       
+
        return newblock;
 }
 
-static int funky_remap[8] = { 0, 1,  2, 3, 4, 5, 6, 7 };
+static int funky_remap[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };
 
-unsigned long partition_map_linux_raid0_4disk(unsigned long block, unsigned long partition_off, unsigned long partition_size, int stride)
+unsigned long partition_map_linux_raid0_4disk(unsigned long block,
+                                             unsigned long partition_off,
+                                             unsigned long partition_size,
+                                             int stride)
 {
-       unsigned long newblock,temp,temp2;
-       
-       newblock = stride - (partition_off%stride); if (newblock == stride) newblock = 0;
+       unsigned long newblock, temp, temp2;
+
+       newblock = stride - (partition_off % stride);
+       if (newblock == stride)
+               newblock = 0;
 
-       if (block < (partition_size / (8*stride))*8*stride ) {
+       if (block < (partition_size / (8 * stride)) * 8 * stride) {
                temp = block % stride;
                temp2 = block / stride;
-               temp2 = ((temp2>>3)<<3)|(funky_remap[temp2&7]);
-               block = temp2*stride+temp;
+               temp2 = ((temp2 >> 3) << 3) | (funky_remap[temp2 & 7]);
+               block = temp2 * stride + temp;
        }
 
-       
+
        newblock += block;
        newblock = newblock % partition_size;
        newblock += partition_off;
-       
+
        return newblock;
 }
 
 
 
-static int pdcraid0_make_request (request_queue_t *q, int rw, struct buffer_head * bh)
+static int pdcraid0_make_request(request_queue_t * q, int rw,
+                                struct buffer_head *bh)
 {
        unsigned long rsect;
-       unsigned long rsect_left,rsect_accum = 0;
+       unsigned long rsect_left, rsect_accum = 0;
        unsigned long block;
-       unsigned int disk=0,real_disk=0;
+       unsigned int disk = 0, real_disk = 0;
        int i;
        int device;
        struct pdcraid *thisraid;
 
        rsect = bh->b_rsector;
-       
+
        /* Ok. We need to modify this sector number to a new disk + new sector number. 
         * If there are disks of different sizes, this gets tricky. 
         * Example with 3 disks (1Gb, 4Gb and 5 GB):
@@ -211,52 +244,66 @@ static int pdcraid0_make_request (request_queue_t *q, int rw, struct buffer_head
         * a disk falls out of the "higher" count, we mark the max sector. So once we pass a cutoff
         * point, we have to divide by one less.
         */
-       
-       device = (bh->b_rdev >> SHIFT)&MAJOR_MASK;
+
+       device = (bh->b_rdev >> SHIFT) & MAJOR_MASK;
        thisraid = &raid[device];
-       if (thisraid->stride==0)
-               thisraid->stride=1;
+       if (thisraid->stride == 0)
+               thisraid->stride = 1;
 
        /* Partitions need adding of the start sector of the partition to the requested sector */
-       
-       rsect = partition_map_normal(rsect, ataraid_gendisk.part[MINOR(bh->b_rdev)].start_sect, ataraid_gendisk.part[MINOR(bh->b_rdev)].nr_sects, thisraid->stride);
+
+       rsect =
+           partition_map_normal(rsect,
+                                ataraid_gendisk.part[MINOR(bh->b_rdev)].
+                                start_sect,
+                                ataraid_gendisk.part[MINOR(bh->b_rdev)].
+                                nr_sects, thisraid->stride);
 
        /* Woops we need to split the request to avoid crossing a stride barrier */
-       if ((rsect/thisraid->stride) != ((rsect+(bh->b_size/512)-1)/thisraid->stride)) {
-               return -1;  
+       if ((rsect / thisraid->stride) !=
+           ((rsect + (bh->b_size / 512) - 1) / thisraid->stride)) {
+               return -1;
        }
-       
+
        rsect_left = rsect;
-       
-       for (i=0;i<8;i++) {
-               if (thisraid->cutoff_disks[i]==0)
+
+       for (i = 0; i < 8; i++) {
+               if (thisraid->cutoff_disks[i] == 0)
                        break;
                if (rsect > thisraid->cutoff[i]) {
                        /* we're in the wrong area so far */
                        rsect_left -= thisraid->cutoff[i];
-                       rsect_accum += thisraid->cutoff[i]/thisraid->cutoff_disks[i];
+                       rsect_accum +=
+                           thisraid->cutoff[i] /
+                           thisraid->cutoff_disks[i];
                } else {
                        block = rsect_left / thisraid->stride;
                        disk = block % thisraid->cutoff_disks[i];
-                       block = (block / thisraid->cutoff_disks[i]) * thisraid->stride;
-                       rsect = rsect_accum + (rsect_left % thisraid->stride) + block;
+                       block =
+                           (block / thisraid->cutoff_disks[i]) *
+                           thisraid->stride;
+                       rsect =
+                           rsect_accum + (rsect_left % thisraid->stride) +
+                           block;
                        break;
                }
        }
-       
-       for (i=0;i<8;i++) {
-               if ((disk==0) && (thisraid->disk[i].sectors > rsect_accum)) {
+
+       for (i = 0; i < 8; i++) {
+               if ((disk == 0)
+                   && (thisraid->disk[i].sectors > rsect_accum)) {
                        real_disk = i;
                        break;
                }
-               if ((disk>0) && (thisraid->disk[i].sectors >= rsect_accum)) {
+               if ((disk > 0)
+                   && (thisraid->disk[i].sectors >= rsect_accum)) {
                        disk--;
                }
-               
+
        }
        disk = real_disk;
-               
-       
+
+
        /*
         * The new BH_Lock semantics in ll_rw_blk.c guarantee that this
         * is the only IO operation happening on this bh.
@@ -270,106 +317,112 @@ static int pdcraid0_make_request (request_queue_t *q, int rw, struct buffer_head
        return 1;
 }
 
-static int pdcraid1_write_request(request_queue_t *q, int rw, struct buffer_head * bh)
+static int pdcraid1_write_request(request_queue_t * q, int rw,
+                                 struct buffer_head *bh)
 {
        struct buffer_head *bh1;
        struct ataraid_bh_private *private;
        int device;
        int i;
 
-       device = (bh->b_rdev >> SHIFT)&MAJOR_MASK;
+       device = (bh->b_rdev >> SHIFT) & MAJOR_MASK;
        private = ataraid_get_private();
-       if (private==NULL)
+       if (private == NULL)
                BUG();
 
        private->parent = bh;
-       
-       atomic_set(&private->count,raid[device].disks);
+
+       atomic_set(&private->count, raid[device].disks);
 
 
-       for (i = 0; i< raid[device].disks; i++) { 
-               bh1=ataraid_get_bhead();
+       for (i = 0; i < raid[device].disks; i++) {
+               bh1 = ataraid_get_bhead();
                /* If this ever fails we're doomed */
                if (!bh1)
                        BUG();
-       
+
                /* dupe the bufferhead and update the parts that need to be different */
                memcpy(bh1, bh, sizeof(*bh));
-               
+
                bh1->b_end_io = ataraid_end_request;
                bh1->b_private = private;
-               bh1->b_rsector += ataraid_gendisk.part[MINOR(bh->b_rdev)].start_sect; /* partition offset */
+               bh1->b_rsector += ataraid_gendisk.part[MINOR(bh->b_rdev)].start_sect;   /* partition offset */
                bh1->b_rdev = raid[device].disk[i].device;
 
                /* update the last known head position for the drive */
-               raid[device].disk[i].last_pos = bh1->b_rsector+(bh1->b_size>>9);
+               raid[device].disk[i].last_pos =
+                   bh1->b_rsector + (bh1->b_size >> 9);
 
-               generic_make_request(rw,bh1);
+               generic_make_request(rw, bh1);
        }
        return 0;
 }
 
-static int pdcraid1_read_request (request_queue_t *q, int rw, struct buffer_head * bh)
+static int pdcraid1_read_request(request_queue_t * q, int rw,
+                                struct buffer_head *bh)
 {
        int device;
        int dist;
-       int bestsofar,bestdist,i;
+       int bestsofar, bestdist, i;
        static int previous;
 
        /* Reads are simple in principle. Pick a disk and go. 
           Initially I cheat by just picking the one which the last known
           head position is closest by.
           Later on, online/offline checking and performance needs adding */
-       
-       device = (bh->b_rdev >> SHIFT)&MAJOR_MASK;
-       bh->b_rsector += ataraid_gendisk.part[MINOR(bh->b_rdev)].start_sect;
 
-       bestsofar = 0; 
+       device = (bh->b_rdev >> SHIFT) & MAJOR_MASK;
+       bh->b_rsector +=
+           ataraid_gendisk.part[MINOR(bh->b_rdev)].start_sect;
+
+       bestsofar = 0;
        bestdist = raid[device].disk[0].last_pos - bh->b_rsector;
-       if (bestdist<0) 
-               bestdist=-bestdist;
-       if (bestdist>4095)
-               bestdist=4095;
+       if (bestdist < 0)
+               bestdist = -bestdist;
+       if (bestdist > 4095)
+               bestdist = 4095;
 
-       for (i=1 ; i<raid[device].disks; i++) {
+       for (i = 1; i < raid[device].disks; i++) {
                dist = raid[device].disk[i].last_pos - bh->b_rsector;
-               if (dist<0) 
+               if (dist < 0)
                        dist = -dist;
-               if (dist>4095)
-                       dist=4095;
-               
-               if (bestdist==dist) {  /* it's a tie; try to do some read balancing */
-                       if ((previous>bestsofar)&&(previous<=i))  
+               if (dist > 4095)
+                       dist = 4095;
+
+               if (bestdist == dist) { /* it's a tie; try to do some read balancing */
+                       if ((previous > bestsofar) && (previous <= i))
                                bestsofar = i;
                        previous = (previous + 1) % raid[device].disks;
-               } else if (bestdist>dist) {
+               } else if (bestdist > dist) {
                        bestdist = dist;
                        bestsofar = i;
                }
-       
+
        }
-       
-       bh->b_rdev = raid[device].disk[bestsofar].device; 
-       raid[device].disk[bestsofar].last_pos = bh->b_rsector+(bh->b_size>>9);
+
+       bh->b_rdev = raid[device].disk[bestsofar].device;
+       raid[device].disk[bestsofar].last_pos =
+           bh->b_rsector + (bh->b_size >> 9);
 
        /*
         * Let the main block layer submit the IO and resolve recursion:
         */
-                               
+
        return 1;
 }
 
 
-static int pdcraid1_make_request (request_queue_t *q, int rw, struct buffer_head * bh)
+static int pdcraid1_make_request(request_queue_t * q, int rw,
+                                struct buffer_head *bh)
 {
        /* Read and Write are totally different cases; split them totally here */
-       if (rw==READA)
+       if (rw == READA)
                rw = READ;
-       
-       if (rw==READ)
-               return pdcraid1_read_request(q,rw,bh);
+
+       if (rw == READ)
+               return pdcraid1_read_request(q, rw, bh);
        else
-               return pdcraid1_write_request(q,rw,bh);
+               return pdcraid1_write_request(q, rw, bh);
 }
 
 #include "pdcraid.h"
@@ -379,23 +432,24 @@ static unsigned long calc_pdcblock_offset(struct block_device *bdev)
        unsigned long lba = 0;
        struct ata_device *ideinfo = get_info_ptr(to_kdev_t(bdev->bd_dev));
 
-       if (ideinfo==NULL)
+       if (ideinfo == NULL)
                return 0;
 
        /* first sector of the last cluster */
-       if (ideinfo->head==0) 
+       if (ideinfo->head == 0)
                return 0;
-       if (ideinfo->sect==0)
+       if (ideinfo->sect == 0)
                return 0;
-       lba = (ideinfo->capacity / (ideinfo->head*ideinfo->sect));
-       lba = lba * (ideinfo->head*ideinfo->sect);
+       lba = (ideinfo->capacity / (ideinfo->head * ideinfo->sect));
+       lba = lba * (ideinfo->head * ideinfo->sect);
        lba = lba - ideinfo->sect;
 
        return lba;
 }
 
 
-static int read_disk_sb(struct block_device *bdev, struct promise_raid_conf *p)
+static int read_disk_sb(struct block_device *bdev,
+                       struct promise_raid_conf *p)
 {
        unsigned long sb_offset;
        char *buffer;
@@ -407,14 +461,15 @@ static int read_disk_sb(struct block_device *bdev, struct promise_raid_conf *p)
         */
        sb_offset = calc_pdcblock_offset(bdev);
 
-       if (sb_offset==0)
-               return -1;      
+       if (sb_offset == 0)
+               return -1;
 
-       for (i = 0, buffer = (char*)p; i < 4; i++, buffer += 512) {
+       for (i = 0, buffer = (char *) p; i < 4; i++, buffer += 512) {
                Sector sect;
                char *q = read_dev_sector(bdev, sb_offset + i, &sect);
                if (!p) {
-                       printk(KERN_ERR "pdcraid: Error reading superblock.\n");
+                       printk(KERN_ERR
+                              "pdcraid: Error reading superblock.\n");
                        return -1;
                }
                memcpy(buffer, q, 512);
@@ -423,127 +478,133 @@ static int read_disk_sb(struct block_device *bdev, struct promise_raid_conf *p)
        return 0;
 }
 
-static unsigned int calc_sb_csum (unsigned int* ptr)
-{      
+static unsigned int calc_sb_csum(unsigned int *ptr)
+{
        unsigned int sum;
        int count;
-       
+
        sum = 0;
-       for (count=0;count<511;count++)
+       for (count = 0; count < 511; count++)
                sum += *ptr++;
-       
+
        return sum;
 }
 
 static int cookie = 0;
 
 static struct promise_raid_conf __initdata prom;
-static void __init probedisk(int devindex,int device, int raidlevel)
+static void __init probedisk(int devindex, int device, int raidlevel)
 {
        int i;
        int major, minor;
        struct block_device *bdev;
 
-       if (devlist[devindex].device!=-1) /* already assigned to another array */
+       if (devlist[devindex].device != -1)     /* already assigned to another array */
                return;
-       
+
        major = devlist[devindex].major;
-       minor = devlist[devindex].minor; 
+       minor = devlist[devindex].minor;
 
-       bdev = bdget(mk_kdev(major,minor));
+       bdev = bdget(mk_kdev(major, minor));
        if (!bdev)
                return;
 
-       if (blkdev_get(bdev, FMODE_READ|FMODE_WRITE, 0, BDEV_RAW) != 0)
+       if (blkdev_get(bdev, FMODE_READ | FMODE_WRITE, 0, BDEV_RAW) != 0)
                return;
 
-        if (read_disk_sb(bdev, &prom))
-               goto out;
+       if (read_disk_sb(bdev, &prom))
+               goto out;
 
-        /* the checksums must match */
-       if (prom.checksum != calc_sb_csum((unsigned int*)&prom))
+       /* the checksums must match */
+       if (prom.checksum != calc_sb_csum((unsigned int *) &prom))
                goto out;
-       if (prom.raid.type!=raidlevel) /* different raidlevel */
+       if (prom.raid.type != raidlevel)        /* different raidlevel */
                goto out;
 
-       if ((cookie!=0) && (cookie != prom.raid.magic_1)) /* different array */
+       if ((cookie != 0) && (cookie != prom.raid.magic_1))     /* different array */
                goto out;
-       
+
        cookie = prom.raid.magic_1;
 
        /* This looks evil. But basically, we have to search for our adapternumber
-          in the arraydefinition, both of which are in the superblock */       
-        for (i=0;(i<prom.raid.total_disks)&&(i<8);i++) {
-               if ( (prom.raid.disk[i].channel== prom.raid.channel) &&
-                    (prom.raid.disk[i].device == prom.raid.device) ) {
+          in the arraydefinition, both of which are in the superblock */
+       for (i = 0; (i < prom.raid.total_disks) && (i < 8); i++) {
+               if ((prom.raid.disk[i].channel == prom.raid.channel) &&
+                   (prom.raid.disk[i].device == prom.raid.device)) {
 
                        raid[device].disk[i].bdev = bdev;
-                       raid[device].disk[i].device = mk_kdev(major,minor);
+                       raid[device].disk[i].device =
+                           mk_kdev(major, minor);
                        raid[device].disk[i].sectors = prom.raid.disk_secs;
-                       raid[device].stride = (1<<prom.raid.raid0_shift);
+                       raid[device].stride = (1 << prom.raid.raid0_shift);
                        raid[device].disks = prom.raid.total_disks;
                        raid[device].sectors = prom.raid.total_secs;
-                       raid[device].geom.heads = prom.raid.heads+1;
+                       raid[device].geom.heads = prom.raid.heads + 1;
                        raid[device].geom.sectors = prom.raid.sectors;
-                       raid[device].geom.cylinders = prom.raid.cylinders+1;
-                       devlist[devindex].device=device;
+                       raid[device].geom.cylinders =
+                           prom.raid.cylinders + 1;
+                       devlist[devindex].device = device;
                        return;
                }
-        }
-out:
+       }
+      out:
        blkdev_put(bdev, BDEV_RAW);
 }
 
 static void __init fill_cutoff(int device)
 {
-       int i,j;
+       int i, j;
        unsigned long smallest;
        unsigned long bar;
        int count;
-       
+
        bar = 0;
-       for (i=0;i<8;i++) {
+       for (i = 0; i < 8; i++) {
                smallest = ~0;
-               for (j=0;j<8;j++) 
-                       if ((raid[device].disk[j].sectors < smallest) && (raid[device].disk[j].sectors>bar))
+               for (j = 0; j < 8; j++)
+                       if ((raid[device].disk[j].sectors < smallest)
+                           && (raid[device].disk[j].sectors > bar))
                                smallest = raid[device].disk[j].sectors;
                count = 0;
-               for (j=0;j<8;j++) 
+               for (j = 0; j < 8; j++)
                        if (raid[device].disk[j].sectors >= smallest)
                                count++;
-                               
+
                smallest = smallest * count;
                bar = smallest;
                raid[device].cutoff[i] = smallest;
                raid[device].cutoff_disks[i] = count;
        }
 }
-                          
-static __init int pdcraid_init_one(int device,int raidlevel)
+
+static __init int pdcraid_init_one(int device, int raidlevel)
 {
        int i, count;
 
-       for (i=0; i<14; i++)
+       for (i = 0; i < 14; i++)
                probedisk(i, device, raidlevel);
-       
-       if (raidlevel==0)
+
+       if (raidlevel == 0)
                fill_cutoff(device);
-       
+
        /* Initialize the gendisk structure */
-       
-       ataraid_register_disk(device,raid[device].sectors);        
-               
-       count=0;
-       
-       for (i=0;i<8;i++) {
-               if (raid[device].disk[i].device!=0) {
+
+       ataraid_register_disk(device, raid[device].sectors);
+
+       count = 0;
+
+       for (i = 0; i < 8; i++) {
+               if (raid[device].disk[i].device != 0) {
                        printk(KERN_INFO "Drive %i is %li Mb (%i / %i) \n",
-                               i,raid[device].disk[i].sectors/2048,major(raid[device].disk[i].device),minor(raid[device].disk[i].device));
+                              i, raid[device].disk[i].sectors / 2048,
+                              major(raid[device].disk[i].device),
+                              minor(raid[device].disk[i].device));
                        count++;
                }
        }
        if (count) {
-               printk(KERN_INFO "Raid%i array consists of %i drives. \n",raidlevel,count);
+               printk(KERN_INFO "Raid%i array consists of %i drives. \n",
+                      raidlevel, count);
                return 0;
        } else {
                return -ENODEV;
@@ -556,10 +617,10 @@ static __init int pdcraid_init(void)
 
        do {
                cookie = 0;
-               device=ataraid_get_device(&pdcraid0_ops);
-               if (device<0)
+               device = ataraid_get_device(&pdcraid0_ops);
+               if (device < 0)
                        break;
-               retval = pdcraid_init_one(device,0);
+               retval = pdcraid_init_one(device, 0);
                if (retval) {
                        ataraid_release_device(device);
                        break;
@@ -569,12 +630,12 @@ static __init int pdcraid_init(void)
        } while (1);
 
        do {
-       
+
                cookie = 0;
-               device=ataraid_get_device(&pdcraid1_ops);
-               if (device<0)
+               device = ataraid_get_device(&pdcraid1_ops);
+               if (device < 0)
                        break;
-               retval = pdcraid_init_one(device,1);
+               retval = pdcraid_init_one(device, 1);
                if (retval) {
                        ataraid_release_device(device);
                        break;
@@ -584,35 +645,38 @@ static __init int pdcraid_init(void)
        } while (1);
 
        if (count) {
-               printk(KERN_INFO "Promise Fasttrak(tm) Softwareraid driver for linux version 0.03beta\n");
+               printk(KERN_INFO
+                      "Promise Fasttrak(tm) Softwareraid driver for linux version 0.03beta\n");
                return 0;
        }
-       printk(KERN_DEBUG "Promise Fasttrak(tm) Softwareraid driver 0.03beta: No raid array found\n");
+       printk(KERN_DEBUG
+              "Promise Fasttrak(tm) Softwareraid driver 0.03beta: No raid array found\n");
        return -ENODEV;
 }
 
-static void __exit pdcraid_exit (void)
+static void __exit pdcraid_exit(void)
 {
-       int i,device;
-       for (device = 0; device<16; device++) {
-               for (i=0;i<8;i++) {
-                       struct block_device *bdev = raid[device].disk[i].bdev;
+       int i, device;
+       for (device = 0; device < 16; device++) {
+               for (i = 0; i < 8; i++) {
+                       struct block_device *bdev =
+                           raid[device].disk[i].bdev;
                        raid[device].disk[i].bdev = NULL;
                        if (bdev)
                                blkdev_put(bdev, BDEV_RAW);
-               }       
+               }
                if (raid[device].sectors)
                        ataraid_release_device(device);
        }
 }
 
-static int pdcraid_open(struct inode * inode, struct file * filp) 
+static int pdcraid_open(struct inode *inode, struct file *filp)
 {
        MOD_INC_USE_COUNT;
        return 0;
 }
-static int pdcraid_release(struct inode * inode, struct file * filp)
-{      
+static int pdcraid_release(struct inode *inode, struct file *filp)
+{
        MOD_DEC_USE_COUNT;
        return 0;
 }
index 111d451dd3e703a8effa1b45e2de14ffa9c260bb..a5fb9998bf5627e11362e411980650a1dde0a3d6 100644 (file)
@@ -388,130 +388,130 @@ static void __init piix_init_dma(struct ata_channel *ch, unsigned long dmabase)
 /* module data table */
 static struct ata_pci_device chipsets[] __initdata = {
        {
-               vendor: PCI_VENDOR_ID_INTEL,
-               device: PCI_DEVICE_ID_INTEL_82371FB_1,
-               init_chipset: piix_init_chipset,
-               init_channel: piix_init_channel,
-               init_dma: piix_init_dma,
-               enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_INTEL,
+               .device = PCI_DEVICE_ID_INTEL_82371FB_1,
+               .init_chipset = piix_init_chipset,
+               .init_channel = piix_init_channel,
+               .init_dma = piix_init_dma,
+               .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
+               .bootable = ON_BOARD
        },
        {
-               vendor: PCI_VENDOR_ID_INTEL,
-               device: PCI_DEVICE_ID_INTEL_82371SB_1,
-               init_chipset: piix_init_chipset,
-               init_channel: piix_init_channel,
-               init_dma: piix_init_dma,
-               enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_INTEL,
+               .device = PCI_DEVICE_ID_INTEL_82371SB_1,
+               .init_chipset = piix_init_chipset,
+               .init_channel = piix_init_channel,
+               .init_dma = piix_init_dma,
+               .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
+               .bootable = ON_BOARD
        },
        {
-               vendor: PCI_VENDOR_ID_INTEL,
-               device: PCI_DEVICE_ID_INTEL_82371AB,
-               init_chipset: piix_init_chipset,
-               init_channel: piix_init_channel,
-               init_dma: piix_init_dma,
-               enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_INTEL,
+               .device = PCI_DEVICE_ID_INTEL_82371AB,
+               .init_chipset = piix_init_chipset,
+               .init_channel = piix_init_channel,
+               .init_dma = piix_init_dma,
+               .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
+               .bootable = ON_BOARD
        },
        {
-               vendor: PCI_VENDOR_ID_INTEL,
-               device: PCI_DEVICE_ID_INTEL_82443MX_1,
-               init_chipset: piix_init_chipset,
-               init_channel: piix_init_channel,
-               init_dma: piix_init_dma,
-               enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_INTEL,
+               .device = PCI_DEVICE_ID_INTEL_82443MX_1,
+               .init_chipset = piix_init_chipset,
+               .init_channel = piix_init_channel,
+               .init_dma = piix_init_dma,
+               .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
+               .bootable = ON_BOARD
        },
        {
-               vendor: PCI_VENDOR_ID_INTEL,
-               device: PCI_DEVICE_ID_INTEL_82372FB_1,
-               init_chipset: piix_init_chipset,
-               init_channel: piix_init_channel,
-               init_dma: piix_init_dma,
-               enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_INTEL,
+               .device = PCI_DEVICE_ID_INTEL_82372FB_1,
+               .init_chipset = piix_init_chipset,
+               .init_channel = piix_init_channel,
+               .init_dma = piix_init_dma,
+               .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
+               .bootable = ON_BOARD
        },
        {
-               vendor: PCI_VENDOR_ID_INTEL,
-               device: PCI_DEVICE_ID_INTEL_82801AA_1,
-               init_chipset: piix_init_chipset,
-               init_channel: piix_init_channel,
-               init_dma: piix_init_dma,
-               enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_INTEL,
+               .device = PCI_DEVICE_ID_INTEL_82801AA_1,
+               .init_chipset = piix_init_chipset,
+               .init_channel = piix_init_channel,
+               .init_dma = piix_init_dma,
+               .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
+               .bootable = ON_BOARD
        },
        {
-               vendor: PCI_VENDOR_ID_INTEL,
-               device: PCI_DEVICE_ID_INTEL_82801AB_1,
-               init_chipset: piix_init_chipset,
-               init_channel: piix_init_channel,
-               init_dma: piix_init_dma,
-               enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_INTEL,
+               .device = PCI_DEVICE_ID_INTEL_82801AB_1,
+               .init_chipset = piix_init_chipset,
+               .init_channel = piix_init_channel,
+               .init_dma = piix_init_dma,
+               .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
+               .bootable = ON_BOARD
        },
        {
-               vendor: PCI_VENDOR_ID_INTEL,
-               device: PCI_DEVICE_ID_INTEL_82801BA_9,
-               init_chipset: piix_init_chipset,
-               init_channel: piix_init_channel,
-               init_dma: piix_init_dma,
-               enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_INTEL,
+               .device = PCI_DEVICE_ID_INTEL_82801BA_9,
+               .init_chipset = piix_init_chipset,
+               .init_channel = piix_init_channel,
+               .init_dma = piix_init_dma,
+               .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
+               .bootable = ON_BOARD
        },
        {
-               vendor: PCI_VENDOR_ID_INTEL,
-               device: PCI_DEVICE_ID_INTEL_82801BA_8,
-               init_chipset: piix_init_chipset,
-               init_channel: piix_init_channel,
-               init_dma: piix_init_dma,
-               enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_INTEL,
+               .device = PCI_DEVICE_ID_INTEL_82801BA_8,
+               .init_chipset = piix_init_chipset,
+               .init_channel = piix_init_channel,
+               .init_dma = piix_init_dma,
+               .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
+               .bootable = ON_BOARD
        },
        {
-               vendor: PCI_VENDOR_ID_INTEL,
-               device: PCI_DEVICE_ID_INTEL_82801E_9,
-               init_chipset: piix_init_chipset,
-               init_channel: piix_init_channel,
-               init_dma: piix_init_dma,
-               enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_INTEL,
+               .device = PCI_DEVICE_ID_INTEL_82801E_9,
+               .init_chipset = piix_init_chipset,
+               .init_channel = piix_init_channel,
+               .init_dma = piix_init_dma,
+               .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
+               .bootable = ON_BOARD
        },
        {
-               vendor: PCI_VENDOR_ID_INTEL,
-               device: PCI_DEVICE_ID_INTEL_82801CA_10,
-               init_chipset: piix_init_chipset,
-               init_channel: piix_init_channel,
-               init_dma: piix_init_dma,
-               enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_INTEL,
+               .device = PCI_DEVICE_ID_INTEL_82801CA_10,
+               .init_chipset = piix_init_chipset,
+               .init_channel = piix_init_channel,
+               .init_dma = piix_init_dma,
+               .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
+               .bootable = ON_BOARD
        },
        {
-               vendor: PCI_VENDOR_ID_INTEL,
-               device: PCI_DEVICE_ID_INTEL_82801CA_11,
-               init_chipset: piix_init_chipset,
-               init_channel: piix_init_channel,
-               init_dma: piix_init_dma,
-               enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_INTEL,
+               .device = PCI_DEVICE_ID_INTEL_82801CA_11,
+               .init_chipset = piix_init_chipset,
+               .init_channel = piix_init_channel,
+               .init_dma = piix_init_dma,
+               .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
+               .bootable = ON_BOARD
        },
        {
-               vendor: PCI_VENDOR_ID_INTEL,
-               device: PCI_DEVICE_ID_INTEL_82801DB_9,
-               init_chipset: piix_init_chipset,
-               init_channel: piix_init_channel,
-               init_dma: piix_init_dma,
-               enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_INTEL,
+               .device = PCI_DEVICE_ID_INTEL_82801DB_9,
+               .init_chipset = piix_init_chipset,
+               .init_channel = piix_init_channel,
+               .init_dma = piix_init_dma,
+               .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
+               .bootable = ON_BOARD
        },
        {
-               vendor: PCI_VENDOR_ID_EFAR,
-               device: PCI_DEVICE_ID_EFAR_SLC90E66_1,
-               init_chipset: piix_init_chipset,
-               init_channel: piix_init_channel,
-               init_dma: piix_init_dma,
-               enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_EFAR,
+               .device = PCI_DEVICE_ID_EFAR_SLC90E66_1,
+               .init_chipset = piix_init_chipset,
+               .init_channel = piix_init_channel,
+               .init_dma = piix_init_dma,
+               .enablebits = {{0x41,0x80,0x80}, {0x43,0x80,0x80}},
+               .bootable = ON_BOARD
        },
 };
 
@@ -519,9 +519,8 @@ int __init init_piix(void)
 {
        int i;
 
-       for (i = 0; i < ARRAY_SIZE(chipsets); ++i) {
+       for (i = 0; i < ARRAY_SIZE(chipsets); ++i)
                ata_register_chipset(&chipsets[i]);
-       }
 
        return 0;
 }
index da683c0783f5575c87588f38e1d3f8a83a3b8ed5..3bdb1de45817731c11887d1048ecc5201333ff83 100644 (file)
@@ -403,7 +403,7 @@ static inline void do_identify(struct ata_device *drive, u8 cmd)
         */
 
        ata_read(drive, id, SECTOR_WORDS);
-       ide__sti();     /* local CPU only */
+       local_irq_enable();
        ata_fix_driveid(id);
 
        if (id->word156 == 0x4d42) {
@@ -616,12 +616,12 @@ static int identify(struct ata_device *drive, u8 cmd)
 
        if (ata_status(drive, DRQ_STAT, BAD_R_STAT)) {
                unsigned long flags;
-               __save_flags(flags);            /* local CPU only */
-               __cli();                        /* local CPU only; some systems need this */
+
+               local_irq_save(flags);          /* some systems need this */
                do_identify(drive, cmd);        /* drive returned ID */
                rc = 0;                         /* drive responded with ID */
                ata_status(drive, 0, 0);        /* clear drive IRQ */
-               __restore_flags(flags);         /* local CPU only */
+               local_irq_restore(flags);       /* local CPU only */
        } else
                rc = 2;                 /* drive refused ID */
 
@@ -733,8 +733,8 @@ static void channel_probe(struct ata_channel *ch)
 
        ch->straight8 = 0;
 
-       __save_flags(flags);    /* local CPU only */
-       __sti();                /* local CPU only; needed for jiffies and irq probing */
+       __save_flags(flags);
+       local_irq_enable();     /* needed for jiffies and irq probing */
 
        /*
         * Check for the presence of a channel by probing for drives on it.
@@ -852,7 +852,7 @@ static void channel_probe(struct ata_channel *ch)
        if (ch->reset)
                ata_reset(ch);
 
-       __restore_flags(flags); /* local CPU only */
+       __restore_flags(flags);
 
        /*
         * Now setup the PIO transfer modes of the drives on this channel.
index ce37509af397344308f40e9b5071326bb9857da5..eebbfb582413841201ed0eab9527cba2655ff4fd 100644 (file)
@@ -57,7 +57,7 @@ static const int pcide_offsets[IDE_NR_PORTS] = {
 
 static int q40ide_default_irq(q40ide_ioreg_t base)
 {
-           switch (base) { 
+           switch (base) {
                    case 0x1f0: return 14;
                    case 0x170: return 15;
                    case 0x1e8: return 11;
@@ -66,12 +66,9 @@ static int q40ide_default_irq(q40ide_ioreg_t base)
           }
 }
 
-
-
-    /*
-     *  Probe for Q40 IDE interfaces
-     */
-
+/*
+ *  Probe for Q40 IDE interfaces
+ */
 void q40ide_init(void)
 {
     int i;
index 2538ba50b6d3aef9a1cddb11da1a1f13e806a3f2..b1bad3dcfb1671dfde4793a7c0c27a35072af0f3 100644 (file)
@@ -51,16 +51,16 @@ static void __init rz1000_init_channel(struct ata_channel *hwif)
 /* module data table */
 static struct ata_pci_device chipsets[] __initdata = {
        {
-               vendor: PCI_VENDOR_ID_PCTECH,
-               device: PCI_DEVICE_ID_PCTECH_RZ1000,
-               init_channel: rz1000_init_channel,
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_PCTECH,
+               .device = PCI_DEVICE_ID_PCTECH_RZ1000,
+               .init_channel = rz1000_init_channel,
+               .bootable = ON_BOARD
        },
        {
-               vendor: PCI_VENDOR_ID_PCTECH,
-               device: PCI_DEVICE_ID_PCTECH_RZ1001,
-               init_channel: rz1000_init_channel,
-               bootable: ON_BOARD
+               .vendor = PCI_VENDOR_ID_PCTECH,
+               .device = PCI_DEVICE_ID_PCTECH_RZ1001,
+               .init_channel = rz1000_init_channel,
+               .bootable = ON_BOARD
        },
 };
 
@@ -68,9 +68,8 @@ int __init init_rz1000(void)
 {
        int i;
 
-       for (i = 0; i < ARRAY_SIZE(chipsets); ++i) {
+       for (i = 0; i < ARRAY_SIZE(chipsets); ++i)
                ata_register_chipset(&chipsets[i]);
-       }
 
         return 0;
 }
index 798bc253bdcea4347f765d56064ffe1b17501051..ff8e39ef3b9f4d67a9454086dcbb589abbd67b63 100644 (file)
@@ -394,20 +394,20 @@ static void __init ide_init_svwks(struct ata_channel *hwif)
 /* module data table */
 static struct ata_pci_device chipsets[] __initdata = {
         {
-               vendor: PCI_VENDOR_ID_SERVERWORKS,
-               device: PCI_DEVICE_ID_SERVERWORKS_OSB4IDE,
-               init_chipset: svwks_init_chipset,
-               init_channel: ide_init_svwks,
-               bootable: ON_BOARD,
-               flags: ATA_F_DMA
+               .vendor = PCI_VENDOR_ID_SERVERWORKS,
+               .device = PCI_DEVICE_ID_SERVERWORKS_OSB4IDE,
+               .init_chipset = svwks_init_chipset,
+               .init_channel = ide_init_svwks,
+               .bootable = ON_BOARD,
+               .flags = ATA_F_DMA
        },
        {
-               vendor: PCI_VENDOR_ID_SERVERWORKS,
-               device: PCI_DEVICE_ID_SERVERWORKS_CSB5IDE,
-               init_chipset: svwks_init_chipset,
-               init_channel: ide_init_svwks,
-               bootable: ON_BOARD,
-               flags: ATA_F_SIMPLEX
+               .vendor = PCI_VENDOR_ID_SERVERWORKS,
+               .device = PCI_DEVICE_ID_SERVERWORKS_CSB5IDE,
+               .init_chipset = svwks_init_chipset,
+               .init_channel = ide_init_svwks,
+               .bootable = ON_BOARD,
+               .flags = ATA_F_SIMPLEX
        },
 };
 
index e83fe6667b62cc2a67afe45d0d761bca73e58406..fb1a56cd01403cb472c8a494e972eca6329d9226 100644 (file)
@@ -505,12 +505,12 @@ static void __init ide_init_sis5513(struct ata_channel *hwif)
 
 /* module data table */
 static struct ata_pci_device chipset __initdata = {
-       vendor: PCI_VENDOR_ID_SI,
-       device: PCI_DEVICE_ID_SI_5513,
-       init_chipset: pci_init_sis5513,
-       init_channel: ide_init_sis5513,
-       enablebits: {{0x4a,0x02,0x02}, {0x4a,0x04,0x04} },
-       bootable: ON_BOARD,
+       .vendor = PCI_VENDOR_ID_SI,
+       .device = PCI_DEVICE_ID_SI_5513,
+       .init_chipset = pci_init_sis5513,
+       .init_channel = ide_init_sis5513,
+       .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04} },
+       .bootable = ON_BOARD,
 };
 
 int __init init_sis5513(void)
index abaa3d61a8d8d9a6019c34380841f5cfd932c878..488b0018bb43f50123f9999ae1bf64da5e1d7c3e 100644 (file)
@@ -360,13 +360,13 @@ static void __init sl82c105_init_channel(struct ata_channel *ch)
 
 /* module data table */
 static struct ata_pci_device chipset __initdata = {
-       vendor: PCI_VENDOR_ID_WINBOND,
-       device: PCI_DEVICE_ID_WINBOND_82C105,
-       init_chipset: sl82c105_init_chipset,
-       init_channel: sl82c105_init_channel,
-       init_dma: sl82c105_init_dma,
-       enablebits: { {0x40,0x01,0x01}, {0x40,0x10,0x10} },
-       bootable: ON_BOARD
+       .vendor = PCI_VENDOR_ID_WINBOND,
+       .device = PCI_DEVICE_ID_WINBOND_82C105,
+       .init_chipset = sl82c105_init_chipset,
+       .init_channel = sl82c105_init_channel,
+       .init_dma = sl82c105_init_dma,
+       .enablebits = { {0x40,0x01,0x01}, {0x40,0x10,0x10} },
+       .bootable = ON_BOARD
 };
 
 int __init init_sl82c105(void)
index 2d05fd15fb49460c31b2cb23f13cfc32ec317878..83c63ff13f7d5f875d06ef5fbe5f6eb3283dfe98 100644 (file)
@@ -61,7 +61,7 @@ static ide_startstop_t tcq_nop_handler(struct ata_device *drive, struct request
        struct ata_taskfile *args = rq->special;
        struct ata_channel *ch = drive->channel;
 
-       ide__sti();
+       local_irq_enable();
 
        spin_lock_irqsave(ch->lock, flags);
 
index 0e6587f651525290234bb395322658a914c74962..4e1995b62a47a1781f67838b44320dc3fc7422f5 100644 (file)
@@ -151,8 +151,7 @@ static void trm290_prepare_drive(struct ata_device *drive, unsigned int use_dma)
        /* select PIO or DMA */
        reg = use_dma ? (0x21 | 0x82) : (0x21 & ~0x82);
 
-       __save_flags(flags);    /* local CPU only */
-       __cli();                /* local CPU only */
+       local_irq_save(flags);
 
        if (reg != hwif->select_data) {
                hwif->select_data = reg;
@@ -167,7 +166,7 @@ static void trm290_prepare_drive(struct ata_device *drive, unsigned int use_dma)
                outw(reg, hwif->config_data+3);
        }
 
-       __restore_flags(flags); /* local CPU only */
+       local_irq_restore(flags);
 }
 
 static void trm290_selectproc(struct ata_device *drive)
@@ -266,8 +265,7 @@ static void __init trm290_init_channel(struct ata_channel *hwif)
                printk("TRM290: using default config base at 0x%04lx\n", hwif->config_data);
        }
 
-       __save_flags(flags);    /* local CPU only */
-       __cli();                /* local CPU only */
+       local_irq_save(flags);
        /* put config reg into first byte of hwif->select_data */
        outb(0x51|(hwif->unit<<3), hwif->config_data+1);
        hwif->select_data = 0x21;                       /* select PIO as default */
@@ -275,7 +273,7 @@ static void __init trm290_init_channel(struct ata_channel *hwif)
        reg = inb(hwif->config_data+3);                 /* get IRQ info */
        reg = (reg & 0x10) | 0x03;                      /* mask IRQs for both ports */
        outb(reg, hwif->config_data+3);
-       __restore_flags(flags); /* local CPU only */
+       local_irq_restore(flags);
 
        if ((reg & 0x10))
                hwif->irq = hwif->unit ? 15 : 14;       /* legacy mode */
@@ -327,10 +325,10 @@ static void __init trm290_init_channel(struct ata_channel *hwif)
 
 /* module data table */
 static struct ata_pci_device chipset __initdata = {
-       vendor: PCI_VENDOR_ID_TEKRAM,
-       device: PCI_DEVICE_ID_TEKRAM_DC290,
-       init_channel: trm290_init_channel,
-       bootable: ON_BOARD
+       .vendor = PCI_VENDOR_ID_TEKRAM,
+       .device = PCI_DEVICE_ID_TEKRAM_DC290,
+       .init_channel = trm290_init_channel,
+       .bootable = ON_BOARD
 };
 
 int __init init_trm290(void)
index 2769442f4e332d45a7dcfc0e38842aa014f81bbe..fb7f1a6116b956a1b9b1cb7bb361b3397b2845bf 100644 (file)
@@ -127,30 +127,29 @@ void __init init_umc8672(void)    /* called from ide.c */
 {
        unsigned long flags;
 
-       __save_flags(flags);    /* local CPU only */
-       __cli();                /* local CPU only */
+       local_irq_save(flags);
        if (!request_region(0x108, 2, "umc8672")) {
-               __restore_flags(flags);
+               local_irq_restore(flags);
                printk("\numc8672: PORTS 0x108-0x109 ALREADY IN USE\n");
                return;
        }
        outb_p (0x5A,0x108); /* enable umc */
        if (in_umc (0xd5) != 0xa0)
        {
-               __restore_flags(flags); /* local CPU only */
-               release_region(0x108, 2); 
+               local_irq_restore(flags);
+               release_region(0x108, 2);
                printk ("umc8672: not found\n");
                return;
        }
        outb_p (0xa5,0x108); /* disable umc */
 
-       umc_set_speeds (current_speeds);
-       __restore_flags(flags); /* local CPU only */
+       umc_set_speeds(current_speeds);
+       local_irq_restore(flags);
 
        ide_hwifs[0].chipset = ide_umc8672;
        ide_hwifs[1].chipset = ide_umc8672;
-       ide_hwifs[0].tuneproc = &tune_umc;
-       ide_hwifs[1].tuneproc = &tune_umc;
+       ide_hwifs[0].tuneproc = tune_umc;
+       ide_hwifs[1].tuneproc = tune_umc;
        ide_hwifs[0].unit = ATA_PRIMARY;
        ide_hwifs[1].unit = ATA_SECONDARY;
 }
index 1706d4b6f42ebbaa697931d5dc0958c9b083bf16..54838f9a8975c0b75d2132f8bcb95e78a38ed524 100644 (file)
@@ -380,22 +380,22 @@ static void __init via82cxxx_init_dma(struct ata_channel *hwif, unsigned long dm
 /* module data table */
 static struct ata_pci_device chipsets[] __initdata = {
        {
-               vendor: PCI_VENDOR_ID_VIA,
-               device: PCI_DEVICE_ID_VIA_82C576_1,
-               init_chipset: via82cxxx_init_chipset,
-               init_channel: via82cxxx_init_channel,
-               init_dma: via82cxxx_init_dma,
-               enablebits: {{0x40,0x02,0x02}, {0x40,0x01,0x01}},
-               bootable: ON_BOARD,
+               .vendor = PCI_VENDOR_ID_VIA,
+               .device = PCI_DEVICE_ID_VIA_82C576_1,
+               .init_chipset = via82cxxx_init_chipset,
+               .init_channel = via82cxxx_init_channel,
+               .init_dma = via82cxxx_init_dma,
+               .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}},
+               .bootable = ON_BOARD,
        },
        {
-               vendor: PCI_VENDOR_ID_VIA,
-               device: PCI_DEVICE_ID_VIA_82C586_1,
-               init_chipset: via82cxxx_init_chipset,
-               init_channel: via82cxxx_init_channel,
-               init_dma: via82cxxx_init_dma,
-               enablebits: {{0x40,0x02,0x02}, {0x40,0x01,0x01}},
-               bootable: ON_BOARD,
+               .vendor = PCI_VENDOR_ID_VIA,
+               .device = PCI_DEVICE_ID_VIA_82C586_1,
+               .init_chipset = via82cxxx_init_chipset,
+               .init_channel = via82cxxx_init_channel,
+               .init_dma = via82cxxx_init_dma,
+               .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}},
+               .bootable = ON_BOARD,
        },
 };
 
@@ -403,9 +403,8 @@ int __init init_via82cxxx(void)
 {
        int i;
 
-       for (i = 0; i < ARRAY_SIZE(chipsets); ++i) {
+       for (i = 0; i < ARRAY_SIZE(chipsets); ++i)
                ata_register_chipset(&chipsets[i]);
-       }
 
        return 0;
 }
index 1f001b4172cc8e71b6967c6a81cdfcef9b3d7686..6cb967d14650f512612bebafcf2f4ea4ea53f9aa 100644 (file)
@@ -318,10 +318,11 @@ static ide_startstop_t idescsi_pc_intr(struct ata_device *drive, struct request
        if (ata_status(drive, 0, DRQ_STAT)) {   /* No more interrupts */
                if (test_bit(IDESCSI_LOG_CMD, &scsi->log))
                        printk (KERN_INFO "Packet command completed, %d bytes transferred\n", pc->actually_transferred);
-               ide__sti();
+               local_irq_enable();
                if (drive->status & ERR_STAT)
                        rq->errors++;
                idescsi_end_request(drive, rq, 1);
+
                return ATA_OP_FINISHED;
        }
        bcount = IN_BYTE (IDE_BCOUNTH_REG) << 8 | IN_BYTE (IDE_BCOUNTL_REG);
index 5ec5fe1da2c1c95781b645ae56e8268ef96ecb73..63bb9f785498b31e7f24ed8c4425f49b86860420 100644 (file)
@@ -19,8 +19,6 @@
 #define MAX_HWIFS      4
 #endif
 
-#define ide__sti()     __sti()
-
 static __inline__ int ide_default_irq(ide_ioreg_t base)
 {
        switch (base) {
index f1cbbe4876ea86b737b2ab412c21c9522d3a5a15..741b223b06f0d57e8d26d150b261d5c245eab666 100644 (file)
@@ -17,8 +17,6 @@
 #define MAX_HWIFS      4
 #endif
 
-#define ide__sti()     __sti()
-
 #include <asm/arch/ide.h>
 
 /*
index 051e96142e10766f40a340d8baeba29d904c1d7e..8f4bd8c131f4df76044cd87879774249d51d7b2d 100644 (file)
@@ -22,8 +22,6 @@
 
 #define MAX_HWIFS      4
 
-#define ide__sti()     __sti()
-
 static __inline__ int ide_default_irq(ide_ioreg_t base)
 {
        /* all IDE busses share the same IRQ, number 4.
index 9bec7f280cde24cc9307c3bec3e891b0a86da004..b2ad635bdf946891cbf2d687a575b2867691fe32 100644 (file)
@@ -23,8 +23,6 @@
 # endif
 #endif
 
-#define ide__sti()     __sti()
-
 static __inline__ int ide_default_irq(ide_ioreg_t base)
 {
        switch (base) {
index 50370ff4de3ddb8a8e5b911644f2fcb4eeed5e5c..3c9fe491018191450f1e292c2cec6f59abda485c 100644 (file)
@@ -25,8 +25,6 @@
 # endif
 #endif
 
-#define ide__sti()     __sti()
-
 static __inline__ int
 ide_default_irq (ide_ioreg_t base)
 {
index 28c7e66668eaa26f6231486b7251487b4c6e5222..1471687982a93fca2b52f71487ebc2856e579e58 100644 (file)
@@ -171,36 +171,5 @@ static __inline__ void ide_get_lock (int *ide_lock, void (*handler)(int, void *,
        }
 }
 #endif /* CONFIG_ATARI */
-
-/*
- * On the Atari, we sometimes can't enable interrupts:
- */
-
-/* MSch: changed sti() to STI() wherever possible in ide.c; moved STI() def. 
- * to asm/ide.h 
- */
-/* The Atari interrupt structure strictly requires that the IPL isn't lowered
- * uncontrolled in an interrupt handler. In the concrete case, the IDE
- * interrupt is already a slow int, so the irq is already disabled at the time
- * the handler is called, and the IPL has been lowered to the minimum value
- * possible. To avoid going below that, STI() checks for being called inside
- * an interrupt, and in that case it does nothing. Hope that is reasonable and
- * works. (Roman)
- */
-#ifdef MACH_ATARI_ONLY
-#define        ide__sti()                                      \
-    do {                                               \
-       if (!in_interrupt()) __sti();                   \
-    } while(0)
-#elif defined(CONFIG_ATARI)
-#define        ide__sti()                                              \
-    do {                                                       \
-       if (!MACH_IS_ATARI || !in_interrupt()) sti();           \
-    } while(0)
-#else /* !defined(CONFIG_ATARI) */
-#define        ide__sti()      __sti()
-#endif
-
 #endif /* __KERNEL__ */
-
 #endif /* _M68K_IDE_H */
index 85447877a181e57a1f453efe0a1ec670128b698f..33cd055aea35240748ddf40aefecd65c10ea3686 100644 (file)
@@ -24,8 +24,6 @@
 # endif
 #endif
 
-#define ide__sti()     __sti()
-
 struct ide_ops {
        int (*ide_default_irq)(ide_ioreg_t base);
        ide_ioreg_t (*ide_default_io_base)(int index);
index ce6635f97a0c10481b7b981747f71541de28b431..de357ad5070e28df1b3247e80074fa324f887a68 100644 (file)
@@ -27,8 +27,6 @@
 # endif
 #endif
 
-#define ide__sti()     __sti()
-
 struct ide_ops {
        int (*ide_default_irq)(ide_ioreg_t base);
        ide_ioreg_t (*ide_default_io_base)(int index);
index 133997006872ca4d7e0e28d4fd67f2323cd6510e..be46fbf6af799f39ce99a3ba7b4c5516f1398ce9 100644 (file)
@@ -19,8 +19,6 @@
 #define MAX_HWIFS      10
 #endif
 
-#define ide__sti()     __sti()
-
 static __inline__ int ide_default_irq(ide_ioreg_t base)
 {
        switch (base) {
index 48dafbc1655bd3f1352f1f5a5d4e6abc280e2717..db9bd31d08c57877c9e192e3b3875f71b092c164 100644 (file)
@@ -44,8 +44,6 @@ extern struct ide_machdep_calls ppc_ide_md;
 #undef SUPPORT_SLOW_DATA_PORTS
 #define        SUPPORT_SLOW_DATA_PORTS 0
 
-#define ide__sti()     __sti()
-
 static __inline__ int ide_default_irq(ide_ioreg_t base)
 {
        if (ppc_ide_md.default_irq)
index 4752dee41b2fdff26996254b9cf5fa558a01eed7..717dd566c7e724e8cf0ad47ace751e1d4e1f9cf4 100644 (file)
@@ -7,7 +7,7 @@
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
- */ 
+ */
 
 /*
  *  This file contains the ppc64 architecture specific IDE code.
 #ifdef __KERNEL__
 
 #ifndef MAX_HWIFS
-#define MAX_HWIFS      4
+# define MAX_HWIFS     4
 #endif
 
-#define ide__sti()     __sti()
-
 static __inline__ int ide_default_irq(ide_ioreg_t base) { return 0; }
 static __inline__ ide_ioreg_t ide_default_io_base(int index) { return 0; }
 
index b5ca760a3097f519244adbeae6d7cfc21c2282b6..01d7765f7ef4aaed931b31c24eba4eb52c5a1c0a 100644 (file)
@@ -15,8 +15,6 @@
 #define MAX_HWIFS      0
 #endif
 
-#define ide__sti()     do {} while (0)
-
 /*
  * We always use the new IDE port registering,
  * so these are fixed here.
diff --git a/include/asm-s390x/ide.h b/include/asm-s390x/ide.h
deleted file mode 100644 (file)
index b5ca760..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- *  linux/include/asm-s390/ide.h
- *
- *  Copyright (C) 1994-1996  Linus Torvalds & authors
- */
-
-/* s390 does not have IDE */
-
-#ifndef __ASMS390_IDE_H
-#define __ASMS390_IDE_H
-
-#ifdef __KERNEL__
-
-#ifndef MAX_HWIFS
-#define MAX_HWIFS      0
-#endif
-
-#define ide__sti()     do {} while (0)
-
-/*
- * We always use the new IDE port registering,
- * so these are fixed here.
- */
-#define ide_default_io_base(i)         ((ide_ioreg_t)0)
-#define ide_default_irq(b)             (0)
-
-#endif /* __KERNEL__ */
-
-#endif /* __ASMS390_IDE_H */
index 9a2ddc37322470e69335c04eb9b55b66ee04513c..eb551e50d57f8b0ecf59dd862dc9798e7ee14d62 100644 (file)
@@ -22,8 +22,6 @@
 #define MAX_HWIFS      2
 #endif
 
-#define ide__sti()     __sti()
-
 static __inline__ int ide_default_irq_hp600(ide_ioreg_t base)
 {
        switch (base) {
index 7ac2eda1d0e71ea5e853615dee79feeebdaca5c0..07bb6650f34ca771e4eccba718cc1837bb3510c8 100644 (file)
@@ -20,8 +20,6 @@
 #undef  MAX_HWIFS
 #define MAX_HWIFS      2
 
-#define        ide__sti()      __sti()
-
 static __inline__ int ide_default_irq(ide_ioreg_t base)
 {
        return 0;
index de65170ba83435bffd0bd63964d1541214d6e4ea..d5672caf1628aee1045c94805dc8c6a7b36b2cb3 100644 (file)
@@ -20,8 +20,6 @@
 #undef  MAX_HWIFS
 #define MAX_HWIFS      2
 
-#define        ide__sti()      __sti()
-
 static __inline__ int ide_default_irq(ide_ioreg_t base)
 {
        return 0;
index 9bec7f280cde24cc9307c3bec3e891b0a86da004..b2ad635bdf946891cbf2d687a575b2867691fe32 100644 (file)
@@ -23,8 +23,6 @@
 # endif
 #endif
 
-#define ide__sti()     __sti()
-
 static __inline__ int ide_default_irq(ide_ioreg_t base)
 {
        switch (base) {