aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-10-11 04:59:46 -0400
committerJeff Garzik <jeff@garzik.org>2006-10-11 04:59:46 -0400
commit701328a7b58d50d8640c21ba5fdf3170b1ddac16 (patch)
tree99a3fe44310a97e92ad1cb3a01f2ee3f6ed0d59a /drivers
parent53e36ada37cb8b01cfbf674580a79edc0bb764c7 (diff)
parent53a5fbdc2dff55161a206ed1a1385a8fa8055c34 (diff)
Merge branch 'master' into upstream-fixes
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/cm_sbs.c4
-rw-r--r--drivers/acpi/hardware/hwregs.c2
-rw-r--r--drivers/ata/sata_promise.c2
-rw-r--r--drivers/ata/sata_sil.c2
-rw-r--r--drivers/ata/sata_svw.c4
-rw-r--r--drivers/atm/ambassador.c7
-rw-r--r--drivers/atm/horizon.c9
-rw-r--r--drivers/atm/lanai.c4
-rw-r--r--drivers/block/DAC960.c14
-rw-r--r--drivers/block/loop.c8
-rw-r--r--drivers/cdrom/cdrom.c6
-rw-r--r--drivers/cdrom/mcdx.c4
-rw-r--r--drivers/char/istallion.c58
-rw-r--r--drivers/char/qtronix.c605
-rw-r--r--drivers/char/rio/func.h2
-rw-r--r--drivers/char/rio/rio_linux.c4
-rw-r--r--drivers/char/rio/riointr.c2
-rw-r--r--drivers/char/riscom8.c7
-rw-r--r--drivers/char/rtc.c4
-rw-r--r--drivers/char/serial167.c18
-rw-r--r--drivers/char/specialix.c2
-rw-r--r--drivers/char/sysrq.c1
-rw-r--r--drivers/char/viocons.c2
-rw-r--r--drivers/char/vme_scc.c2
-rw-r--r--drivers/dma/ioatdma.c4
-rw-r--r--drivers/dma/ioatdma.h4
-rw-r--r--drivers/firmware/dcdbas.c2
-rw-r--r--drivers/i2c/busses/i2c-powermac.c28
-rw-r--r--drivers/ide/mips/swarm.c2
-rw-r--r--drivers/ieee1394/nodemgr.c2
-rw-r--r--drivers/infiniband/core/cm.c84
-rw-r--r--drivers/infiniband/hw/amso1100/c2_ae.c2
-rw-r--r--drivers/infiniband/hw/amso1100/c2_qp.c16
-rw-r--r--drivers/infiniband/hw/mthca/mthca_provider.c2
-rw-r--r--drivers/infiniband/hw/mthca/mthca_srq.c6
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_ib.c5
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.c27
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.h2
-rw-r--r--drivers/input/keyboard/Kconfig4
-rw-r--r--drivers/input/keyboard/hil_kbd.c2
-rw-r--r--drivers/input/misc/Kconfig2
-rw-r--r--drivers/input/mouse/Kconfig2
-rw-r--r--drivers/input/mouse/hil_ptr.c2
-rw-r--r--drivers/input/serio/Kconfig2
-rw-r--r--drivers/input/serio/gscps2.c4
-rw-r--r--drivers/input/serio/hil_mlc.c32
-rw-r--r--drivers/isdn/act2000/act2000_isa.c22
-rw-r--r--drivers/macintosh/adb-iop.c2
-rw-r--r--drivers/macintosh/macio-adb.c2
-rw-r--r--drivers/macintosh/via-cuda.c2
-rw-r--r--drivers/macintosh/via-macii.c2
-rw-r--r--drivers/macintosh/via-maciisi.c2
-rw-r--r--drivers/macintosh/via-pmu68k.c6
-rw-r--r--drivers/macintosh/windfarm_pm112.c18
-rw-r--r--drivers/macintosh/windfarm_pm81.c24
-rw-r--r--drivers/macintosh/windfarm_pm91.c24
-rw-r--r--drivers/md/md.c1
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c2
-rw-r--r--drivers/media/video/zoran_device.c2
-rw-r--r--drivers/misc/tifm_7xx1.c13
-rw-r--r--drivers/misc/tifm_core.c2
-rw-r--r--drivers/mmc/mmc_block.c104
-rw-r--r--drivers/mmc/sdhci.c2
-rw-r--r--drivers/mmc/tifm_sd.c14
-rw-r--r--drivers/mtd/maps/physmap.c2
-rw-r--r--drivers/mtd/nand/cs553x_nand.c2
-rw-r--r--drivers/net/3c509.c7
-rw-r--r--drivers/net/3c523.c7
-rw-r--r--drivers/net/3c527.c5
-rw-r--r--drivers/net/7990.c2
-rw-r--r--drivers/net/8390.c8
-rw-r--r--drivers/net/atp.c6
-rw-r--r--drivers/net/chelsio/cpl5_cmd.h6
-rw-r--r--drivers/net/de600.c6
-rw-r--r--drivers/net/declance.c4
-rw-r--r--drivers/net/dgrs.c4
-rw-r--r--drivers/net/dm9000.c2
-rw-r--r--drivers/net/eepro.c22
-rw-r--r--drivers/net/eexpress.c7
-rw-r--r--drivers/net/irda/ali-ircc.c10
-rw-r--r--drivers/net/irda/donauboe.c31
-rw-r--r--drivers/net/irda/irport.c8
-rw-r--r--drivers/net/irda/irport.h2
-rw-r--r--drivers/net/irda/nsc-ircc.c9
-rw-r--r--drivers/net/irda/w83977af_ir.c9
-rw-r--r--drivers/net/lance.c5
-rw-r--r--drivers/net/lasi_82596.c2
-rw-r--r--drivers/net/mv643xx_eth.c2
-rw-r--r--drivers/net/pcmcia/axnet_cs.c8
-rw-r--r--drivers/net/pcnet32.c7
-rw-r--r--drivers/net/plip.c5
-rw-r--r--drivers/net/s2io.h322
-rw-r--r--drivers/net/saa9730.c2
-rw-r--r--drivers/net/sb1000.c8
-rw-r--r--drivers/net/skfp/skfddi.c7
-rw-r--r--drivers/net/smc91x.c2
-rw-r--r--drivers/net/sonic.c7
-rw-r--r--drivers/net/sunhme.c4
-rw-r--r--drivers/net/sunlance.c2
-rw-r--r--drivers/net/sunqe.c2
-rw-r--r--drivers/net/tokenring/smctr.c7
-rw-r--r--drivers/net/tokenring/tms380tr.c5
-rw-r--r--drivers/net/tulip/de4x5.c6
-rw-r--r--drivers/net/wan/cycx_main.c4
-rw-r--r--drivers/net/wan/sdla.c8
-rw-r--r--drivers/net/wireless/orinoco.c2
-rw-r--r--drivers/net/wireless/wavelan_cs.c11
-rw-r--r--drivers/net/wireless/wl3501_cs.c15
-rw-r--r--drivers/net/yellowfin.c7
-rw-r--r--drivers/net/znet.c5
-rw-r--r--drivers/parisc/dino.c2
-rw-r--r--drivers/parisc/eisa.c2
-rw-r--r--drivers/parport/parport_mfc3.c2
-rw-r--r--drivers/parport/parport_sunbpp.c2
-rw-r--r--drivers/pcmcia/at91_cf.c2
-rw-r--r--drivers/pcmcia/hd64465_ss.c7
-rw-r--r--drivers/pcmcia/m32r_pcc.c2
-rw-r--r--drivers/s390/block/dasd_diag.c2
-rw-r--r--drivers/s390/char/ctrlchar.c2
-rw-r--r--drivers/s390/char/keyboard.c2
-rw-r--r--drivers/s390/char/monwriter.c10
-rw-r--r--drivers/s390/char/sclp.c4
-rw-r--r--drivers/s390/cio/chsc.c25
-rw-r--r--drivers/s390/cio/cio.c6
-rw-r--r--drivers/s390/crypto/ap_bus.c2
-rw-r--r--drivers/s390/net/iucv.c4
-rw-r--r--drivers/s390/scsi/zfcp_erp.c2
-rw-r--r--drivers/sbus/char/openprom.c2
-rw-r--r--drivers/sbus/char/uctrl.c2
-rw-r--r--drivers/scsi/NCR53c406a.c8
-rw-r--r--drivers/scsi/advansys.c6
-rw-r--r--drivers/scsi/aha152x.c7
-rw-r--r--drivers/scsi/aic7xxx_old.c12
-rw-r--r--drivers/scsi/dc395x.c4
-rw-r--r--drivers/scsi/mesh.c4
-rw-r--r--drivers/scsi/qlogicfas408.c6
-rw-r--r--drivers/scsi/scsi_error.c2
-rw-r--r--drivers/scsi/tmscsim.c8
-rw-r--r--drivers/scsi/ultrastor.c8
-rw-r--r--drivers/serial/68360serial.c2
-rw-r--r--drivers/serial/jsm/jsm_neo.c2
-rw-r--r--drivers/serial/m32r_sio.c2
-rw-r--r--drivers/serial/mpc52xx_uart.c10
-rw-r--r--drivers/serial/mux.c2
-rw-r--r--drivers/serial/netx-serial.c2
-rw-r--r--drivers/serial/pxa.c2
-rw-r--r--drivers/serial/sn_console.c2
-rw-r--r--drivers/serial/sunzilog.c2
-rw-r--r--drivers/sn/ioc3.c2
-rw-r--r--drivers/spi/pxa2xx_spi.c2
-rw-r--r--drivers/tc/zs.c2
-rw-r--r--drivers/usb/core/devio.c6
-rw-r--r--drivers/usb/gadget/dummy_hcd.c2
-rw-r--r--drivers/usb/host/ohci-q.c2
-rw-r--r--drivers/usb/serial/mos7840.c46
155 files changed, 712 insertions, 1390 deletions
diff --git a/drivers/acpi/cm_sbs.c b/drivers/acpi/cm_sbs.c
index a01ce6700bfe..4a9b7bf6f44e 100644
--- a/drivers/acpi/cm_sbs.c
+++ b/drivers/acpi/cm_sbs.c
@@ -67,7 +67,7 @@ void acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir_param)
67 lock_ac_dir_cnt--; 67 lock_ac_dir_cnt--;
68 if (lock_ac_dir_cnt == 0 && acpi_ac_dir_param && acpi_ac_dir) { 68 if (lock_ac_dir_cnt == 0 && acpi_ac_dir_param && acpi_ac_dir) {
69 remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir); 69 remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir);
70 acpi_ac_dir = 0; 70 acpi_ac_dir = NULL;
71 } 71 }
72 mutex_unlock(&cm_sbs_mutex); 72 mutex_unlock(&cm_sbs_mutex);
73} 73}
@@ -99,7 +99,7 @@ void acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir_param)
99 if (lock_battery_dir_cnt == 0 && acpi_battery_dir_param 99 if (lock_battery_dir_cnt == 0 && acpi_battery_dir_param
100 && acpi_battery_dir) { 100 && acpi_battery_dir) {
101 remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir); 101 remove_proc_entry(ACPI_BATTERY_CLASS, acpi_root_dir);
102 acpi_battery_dir = 0; 102 acpi_battery_dir = NULL;
103 } 103 }
104 mutex_unlock(&cm_sbs_mutex); 104 mutex_unlock(&cm_sbs_mutex);
105 return; 105 return;
diff --git a/drivers/acpi/hardware/hwregs.c b/drivers/acpi/hardware/hwregs.c
index 3143f36fcec9..fa58c1edce1e 100644
--- a/drivers/acpi/hardware/hwregs.c
+++ b/drivers/acpi/hardware/hwregs.c
@@ -665,8 +665,6 @@ acpi_status acpi_hw_register_write(u8 use_lock, u32 register_id, u32 value)
665 665
666 /* 666 /*
667 * Perform a read first to preserve certain bits (per ACPI spec) 667 * Perform a read first to preserve certain bits (per ACPI spec)
668 *
669 * Note: This includes SCI_EN, we never want to change this bit
670 */ 668 */
671 status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK, 669 status = acpi_hw_register_read(ACPI_MTX_DO_NOT_LOCK,
672 ACPI_REGISTER_PM1_CONTROL, 670 ACPI_REGISTER_PM1_CONTROL,
diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c
index 1eb0d63c17d5..72eda5160fad 100644
--- a/drivers/ata/sata_promise.c
+++ b/drivers/ata/sata_promise.c
@@ -361,7 +361,7 @@ static void pdc_sata_phy_reset(struct ata_port *ap)
361static void pdc_pata_cbl_detect(struct ata_port *ap) 361static void pdc_pata_cbl_detect(struct ata_port *ap)
362{ 362{
363 u8 tmp; 363 u8 tmp;
364 void __iomem *mmio = (void *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03; 364 void __iomem *mmio = (void __iomem *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03;
365 365
366 tmp = readb(mmio); 366 tmp = readb(mmio);
367 367
diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c
index ae5edb80ea9a..ca8d99312472 100644
--- a/drivers/ata/sata_sil.c
+++ b/drivers/ata/sata_sil.c
@@ -349,7 +349,7 @@ static u32 sil_scr_read (struct ata_port *ap, unsigned int sc_reg)
349 349
350static void sil_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val) 350static void sil_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val)
351{ 351{
352 void *mmio = (void __iomem *) sil_scr_addr(ap, sc_reg); 352 void __iomem *mmio = (void __iomem *) sil_scr_addr(ap, sc_reg);
353 if (mmio) 353 if (mmio)
354 writel(val, mmio); 354 writel(val, mmio);
355} 355}
diff --git a/drivers/ata/sata_svw.c b/drivers/ata/sata_svw.c
index 84025a2fd5be..db32d15b7fa1 100644
--- a/drivers/ata/sata_svw.c
+++ b/drivers/ata/sata_svw.c
@@ -177,7 +177,7 @@ static void k2_bmdma_setup_mmio (struct ata_queued_cmd *qc)
177 struct ata_port *ap = qc->ap; 177 struct ata_port *ap = qc->ap;
178 unsigned int rw = (qc->tf.flags & ATA_TFLAG_WRITE); 178 unsigned int rw = (qc->tf.flags & ATA_TFLAG_WRITE);
179 u8 dmactl; 179 u8 dmactl;
180 void *mmio = (void *) ap->ioaddr.bmdma_addr; 180 void __iomem *mmio = (void __iomem *) ap->ioaddr.bmdma_addr;
181 /* load PRD table addr. */ 181 /* load PRD table addr. */
182 mb(); /* make sure PRD table writes are visible to controller */ 182 mb(); /* make sure PRD table writes are visible to controller */
183 writel(ap->prd_dma, mmio + ATA_DMA_TABLE_OFS); 183 writel(ap->prd_dma, mmio + ATA_DMA_TABLE_OFS);
@@ -205,7 +205,7 @@ static void k2_bmdma_setup_mmio (struct ata_queued_cmd *qc)
205static void k2_bmdma_start_mmio (struct ata_queued_cmd *qc) 205static void k2_bmdma_start_mmio (struct ata_queued_cmd *qc)
206{ 206{
207 struct ata_port *ap = qc->ap; 207 struct ata_port *ap = qc->ap;
208 void *mmio = (void *) ap->ioaddr.bmdma_addr; 208 void __iomem *mmio = (void __iomem *) ap->ioaddr.bmdma_addr;
209 u8 dmactl; 209 u8 dmactl;
210 210
211 /* start host DMA transaction */ 211 /* start host DMA transaction */
diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c
index 8ff5c4e50823..323592de047b 100644
--- a/drivers/atm/ambassador.c
+++ b/drivers/atm/ambassador.c
@@ -862,15 +862,10 @@ static inline void interrupts_off (amb_dev * dev) {
862/********** interrupt handling **********/ 862/********** interrupt handling **********/
863 863
864static irqreturn_t interrupt_handler(int irq, void *dev_id) { 864static irqreturn_t interrupt_handler(int irq, void *dev_id) {
865 amb_dev * dev = (amb_dev *) dev_id; 865 amb_dev * dev = dev_id;
866 866
867 PRINTD (DBG_IRQ|DBG_FLOW, "interrupt_handler: %p", dev_id); 867 PRINTD (DBG_IRQ|DBG_FLOW, "interrupt_handler: %p", dev_id);
868 868
869 if (!dev_id) {
870 PRINTD (DBG_IRQ|DBG_ERR, "irq with NULL dev_id: %d", irq);
871 return IRQ_NONE;
872 }
873
874 { 869 {
875 u32 interrupt = rd_plain (dev, offsetof(amb_mem, interrupt)); 870 u32 interrupt = rd_plain (dev, offsetof(amb_mem, interrupt));
876 871
diff --git a/drivers/atm/horizon.c b/drivers/atm/horizon.c
index 33e9ee47392b..f59349206dd2 100644
--- a/drivers/atm/horizon.c
+++ b/drivers/atm/horizon.c
@@ -1389,15 +1389,6 @@ static irqreturn_t interrupt_handler(int irq, void *dev_id) {
1389 1389
1390 PRINTD (DBG_FLOW, "interrupt_handler: %p", dev_id); 1390 PRINTD (DBG_FLOW, "interrupt_handler: %p", dev_id);
1391 1391
1392 if (!dev_id) {
1393 PRINTD (DBG_IRQ|DBG_ERR, "irq with NULL dev_id: %d", irq);
1394 return IRQ_NONE;
1395 }
1396 if (irq != dev->irq) {
1397 PRINTD (DBG_IRQ|DBG_ERR, "irq mismatch: %d", irq);
1398 return IRQ_NONE;
1399 }
1400
1401 // definitely for us 1392 // definitely for us
1402 irq_ok = 0; 1393 irq_ok = 0;
1403 while ((int_source = rd_regl (dev, INT_SOURCE_REG_OFF) 1394 while ((int_source = rd_regl (dev, INT_SOURCE_REG_OFF)
diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c
index 8895f026bea7..267825501dfe 100644
--- a/drivers/atm/lanai.c
+++ b/drivers/atm/lanai.c
@@ -1892,11 +1892,9 @@ static inline void lanai_int_1(struct lanai_dev *lanai, u32 reason)
1892 1892
1893static irqreturn_t lanai_int(int irq, void *devid) 1893static irqreturn_t lanai_int(int irq, void *devid)
1894{ 1894{
1895 struct lanai_dev *lanai = (struct lanai_dev *) devid; 1895 struct lanai_dev *lanai = devid;
1896 u32 reason; 1896 u32 reason;
1897 1897
1898 (void) irq; /* unused variables */
1899
1900#ifdef USE_POWERDOWN 1898#ifdef USE_POWERDOWN
1901 /* 1899 /*
1902 * If we're powered down we shouldn't be generating any interrupts - 1900 * If we're powered down we shouldn't be generating any interrupts -
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c
index 3e8ab84b9447..742d07403101 100644
--- a/drivers/block/DAC960.c
+++ b/drivers/block/DAC960.c
@@ -5254,7 +5254,7 @@ static void DAC960_V2_ProcessCompletedCommand(DAC960_Command_T *Command)
5254static irqreturn_t DAC960_GEM_InterruptHandler(int IRQ_Channel, 5254static irqreturn_t DAC960_GEM_InterruptHandler(int IRQ_Channel,
5255 void *DeviceIdentifier) 5255 void *DeviceIdentifier)
5256{ 5256{
5257 DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; 5257 DAC960_Controller_T *Controller = DeviceIdentifier;
5258 void __iomem *ControllerBaseAddress = Controller->BaseAddress; 5258 void __iomem *ControllerBaseAddress = Controller->BaseAddress;
5259 DAC960_V2_StatusMailbox_T *NextStatusMailbox; 5259 DAC960_V2_StatusMailbox_T *NextStatusMailbox;
5260 unsigned long flags; 5260 unsigned long flags;
@@ -5295,7 +5295,7 @@ static irqreturn_t DAC960_GEM_InterruptHandler(int IRQ_Channel,
5295static irqreturn_t DAC960_BA_InterruptHandler(int IRQ_Channel, 5295static irqreturn_t DAC960_BA_InterruptHandler(int IRQ_Channel,
5296 void *DeviceIdentifier) 5296 void *DeviceIdentifier)
5297{ 5297{
5298 DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; 5298 DAC960_Controller_T *Controller = DeviceIdentifier;
5299 void __iomem *ControllerBaseAddress = Controller->BaseAddress; 5299 void __iomem *ControllerBaseAddress = Controller->BaseAddress;
5300 DAC960_V2_StatusMailbox_T *NextStatusMailbox; 5300 DAC960_V2_StatusMailbox_T *NextStatusMailbox;
5301 unsigned long flags; 5301 unsigned long flags;
@@ -5337,7 +5337,7 @@ static irqreturn_t DAC960_BA_InterruptHandler(int IRQ_Channel,
5337static irqreturn_t DAC960_LP_InterruptHandler(int IRQ_Channel, 5337static irqreturn_t DAC960_LP_InterruptHandler(int IRQ_Channel,
5338 void *DeviceIdentifier) 5338 void *DeviceIdentifier)
5339{ 5339{
5340 DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; 5340 DAC960_Controller_T *Controller = DeviceIdentifier;
5341 void __iomem *ControllerBaseAddress = Controller->BaseAddress; 5341 void __iomem *ControllerBaseAddress = Controller->BaseAddress;
5342 DAC960_V2_StatusMailbox_T *NextStatusMailbox; 5342 DAC960_V2_StatusMailbox_T *NextStatusMailbox;
5343 unsigned long flags; 5343 unsigned long flags;
@@ -5379,7 +5379,7 @@ static irqreturn_t DAC960_LP_InterruptHandler(int IRQ_Channel,
5379static irqreturn_t DAC960_LA_InterruptHandler(int IRQ_Channel, 5379static irqreturn_t DAC960_LA_InterruptHandler(int IRQ_Channel,
5380 void *DeviceIdentifier) 5380 void *DeviceIdentifier)
5381{ 5381{
5382 DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; 5382 DAC960_Controller_T *Controller = DeviceIdentifier;
5383 void __iomem *ControllerBaseAddress = Controller->BaseAddress; 5383 void __iomem *ControllerBaseAddress = Controller->BaseAddress;
5384 DAC960_V1_StatusMailbox_T *NextStatusMailbox; 5384 DAC960_V1_StatusMailbox_T *NextStatusMailbox;
5385 unsigned long flags; 5385 unsigned long flags;
@@ -5417,7 +5417,7 @@ static irqreturn_t DAC960_LA_InterruptHandler(int IRQ_Channel,
5417static irqreturn_t DAC960_PG_InterruptHandler(int IRQ_Channel, 5417static irqreturn_t DAC960_PG_InterruptHandler(int IRQ_Channel,
5418 void *DeviceIdentifier) 5418 void *DeviceIdentifier)
5419{ 5419{
5420 DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; 5420 DAC960_Controller_T *Controller = DeviceIdentifier;
5421 void __iomem *ControllerBaseAddress = Controller->BaseAddress; 5421 void __iomem *ControllerBaseAddress = Controller->BaseAddress;
5422 DAC960_V1_StatusMailbox_T *NextStatusMailbox; 5422 DAC960_V1_StatusMailbox_T *NextStatusMailbox;
5423 unsigned long flags; 5423 unsigned long flags;
@@ -5455,7 +5455,7 @@ static irqreturn_t DAC960_PG_InterruptHandler(int IRQ_Channel,
5455static irqreturn_t DAC960_PD_InterruptHandler(int IRQ_Channel, 5455static irqreturn_t DAC960_PD_InterruptHandler(int IRQ_Channel,
5456 void *DeviceIdentifier) 5456 void *DeviceIdentifier)
5457{ 5457{
5458 DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; 5458 DAC960_Controller_T *Controller = DeviceIdentifier;
5459 void __iomem *ControllerBaseAddress = Controller->BaseAddress; 5459 void __iomem *ControllerBaseAddress = Controller->BaseAddress;
5460 unsigned long flags; 5460 unsigned long flags;
5461 5461
@@ -5493,7 +5493,7 @@ static irqreturn_t DAC960_PD_InterruptHandler(int IRQ_Channel,
5493static irqreturn_t DAC960_P_InterruptHandler(int IRQ_Channel, 5493static irqreturn_t DAC960_P_InterruptHandler(int IRQ_Channel,
5494 void *DeviceIdentifier) 5494 void *DeviceIdentifier)
5495{ 5495{
5496 DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; 5496 DAC960_Controller_T *Controller = DeviceIdentifier;
5497 void __iomem *ControllerBaseAddress = Controller->BaseAddress; 5497 void __iomem *ControllerBaseAddress = Controller->BaseAddress;
5498 unsigned long flags; 5498 unsigned long flags;
5499 5499
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index d6bb8da955a2..beab6d2643cb 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -295,7 +295,7 @@ fail:
295 * and do_lo_send_write(). 295 * and do_lo_send_write().
296 */ 296 */
297static int __do_lo_send_write(struct file *file, 297static int __do_lo_send_write(struct file *file,
298 u8 __user *buf, const int len, loff_t pos) 298 u8 *buf, const int len, loff_t pos)
299{ 299{
300 ssize_t bw; 300 ssize_t bw;
301 mm_segment_t old_fs = get_fs(); 301 mm_segment_t old_fs = get_fs();
@@ -324,7 +324,7 @@ static int do_lo_send_direct_write(struct loop_device *lo,
324 struct bio_vec *bvec, int bsize, loff_t pos, struct page *page) 324 struct bio_vec *bvec, int bsize, loff_t pos, struct page *page)
325{ 325{
326 ssize_t bw = __do_lo_send_write(lo->lo_backing_file, 326 ssize_t bw = __do_lo_send_write(lo->lo_backing_file,
327 (u8 __user *)kmap(bvec->bv_page) + bvec->bv_offset, 327 kmap(bvec->bv_page) + bvec->bv_offset,
328 bvec->bv_len, pos); 328 bvec->bv_len, pos);
329 kunmap(bvec->bv_page); 329 kunmap(bvec->bv_page);
330 cond_resched(); 330 cond_resched();
@@ -351,7 +351,7 @@ static int do_lo_send_write(struct loop_device *lo, struct bio_vec *bvec,
351 bvec->bv_offset, bvec->bv_len, pos >> 9); 351 bvec->bv_offset, bvec->bv_len, pos >> 9);
352 if (likely(!ret)) 352 if (likely(!ret))
353 return __do_lo_send_write(lo->lo_backing_file, 353 return __do_lo_send_write(lo->lo_backing_file,
354 (u8 __user *)page_address(page), bvec->bv_len, 354 page_address(page), bvec->bv_len,
355 pos); 355 pos);
356 printk(KERN_ERR "loop: Transfer error at byte offset %llu, " 356 printk(KERN_ERR "loop: Transfer error at byte offset %llu, "
357 "length %i.\n", (unsigned long long)pos, bvec->bv_len); 357 "length %i.\n", (unsigned long long)pos, bvec->bv_len);
@@ -1187,7 +1187,7 @@ struct compat_loop_info {
1187 * - noinlined to reduce stack space usage in main part of driver 1187 * - noinlined to reduce stack space usage in main part of driver
1188 */ 1188 */
1189static noinline int 1189static noinline int
1190loop_info64_from_compat(const struct compat_loop_info *arg, 1190loop_info64_from_compat(const struct compat_loop_info __user *arg,
1191 struct loop_info64 *info64) 1191 struct loop_info64 *info64)
1192{ 1192{
1193 struct compat_loop_info info; 1193 struct compat_loop_info info;
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index 2a0c50d84fc5..7ea0f48f8fa6 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -703,7 +703,7 @@ static int cdrom_has_defect_mgt(struct cdrom_device_info *cdi)
703{ 703{
704 struct packet_command cgc; 704 struct packet_command cgc;
705 char buffer[16]; 705 char buffer[16];
706 __u16 *feature_code; 706 __be16 *feature_code;
707 int ret; 707 int ret;
708 708
709 init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ); 709 init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ);
@@ -716,7 +716,7 @@ static int cdrom_has_defect_mgt(struct cdrom_device_info *cdi)
716 if ((ret = cdi->ops->generic_packet(cdi, &cgc))) 716 if ((ret = cdi->ops->generic_packet(cdi, &cgc)))
717 return ret; 717 return ret;
718 718
719 feature_code = (__u16 *) &buffer[sizeof(struct feature_header)]; 719 feature_code = (__be16 *) &buffer[sizeof(struct feature_header)];
720 if (be16_to_cpu(*feature_code) == CDF_HWDM) 720 if (be16_to_cpu(*feature_code) == CDF_HWDM)
721 return 0; 721 return 0;
722 722
@@ -2963,7 +2963,7 @@ static int mmc_ioctl(struct cdrom_device_info *cdi, unsigned int cmd,
2963 how much data is available for transfer. buffer[1] is 2963 how much data is available for transfer. buffer[1] is
2964 unfortunately ambigious and the only reliable way seem 2964 unfortunately ambigious and the only reliable way seem
2965 to be to simply skip over the block descriptor... */ 2965 to be to simply skip over the block descriptor... */
2966 offset = 8 + be16_to_cpu(*(unsigned short *)(buffer+6)); 2966 offset = 8 + be16_to_cpu(*(__be16 *)(buffer+6));
2967 2967
2968 if (offset + 16 > sizeof(buffer)) 2968 if (offset + 16 > sizeof(buffer))
2969 return -E2BIG; 2969 return -E2BIG;
diff --git a/drivers/cdrom/mcdx.c b/drivers/cdrom/mcdx.c
index 60e1978ec0ea..f574962f4288 100644
--- a/drivers/cdrom/mcdx.c
+++ b/drivers/cdrom/mcdx.c
@@ -850,10 +850,6 @@ static irqreturn_t mcdx_intr(int irq, void *dev_id)
850 struct s_drive_stuff *stuffp = dev_id; 850 struct s_drive_stuff *stuffp = dev_id;
851 unsigned char b; 851 unsigned char b;
852 852
853 if (stuffp == NULL) {
854 xwarn("mcdx: no device for intr %d\n", irq);
855 return IRQ_NONE;
856 }
857#ifdef AK2 853#ifdef AK2
858 if (!stuffp->busy && stuffp->pending) 854 if (!stuffp->busy && stuffp->pending)
859 stuffp->int_err = 1; 855 stuffp->int_err = 1;
diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c
index d6e031542c6b..ffdf9df1a67a 100644
--- a/drivers/char/istallion.c
+++ b/drivers/char/istallion.c
@@ -686,37 +686,37 @@ static stlibrd_t *stli_allocbrd(void);
686static void stli_ecpinit(stlibrd_t *brdp); 686static void stli_ecpinit(stlibrd_t *brdp);
687static void stli_ecpenable(stlibrd_t *brdp); 687static void stli_ecpenable(stlibrd_t *brdp);
688static void stli_ecpdisable(stlibrd_t *brdp); 688static void stli_ecpdisable(stlibrd_t *brdp);
689static char *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line); 689static void __iomem *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line);
690static void stli_ecpreset(stlibrd_t *brdp); 690static void stli_ecpreset(stlibrd_t *brdp);
691static void stli_ecpintr(stlibrd_t *brdp); 691static void stli_ecpintr(stlibrd_t *brdp);
692static void stli_ecpeiinit(stlibrd_t *brdp); 692static void stli_ecpeiinit(stlibrd_t *brdp);
693static void stli_ecpeienable(stlibrd_t *brdp); 693static void stli_ecpeienable(stlibrd_t *brdp);
694static void stli_ecpeidisable(stlibrd_t *brdp); 694static void stli_ecpeidisable(stlibrd_t *brdp);
695static char *stli_ecpeigetmemptr(stlibrd_t *brdp, unsigned long offset, int line); 695static void __iomem *stli_ecpeigetmemptr(stlibrd_t *brdp, unsigned long offset, int line);
696static void stli_ecpeireset(stlibrd_t *brdp); 696static void stli_ecpeireset(stlibrd_t *brdp);
697static void stli_ecpmcenable(stlibrd_t *brdp); 697static void stli_ecpmcenable(stlibrd_t *brdp);
698static void stli_ecpmcdisable(stlibrd_t *brdp); 698static void stli_ecpmcdisable(stlibrd_t *brdp);
699static char *stli_ecpmcgetmemptr(stlibrd_t *brdp, unsigned long offset, int line); 699static void __iomem *stli_ecpmcgetmemptr(stlibrd_t *brdp, unsigned long offset, int line);
700static void stli_ecpmcreset(stlibrd_t *brdp); 700static void stli_ecpmcreset(stlibrd_t *brdp);
701static void stli_ecppciinit(stlibrd_t *brdp); 701static void stli_ecppciinit(stlibrd_t *brdp);
702static char *stli_ecppcigetmemptr(stlibrd_t *brdp, unsigned long offset, int line); 702static void __iomem *stli_ecppcigetmemptr(stlibrd_t *brdp, unsigned long offset, int line);
703static void stli_ecppcireset(stlibrd_t *brdp); 703static void stli_ecppcireset(stlibrd_t *brdp);
704 704
705static void stli_onbinit(stlibrd_t *brdp); 705static void stli_onbinit(stlibrd_t *brdp);
706static void stli_onbenable(stlibrd_t *brdp); 706static void stli_onbenable(stlibrd_t *brdp);
707static void stli_onbdisable(stlibrd_t *brdp); 707static void stli_onbdisable(stlibrd_t *brdp);
708static char *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line); 708static void __iomem *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line);
709static void stli_onbreset(stlibrd_t *brdp); 709static void stli_onbreset(stlibrd_t *brdp);
710static void stli_onbeinit(stlibrd_t *brdp); 710static void stli_onbeinit(stlibrd_t *brdp);
711static void stli_onbeenable(stlibrd_t *brdp); 711static void stli_onbeenable(stlibrd_t *brdp);
712static void stli_onbedisable(stlibrd_t *brdp); 712static void stli_onbedisable(stlibrd_t *brdp);
713static char *stli_onbegetmemptr(stlibrd_t *brdp, unsigned long offset, int line); 713static void __iomem *stli_onbegetmemptr(stlibrd_t *brdp, unsigned long offset, int line);
714static void stli_onbereset(stlibrd_t *brdp); 714static void stli_onbereset(stlibrd_t *brdp);
715static void stli_bbyinit(stlibrd_t *brdp); 715static void stli_bbyinit(stlibrd_t *brdp);
716static char *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line); 716static void __iomem *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line);
717static void stli_bbyreset(stlibrd_t *brdp); 717static void stli_bbyreset(stlibrd_t *brdp);
718static void stli_stalinit(stlibrd_t *brdp); 718static void stli_stalinit(stlibrd_t *brdp);
719static char *stli_stalgetmemptr(stlibrd_t *brdp, unsigned long offset, int line); 719static void __iomem *stli_stalgetmemptr(stlibrd_t *brdp, unsigned long offset, int line);
720static void stli_stalreset(stlibrd_t *brdp); 720static void stli_stalreset(stlibrd_t *brdp);
721 721
722static stliport_t *stli_getport(int brdnr, int panelnr, int portnr); 722static stliport_t *stli_getport(int brdnr, int panelnr, int portnr);
@@ -1566,7 +1566,7 @@ static void stli_flushchars(struct tty_struct *tty)
1566 1566
1567 len = MIN(len, cooksize); 1567 len = MIN(len, cooksize);
1568 count = 0; 1568 count = 0;
1569 shbuf = (char *) EBRDGETMEMPTR(brdp, portp->txoffset); 1569 shbuf = EBRDGETMEMPTR(brdp, portp->txoffset);
1570 buf = stli_txcookbuf; 1570 buf = stli_txcookbuf;
1571 1571
1572 while (len > 0) { 1572 while (len > 0) {
@@ -2948,9 +2948,9 @@ static void stli_ecpdisable(stlibrd_t *brdp)
2948 2948
2949/*****************************************************************************/ 2949/*****************************************************************************/
2950 2950
2951static char *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) 2951static void __iomem *stli_ecpgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
2952{ 2952{
2953 void *ptr; 2953 void __iomem *ptr;
2954 unsigned char val; 2954 unsigned char val;
2955 2955
2956 if (offset > brdp->memsize) { 2956 if (offset > brdp->memsize) {
@@ -3022,9 +3022,9 @@ static void stli_ecpeidisable(stlibrd_t *brdp)
3022 3022
3023/*****************************************************************************/ 3023/*****************************************************************************/
3024 3024
3025static char *stli_ecpeigetmemptr(stlibrd_t *brdp, unsigned long offset, int line) 3025static void __iomem *stli_ecpeigetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
3026{ 3026{
3027 void *ptr; 3027 void __iomem *ptr;
3028 unsigned char val; 3028 unsigned char val;
3029 3029
3030 if (offset > brdp->memsize) { 3030 if (offset > brdp->memsize) {
@@ -3074,9 +3074,9 @@ static void stli_ecpmcdisable(stlibrd_t *brdp)
3074 3074
3075/*****************************************************************************/ 3075/*****************************************************************************/
3076 3076
3077static char *stli_ecpmcgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) 3077static void __iomem *stli_ecpmcgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
3078{ 3078{
3079 void *ptr; 3079 void __iomem *ptr;
3080 unsigned char val; 3080 unsigned char val;
3081 3081
3082 if (offset > brdp->memsize) { 3082 if (offset > brdp->memsize) {
@@ -3119,9 +3119,9 @@ static void stli_ecppciinit(stlibrd_t *brdp)
3119 3119
3120/*****************************************************************************/ 3120/*****************************************************************************/
3121 3121
3122static char *stli_ecppcigetmemptr(stlibrd_t *brdp, unsigned long offset, int line) 3122static void __iomem *stli_ecppcigetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
3123{ 3123{
3124 void *ptr; 3124 void __iomem *ptr;
3125 unsigned char val; 3125 unsigned char val;
3126 3126
3127 if (offset > brdp->memsize) { 3127 if (offset > brdp->memsize) {
@@ -3185,9 +3185,9 @@ static void stli_onbdisable(stlibrd_t *brdp)
3185 3185
3186/*****************************************************************************/ 3186/*****************************************************************************/
3187 3187
3188static char *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) 3188static void __iomem *stli_onbgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
3189{ 3189{
3190 void *ptr; 3190 void __iomem *ptr;
3191 3191
3192 if (offset > brdp->memsize) { 3192 if (offset > brdp->memsize) {
3193 printk(KERN_ERR "STALLION: shared memory pointer=%x out of " 3193 printk(KERN_ERR "STALLION: shared memory pointer=%x out of "
@@ -3250,9 +3250,9 @@ static void stli_onbedisable(stlibrd_t *brdp)
3250 3250
3251/*****************************************************************************/ 3251/*****************************************************************************/
3252 3252
3253static char *stli_onbegetmemptr(stlibrd_t *brdp, unsigned long offset, int line) 3253static void __iomem *stli_onbegetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
3254{ 3254{
3255 void *ptr; 3255 void __iomem *ptr;
3256 unsigned char val; 3256 unsigned char val;
3257 3257
3258 if (offset > brdp->memsize) { 3258 if (offset > brdp->memsize) {
@@ -3300,9 +3300,9 @@ static void stli_bbyinit(stlibrd_t *brdp)
3300 3300
3301/*****************************************************************************/ 3301/*****************************************************************************/
3302 3302
3303static char *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line) 3303static void __iomem *stli_bbygetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
3304{ 3304{
3305 void *ptr; 3305 void __iomem *ptr;
3306 unsigned char val; 3306 unsigned char val;
3307 3307
3308 BUG_ON(offset > brdp->memsize); 3308 BUG_ON(offset > brdp->memsize);
@@ -3337,7 +3337,7 @@ static void stli_stalinit(stlibrd_t *brdp)
3337 3337
3338/*****************************************************************************/ 3338/*****************************************************************************/
3339 3339
3340static char *stli_stalgetmemptr(stlibrd_t *brdp, unsigned long offset, int line) 3340static void __iomem *stli_stalgetmemptr(stlibrd_t *brdp, unsigned long offset, int line)
3341{ 3341{
3342 BUG_ON(offset > brdp->memsize); 3342 BUG_ON(offset > brdp->memsize);
3343 return brdp->membase + (offset % STAL_PAGESIZE); 3343 return brdp->membase + (offset % STAL_PAGESIZE);
@@ -3876,7 +3876,7 @@ static int stli_eisamemprobe(stlibrd_t *brdp)
3876 continue; 3876 continue;
3877 3877
3878 if (brdp->brdtype == BRD_ECPE) { 3878 if (brdp->brdtype == BRD_ECPE) {
3879 ecpsigp = (cdkecpsig_t __iomem *) stli_ecpeigetmemptr(brdp, 3879 ecpsigp = stli_ecpeigetmemptr(brdp,
3880 CDK_SIGADDR, __LINE__); 3880 CDK_SIGADDR, __LINE__);
3881 memcpy_fromio(&ecpsig, ecpsigp, sizeof(cdkecpsig_t)); 3881 memcpy_fromio(&ecpsig, ecpsigp, sizeof(cdkecpsig_t));
3882 if (ecpsig.magic == cpu_to_le32(ECP_MAGIC)) 3882 if (ecpsig.magic == cpu_to_le32(ECP_MAGIC))
@@ -4184,7 +4184,7 @@ static int stli_initbrds(void)
4184static ssize_t stli_memread(struct file *fp, char __user *buf, size_t count, loff_t *offp) 4184static ssize_t stli_memread(struct file *fp, char __user *buf, size_t count, loff_t *offp)
4185{ 4185{
4186 unsigned long flags; 4186 unsigned long flags;
4187 void *memptr; 4187 void __iomem *memptr;
4188 stlibrd_t *brdp; 4188 stlibrd_t *brdp;
4189 int brdnr, size, n; 4189 int brdnr, size, n;
4190 void *p; 4190 void *p;
@@ -4214,7 +4214,7 @@ static ssize_t stli_memread(struct file *fp, char __user *buf, size_t count, lof
4214 while (size > 0) { 4214 while (size > 0) {
4215 spin_lock_irqsave(&brd_lock, flags); 4215 spin_lock_irqsave(&brd_lock, flags);
4216 EBRDENABLE(brdp); 4216 EBRDENABLE(brdp);
4217 memptr = (void *) EBRDGETMEMPTR(brdp, off); 4217 memptr = EBRDGETMEMPTR(brdp, off);
4218 n = MIN(size, (brdp->pagesize - (((unsigned long) off) % brdp->pagesize))); 4218 n = MIN(size, (brdp->pagesize - (((unsigned long) off) % brdp->pagesize)));
4219 n = MIN(n, PAGE_SIZE); 4219 n = MIN(n, PAGE_SIZE);
4220 memcpy_fromio(p, memptr, n); 4220 memcpy_fromio(p, memptr, n);
@@ -4247,7 +4247,7 @@ out:
4247static ssize_t stli_memwrite(struct file *fp, const char __user *buf, size_t count, loff_t *offp) 4247static ssize_t stli_memwrite(struct file *fp, const char __user *buf, size_t count, loff_t *offp)
4248{ 4248{
4249 unsigned long flags; 4249 unsigned long flags;
4250 void *memptr; 4250 void __iomem *memptr;
4251 stlibrd_t *brdp; 4251 stlibrd_t *brdp;
4252 char __user *chbuf; 4252 char __user *chbuf;
4253 int brdnr, size, n; 4253 int brdnr, size, n;
@@ -4287,7 +4287,7 @@ static ssize_t stli_memwrite(struct file *fp, const char __user *buf, size_t cou
4287 } 4287 }
4288 spin_lock_irqsave(&brd_lock, flags); 4288 spin_lock_irqsave(&brd_lock, flags);
4289 EBRDENABLE(brdp); 4289 EBRDENABLE(brdp);
4290 memptr = (void *) EBRDGETMEMPTR(brdp, off); 4290 memptr = EBRDGETMEMPTR(brdp, off);
4291 memcpy_toio(memptr, p, n); 4291 memcpy_toio(memptr, p, n);
4292 EBRDDISABLE(brdp); 4292 EBRDDISABLE(brdp);
4293 spin_unlock_irqrestore(&brd_lock, flags); 4293 spin_unlock_irqrestore(&brd_lock, flags);
diff --git a/drivers/char/qtronix.c b/drivers/char/qtronix.c
deleted file mode 100644
index 5c9477741a30..000000000000
--- a/drivers/char/qtronix.c
+++ /dev/null
@@ -1,605 +0,0 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * Qtronix 990P infrared keyboard driver.
5 *
6 *
7 * Copyright 2001 MontaVista Software Inc.
8 * Author: MontaVista Software, Inc.
9 * ppopov@mvista.com or source@mvista.com
10 *
11 *
12 * The bottom portion of this driver was take from
13 * pc_keyb.c Please see that file for copyrights.
14 *
15 * This program is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by the
17 * Free Software Foundation; either version 2 of the License, or (at your
18 * option) any later version.
19 *
20 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
21 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
23 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
26 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
27 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
31 * You should have received a copy of the GNU General Public License along
32 * with this program; if not, write to the Free Software Foundation, Inc.,
33 * 675 Mass Ave, Cambridge, MA 02139, USA.
34 */
35
36
37/*
38 * NOTE:
39 *
40 * This driver has only been tested with the Consumer IR
41 * port of the ITE 8172 system controller.
42 *
43 * You do not need this driver if you are using the ps/2 or
44 * USB adapter that the keyboard ships with. You only need
45 * this driver if your board has a IR port and the keyboard
46 * data is being sent directly to the IR. In that case,
47 * you also need some low-level IR support. See it8172_cir.c.
48 *
49 */
50
51#ifdef CONFIG_QTRONIX_KEYBOARD
52
53#include <linux/module.h>
54#include <linux/types.h>
55#include <linux/pci.h>
56#include <linux/kernel.h>
57
58#include <asm/it8172/it8172.h>
59#include <asm/it8172/it8172_int.h>
60#include <asm/it8172/it8172_cir.h>
61
62#include <linux/spinlock.h>
63#include <linux/sched.h>
64#include <linux/interrupt.h>
65#include <linux/tty.h>
66#include <linux/mm.h>
67#include <linux/signal.h>
68#include <linux/init.h>
69#include <linux/kbd_ll.h>
70#include <linux/delay.h>
71#include <linux/poll.h>
72#include <linux/miscdevice.h>
73#include <linux/slab.h>
74#include <linux/kbd_kern.h>
75#include <linux/smp_lock.h>
76#include <asm/io.h>
77#include <linux/pc_keyb.h>
78
79#include <asm/keyboard.h>
80#include <linux/bitops.h>
81#include <asm/uaccess.h>
82#include <asm/irq.h>
83#include <asm/system.h>
84
85#define leading1 0
86#define leading2 0xF
87
88#define KBD_CIR_PORT 0
89#define AUX_RECONNECT 170 /* scancode when ps2 device is plugged (back) in */
90
91static int data_index;
92struct cir_port *cir;
93static unsigned char kbdbytes[5];
94static unsigned char cir_data[32]; /* we only need 16 chars */
95
96static void kbd_int_handler(int irq, void *dev_id);
97static int handle_data(unsigned char *p_data);
98static inline void handle_mouse_event(unsigned char scancode);
99static inline void handle_keyboard_event(unsigned char scancode, int down);
100static int __init psaux_init(void);
101
102static struct aux_queue *queue; /* Mouse data buffer. */
103static int aux_count = 0;
104
105/*
106 * Keys accessed through the 'Fn' key
107 * The Fn key does not produce a key-up sequence. So, the first
108 * time the user presses it, it will be key-down event. The key
109 * stays down until the user presses it again.
110 */
111#define NUM_FN_KEYS 56
112static unsigned char fn_keys[NUM_FN_KEYS] = {
113 0,0,0,0,0,0,0,0, /* 0 7 */
114 8,9,10,93,0,0,0,0, /* 8 15 */
115 0,0,0,0,0,0,0,5, /* 16 23 */
116 6,7,91,0,0,0,0,0, /* 24 31 */
117 0,0,0,0,0,2,3,4, /* 32 39 */
118 92,0,0,0,0,0,0,0, /* 40 47 */
119 0,0,0,0,11,0,94,95 /* 48 55 */
120
121};
122
123void __init init_qtronix_990P_kbd(void)
124{
125 int retval;
126
127 cir = (struct cir_port *)kmalloc(sizeof(struct cir_port), GFP_KERNEL);
128 if (!cir) {
129 printk("Unable to initialize Qtronix keyboard\n");
130 return;
131 }
132
133 /*
134 * revisit
135 * this should be programmable, somehow by the, by the user.
136 */
137 cir->port = KBD_CIR_PORT;
138 cir->baud_rate = 0x1d;
139 cir->rdwos = 0;
140 cir->rxdcr = 0x3;
141 cir->hcfs = 0;
142 cir->fifo_tl = 0;
143 cir->cfq = 0x1d;
144 cir_port_init(cir);
145
146 retval = request_irq(IT8172_CIR0_IRQ, kbd_int_handler,
147 (unsigned long )(IRQF_DISABLED|IRQF_SHARED),
148 (const char *)"Qtronix IR Keyboard", (void *)cir);
149
150 if (retval) {
151 printk("unable to allocate cir %d irq %d\n",
152 cir->port, IT8172_CIR0_IRQ);
153 }
154#ifdef CONFIG_PSMOUSE
155 psaux_init();
156#endif
157}
158
159static inline unsigned char BitReverse(unsigned short key)
160{
161 unsigned char rkey = 0;
162 rkey |= (key & 0x1) << 7;
163 rkey |= (key & 0x2) << 5;
164 rkey |= (key & 0x4) << 3;
165 rkey |= (key & 0x8) << 1;
166 rkey |= (key & 0x10) >> 1;
167 rkey |= (key & 0x20) >> 3;
168 rkey |= (key & 0x40) >> 5;
169 rkey |= (key & 0x80) >> 7;
170 return rkey;
171
172}
173
174
175static inline u_int8_t UpperByte(u_int8_t data)
176{
177 return (data >> 4);
178}
179
180
181static inline u_int8_t LowerByte(u_int8_t data)
182{
183 return (data & 0xF);
184}
185
186
187int CheckSumOk(u_int8_t byte1, u_int8_t byte2,
188 u_int8_t byte3, u_int8_t byte4, u_int8_t byte5)
189{
190 u_int8_t CheckSum;
191
192 CheckSum = (byte1 & 0x0F) + byte2 + byte3 + byte4 + byte5;
193 if ( LowerByte(UpperByte(CheckSum) + LowerByte(CheckSum)) != UpperByte(byte1) )
194 return 0;
195 else
196 return 1;
197}
198
199
200static void kbd_int_handler(int irq, void *dev_id)
201{
202 struct cir_port *cir;
203 int j;
204 unsigned char int_status;
205
206 cir = (struct cir_port *)dev_id;
207 int_status = get_int_status(cir);
208 if (int_status & 0x4) {
209 clear_fifo(cir);
210 return;
211 }
212
213 while (cir_get_rx_count(cir)) {
214
215 cir_data[data_index] = cir_read_data(cir);
216
217 if (data_index == 0) {/* expecting first byte */
218 if (cir_data[data_index] != leading1) {
219 //printk("!leading byte %x\n", cir_data[data_index]);
220 set_rx_active(cir);
221 clear_fifo(cir);
222 continue;
223 }
224 }
225 if (data_index == 1) {
226 if ((cir_data[data_index] & 0xf) != leading2) {
227 set_rx_active(cir);
228 data_index = 0; /* start over */
229 clear_fifo(cir);
230 continue;
231 }
232 }
233
234 if ( (cir_data[data_index] == 0xff)) { /* last byte */
235 //printk("data_index %d\n", data_index);
236 set_rx_active(cir);
237#if 0
238 for (j=0; j<=data_index; j++) {
239 printk("rx_data %d: %x\n", j, cir_data[j]);
240 }
241#endif
242 data_index = 0;
243 handle_data(cir_data);
244 return;
245 }
246 else if (data_index>16) {
247 set_rx_active(cir);
248#if 0
249 printk("warning: data_index %d\n", data_index);
250 for (j=0; j<=data_index; j++) {
251 printk("rx_data %d: %x\n", j, cir_data[j]);
252 }
253#endif
254 data_index = 0;
255 clear_fifo(cir);
256 return;
257 }
258 data_index++;
259 }
260}
261
262
263#define NUM_KBD_BYTES 5
264static int handle_data(unsigned char *p_data)
265{
266 u_int32_t bit_bucket;
267 u_int32_t i, j;
268 u_int32_t got_bits, next_byte;
269 int down = 0;
270
271 /* Reorganize the bit stream */
272 for (i=0; i<16; i++)
273 p_data[i] = BitReverse(~p_data[i]);
274
275 /*
276 * We've already previously checked that p_data[0]
277 * is equal to leading1 and that (p_data[1] & 0xf)
278 * is equal to leading2. These twelve bits are the
279 * leader code. We can now throw them away (the 12
280 * bits) and continue parsing the stream.
281 */
282 bit_bucket = p_data[1] << 12;
283 got_bits = 4;
284 next_byte = 2;
285
286 /*
287 * Process four bits at a time
288 */
289 for (i=0; i<NUM_KBD_BYTES; i++) {
290
291 kbdbytes[i]=0;
292
293 for (j=0; j<8; j++) /* 8 bits per byte */
294 {
295 if (got_bits < 4) {
296 bit_bucket |= (p_data[next_byte++] << (8 - got_bits));
297 got_bits += 8;
298 }
299
300 if ((bit_bucket & 0xF000) == 0x8000) {
301 /* Convert 1000b to 1 */
302 kbdbytes[i] = 0x80 | (kbdbytes[i] >> 1);
303 got_bits -= 4;
304 bit_bucket = bit_bucket << 4;
305 }
306 else if ((bit_bucket & 0xC000) == 0x8000) {
307 /* Convert 10b to 0 */
308 kbdbytes[i] = kbdbytes[i] >> 1;
309 got_bits -= 2;
310 bit_bucket = bit_bucket << 2;
311 }
312 else {
313 /* bad serial stream */
314 return 1;
315 }
316
317 if (next_byte > 16) {
318 //printk("error: too many bytes\n");
319 return 1;
320 }
321 }
322 }
323
324
325 if (!CheckSumOk(kbdbytes[0], kbdbytes[1],
326 kbdbytes[2], kbdbytes[3], kbdbytes[4])) {
327 //printk("checksum failed\n");
328 return 1;
329 }
330
331 if (kbdbytes[1] & 0x08) {
332 //printk("m: %x %x %x\n", kbdbytes[1], kbdbytes[2], kbdbytes[3]);
333 handle_mouse_event(kbdbytes[1]);
334 handle_mouse_event(kbdbytes[2]);
335 handle_mouse_event(kbdbytes[3]);
336 }
337 else {
338 if (kbdbytes[2] == 0) down = 1;
339#if 0
340 if (down)
341 printk("down %d\n", kbdbytes[3]);
342 else
343 printk("up %d\n", kbdbytes[3]);
344#endif
345 handle_keyboard_event(kbdbytes[3], down);
346 }
347 return 0;
348}
349
350
351DEFINE_SPINLOCK(kbd_controller_lock);
352static unsigned char handle_kbd_event(void);
353
354
355int kbd_setkeycode(unsigned int scancode, unsigned int keycode)
356{
357 printk("kbd_setkeycode scancode %x keycode %x\n", scancode, keycode);
358 return 0;
359}
360
361int kbd_getkeycode(unsigned int scancode)
362{
363 return scancode;
364}
365
366
367int kbd_translate(unsigned char scancode, unsigned char *keycode,
368 char raw_mode)
369{
370 static int prev_scancode = 0;
371
372 if (scancode == 0x00 || scancode == 0xff) {
373 prev_scancode = 0;
374 return 0;
375 }
376
377 /* todo */
378 if (!prev_scancode && scancode == 160) { /* Fn key down */
379 //printk("Fn key down\n");
380 prev_scancode = 160;
381 return 0;
382 }
383 else if (prev_scancode && scancode == 160) { /* Fn key up */
384 //printk("Fn key up\n");
385 prev_scancode = 0;
386 return 0;
387 }
388
389 /* todo */
390 if (prev_scancode == 160) {
391 if (scancode <= NUM_FN_KEYS) {
392 *keycode = fn_keys[scancode];
393 //printk("fn keycode %d\n", *keycode);
394 }
395 else
396 return 0;
397 }
398 else if (scancode <= 127) {
399 *keycode = scancode;
400 }
401 else
402 return 0;
403
404
405 return 1;
406}
407
408char kbd_unexpected_up(unsigned char keycode)
409{
410 //printk("kbd_unexpected_up\n");
411 return 0;
412}
413
414static unsigned char kbd_exists = 1;
415
416static inline void handle_keyboard_event(unsigned char scancode, int down)
417{
418 kbd_exists = 1;
419 handle_scancode(scancode, down);
420 tasklet_schedule(&keyboard_tasklet);
421}
422
423
424void kbd_leds(unsigned char leds)
425{
426}
427
428/* dummy */
429void kbd_init_hw(void)
430{
431}
432
433
434
435static inline void handle_mouse_event(unsigned char scancode)
436{
437 if(scancode == AUX_RECONNECT){
438 queue->head = queue->tail = 0; /* Flush input queue */
439 // __aux_write_ack(AUX_ENABLE_DEV); /* ping the mouse :) */
440 return;
441 }
442
443 if (aux_count) {
444 int head = queue->head;
445
446 queue->buf[head] = scancode;
447 head = (head + 1) & (AUX_BUF_SIZE-1);
448 if (head != queue->tail) {
449 queue->head = head;
450 kill_fasync(&queue->fasync, SIGIO, POLL_IN);
451 wake_up_interruptible(&queue->proc_list);
452 }
453 }
454}
455
456static unsigned char get_from_queue(void)
457{
458 unsigned char result;
459 unsigned long flags;
460
461 spin_lock_irqsave(&kbd_controller_lock, flags);
462 result = queue->buf[queue->tail];
463 queue->tail = (queue->tail + 1) & (AUX_BUF_SIZE-1);
464 spin_unlock_irqrestore(&kbd_controller_lock, flags);
465 return result;
466}
467
468
469static inline int queue_empty(void)
470{
471 return queue->head == queue->tail;
472}
473
474static int fasync_aux(int fd, struct file *filp, int on)
475{
476 int retval;
477
478 //printk("fasync_aux\n");
479 retval = fasync_helper(fd, filp, on, &queue->fasync);
480 if (retval < 0)
481 return retval;
482 return 0;
483}
484
485
486/*
487 * Random magic cookie for the aux device
488 */
489#define AUX_DEV ((void *)queue)
490
491static int release_aux(struct inode * inode, struct file * file)
492{
493 fasync_aux(-1, file, 0);
494 aux_count--;
495 return 0;
496}
497
498static int open_aux(struct inode * inode, struct file * file)
499{
500 if (aux_count++) {
501 return 0;
502 }
503 queue->head = queue->tail = 0; /* Flush input queue */
504 return 0;
505}
506
507/*
508 * Put bytes from input queue to buffer.
509 */
510
511static ssize_t read_aux(struct file * file, char * buffer,
512 size_t count, loff_t *ppos)
513{
514 DECLARE_WAITQUEUE(wait, current);
515 ssize_t i = count;
516 unsigned char c;
517
518 if (queue_empty()) {
519 if (file->f_flags & O_NONBLOCK)
520 return -EAGAIN;
521 add_wait_queue(&queue->proc_list, &wait);
522repeat:
523 set_current_state(TASK_INTERRUPTIBLE);
524 if (queue_empty() && !signal_pending(current)) {
525 schedule();
526 goto repeat;
527 }
528 current->state = TASK_RUNNING;
529 remove_wait_queue(&queue->proc_list, &wait);
530 }
531 while (i > 0 && !queue_empty()) {
532 c = get_from_queue();
533 put_user(c, buffer++);
534 i--;
535 }
536 if (count-i) {
537 struct inode *inode = file->f_dentry->d_inode;
538 inode->i_atime = current_fs_time(inode->i_sb);
539 return count-i;
540 }
541 if (signal_pending(current))
542 return -ERESTARTSYS;
543 return 0;
544}
545
546/*
547 * Write to the aux device.
548 */
549
550static ssize_t write_aux(struct file * file, const char * buffer,
551 size_t count, loff_t *ppos)
552{
553 /*
554 * The ITE boards this was tested on did not have the
555 * transmit wires connected.
556 */
557 return count;
558}
559
560static unsigned int aux_poll(struct file *file, poll_table * wait)
561{
562 poll_wait(file, &queue->proc_list, wait);
563 if (!queue_empty())
564 return POLLIN | POLLRDNORM;
565 return 0;
566}
567
568struct file_operations psaux_fops = {
569 .read = read_aux,
570 .write = write_aux,
571 .poll = aux_poll,
572 .open = open_aux,
573 .release = release_aux,
574 .fasync = fasync_aux,
575};
576
577/*
578 * Initialize driver.
579 */
580static struct miscdevice psaux_mouse = {
581 PSMOUSE_MINOR, "psaux", &psaux_fops
582};
583
584static int __init psaux_init(void)
585{
586 int retval;
587
588 retval = misc_register(&psaux_mouse);
589 if(retval < 0)
590 return retval;
591
592 queue = (struct aux_queue *) kmalloc(sizeof(*queue), GFP_KERNEL);
593 if (!queue) {
594 misc_deregister(&psaux_mouse);
595 return -ENOMEM;
596 }
597
598 memset(queue, 0, sizeof(*queue));
599 queue->head = queue->tail = 0;
600 init_waitqueue_head(&queue->proc_list);
601
602 return 0;
603}
604module_init(init_qtronix_990P_kbd);
605#endif
diff --git a/drivers/char/rio/func.h b/drivers/char/rio/func.h
index 6b039186856d..9e7283bd81a0 100644
--- a/drivers/char/rio/func.h
+++ b/drivers/char/rio/func.h
@@ -88,7 +88,7 @@ void RIOHostReset(unsigned int, struct DpRam __iomem *, unsigned int);
88 88
89/* riointr.c */ 89/* riointr.c */
90void RIOTxEnable(char *); 90void RIOTxEnable(char *);
91void RIOServiceHost(struct rio_info *, struct Host *, int); 91void RIOServiceHost(struct rio_info *, struct Host *);
92int riotproc(struct rio_info *, struct ttystatics *, int, int); 92int riotproc(struct rio_info *, struct ttystatics *, int, int);
93 93
94/* rioparam.c */ 94/* rioparam.c */
diff --git a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c
index 3bea594600d4..c382df0f82f6 100644
--- a/drivers/char/rio/rio_linux.c
+++ b/drivers/char/rio/rio_linux.c
@@ -368,7 +368,7 @@ static irqreturn_t rio_interrupt(int irq, void *ptr)
368 struct Host *HostP; 368 struct Host *HostP;
369 func_enter(); 369 func_enter();
370 370
371 HostP = (struct Host *) ptr; /* &p->RIOHosts[(long)ptr]; */ 371 HostP = ptr; /* &p->RIOHosts[(long)ptr]; */
372 rio_dprintk(RIO_DEBUG_IFLOW, "rio: enter rio_interrupt (%d/%d)\n", irq, HostP->Ivec); 372 rio_dprintk(RIO_DEBUG_IFLOW, "rio: enter rio_interrupt (%d/%d)\n", irq, HostP->Ivec);
373 373
374 /* AAargh! The order in which to do these things is essential and 374 /* AAargh! The order in which to do these things is essential and
@@ -402,7 +402,7 @@ static irqreturn_t rio_interrupt(int irq, void *ptr)
402 return IRQ_HANDLED; 402 return IRQ_HANDLED;
403 } 403 }
404 404
405 RIOServiceHost(p, HostP, irq); 405 RIOServiceHost(p, HostP);
406 406
407 rio_dprintk(RIO_DEBUG_IFLOW, "riointr() doing host %p type %d\n", ptr, HostP->Type); 407 rio_dprintk(RIO_DEBUG_IFLOW, "riointr() doing host %p type %d\n", ptr, HostP->Type);
408 408
diff --git a/drivers/char/rio/riointr.c b/drivers/char/rio/riointr.c
index 0bd09040a5c0..eeda40c5e189 100644
--- a/drivers/char/rio/riointr.c
+++ b/drivers/char/rio/riointr.c
@@ -181,7 +181,7 @@ static int RupIntr;
181static int RxIntr; 181static int RxIntr;
182static int TxIntr; 182static int TxIntr;
183 183
184void RIOServiceHost(struct rio_info *p, struct Host *HostP, int From) 184void RIOServiceHost(struct rio_info *p, struct Host *HostP)
185{ 185{
186 rio_spin_lock(&HostP->HostLock); 186 rio_spin_lock(&HostP->HostLock);
187 if ((HostP->Flags & RUN_STATE) != RC_RUNNING) { 187 if ((HostP->Flags & RUN_STATE) != RC_RUNNING) {
diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c
index be68cfb0ae69..5ab32b38f45a 100644
--- a/drivers/char/riscom8.c
+++ b/drivers/char/riscom8.c
@@ -559,11 +559,10 @@ static irqreturn_t rc_interrupt(int irq, void * dev_id)
559 int handled = 0; 559 int handled = 0;
560 560
561 bp = IRQ_to_board[irq]; 561 bp = IRQ_to_board[irq];
562 562
563 if (!bp || !(bp->flags & RC_BOARD_ACTIVE)) { 563 if (!(bp->flags & RC_BOARD_ACTIVE))
564 return IRQ_NONE; 564 return IRQ_NONE;
565 } 565
566
567 while ((++loop < 16) && ((status = ~(rc_in(bp, RC_BSR))) & 566 while ((++loop < 16) && ((status = ~(rc_in(bp, RC_BSR))) &
568 (RC_BSR_TOUT | RC_BSR_TINT | 567 (RC_BSR_TOUT | RC_BSR_TINT |
569 RC_BSR_MINT | RC_BSR_RINT))) { 568 RC_BSR_MINT | RC_BSR_RINT))) {
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c
index abee7a339462..66a7385bc34a 100644
--- a/drivers/char/rtc.c
+++ b/drivers/char/rtc.c
@@ -35,13 +35,13 @@
35 * 1.09a Pete Zaitcev: Sun SPARC 35 * 1.09a Pete Zaitcev: Sun SPARC
36 * 1.09b Jeff Garzik: Modularize, init cleanup 36 * 1.09b Jeff Garzik: Modularize, init cleanup
37 * 1.09c Jeff Garzik: SMP cleanup 37 * 1.09c Jeff Garzik: SMP cleanup
38 * 1.10 Paul Barton-Davis: add support for async I/O 38 * 1.10 Paul Barton-Davis: add support for async I/O
39 * 1.10a Andrea Arcangeli: Alpha updates 39 * 1.10a Andrea Arcangeli: Alpha updates
40 * 1.10b Andrew Morton: SMP lock fix 40 * 1.10b Andrew Morton: SMP lock fix
41 * 1.10c Cesar Barros: SMP locking fixes and cleanup 41 * 1.10c Cesar Barros: SMP locking fixes and cleanup
42 * 1.10d Paul Gortmaker: delete paranoia check in rtc_exit 42 * 1.10d Paul Gortmaker: delete paranoia check in rtc_exit
43 * 1.10e Maciej W. Rozycki: Handle DECstation's year weirdness. 43 * 1.10e Maciej W. Rozycki: Handle DECstation's year weirdness.
44 * 1.11 Takashi Iwai: Kernel access functions 44 * 1.11 Takashi Iwai: Kernel access functions
45 * rtc_register/rtc_unregister/rtc_control 45 * rtc_register/rtc_unregister/rtc_control
46 * 1.11a Daniele Bellucci: Audit create_proc_read_entry in rtc_init 46 * 1.11a Daniele Bellucci: Audit create_proc_read_entry in rtc_init
47 * 1.12 Venkatesh Pallipadi: Hooks for emulating rtc on HPET base-timer 47 * 1.12 Venkatesh Pallipadi: Hooks for emulating rtc on HPET base-timer
diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c
index 6f13f98e3171..461bfe0234c9 100644
--- a/drivers/char/serial167.c
+++ b/drivers/char/serial167.c
@@ -62,6 +62,7 @@
62#include <linux/console.h> 62#include <linux/console.h>
63#include <linux/module.h> 63#include <linux/module.h>
64#include <linux/bitops.h> 64#include <linux/bitops.h>
65#include <linux/tty_flip.h>
65 66
66#include <asm/system.h> 67#include <asm/system.h>
67#include <asm/io.h> 68#include <asm/io.h>
@@ -427,8 +428,9 @@ cd2401_rxerr_interrupt(int irq, void *dev_id)
427 overflowing, we still loose 428 overflowing, we still loose
428 the next incoming character. 429 the next incoming character.
429 */ 430 */
430 tty_insert_flip_char(tty, data, TTY_NORMAL); 431 if (tty_buffer_request_room(tty, 1) != 0){
431 } 432 tty_insert_flip_char(tty, data, TTY_FRAME);
433 }
432 /* These two conditions may imply */ 434 /* These two conditions may imply */
433 /* a normal read should be done. */ 435 /* a normal read should be done. */
434 /* else if(data & CyTIMEOUT) */ 436 /* else if(data & CyTIMEOUT) */
@@ -437,14 +439,14 @@ cd2401_rxerr_interrupt(int irq, void *dev_id)
437 tty_insert_flip_char(tty, 0, TTY_NORMAL); 439 tty_insert_flip_char(tty, 0, TTY_NORMAL);
438 } 440 }
439 }else{ 441 }else{
440 tty_insert_flip_char(tty, data, TTY_NORMAL); 442 tty_insert_flip_char(tty, data, TTY_NORMAL);
441 } 443 }
442 }else{ 444 }else{
443 /* there was a software buffer overrun 445 /* there was a software buffer overrun
444 and nothing could be done about it!!! */ 446 and nothing could be done about it!!! */
445 } 447 }
446 } 448 }
447 schedule_delayed_work(&tty->flip.work, 1); 449 tty_schedule_flip(tty);
448 /* end of service */ 450 /* end of service */
449 base_addr[CyREOIR] = rfoc ? 0 : CyNOTRANS; 451 base_addr[CyREOIR] = rfoc ? 0 : CyNOTRANS;
450 return IRQ_HANDLED; 452 return IRQ_HANDLED;
@@ -635,6 +637,7 @@ cd2401_rx_interrupt(int irq, void *dev_id)
635 char data; 637 char data;
636 int char_count; 638 int char_count;
637 int save_cnt; 639 int save_cnt;
640 int len;
638 641
639 /* determine the channel and change to that context */ 642 /* determine the channel and change to that context */
640 channel = (u_short ) (base_addr[CyLICR] >> 2); 643 channel = (u_short ) (base_addr[CyLICR] >> 2);
@@ -667,14 +670,15 @@ cd2401_rx_interrupt(int irq, void *dev_id)
667 info->mon.char_max = char_count; 670 info->mon.char_max = char_count;
668 info->mon.char_last = char_count; 671 info->mon.char_last = char_count;
669#endif 672#endif
670 while(char_count--){ 673 len = tty_buffer_request_room(tty, char_count);
674 while(len--){
671 data = base_addr[CyRDR]; 675 data = base_addr[CyRDR];
672 tty_insert_flip_char(tty, data, TTY_NORMAL); 676 tty_insert_flip_char(tty, data, TTY_NORMAL);
673#ifdef CYCLOM_16Y_HACK 677#ifdef CYCLOM_16Y_HACK
674 udelay(10L); 678 udelay(10L);
675#endif 679#endif
676 } 680 }
677 schedule_delayed_work(&tty->flip.work, 1); 681 tty_schedule_flip(tty);
678 } 682 }
679 /* end of service */ 683 /* end of service */
680 base_addr[CyREOIR] = save_cnt ? 0 : CyNOTRANS; 684 base_addr[CyREOIR] = save_cnt ? 0 : CyNOTRANS;
@@ -1422,7 +1426,6 @@ cy_tiocmget(struct tty_struct *tty, struct file *file)
1422 volatile unsigned char *base_addr = (u_char *)BASE_ADDR; 1426 volatile unsigned char *base_addr = (u_char *)BASE_ADDR;
1423 unsigned long flags; 1427 unsigned long flags;
1424 unsigned char status; 1428 unsigned char status;
1425 unsigned int result;
1426 1429
1427 channel = info->line; 1430 channel = info->line;
1428 1431
@@ -1446,7 +1449,6 @@ cy_tiocmset(struct tty_struct *tty, struct file *file,
1446 int channel; 1449 int channel;
1447 volatile unsigned char *base_addr = (u_char *)BASE_ADDR; 1450 volatile unsigned char *base_addr = (u_char *)BASE_ADDR;
1448 unsigned long flags; 1451 unsigned long flags;
1449 unsigned int arg;
1450 1452
1451 channel = info->line; 1453 channel = info->line;
1452 1454
diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c
index 6022495571ae..d0b88d0e87fd 100644
--- a/drivers/char/specialix.c
+++ b/drivers/char/specialix.c
@@ -912,7 +912,7 @@ static irqreturn_t sx_interrupt(int irq, void *dev_id)
912 spin_lock_irqsave(&bp->lock, flags); 912 spin_lock_irqsave(&bp->lock, flags);
913 913
914 dprintk (SX_DEBUG_FLOW, "enter %s port %d room: %ld\n", __FUNCTION__, port_No(sx_get_port(bp, "INT")), SERIAL_XMIT_SIZE - sx_get_port(bp, "ITN")->xmit_cnt - 1); 914 dprintk (SX_DEBUG_FLOW, "enter %s port %d room: %ld\n", __FUNCTION__, port_No(sx_get_port(bp, "INT")), SERIAL_XMIT_SIZE - sx_get_port(bp, "ITN")->xmit_cnt - 1);
915 if (!bp || !(bp->flags & SX_BOARD_ACTIVE)) { 915 if (!(bp->flags & SX_BOARD_ACTIVE)) {
916 dprintk (SX_DEBUG_IRQ, "sx: False interrupt. irq %d.\n", irq); 916 dprintk (SX_DEBUG_IRQ, "sx: False interrupt. irq %d.\n", irq);
917 spin_unlock_irqrestore(&bp->lock, flags); 917 spin_unlock_irqrestore(&bp->lock, flags);
918 func_exit(); 918 func_exit();
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c
index 4c0e08685705..5f49280779fb 100644
--- a/drivers/char/sysrq.c
+++ b/drivers/char/sysrq.c
@@ -38,6 +38,7 @@
38#include <linux/irq.h> 38#include <linux/irq.h>
39 39
40#include <asm/ptrace.h> 40#include <asm/ptrace.h>
41#include <asm/irq_regs.h>
41 42
42/* Whether we react on sysrq keys or just ignore them */ 43/* Whether we react on sysrq keys or just ignore them */
43int sysrq_enabled = 1; 44int sysrq_enabled = 1;
diff --git a/drivers/char/viocons.c b/drivers/char/viocons.c
index a362ee9c92dd..6d2e314860df 100644
--- a/drivers/char/viocons.c
+++ b/drivers/char/viocons.c
@@ -947,7 +947,7 @@ static void vioHandleData(struct HvLpEvent *event)
947 */ 947 */
948 continue; 948 continue;
949 } else if (vio_sysrq_pressed) { 949 } else if (vio_sysrq_pressed) {
950 handle_sysrq(cevent->data[index], NULL, tty); 950 handle_sysrq(cevent->data[index], tty);
951 vio_sysrq_pressed = 0; 951 vio_sysrq_pressed = 0;
952 /* 952 /*
953 * continue because we don't want to add 953 * continue because we don't want to add
diff --git a/drivers/char/vme_scc.c b/drivers/char/vme_scc.c
index 0cdbaa70cf9f..d0b94dd1af6d 100644
--- a/drivers/char/vme_scc.c
+++ b/drivers/char/vme_scc.c
@@ -593,7 +593,7 @@ static void scc_enable_tx_interrupts(void *ptr)
593 local_irq_save(flags); 593 local_irq_save(flags);
594 SCCmod(INT_AND_DMA_REG, 0xff, IDR_TX_INT_ENAB); 594 SCCmod(INT_AND_DMA_REG, 0xff, IDR_TX_INT_ENAB);
595 /* restart the transmitter */ 595 /* restart the transmitter */
596 scc_tx_int (0, port, 0); 596 scc_tx_int (0, port);
597 local_irq_restore(flags); 597 local_irq_restore(flags);
598} 598}
599 599
diff --git a/drivers/dma/ioatdma.c b/drivers/dma/ioatdma.c
index f3bf1e230bca..0358419a0e48 100644
--- a/drivers/dma/ioatdma.c
+++ b/drivers/dma/ioatdma.c
@@ -80,7 +80,7 @@ static int enumerate_dma_channels(struct ioat_device *device)
80 80
81static struct ioat_desc_sw *ioat_dma_alloc_descriptor( 81static struct ioat_desc_sw *ioat_dma_alloc_descriptor(
82 struct ioat_dma_chan *ioat_chan, 82 struct ioat_dma_chan *ioat_chan,
83 int flags) 83 gfp_t flags)
84{ 84{
85 struct ioat_dma_descriptor *desc; 85 struct ioat_dma_descriptor *desc;
86 struct ioat_desc_sw *desc_sw; 86 struct ioat_desc_sw *desc_sw;
@@ -686,7 +686,7 @@ static int __devinit ioat_probe(struct pci_dev *pdev,
686{ 686{
687 int err; 687 int err;
688 unsigned long mmio_start, mmio_len; 688 unsigned long mmio_start, mmio_len;
689 void *reg_base; 689 void __iomem *reg_base;
690 struct ioat_device *device; 690 struct ioat_device *device;
691 691
692 err = pci_enable_device(pdev); 692 err = pci_enable_device(pdev);
diff --git a/drivers/dma/ioatdma.h b/drivers/dma/ioatdma.h
index a5d3b3644160..62b26a9be4c9 100644
--- a/drivers/dma/ioatdma.h
+++ b/drivers/dma/ioatdma.h
@@ -44,7 +44,7 @@ extern struct list_head dma_client_list;
44 44
45struct ioat_device { 45struct ioat_device {
46 struct pci_dev *pdev; 46 struct pci_dev *pdev;
47 void *reg_base; 47 void __iomem *reg_base;
48 struct pci_pool *dma_pool; 48 struct pci_pool *dma_pool;
49 struct pci_pool *completion_pool; 49 struct pci_pool *completion_pool;
50 50
@@ -73,7 +73,7 @@ struct ioat_device {
73 73
74struct ioat_dma_chan { 74struct ioat_dma_chan {
75 75
76 void *reg_base; 76 void __iomem *reg_base;
77 77
78 dma_cookie_t completed_cookie; 78 dma_cookie_t completed_cookie;
79 unsigned long last_completion; 79 unsigned long last_completion;
diff --git a/drivers/firmware/dcdbas.c b/drivers/firmware/dcdbas.c
index 339f405ff708..8bcb58cd4ac0 100644
--- a/drivers/firmware/dcdbas.c
+++ b/drivers/firmware/dcdbas.c
@@ -559,7 +559,7 @@ static int __devinit dcdbas_probe(struct platform_device *dev)
559 while (--i >= 0) 559 while (--i >= 0)
560 sysfs_remove_bin_file(&dev->dev.kobj, 560 sysfs_remove_bin_file(&dev->dev.kobj,
561 dcdbas_bin_attrs[i]); 561 dcdbas_bin_attrs[i]);
562 sysfs_create_group(&dev->dev.kobj, &dcdbas_attr_group); 562 sysfs_remove_group(&dev->dev.kobj, &dcdbas_attr_group);
563 return error; 563 return error;
564 } 564 }
565 } 565 }
diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-powermac.c
index a508cb962d24..648d55533d87 100644
--- a/drivers/i2c/busses/i2c-powermac.c
+++ b/drivers/i2c/busses/i2c-powermac.c
@@ -182,9 +182,9 @@ static const struct i2c_algorithm i2c_powermac_algorithm = {
182}; 182};
183 183
184 184
185static int i2c_powermac_remove(struct device *dev) 185static int i2c_powermac_remove(struct platform_device *dev)
186{ 186{
187 struct i2c_adapter *adapter = dev_get_drvdata(dev); 187 struct i2c_adapter *adapter = platform_get_drvdata(dev);
188 struct pmac_i2c_bus *bus = i2c_get_adapdata(adapter); 188 struct pmac_i2c_bus *bus = i2c_get_adapdata(adapter);
189 int rc; 189 int rc;
190 190
@@ -195,16 +195,16 @@ static int i2c_powermac_remove(struct device *dev)
195 if (rc) 195 if (rc)
196 printk("i2c-powermac.c: Failed to remove bus %s !\n", 196 printk("i2c-powermac.c: Failed to remove bus %s !\n",
197 adapter->name); 197 adapter->name);
198 dev_set_drvdata(dev, NULL); 198 platform_set_drvdata(dev, NULL);
199 kfree(adapter); 199 kfree(adapter);
200 200
201 return 0; 201 return 0;
202} 202}
203 203
204 204
205static int i2c_powermac_probe(struct device *dev) 205static int __devexit i2c_powermac_probe(struct platform_device *dev)
206{ 206{
207 struct pmac_i2c_bus *bus = dev->platform_data; 207 struct pmac_i2c_bus *bus = dev->dev.platform_data;
208 struct device_node *parent = NULL; 208 struct device_node *parent = NULL;
209 struct i2c_adapter *adapter; 209 struct i2c_adapter *adapter;
210 char name[32]; 210 char name[32];
@@ -246,11 +246,11 @@ static int i2c_powermac_probe(struct device *dev)
246 printk(KERN_ERR "i2c-powermac: can't allocate inteface !\n"); 246 printk(KERN_ERR "i2c-powermac: can't allocate inteface !\n");
247 return -ENOMEM; 247 return -ENOMEM;
248 } 248 }
249 dev_set_drvdata(dev, adapter); 249 platform_set_drvdata(dev, adapter);
250 strcpy(adapter->name, name); 250 strcpy(adapter->name, name);
251 adapter->algo = &i2c_powermac_algorithm; 251 adapter->algo = &i2c_powermac_algorithm;
252 i2c_set_adapdata(adapter, bus); 252 i2c_set_adapdata(adapter, bus);
253 adapter->dev.parent = dev; 253 adapter->dev.parent = &dev->dev;
254 pmac_i2c_attach_adapter(bus, adapter); 254 pmac_i2c_attach_adapter(bus, adapter);
255 rc = i2c_add_adapter(adapter); 255 rc = i2c_add_adapter(adapter);
256 if (rc) { 256 if (rc) {
@@ -265,23 +265,25 @@ static int i2c_powermac_probe(struct device *dev)
265} 265}
266 266
267 267
268static struct device_driver i2c_powermac_driver = { 268static struct platform_driver i2c_powermac_driver = {
269 .name = "i2c-powermac",
270 .bus = &platform_bus_type,
271 .probe = i2c_powermac_probe, 269 .probe = i2c_powermac_probe,
272 .remove = i2c_powermac_remove, 270 .remove = __devexit_p(i2c_powermac_remove),
271 .driver = {
272 .name = "i2c-powermac",
273 .bus = &platform_bus_type,
274 },
273}; 275};
274 276
275static int __init i2c_powermac_init(void) 277static int __init i2c_powermac_init(void)
276{ 278{
277 driver_register(&i2c_powermac_driver); 279 platform_driver_register(&i2c_powermac_driver);
278 return 0; 280 return 0;
279} 281}
280 282
281 283
282static void __exit i2c_powermac_cleanup(void) 284static void __exit i2c_powermac_cleanup(void)
283{ 285{
284 driver_unregister(&i2c_powermac_driver); 286 platform_driver_unregister(&i2c_powermac_driver);
285} 287}
286 288
287module_init(i2c_powermac_init); 289module_init(i2c_powermac_init);
diff --git a/drivers/ide/mips/swarm.c b/drivers/ide/mips/swarm.c
index 66f6064f4640..09c9e7936b0d 100644
--- a/drivers/ide/mips/swarm.c
+++ b/drivers/ide/mips/swarm.c
@@ -4,6 +4,7 @@
4 * Author: Manish Lachwani, mlachwani@mvista.com 4 * Author: Manish Lachwani, mlachwani@mvista.com
5 * Copyright (C) 2004 MIPS Technologies, Inc. All rights reserved. 5 * Copyright (C) 2004 MIPS Technologies, Inc. All rights reserved.
6 * Author: Maciej W. Rozycki <macro@mips.com> 6 * Author: Maciej W. Rozycki <macro@mips.com>
7 * Copyright (c) 2006 Maciej W. Rozycki
7 * 8 *
8 * This program is free software; you can redistribute it and/or 9 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License 10 * modify it under the terms of the GNU General Public License
@@ -127,6 +128,7 @@ static int __devinit swarm_ide_probe(struct device *dev)
127 memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); 128 memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports));
128 hwif->irq = hwif->hw.irq; 129 hwif->irq = hwif->hw.irq;
129 130
131 probe_hwif_init(hwif);
130 dev_set_drvdata(dev, hwif); 132 dev_set_drvdata(dev, hwif);
131 133
132 return 0; 134 return 0;
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
index 3e7974c57443..8e7b83f84485 100644
--- a/drivers/ieee1394/nodemgr.c
+++ b/drivers/ieee1394/nodemgr.c
@@ -1614,7 +1614,7 @@ static int nodemgr_host_thread(void *__hi)
1614{ 1614{
1615 struct host_info *hi = (struct host_info *)__hi; 1615 struct host_info *hi = (struct host_info *)__hi;
1616 struct hpsb_host *host = hi->host; 1616 struct hpsb_host *host = hi->host;
1617 unsigned int g, generation = get_hpsb_generation(host) - 1; 1617 unsigned int g, generation = 0;
1618 int i, reset_cycles = 0; 1618 int i, reset_cycles = 0;
1619 1619
1620 /* Setup our device-model entries */ 1620 /* Setup our device-model entries */
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index f35fcc4c0638..25b1018a476c 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -75,6 +75,7 @@ static struct ib_cm {
75 struct rb_root remote_sidr_table; 75 struct rb_root remote_sidr_table;
76 struct idr local_id_table; 76 struct idr local_id_table;
77 __be32 random_id_operand; 77 __be32 random_id_operand;
78 struct list_head timewait_list;
78 struct workqueue_struct *wq; 79 struct workqueue_struct *wq;
79} cm; 80} cm;
80 81
@@ -112,6 +113,7 @@ struct cm_work {
112 113
113struct cm_timewait_info { 114struct cm_timewait_info {
114 struct cm_work work; /* Must be first. */ 115 struct cm_work work; /* Must be first. */
116 struct list_head list;
115 struct rb_node remote_qp_node; 117 struct rb_node remote_qp_node;
116 struct rb_node remote_id_node; 118 struct rb_node remote_id_node;
117 __be64 remote_ca_guid; 119 __be64 remote_ca_guid;
@@ -647,13 +649,6 @@ static inline int cm_convert_to_ms(int iba_time)
647 649
648static void cm_cleanup_timewait(struct cm_timewait_info *timewait_info) 650static void cm_cleanup_timewait(struct cm_timewait_info *timewait_info)
649{ 651{
650 unsigned long flags;
651
652 if (!timewait_info->inserted_remote_id &&
653 !timewait_info->inserted_remote_qp)
654 return;
655
656 spin_lock_irqsave(&cm.lock, flags);
657 if (timewait_info->inserted_remote_id) { 652 if (timewait_info->inserted_remote_id) {
658 rb_erase(&timewait_info->remote_id_node, &cm.remote_id_table); 653 rb_erase(&timewait_info->remote_id_node, &cm.remote_id_table);
659 timewait_info->inserted_remote_id = 0; 654 timewait_info->inserted_remote_id = 0;
@@ -663,7 +658,6 @@ static void cm_cleanup_timewait(struct cm_timewait_info *timewait_info)
663 rb_erase(&timewait_info->remote_qp_node, &cm.remote_qp_table); 658 rb_erase(&timewait_info->remote_qp_node, &cm.remote_qp_table);
664 timewait_info->inserted_remote_qp = 0; 659 timewait_info->inserted_remote_qp = 0;
665 } 660 }
666 spin_unlock_irqrestore(&cm.lock, flags);
667} 661}
668 662
669static struct cm_timewait_info * cm_create_timewait_info(__be32 local_id) 663static struct cm_timewait_info * cm_create_timewait_info(__be32 local_id)
@@ -684,8 +678,12 @@ static struct cm_timewait_info * cm_create_timewait_info(__be32 local_id)
684static void cm_enter_timewait(struct cm_id_private *cm_id_priv) 678static void cm_enter_timewait(struct cm_id_private *cm_id_priv)
685{ 679{
686 int wait_time; 680 int wait_time;
681 unsigned long flags;
687 682
683 spin_lock_irqsave(&cm.lock, flags);
688 cm_cleanup_timewait(cm_id_priv->timewait_info); 684 cm_cleanup_timewait(cm_id_priv->timewait_info);
685 list_add_tail(&cm_id_priv->timewait_info->list, &cm.timewait_list);
686 spin_unlock_irqrestore(&cm.lock, flags);
689 687
690 /* 688 /*
691 * The cm_id could be destroyed by the user before we exit timewait. 689 * The cm_id could be destroyed by the user before we exit timewait.
@@ -701,9 +699,13 @@ static void cm_enter_timewait(struct cm_id_private *cm_id_priv)
701 699
702static void cm_reset_to_idle(struct cm_id_private *cm_id_priv) 700static void cm_reset_to_idle(struct cm_id_private *cm_id_priv)
703{ 701{
702 unsigned long flags;
703
704 cm_id_priv->id.state = IB_CM_IDLE; 704 cm_id_priv->id.state = IB_CM_IDLE;
705 if (cm_id_priv->timewait_info) { 705 if (cm_id_priv->timewait_info) {
706 spin_lock_irqsave(&cm.lock, flags);
706 cm_cleanup_timewait(cm_id_priv->timewait_info); 707 cm_cleanup_timewait(cm_id_priv->timewait_info);
708 spin_unlock_irqrestore(&cm.lock, flags);
707 kfree(cm_id_priv->timewait_info); 709 kfree(cm_id_priv->timewait_info);
708 cm_id_priv->timewait_info = NULL; 710 cm_id_priv->timewait_info = NULL;
709 } 711 }
@@ -1307,6 +1309,7 @@ static struct cm_id_private * cm_match_req(struct cm_work *work,
1307 if (timewait_info) { 1309 if (timewait_info) {
1308 cur_cm_id_priv = cm_get_id(timewait_info->work.local_id, 1310 cur_cm_id_priv = cm_get_id(timewait_info->work.local_id,
1309 timewait_info->work.remote_id); 1311 timewait_info->work.remote_id);
1312 cm_cleanup_timewait(cm_id_priv->timewait_info);
1310 spin_unlock_irqrestore(&cm.lock, flags); 1313 spin_unlock_irqrestore(&cm.lock, flags);
1311 if (cur_cm_id_priv) { 1314 if (cur_cm_id_priv) {
1312 cm_dup_req_handler(work, cur_cm_id_priv); 1315 cm_dup_req_handler(work, cur_cm_id_priv);
@@ -1315,7 +1318,8 @@ static struct cm_id_private * cm_match_req(struct cm_work *work,
1315 cm_issue_rej(work->port, work->mad_recv_wc, 1318 cm_issue_rej(work->port, work->mad_recv_wc,
1316 IB_CM_REJ_STALE_CONN, CM_MSG_RESPONSE_REQ, 1319 IB_CM_REJ_STALE_CONN, CM_MSG_RESPONSE_REQ,
1317 NULL, 0); 1320 NULL, 0);
1318 goto error; 1321 listen_cm_id_priv = NULL;
1322 goto out;
1319 } 1323 }
1320 1324
1321 /* Find matching listen request. */ 1325 /* Find matching listen request. */
@@ -1323,21 +1327,20 @@ static struct cm_id_private * cm_match_req(struct cm_work *work,
1323 req_msg->service_id, 1327 req_msg->service_id,
1324 req_msg->private_data); 1328 req_msg->private_data);
1325 if (!listen_cm_id_priv) { 1329 if (!listen_cm_id_priv) {
1330 cm_cleanup_timewait(cm_id_priv->timewait_info);
1326 spin_unlock_irqrestore(&cm.lock, flags); 1331 spin_unlock_irqrestore(&cm.lock, flags);
1327 cm_issue_rej(work->port, work->mad_recv_wc, 1332 cm_issue_rej(work->port, work->mad_recv_wc,
1328 IB_CM_REJ_INVALID_SERVICE_ID, CM_MSG_RESPONSE_REQ, 1333 IB_CM_REJ_INVALID_SERVICE_ID, CM_MSG_RESPONSE_REQ,
1329 NULL, 0); 1334 NULL, 0);
1330 goto error; 1335 goto out;
1331 } 1336 }
1332 atomic_inc(&listen_cm_id_priv->refcount); 1337 atomic_inc(&listen_cm_id_priv->refcount);
1333 atomic_inc(&cm_id_priv->refcount); 1338 atomic_inc(&cm_id_priv->refcount);
1334 cm_id_priv->id.state = IB_CM_REQ_RCVD; 1339 cm_id_priv->id.state = IB_CM_REQ_RCVD;
1335 atomic_inc(&cm_id_priv->work_count); 1340 atomic_inc(&cm_id_priv->work_count);
1336 spin_unlock_irqrestore(&cm.lock, flags); 1341 spin_unlock_irqrestore(&cm.lock, flags);
1342out:
1337 return listen_cm_id_priv; 1343 return listen_cm_id_priv;
1338
1339error: cm_cleanup_timewait(cm_id_priv->timewait_info);
1340 return NULL;
1341} 1344}
1342 1345
1343static int cm_req_handler(struct cm_work *work) 1346static int cm_req_handler(struct cm_work *work)
@@ -1899,6 +1902,32 @@ out: spin_unlock_irqrestore(&cm_id_priv->lock, flags);
1899} 1902}
1900EXPORT_SYMBOL(ib_send_cm_drep); 1903EXPORT_SYMBOL(ib_send_cm_drep);
1901 1904
1905static int cm_issue_drep(struct cm_port *port,
1906 struct ib_mad_recv_wc *mad_recv_wc)
1907{
1908 struct ib_mad_send_buf *msg = NULL;
1909 struct cm_dreq_msg *dreq_msg;
1910 struct cm_drep_msg *drep_msg;
1911 int ret;
1912
1913 ret = cm_alloc_response_msg(port, mad_recv_wc, &msg);
1914 if (ret)
1915 return ret;
1916
1917 dreq_msg = (struct cm_dreq_msg *) mad_recv_wc->recv_buf.mad;
1918 drep_msg = (struct cm_drep_msg *) msg->mad;
1919
1920 cm_format_mad_hdr(&drep_msg->hdr, CM_DREP_ATTR_ID, dreq_msg->hdr.tid);
1921 drep_msg->remote_comm_id = dreq_msg->local_comm_id;
1922 drep_msg->local_comm_id = dreq_msg->remote_comm_id;
1923
1924 ret = ib_post_send_mad(msg, NULL);
1925 if (ret)
1926 cm_free_msg(msg);
1927
1928 return ret;
1929}
1930
1902static int cm_dreq_handler(struct cm_work *work) 1931static int cm_dreq_handler(struct cm_work *work)
1903{ 1932{
1904 struct cm_id_private *cm_id_priv; 1933 struct cm_id_private *cm_id_priv;
@@ -1910,8 +1939,10 @@ static int cm_dreq_handler(struct cm_work *work)
1910 dreq_msg = (struct cm_dreq_msg *)work->mad_recv_wc->recv_buf.mad; 1939 dreq_msg = (struct cm_dreq_msg *)work->mad_recv_wc->recv_buf.mad;
1911 cm_id_priv = cm_acquire_id(dreq_msg->remote_comm_id, 1940 cm_id_priv = cm_acquire_id(dreq_msg->remote_comm_id,
1912 dreq_msg->local_comm_id); 1941 dreq_msg->local_comm_id);
1913 if (!cm_id_priv) 1942 if (!cm_id_priv) {
1943 cm_issue_drep(work->port, work->mad_recv_wc);
1914 return -EINVAL; 1944 return -EINVAL;
1945 }
1915 1946
1916 work->cm_event.private_data = &dreq_msg->private_data; 1947 work->cm_event.private_data = &dreq_msg->private_data;
1917 1948
@@ -2601,28 +2632,29 @@ static int cm_timewait_handler(struct cm_work *work)
2601{ 2632{
2602 struct cm_timewait_info *timewait_info; 2633 struct cm_timewait_info *timewait_info;
2603 struct cm_id_private *cm_id_priv; 2634 struct cm_id_private *cm_id_priv;
2604 unsigned long flags;
2605 int ret; 2635 int ret;
2606 2636
2607 timewait_info = (struct cm_timewait_info *)work; 2637 timewait_info = (struct cm_timewait_info *)work;
2608 cm_cleanup_timewait(timewait_info); 2638 spin_lock_irq(&cm.lock);
2639 list_del(&timewait_info->list);
2640 spin_unlock_irq(&cm.lock);
2609 2641
2610 cm_id_priv = cm_acquire_id(timewait_info->work.local_id, 2642 cm_id_priv = cm_acquire_id(timewait_info->work.local_id,
2611 timewait_info->work.remote_id); 2643 timewait_info->work.remote_id);
2612 if (!cm_id_priv) 2644 if (!cm_id_priv)
2613 return -EINVAL; 2645 return -EINVAL;
2614 2646
2615 spin_lock_irqsave(&cm_id_priv->lock, flags); 2647 spin_lock_irq(&cm_id_priv->lock);
2616 if (cm_id_priv->id.state != IB_CM_TIMEWAIT || 2648 if (cm_id_priv->id.state != IB_CM_TIMEWAIT ||
2617 cm_id_priv->remote_qpn != timewait_info->remote_qpn) { 2649 cm_id_priv->remote_qpn != timewait_info->remote_qpn) {
2618 spin_unlock_irqrestore(&cm_id_priv->lock, flags); 2650 spin_unlock_irq(&cm_id_priv->lock);
2619 goto out; 2651 goto out;
2620 } 2652 }
2621 cm_id_priv->id.state = IB_CM_IDLE; 2653 cm_id_priv->id.state = IB_CM_IDLE;
2622 ret = atomic_inc_and_test(&cm_id_priv->work_count); 2654 ret = atomic_inc_and_test(&cm_id_priv->work_count);
2623 if (!ret) 2655 if (!ret)
2624 list_add_tail(&work->list, &cm_id_priv->work_list); 2656 list_add_tail(&work->list, &cm_id_priv->work_list);
2625 spin_unlock_irqrestore(&cm_id_priv->lock, flags); 2657 spin_unlock_irq(&cm_id_priv->lock);
2626 2658
2627 if (ret) 2659 if (ret)
2628 cm_process_work(cm_id_priv, work); 2660 cm_process_work(cm_id_priv, work);
@@ -3374,6 +3406,7 @@ static int __init ib_cm_init(void)
3374 idr_init(&cm.local_id_table); 3406 idr_init(&cm.local_id_table);
3375 get_random_bytes(&cm.random_id_operand, sizeof cm.random_id_operand); 3407 get_random_bytes(&cm.random_id_operand, sizeof cm.random_id_operand);
3376 idr_pre_get(&cm.local_id_table, GFP_KERNEL); 3408 idr_pre_get(&cm.local_id_table, GFP_KERNEL);
3409 INIT_LIST_HEAD(&cm.timewait_list);
3377 3410
3378 cm.wq = create_workqueue("ib_cm"); 3411 cm.wq = create_workqueue("ib_cm");
3379 if (!cm.wq) 3412 if (!cm.wq)
@@ -3391,7 +3424,20 @@ error:
3391 3424
3392static void __exit ib_cm_cleanup(void) 3425static void __exit ib_cm_cleanup(void)
3393{ 3426{
3427 struct cm_timewait_info *timewait_info, *tmp;
3428
3429 spin_lock_irq(&cm.lock);
3430 list_for_each_entry(timewait_info, &cm.timewait_list, list)
3431 cancel_delayed_work(&timewait_info->work.work);
3432 spin_unlock_irq(&cm.lock);
3433
3394 destroy_workqueue(cm.wq); 3434 destroy_workqueue(cm.wq);
3435
3436 list_for_each_entry_safe(timewait_info, tmp, &cm.timewait_list, list) {
3437 list_del(&timewait_info->list);
3438 kfree(timewait_info);
3439 }
3440
3395 ib_unregister_client(&cm_client); 3441 ib_unregister_client(&cm_client);
3396 idr_destroy(&cm.local_id_table); 3442 idr_destroy(&cm.local_id_table);
3397} 3443}
diff --git a/drivers/infiniband/hw/amso1100/c2_ae.c b/drivers/infiniband/hw/amso1100/c2_ae.c
index 3aae4978e1cb..a31439bd3b67 100644
--- a/drivers/infiniband/hw/amso1100/c2_ae.c
+++ b/drivers/infiniband/hw/amso1100/c2_ae.c
@@ -66,7 +66,6 @@ static int c2_convert_cm_status(u32 c2_status)
66 } 66 }
67} 67}
68 68
69#ifdef DEBUG
70static const char* to_event_str(int event) 69static const char* to_event_str(int event)
71{ 70{
72 static const char* event_str[] = { 71 static const char* event_str[] = {
@@ -144,7 +143,6 @@ static const char *to_qp_state_str(int state)
144 return "<invalid QP state>"; 143 return "<invalid QP state>";
145 }; 144 };
146} 145}
147#endif
148 146
149void c2_ae_event(struct c2_dev *c2dev, u32 mq_index) 147void c2_ae_event(struct c2_dev *c2dev, u32 mq_index)
150{ 148{
diff --git a/drivers/infiniband/hw/amso1100/c2_qp.c b/drivers/infiniband/hw/amso1100/c2_qp.c
index 12261132b077..5bcf697aa335 100644
--- a/drivers/infiniband/hw/amso1100/c2_qp.c
+++ b/drivers/infiniband/hw/amso1100/c2_qp.c
@@ -35,6 +35,8 @@
35 * 35 *
36 */ 36 */
37 37
38#include <linux/delay.h>
39
38#include "c2.h" 40#include "c2.h"
39#include "c2_vq.h" 41#include "c2_vq.h"
40#include "c2_status.h" 42#include "c2_status.h"
@@ -705,10 +707,8 @@ static inline void c2_activity(struct c2_dev *c2dev, u32 mq_index, u16 shared)
705 * cannot get on the bus and the card and system hang in a 707 * cannot get on the bus and the card and system hang in a
706 * deadlock -- thus the need for this code. [TOT] 708 * deadlock -- thus the need for this code. [TOT]
707 */ 709 */
708 while (readl(c2dev->regs + PCI_BAR0_ADAPTER_HINT) & 0x80000000) { 710 while (readl(c2dev->regs + PCI_BAR0_ADAPTER_HINT) & 0x80000000)
709 set_current_state(TASK_UNINTERRUPTIBLE); 711 udelay(10);
710 schedule_timeout(0);
711 }
712 712
713 __raw_writel(C2_HINT_MAKE(mq_index, shared), 713 __raw_writel(C2_HINT_MAKE(mq_index, shared),
714 c2dev->regs + PCI_BAR0_ADAPTER_HINT); 714 c2dev->regs + PCI_BAR0_ADAPTER_HINT);
@@ -766,6 +766,7 @@ int c2_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr,
766 struct c2_dev *c2dev = to_c2dev(ibqp->device); 766 struct c2_dev *c2dev = to_c2dev(ibqp->device);
767 struct c2_qp *qp = to_c2qp(ibqp); 767 struct c2_qp *qp = to_c2qp(ibqp);
768 union c2wr wr; 768 union c2wr wr;
769 unsigned long lock_flags;
769 int err = 0; 770 int err = 0;
770 771
771 u32 flags; 772 u32 flags;
@@ -881,8 +882,10 @@ int c2_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr,
881 /* 882 /*
882 * Post the puppy! 883 * Post the puppy!
883 */ 884 */
885 spin_lock_irqsave(&qp->lock, lock_flags);
884 err = qp_wr_post(&qp->sq_mq, &wr, qp, msg_size); 886 err = qp_wr_post(&qp->sq_mq, &wr, qp, msg_size);
885 if (err) { 887 if (err) {
888 spin_unlock_irqrestore(&qp->lock, lock_flags);
886 break; 889 break;
887 } 890 }
888 891
@@ -890,6 +893,7 @@ int c2_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr,
890 * Enqueue mq index to activity FIFO. 893 * Enqueue mq index to activity FIFO.
891 */ 894 */
892 c2_activity(c2dev, qp->sq_mq.index, qp->sq_mq.hint_count); 895 c2_activity(c2dev, qp->sq_mq.index, qp->sq_mq.hint_count);
896 spin_unlock_irqrestore(&qp->lock, lock_flags);
893 897
894 ib_wr = ib_wr->next; 898 ib_wr = ib_wr->next;
895 } 899 }
@@ -905,6 +909,7 @@ int c2_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr,
905 struct c2_dev *c2dev = to_c2dev(ibqp->device); 909 struct c2_dev *c2dev = to_c2dev(ibqp->device);
906 struct c2_qp *qp = to_c2qp(ibqp); 910 struct c2_qp *qp = to_c2qp(ibqp);
907 union c2wr wr; 911 union c2wr wr;
912 unsigned long lock_flags;
908 int err = 0; 913 int err = 0;
909 914
910 if (qp->state > IB_QPS_RTS) 915 if (qp->state > IB_QPS_RTS)
@@ -945,8 +950,10 @@ int c2_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr,
945 break; 950 break;
946 } 951 }
947 952
953 spin_lock_irqsave(&qp->lock, lock_flags);
948 err = qp_wr_post(&qp->rq_mq, &wr, qp, qp->rq_mq.msg_size); 954 err = qp_wr_post(&qp->rq_mq, &wr, qp, qp->rq_mq.msg_size);
949 if (err) { 955 if (err) {
956 spin_unlock_irqrestore(&qp->lock, lock_flags);
950 break; 957 break;
951 } 958 }
952 959
@@ -954,6 +961,7 @@ int c2_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *ib_wr,
954 * Enqueue mq index to activity FIFO 961 * Enqueue mq index to activity FIFO
955 */ 962 */
956 c2_activity(c2dev, qp->rq_mq.index, qp->rq_mq.hint_count); 963 c2_activity(c2dev, qp->rq_mq.index, qp->rq_mq.hint_count);
964 spin_unlock_irqrestore(&qp->lock, lock_flags);
957 965
958 ib_wr = ib_wr->next; 966 ib_wr = ib_wr->next;
959 } 967 }
diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c
index 981fe2eebdfa..fc67f780581b 100644
--- a/drivers/infiniband/hw/mthca/mthca_provider.c
+++ b/drivers/infiniband/hw/mthca/mthca_provider.c
@@ -179,6 +179,8 @@ static int mthca_query_port(struct ib_device *ibdev,
179 props->max_mtu = out_mad->data[41] & 0xf; 179 props->max_mtu = out_mad->data[41] & 0xf;
180 props->active_mtu = out_mad->data[36] >> 4; 180 props->active_mtu = out_mad->data[36] >> 4;
181 props->subnet_timeout = out_mad->data[51] & 0x1f; 181 props->subnet_timeout = out_mad->data[51] & 0x1f;
182 props->max_vl_num = out_mad->data[37] >> 4;
183 props->init_type_reply = out_mad->data[41] >> 4;
182 184
183 out: 185 out:
184 kfree(in_mad); 186 kfree(in_mad);
diff --git a/drivers/infiniband/hw/mthca/mthca_srq.c b/drivers/infiniband/hw/mthca/mthca_srq.c
index 0f316c87bf64..92a72f521528 100644
--- a/drivers/infiniband/hw/mthca/mthca_srq.c
+++ b/drivers/infiniband/hw/mthca/mthca_srq.c
@@ -201,6 +201,8 @@ int mthca_alloc_srq(struct mthca_dev *dev, struct mthca_pd *pd,
201 201
202 if (mthca_is_memfree(dev)) 202 if (mthca_is_memfree(dev))
203 srq->max = roundup_pow_of_two(srq->max + 1); 203 srq->max = roundup_pow_of_two(srq->max + 1);
204 else
205 srq->max = srq->max + 1;
204 206
205 ds = max(64UL, 207 ds = max(64UL,
206 roundup_pow_of_two(sizeof (struct mthca_next_seg) + 208 roundup_pow_of_two(sizeof (struct mthca_next_seg) +
@@ -277,7 +279,7 @@ int mthca_alloc_srq(struct mthca_dev *dev, struct mthca_pd *pd,
277 srq->first_free = 0; 279 srq->first_free = 0;
278 srq->last_free = srq->max - 1; 280 srq->last_free = srq->max - 1;
279 281
280 attr->max_wr = (mthca_is_memfree(dev)) ? srq->max - 1 : srq->max; 282 attr->max_wr = srq->max - 1;
281 attr->max_sge = srq->max_gs; 283 attr->max_sge = srq->max_gs;
282 284
283 return 0; 285 return 0;
@@ -413,7 +415,7 @@ int mthca_query_srq(struct ib_srq *ibsrq, struct ib_srq_attr *srq_attr)
413 srq_attr->srq_limit = be16_to_cpu(tavor_ctx->limit_watermark); 415 srq_attr->srq_limit = be16_to_cpu(tavor_ctx->limit_watermark);
414 } 416 }
415 417
416 srq_attr->max_wr = (mthca_is_memfree(dev)) ? srq->max - 1 : srq->max; 418 srq_attr->max_wr = srq->max - 1;
417 srq_attr->max_sge = srq->max_gs; 419 srq_attr->max_sge = srq->max_gs;
418 420
419out: 421out:
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
index f426a69d9a43..8bf5e9ec7c95 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@ -355,6 +355,11 @@ void ipoib_send(struct net_device *dev, struct sk_buff *skb,
355 tx_req->skb = skb; 355 tx_req->skb = skb;
356 addr = dma_map_single(priv->ca->dma_device, skb->data, skb->len, 356 addr = dma_map_single(priv->ca->dma_device, skb->data, skb->len,
357 DMA_TO_DEVICE); 357 DMA_TO_DEVICE);
358 if (unlikely(dma_mapping_error(addr))) {
359 ++priv->stats.tx_errors;
360 dev_kfree_skb_any(skb);
361 return;
362 }
358 pci_unmap_addr_set(tx_req, mapping, addr); 363 pci_unmap_addr_set(tx_req, mapping, addr);
359 364
360 if (unlikely(post_send(priv, priv->tx_head & (ipoib_sendq_size - 1), 365 if (unlikely(post_send(priv, priv->tx_head & (ipoib_sendq_size - 1),
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 44b9e5be6687..4b09147f438f 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -343,29 +343,32 @@ static int srp_send_req(struct srp_target_port *target)
343 */ 343 */
344 if (target->io_class == SRP_REV10_IB_IO_CLASS) { 344 if (target->io_class == SRP_REV10_IB_IO_CLASS) {
345 memcpy(req->priv.initiator_port_id, 345 memcpy(req->priv.initiator_port_id,
346 target->srp_host->initiator_port_id + 8, 8); 346 &target->path.sgid.global.interface_id, 8);
347 memcpy(req->priv.initiator_port_id + 8, 347 memcpy(req->priv.initiator_port_id + 8,
348 target->srp_host->initiator_port_id, 8); 348 &target->initiator_ext, 8);
349 memcpy(req->priv.target_port_id, &target->ioc_guid, 8); 349 memcpy(req->priv.target_port_id, &target->ioc_guid, 8);
350 memcpy(req->priv.target_port_id + 8, &target->id_ext, 8); 350 memcpy(req->priv.target_port_id + 8, &target->id_ext, 8);
351 } else { 351 } else {
352 memcpy(req->priv.initiator_port_id, 352 memcpy(req->priv.initiator_port_id,
353 target->srp_host->initiator_port_id, 16); 353 &target->initiator_ext, 8);
354 memcpy(req->priv.initiator_port_id + 8,
355 &target->path.sgid.global.interface_id, 8);
354 memcpy(req->priv.target_port_id, &target->id_ext, 8); 356 memcpy(req->priv.target_port_id, &target->id_ext, 8);
355 memcpy(req->priv.target_port_id + 8, &target->ioc_guid, 8); 357 memcpy(req->priv.target_port_id + 8, &target->ioc_guid, 8);
356 } 358 }
357 359
358 /* 360 /*
359 * Topspin/Cisco SRP targets will reject our login unless we 361 * Topspin/Cisco SRP targets will reject our login unless we
360 * zero out the first 8 bytes of our initiator port ID. The 362 * zero out the first 8 bytes of our initiator port ID and set
361 * second 8 bytes must be our local node GUID, but we always 363 * the second 8 bytes to the local node GUID.
362 * use that anyway.
363 */ 364 */
364 if (topspin_workarounds && !memcmp(&target->ioc_guid, topspin_oui, 3)) { 365 if (topspin_workarounds && !memcmp(&target->ioc_guid, topspin_oui, 3)) {
365 printk(KERN_DEBUG PFX "Topspin/Cisco initiator port ID workaround " 366 printk(KERN_DEBUG PFX "Topspin/Cisco initiator port ID workaround "
366 "activated for target GUID %016llx\n", 367 "activated for target GUID %016llx\n",
367 (unsigned long long) be64_to_cpu(target->ioc_guid)); 368 (unsigned long long) be64_to_cpu(target->ioc_guid));
368 memset(req->priv.initiator_port_id, 0, 8); 369 memset(req->priv.initiator_port_id, 0, 8);
370 memcpy(req->priv.initiator_port_id + 8,
371 &target->srp_host->dev->dev->node_guid, 8);
369 } 372 }
370 373
371 status = ib_send_cm_req(target->cm_id, &req->param); 374 status = ib_send_cm_req(target->cm_id, &req->param);
@@ -1553,6 +1556,7 @@ enum {
1553 SRP_OPT_MAX_SECT = 1 << 5, 1556 SRP_OPT_MAX_SECT = 1 << 5,
1554 SRP_OPT_MAX_CMD_PER_LUN = 1 << 6, 1557 SRP_OPT_MAX_CMD_PER_LUN = 1 << 6,
1555 SRP_OPT_IO_CLASS = 1 << 7, 1558 SRP_OPT_IO_CLASS = 1 << 7,
1559 SRP_OPT_INITIATOR_EXT = 1 << 8,
1556 SRP_OPT_ALL = (SRP_OPT_ID_EXT | 1560 SRP_OPT_ALL = (SRP_OPT_ID_EXT |
1557 SRP_OPT_IOC_GUID | 1561 SRP_OPT_IOC_GUID |
1558 SRP_OPT_DGID | 1562 SRP_OPT_DGID |
@@ -1569,6 +1573,7 @@ static match_table_t srp_opt_tokens = {
1569 { SRP_OPT_MAX_SECT, "max_sect=%d" }, 1573 { SRP_OPT_MAX_SECT, "max_sect=%d" },
1570 { SRP_OPT_MAX_CMD_PER_LUN, "max_cmd_per_lun=%d" }, 1574 { SRP_OPT_MAX_CMD_PER_LUN, "max_cmd_per_lun=%d" },
1571 { SRP_OPT_IO_CLASS, "io_class=%x" }, 1575 { SRP_OPT_IO_CLASS, "io_class=%x" },
1576 { SRP_OPT_INITIATOR_EXT, "initiator_ext=%s" },
1572 { SRP_OPT_ERR, NULL } 1577 { SRP_OPT_ERR, NULL }
1573}; 1578};
1574 1579
@@ -1668,6 +1673,12 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target)
1668 target->io_class = token; 1673 target->io_class = token;
1669 break; 1674 break;
1670 1675
1676 case SRP_OPT_INITIATOR_EXT:
1677 p = match_strdup(args);
1678 target->initiator_ext = cpu_to_be64(simple_strtoull(p, NULL, 16));
1679 kfree(p);
1680 break;
1681
1671 default: 1682 default:
1672 printk(KERN_WARNING PFX "unknown parameter or missing value " 1683 printk(KERN_WARNING PFX "unknown parameter or missing value "
1673 "'%s' in target creation request\n", p); 1684 "'%s' in target creation request\n", p);
@@ -1708,7 +1719,6 @@ static ssize_t srp_create_target(struct class_device *class_dev,
1708 target_host->max_lun = SRP_MAX_LUN; 1719 target_host->max_lun = SRP_MAX_LUN;
1709 1720
1710 target = host_to_target(target_host); 1721 target = host_to_target(target_host);
1711 memset(target, 0, sizeof *target);
1712 1722
1713 target->io_class = SRP_REV16A_IB_IO_CLASS; 1723 target->io_class = SRP_REV16A_IB_IO_CLASS;
1714 target->scsi_host = target_host; 1724 target->scsi_host = target_host;
@@ -1815,9 +1825,6 @@ static struct srp_host *srp_add_port(struct srp_device *device, u8 port)
1815 host->dev = device; 1825 host->dev = device;
1816 host->port = port; 1826 host->port = port;
1817 1827
1818 host->initiator_port_id[7] = port;
1819 memcpy(host->initiator_port_id + 8, &device->dev->node_guid, 8);
1820
1821 host->class_dev.class = &srp_class; 1828 host->class_dev.class = &srp_class;
1822 host->class_dev.dev = device->dev->dma_device; 1829 host->class_dev.dev = device->dev->dma_device;
1823 snprintf(host->class_dev.class_id, BUS_ID_SIZE, "srp-%s-%d", 1830 snprintf(host->class_dev.class_id, BUS_ID_SIZE, "srp-%s-%d",
diff --git a/drivers/infiniband/ulp/srp/ib_srp.h b/drivers/infiniband/ulp/srp/ib_srp.h
index 5b581fb8eb0d..d4e35ef51374 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.h
+++ b/drivers/infiniband/ulp/srp/ib_srp.h
@@ -91,7 +91,6 @@ struct srp_device {
91}; 91};
92 92
93struct srp_host { 93struct srp_host {
94 u8 initiator_port_id[16];
95 struct srp_device *dev; 94 struct srp_device *dev;
96 u8 port; 95 u8 port;
97 struct class_device class_dev; 96 struct class_device class_dev;
@@ -122,6 +121,7 @@ struct srp_target_port {
122 __be64 id_ext; 121 __be64 id_ext;
123 __be64 ioc_guid; 122 __be64 ioc_guid;
124 __be64 service_id; 123 __be64 service_id;
124 __be64 initiator_ext;
125 u16 io_class; 125 u16 io_class;
126 struct srp_host *srp_host; 126 struct srp_host *srp_host;
127 struct Scsi_Host *scsi_host; 127 struct Scsi_Host *scsi_host;
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 679bde34d247..81a333f73010 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -166,7 +166,7 @@ config KEYBOARD_AMIGA
166 166
167config KEYBOARD_HIL_OLD 167config KEYBOARD_HIL_OLD
168 tristate "HP HIL keyboard support (simple driver)" 168 tristate "HP HIL keyboard support (simple driver)"
169 depends on GSC 169 depends on GSC || HP300
170 default y 170 default y
171 help 171 help
172 The "Human Interface Loop" is a older, 8-channel USB-like 172 The "Human Interface Loop" is a older, 8-channel USB-like
@@ -183,7 +183,7 @@ config KEYBOARD_HIL_OLD
183 183
184config KEYBOARD_HIL 184config KEYBOARD_HIL
185 tristate "HP HIL keyboard support" 185 tristate "HP HIL keyboard support"
186 depends on GSC 186 depends on GSC || HP300
187 default y 187 default y
188 select HP_SDC 188 select HP_SDC
189 select HIL_MLC 189 select HIL_MLC
diff --git a/drivers/input/keyboard/hil_kbd.c b/drivers/input/keyboard/hil_kbd.c
index c9b0b8978cd8..e774dd31e99b 100644
--- a/drivers/input/keyboard/hil_kbd.c
+++ b/drivers/input/keyboard/hil_kbd.c
@@ -328,7 +328,7 @@ static int hil_kbd_connect(struct serio *serio, struct serio_driver *drv)
328 kbd->dev->id.vendor = PCI_VENDOR_ID_HP; 328 kbd->dev->id.vendor = PCI_VENDOR_ID_HP;
329 kbd->dev->id.product = 0x0001; /* TODO: get from kbd->rsc */ 329 kbd->dev->id.product = 0x0001; /* TODO: get from kbd->rsc */
330 kbd->dev->id.version = 0x0100; /* TODO: get from kbd->rsc */ 330 kbd->dev->id.version = 0x0100; /* TODO: get from kbd->rsc */
331 kbd->dev->dev = &serio->dev; 331 kbd->dev->cdev.dev = &serio->dev;
332 332
333 for (i = 0; i < 128; i++) { 333 for (i = 0; i < 128; i++) {
334 set_bit(hil_kbd_set1[i], kbd->dev->keybit); 334 set_bit(hil_kbd_set1[i], kbd->dev->keybit);
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index a6dfc7455733..ba0e88c64e1e 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -73,7 +73,7 @@ config INPUT_UINPUT
73 73
74config HP_SDC_RTC 74config HP_SDC_RTC
75 tristate "HP SDC Real Time Clock" 75 tristate "HP SDC Real Time Clock"
76 depends on GSC 76 depends on GSC || HP300
77 select HP_SDC 77 select HP_SDC
78 help 78 help
79 Say Y here if you want to support the built-in real time clock 79 Say Y here if you want to support the built-in real time clock
diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig
index f15ccf781688..35d998c3e578 100644
--- a/drivers/input/mouse/Kconfig
+++ b/drivers/input/mouse/Kconfig
@@ -119,7 +119,7 @@ config MOUSE_VSXXXAA
119 119
120config MOUSE_HIL 120config MOUSE_HIL
121 tristate "HIL pointers (mice etc)." 121 tristate "HIL pointers (mice etc)."
122 depends on GSC 122 depends on GSC || HP300
123 select HP_SDC 123 select HP_SDC
124 select HIL_MLC 124 select HIL_MLC
125 help 125 help
diff --git a/drivers/input/mouse/hil_ptr.c b/drivers/input/mouse/hil_ptr.c
index 402b057e986e..4f2b503c1ac7 100644
--- a/drivers/input/mouse/hil_ptr.c
+++ b/drivers/input/mouse/hil_ptr.c
@@ -375,7 +375,7 @@ static int hil_ptr_connect(struct serio *serio, struct serio_driver *driver)
375 ptr->dev->id.vendor = PCI_VENDOR_ID_HP; 375 ptr->dev->id.vendor = PCI_VENDOR_ID_HP;
376 ptr->dev->id.product = 0x0001; /* TODO: get from ptr->rsc */ 376 ptr->dev->id.product = 0x0001; /* TODO: get from ptr->rsc */
377 ptr->dev->id.version = 0x0100; /* TODO: get from ptr->rsc */ 377 ptr->dev->id.version = 0x0100; /* TODO: get from ptr->rsc */
378 ptr->dev->dev = &serio->dev; 378 ptr->dev->cdev.dev = &serio->dev;
379 379
380 input_register_device(ptr->dev); 380 input_register_device(ptr->dev);
381 printk(KERN_INFO "input: %s (%s), ID: %d\n", 381 printk(KERN_INFO "input: %s (%s), ID: %d\n",
diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig
index 8cdbfeca5903..adef447f23ea 100644
--- a/drivers/input/serio/Kconfig
+++ b/drivers/input/serio/Kconfig
@@ -112,7 +112,7 @@ config SERIO_GSCPS2
112 112
113config HP_SDC 113config HP_SDC
114 tristate "HP System Device Controller i8042 Support" 114 tristate "HP System Device Controller i8042 Support"
115 depends on GSC && SERIO 115 depends on (GSC || HP300) && SERIO
116 default y 116 default y
117 ---help--- 117 ---help---
118 This option enables support for the "System Device 118 This option enables support for the "System Device
diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c
index 081fdc3c7737..74f14e097789 100644
--- a/drivers/input/serio/gscps2.c
+++ b/drivers/input/serio/gscps2.c
@@ -166,7 +166,7 @@ static inline int gscps2_writeb_output(struct gscps2port *ps2port, u8 data)
166 166
167 /* make sure any received data is returned as fast as possible */ 167 /* make sure any received data is returned as fast as possible */
168 /* this is important e.g. when we set the LEDs on the keyboard */ 168 /* this is important e.g. when we set the LEDs on the keyboard */
169 gscps2_interrupt(0, NULL, NULL); 169 gscps2_interrupt(0, NULL);
170 170
171 return 1; 171 return 1;
172} 172}
@@ -306,7 +306,7 @@ static int gscps2_open(struct serio *port)
306 /* enable it */ 306 /* enable it */
307 gscps2_enable(ps2port, ENABLE); 307 gscps2_enable(ps2port, ENABLE);
308 308
309 gscps2_interrupt(0, NULL, NULL); 309 gscps2_interrupt(0, NULL);
310 310
311 return 0; 311 return 0;
312} 312}
diff --git a/drivers/input/serio/hil_mlc.c b/drivers/input/serio/hil_mlc.c
index bbbe15e21904..bdfde046b741 100644
--- a/drivers/input/serio/hil_mlc.c
+++ b/drivers/input/serio/hil_mlc.c
@@ -162,10 +162,10 @@ static void hil_mlc_send_polls(hil_mlc *mlc) {
162 if (did != (p & HIL_PKT_ADDR_MASK) >> 8) { 162 if (did != (p & HIL_PKT_ADDR_MASK) >> 8) {
163 if (drv == NULL || drv->interrupt == NULL) goto skip; 163 if (drv == NULL || drv->interrupt == NULL) goto skip;
164 164
165 drv->interrupt(serio, 0, 0, NULL); 165 drv->interrupt(serio, 0, 0);
166 drv->interrupt(serio, HIL_ERR_INT >> 16, 0, NULL); 166 drv->interrupt(serio, HIL_ERR_INT >> 16, 0);
167 drv->interrupt(serio, HIL_PKT_CMD >> 8, 0, NULL); 167 drv->interrupt(serio, HIL_PKT_CMD >> 8, 0);
168 drv->interrupt(serio, HIL_CMD_POL + cnt, 0, NULL); 168 drv->interrupt(serio, HIL_CMD_POL + cnt, 0);
169 skip: 169 skip:
170 did = (p & HIL_PKT_ADDR_MASK) >> 8; 170 did = (p & HIL_PKT_ADDR_MASK) >> 8;
171 serio = did ? mlc->serio[mlc->di_map[did-1]] : NULL; 171 serio = did ? mlc->serio[mlc->di_map[did-1]] : NULL;
@@ -174,10 +174,10 @@ static void hil_mlc_send_polls(hil_mlc *mlc) {
174 } 174 }
175 cnt++; i++; 175 cnt++; i++;
176 if (drv == NULL || drv->interrupt == NULL) continue; 176 if (drv == NULL || drv->interrupt == NULL) continue;
177 drv->interrupt(serio, (p >> 24), 0, NULL); 177 drv->interrupt(serio, (p >> 24), 0);
178 drv->interrupt(serio, (p >> 16) & 0xff, 0, NULL); 178 drv->interrupt(serio, (p >> 16) & 0xff, 0);
179 drv->interrupt(serio, (p >> 8) & ~HIL_PKT_ADDR_MASK, 0, NULL); 179 drv->interrupt(serio, (p >> 8) & ~HIL_PKT_ADDR_MASK, 0);
180 drv->interrupt(serio, p & 0xff, 0, NULL); 180 drv->interrupt(serio, p & 0xff, 0);
181 } 181 }
182} 182}
183 183
@@ -780,16 +780,16 @@ static int hil_mlc_serio_write(struct serio *serio, unsigned char c) {
780 while ((last != idx) && (*last == 0)) last--; 780 while ((last != idx) && (*last == 0)) last--;
781 781
782 while (idx != last) { 782 while (idx != last) {
783 drv->interrupt(serio, 0, 0, NULL); 783 drv->interrupt(serio, 0, 0);
784 drv->interrupt(serio, HIL_ERR_INT >> 16, 0, NULL); 784 drv->interrupt(serio, HIL_ERR_INT >> 16, 0);
785 drv->interrupt(serio, 0, 0, NULL); 785 drv->interrupt(serio, 0, 0);
786 drv->interrupt(serio, *idx, 0, NULL); 786 drv->interrupt(serio, *idx, 0);
787 idx++; 787 idx++;
788 } 788 }
789 drv->interrupt(serio, 0, 0, NULL); 789 drv->interrupt(serio, 0, 0);
790 drv->interrupt(serio, HIL_ERR_INT >> 16, 0, NULL); 790 drv->interrupt(serio, HIL_ERR_INT >> 16, 0);
791 drv->interrupt(serio, HIL_PKT_CMD >> 8, 0, NULL); 791 drv->interrupt(serio, HIL_PKT_CMD >> 8, 0);
792 drv->interrupt(serio, *idx, 0, NULL); 792 drv->interrupt(serio, *idx, 0);
793 793
794 mlc->serio_oidx[map->didx] = 0; 794 mlc->serio_oidx[map->didx] = 0;
795 mlc->serio_opacket[map->didx] = 0; 795 mlc->serio_opacket[map->didx] = 0;
diff --git a/drivers/isdn/act2000/act2000_isa.c b/drivers/isdn/act2000/act2000_isa.c
index 3014495b7ff7..3cac23739344 100644
--- a/drivers/isdn/act2000/act2000_isa.c
+++ b/drivers/isdn/act2000/act2000_isa.c
@@ -16,8 +16,6 @@
16#include "act2000_isa.h" 16#include "act2000_isa.h"
17#include "capi.h" 17#include "capi.h"
18 18
19static act2000_card *irq2card_map[16];
20
21/* 19/*
22 * Reset Controller, then try to read the Card's signature. 20 * Reset Controller, then try to read the Card's signature.
23 + Return: 21 + Return:
@@ -65,14 +63,9 @@ act2000_isa_detect(unsigned short portbase)
65static irqreturn_t 63static irqreturn_t
66act2000_isa_interrupt(int irq, void *dev_id) 64act2000_isa_interrupt(int irq, void *dev_id)
67{ 65{
68 act2000_card *card = irq2card_map[irq]; 66 act2000_card *card = dev_id;
69 u_char istatus; 67 u_char istatus;
70 68
71 if (!card) {
72 printk(KERN_WARNING
73 "act2000: Spurious interrupt!\n");
74 return IRQ_NONE;
75 }
76 istatus = (inb(ISA_PORT_ISR) & 0x07); 69 istatus = (inb(ISA_PORT_ISR) & 0x07);
77 if (istatus & ISA_ISR_OUT) { 70 if (istatus & ISA_ISR_OUT) {
78 /* RX fifo has data */ 71 /* RX fifo has data */
@@ -139,17 +132,15 @@ int
139act2000_isa_config_irq(act2000_card * card, short irq) 132act2000_isa_config_irq(act2000_card * card, short irq)
140{ 133{
141 if (card->flags & ACT2000_FLAGS_IVALID) { 134 if (card->flags & ACT2000_FLAGS_IVALID) {
142 free_irq(card->irq, NULL); 135 free_irq(card->irq, card);
143 irq2card_map[card->irq] = NULL;
144 } 136 }
145 card->flags &= ~ACT2000_FLAGS_IVALID; 137 card->flags &= ~ACT2000_FLAGS_IVALID;
146 outb(ISA_COR_IRQOFF, ISA_PORT_COR); 138 outb(ISA_COR_IRQOFF, ISA_PORT_COR);
147 if (!irq) 139 if (!irq)
148 return 0; 140 return 0;
149 141
150 if (!request_irq(irq, &act2000_isa_interrupt, 0, card->regname, NULL)) { 142 if (!request_irq(irq, &act2000_isa_interrupt, 0, card->regname, card)) {
151 card->irq = irq; 143 card->irq = irq;
152 irq2card_map[card->irq] = card;
153 card->flags |= ACT2000_FLAGS_IVALID; 144 card->flags |= ACT2000_FLAGS_IVALID;
154 printk(KERN_WARNING 145 printk(KERN_WARNING
155 "act2000: Could not request irq %d\n",irq); 146 "act2000: Could not request irq %d\n",irq);
@@ -188,10 +179,9 @@ act2000_isa_release(act2000_card * card)
188 unsigned long flags; 179 unsigned long flags;
189 180
190 spin_lock_irqsave(&card->lock, flags); 181 spin_lock_irqsave(&card->lock, flags);
191 if (card->flags & ACT2000_FLAGS_IVALID) { 182 if (card->flags & ACT2000_FLAGS_IVALID)
192 free_irq(card->irq, NULL); 183 free_irq(card->irq, card);
193 irq2card_map[card->irq] = NULL; 184
194 }
195 card->flags &= ~ACT2000_FLAGS_IVALID; 185 card->flags &= ~ACT2000_FLAGS_IVALID;
196 if (card->flags & ACT2000_FLAGS_PVALID) 186 if (card->flags & ACT2000_FLAGS_PVALID)
197 release_region(card->port, ISA_REGION); 187 release_region(card->port, ISA_REGION);
diff --git a/drivers/macintosh/adb-iop.c b/drivers/macintosh/adb-iop.c
index 1ffee7aaff20..17ef5d3c01b4 100644
--- a/drivers/macintosh/adb-iop.c
+++ b/drivers/macintosh/adb-iop.c
@@ -266,7 +266,7 @@ int adb_iop_autopoll(int devs)
266void adb_iop_poll(void) 266void adb_iop_poll(void)
267{ 267{
268 if (adb_iop_state == idle) adb_iop_start(); 268 if (adb_iop_state == idle) adb_iop_start();
269 iop_ism_irq(0, (void *) ADB_IOP, NULL); 269 iop_ism_irq(0, (void *) ADB_IOP);
270} 270}
271 271
272int adb_iop_reset_bus(void) 272int adb_iop_reset_bus(void)
diff --git a/drivers/macintosh/macio-adb.c b/drivers/macintosh/macio-adb.c
index 57ccc19cbdbf..797cef72258f 100644
--- a/drivers/macintosh/macio-adb.c
+++ b/drivers/macintosh/macio-adb.c
@@ -270,6 +270,6 @@ static void macio_adb_poll(void)
270 270
271 local_irq_save(flags); 271 local_irq_save(flags);
272 if (in_8(&adb->intr.r) != 0) 272 if (in_8(&adb->intr.r) != 0)
273 macio_adb_interrupt(0, NULL, NULL); 273 macio_adb_interrupt(0, NULL);
274 local_irq_restore(flags); 274 local_irq_restore(flags);
275} 275}
diff --git a/drivers/macintosh/via-cuda.c b/drivers/macintosh/via-cuda.c
index 64a07ccfe369..df66291b1322 100644
--- a/drivers/macintosh/via-cuda.c
+++ b/drivers/macintosh/via-cuda.c
@@ -437,7 +437,7 @@ cuda_poll(void)
437 * disable_irq(), would that work on m68k ? --BenH 437 * disable_irq(), would that work on m68k ? --BenH
438 */ 438 */
439 local_irq_save(flags); 439 local_irq_save(flags);
440 cuda_interrupt(0, NULL, NULL); 440 cuda_interrupt(0, NULL);
441 local_irq_restore(flags); 441 local_irq_restore(flags);
442} 442}
443 443
diff --git a/drivers/macintosh/via-macii.c b/drivers/macintosh/via-macii.c
index ad4bd579f610..5d88d5b0ad99 100644
--- a/drivers/macintosh/via-macii.c
+++ b/drivers/macintosh/via-macii.c
@@ -295,7 +295,7 @@ static void macii_poll(void)
295 unsigned long flags; 295 unsigned long flags;
296 296
297 local_irq_save(flags); 297 local_irq_save(flags);
298 if (via[IFR] & SR_INT) macii_interrupt(0, NULL, NULL); 298 if (via[IFR] & SR_INT) macii_interrupt(0, NULL);
299 local_irq_restore(flags); 299 local_irq_restore(flags);
300} 300}
301 301
diff --git a/drivers/macintosh/via-maciisi.c b/drivers/macintosh/via-maciisi.c
index 789ee52086fe..1f0aa5dc9aa5 100644
--- a/drivers/macintosh/via-maciisi.c
+++ b/drivers/macintosh/via-maciisi.c
@@ -421,7 +421,7 @@ maciisi_poll(void)
421 421
422 local_irq_save(flags); 422 local_irq_save(flags);
423 if (via[IFR] & SR_INT) { 423 if (via[IFR] & SR_INT) {
424 maciisi_interrupt(0, NULL, NULL); 424 maciisi_interrupt(0, NULL);
425 } 425 }
426 else /* avoid calling this function too quickly in a loop */ 426 else /* avoid calling this function too quickly in a loop */
427 udelay(ADB_DELAY); 427 udelay(ADB_DELAY);
diff --git a/drivers/macintosh/via-pmu68k.c b/drivers/macintosh/via-pmu68k.c
index 98ec915d0409..d9986f3a3fbf 100644
--- a/drivers/macintosh/via-pmu68k.c
+++ b/drivers/macintosh/via-pmu68k.c
@@ -221,7 +221,7 @@ pmu_init(void)
221 } 221 }
222 if (pmu_state == idle) { 222 if (pmu_state == idle) {
223 adb_int_pending = 1; 223 adb_int_pending = 1;
224 pmu_interrupt(0, NULL, NULL); 224 pmu_interrupt(0, NULL);
225 } 225 }
226 pmu_poll(); 226 pmu_poll();
227 udelay(10); 227 udelay(10);
@@ -562,11 +562,11 @@ pmu_poll(void)
562 local_irq_save(flags); 562 local_irq_save(flags);
563 if (via1[IFR] & SR_INT) { 563 if (via1[IFR] & SR_INT) {
564 via1[IFR] = SR_INT; 564 via1[IFR] = SR_INT;
565 pmu_interrupt(IRQ_MAC_ADB_SR, NULL, NULL); 565 pmu_interrupt(IRQ_MAC_ADB_SR, NULL);
566 } 566 }
567 if (via1[IFR] & CB1_INT) { 567 if (via1[IFR] & CB1_INT) {
568 via1[IFR] = CB1_INT; 568 via1[IFR] = CB1_INT;
569 pmu_interrupt(IRQ_MAC_ADB_CL, NULL, NULL); 569 pmu_interrupt(IRQ_MAC_ADB_CL, NULL);
570 } 570 }
571 local_irq_restore(flags); 571 local_irq_restore(flags);
572} 572}
diff --git a/drivers/macintosh/windfarm_pm112.c b/drivers/macintosh/windfarm_pm112.c
index ef66bf2778ec..fa4b13f89369 100644
--- a/drivers/macintosh/windfarm_pm112.c
+++ b/drivers/macintosh/windfarm_pm112.c
@@ -650,24 +650,26 @@ static struct notifier_block pm112_events = {
650 .notifier_call = pm112_wf_notify, 650 .notifier_call = pm112_wf_notify,
651}; 651};
652 652
653static int wf_pm112_probe(struct device *dev) 653static int wf_pm112_probe(struct platform_device *dev)
654{ 654{
655 wf_register_client(&pm112_events); 655 wf_register_client(&pm112_events);
656 return 0; 656 return 0;
657} 657}
658 658
659static int wf_pm112_remove(struct device *dev) 659static int __devexit wf_pm112_remove(struct platform_device *dev)
660{ 660{
661 wf_unregister_client(&pm112_events); 661 wf_unregister_client(&pm112_events);
662 /* should release all sensors and controls */ 662 /* should release all sensors and controls */
663 return 0; 663 return 0;
664} 664}
665 665
666static struct device_driver wf_pm112_driver = { 666static struct platform_driver wf_pm112_driver = {
667 .name = "windfarm",
668 .bus = &platform_bus_type,
669 .probe = wf_pm112_probe, 667 .probe = wf_pm112_probe,
670 .remove = wf_pm112_remove, 668 .remove = __devexit_p(wf_pm112_remove),
669 .driver = {
670 .name = "windfarm",
671 .bus = &platform_bus_type,
672 },
671}; 673};
672 674
673static int __init wf_pm112_init(void) 675static int __init wf_pm112_init(void)
@@ -683,13 +685,13 @@ static int __init wf_pm112_init(void)
683 ++nr_cores; 685 ++nr_cores;
684 686
685 printk(KERN_INFO "windfarm: initializing for dual-core desktop G5\n"); 687 printk(KERN_INFO "windfarm: initializing for dual-core desktop G5\n");
686 driver_register(&wf_pm112_driver); 688 platform_driver_register(&wf_pm112_driver);
687 return 0; 689 return 0;
688} 690}
689 691
690static void __exit wf_pm112_exit(void) 692static void __exit wf_pm112_exit(void)
691{ 693{
692 driver_unregister(&wf_pm112_driver); 694 platform_driver_unregister(&wf_pm112_driver);
693} 695}
694 696
695module_init(wf_pm112_init); 697module_init(wf_pm112_init);
diff --git a/drivers/macintosh/windfarm_pm81.c b/drivers/macintosh/windfarm_pm81.c
index 2ff546e4c92f..2a944851b8e1 100644
--- a/drivers/macintosh/windfarm_pm81.c
+++ b/drivers/macintosh/windfarm_pm81.c
@@ -131,8 +131,6 @@
131 131
132static int wf_smu_mach_model; /* machine model id */ 132static int wf_smu_mach_model; /* machine model id */
133 133
134static struct device *wf_smu_dev;
135
136/* Controls & sensors */ 134/* Controls & sensors */
137static struct wf_sensor *sensor_cpu_power; 135static struct wf_sensor *sensor_cpu_power;
138static struct wf_sensor *sensor_cpu_temp; 136static struct wf_sensor *sensor_cpu_temp;
@@ -717,16 +715,14 @@ static int wf_init_pm(void)
717 return 0; 715 return 0;
718} 716}
719 717
720static int wf_smu_probe(struct device *ddev) 718static int wf_smu_probe(struct platform_device *ddev)
721{ 719{
722 wf_smu_dev = ddev;
723
724 wf_register_client(&wf_smu_events); 720 wf_register_client(&wf_smu_events);
725 721
726 return 0; 722 return 0;
727} 723}
728 724
729static int wf_smu_remove(struct device *ddev) 725static int __devexit wf_smu_remove(struct platform_device *ddev)
730{ 726{
731 wf_unregister_client(&wf_smu_events); 727 wf_unregister_client(&wf_smu_events);
732 728
@@ -766,16 +762,16 @@ static int wf_smu_remove(struct device *ddev)
766 if (wf_smu_cpu_fans) 762 if (wf_smu_cpu_fans)
767 kfree(wf_smu_cpu_fans); 763 kfree(wf_smu_cpu_fans);
768 764
769 wf_smu_dev = NULL;
770
771 return 0; 765 return 0;
772} 766}
773 767
774static struct device_driver wf_smu_driver = { 768static struct platform_driver wf_smu_driver = {
775 .name = "windfarm",
776 .bus = &platform_bus_type,
777 .probe = wf_smu_probe, 769 .probe = wf_smu_probe,
778 .remove = wf_smu_remove, 770 .remove = __devexit_p(wf_smu_remove),
771 .driver = {
772 .name = "windfarm",
773 .bus = &platform_bus_type,
774 },
779}; 775};
780 776
781 777
@@ -794,7 +790,7 @@ static int __init wf_smu_init(void)
794 request_module("windfarm_lm75_sensor"); 790 request_module("windfarm_lm75_sensor");
795 791
796#endif /* MODULE */ 792#endif /* MODULE */
797 driver_register(&wf_smu_driver); 793 platform_driver_register(&wf_smu_driver);
798 } 794 }
799 795
800 return rc; 796 return rc;
@@ -803,7 +799,7 @@ static int __init wf_smu_init(void)
803static void __exit wf_smu_exit(void) 799static void __exit wf_smu_exit(void)
804{ 800{
805 801
806 driver_unregister(&wf_smu_driver); 802 platform_driver_unregister(&wf_smu_driver);
807} 803}
808 804
809 805
diff --git a/drivers/macintosh/windfarm_pm91.c b/drivers/macintosh/windfarm_pm91.c
index 59e9ffe37c39..9961a67b4f85 100644
--- a/drivers/macintosh/windfarm_pm91.c
+++ b/drivers/macintosh/windfarm_pm91.c
@@ -63,8 +63,6 @@
63 */ 63 */
64#undef HACKED_OVERTEMP 64#undef HACKED_OVERTEMP
65 65
66static struct device *wf_smu_dev;
67
68/* Controls & sensors */ 66/* Controls & sensors */
69static struct wf_sensor *sensor_cpu_power; 67static struct wf_sensor *sensor_cpu_power;
70static struct wf_sensor *sensor_cpu_temp; 68static struct wf_sensor *sensor_cpu_temp;
@@ -641,16 +639,14 @@ static int wf_init_pm(void)
641 return 0; 639 return 0;
642} 640}
643 641
644static int wf_smu_probe(struct device *ddev) 642static int wf_smu_probe(struct platform_device *ddev)
645{ 643{
646 wf_smu_dev = ddev;
647
648 wf_register_client(&wf_smu_events); 644 wf_register_client(&wf_smu_events);
649 645
650 return 0; 646 return 0;
651} 647}
652 648
653static int wf_smu_remove(struct device *ddev) 649static int __devexit wf_smu_remove(struct platform_device *ddev)
654{ 650{
655 wf_unregister_client(&wf_smu_events); 651 wf_unregister_client(&wf_smu_events);
656 652
@@ -698,16 +694,16 @@ static int wf_smu_remove(struct device *ddev)
698 if (wf_smu_cpu_fans) 694 if (wf_smu_cpu_fans)
699 kfree(wf_smu_cpu_fans); 695 kfree(wf_smu_cpu_fans);
700 696
701 wf_smu_dev = NULL;
702
703 return 0; 697 return 0;
704} 698}
705 699
706static struct device_driver wf_smu_driver = { 700static struct platform_driver wf_smu_driver = {
707 .name = "windfarm",
708 .bus = &platform_bus_type,
709 .probe = wf_smu_probe, 701 .probe = wf_smu_probe,
710 .remove = wf_smu_remove, 702 .remove = __devexit_p(wf_smu_remove),
703 .driver = {
704 .name = "windfarm",
705 .bus = &platform_bus_type,
706 },
711}; 707};
712 708
713 709
@@ -725,7 +721,7 @@ static int __init wf_smu_init(void)
725 request_module("windfarm_lm75_sensor"); 721 request_module("windfarm_lm75_sensor");
726 722
727#endif /* MODULE */ 723#endif /* MODULE */
728 driver_register(&wf_smu_driver); 724 platform_driver_register(&wf_smu_driver);
729 } 725 }
730 726
731 return rc; 727 return rc;
@@ -734,7 +730,7 @@ static int __init wf_smu_init(void)
734static void __exit wf_smu_exit(void) 730static void __exit wf_smu_exit(void)
735{ 731{
736 732
737 driver_unregister(&wf_smu_driver); 733 platform_driver_unregister(&wf_smu_driver);
738} 734}
739 735
740 736
diff --git a/drivers/md/md.c b/drivers/md/md.c
index cb8281605be8..57fa64f93e5f 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -3849,6 +3849,7 @@ static int hot_add_disk(mddev_t * mddev, dev_t dev)
3849 } 3849 }
3850 clear_bit(In_sync, &rdev->flags); 3850 clear_bit(In_sync, &rdev->flags);
3851 rdev->desc_nr = -1; 3851 rdev->desc_nr = -1;
3852 rdev->saved_raid_disk = -1;
3852 err = bind_rdev_to_array(rdev, mddev); 3853 err = bind_rdev_to_array(rdev, mddev);
3853 if (err) 3854 if (err)
3854 goto abort_export; 3855 goto abort_export;
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index 20df657b70c8..2a461dde480c 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -174,7 +174,7 @@ static void em28xx_config_i2c(struct em28xx *dev)
174 174
175 route.input = INPUT(dev->ctl_input)->vmux; 175 route.input = INPUT(dev->ctl_input)->vmux;
176 route.output = 0; 176 route.output = 0;
177 em28xx_i2c_call_clients(dev, VIDIOC_INT_RESET, 0); 177 em28xx_i2c_call_clients(dev, VIDIOC_INT_RESET, NULL);
178 em28xx_i2c_call_clients(dev, VIDIOC_INT_S_VIDEO_ROUTING, &route); 178 em28xx_i2c_call_clients(dev, VIDIOC_INT_S_VIDEO_ROUTING, &route);
179 em28xx_i2c_call_clients(dev, VIDIOC_STREAMON, NULL); 179 em28xx_i2c_call_clients(dev, VIDIOC_STREAMON, NULL);
180 180
diff --git a/drivers/media/video/zoran_device.c b/drivers/media/video/zoran_device.c
index d9d5020a2224..168e431d7c71 100644
--- a/drivers/media/video/zoran_device.c
+++ b/drivers/media/video/zoran_device.c
@@ -1415,7 +1415,7 @@ zoran_irq (int irq,
1415 struct zoran *zr; 1415 struct zoran *zr;
1416 unsigned long flags; 1416 unsigned long flags;
1417 1417
1418 zr = (struct zoran *) dev_id; 1418 zr = dev_id;
1419 count = 0; 1419 count = 0;
1420 1420
1421 if (zr->testing) { 1421 if (zr->testing) {
diff --git a/drivers/misc/tifm_7xx1.c b/drivers/misc/tifm_7xx1.c
index b1748669e05b..1ba8754e9383 100644
--- a/drivers/misc/tifm_7xx1.c
+++ b/drivers/misc/tifm_7xx1.c
@@ -48,7 +48,7 @@ static void tifm_7xx1_remove_media(void *adapter)
48 printk(KERN_INFO DRIVER_NAME 48 printk(KERN_INFO DRIVER_NAME
49 ": demand removing card from socket %d\n", cnt); 49 ": demand removing card from socket %d\n", cnt);
50 sock = fm->sockets[cnt]; 50 sock = fm->sockets[cnt];
51 fm->sockets[cnt] = 0; 51 fm->sockets[cnt] = NULL;
52 fm->remove_mask &= ~(1 << cnt); 52 fm->remove_mask &= ~(1 << cnt);
53 53
54 writel(0x0e00, sock->addr + SOCK_CONTROL); 54 writel(0x0e00, sock->addr + SOCK_CONTROL);
@@ -118,7 +118,7 @@ static irqreturn_t tifm_7xx1_isr(int irq, void *dev_id)
118 return IRQ_HANDLED; 118 return IRQ_HANDLED;
119} 119}
120 120
121static tifm_media_id tifm_7xx1_toggle_sock_power(char *sock_addr, int is_x2) 121static tifm_media_id tifm_7xx1_toggle_sock_power(char __iomem *sock_addr, int is_x2)
122{ 122{
123 unsigned int s_state; 123 unsigned int s_state;
124 int cnt; 124 int cnt;
@@ -163,7 +163,8 @@ static tifm_media_id tifm_7xx1_toggle_sock_power(char *sock_addr, int is_x2)
163 return (readl(sock_addr + SOCK_PRESENT_STATE) >> 4) & 7; 163 return (readl(sock_addr + SOCK_PRESENT_STATE) >> 4) & 7;
164} 164}
165 165
166inline static char *tifm_7xx1_sock_addr(char *base_addr, unsigned int sock_num) 166inline static char __iomem *
167tifm_7xx1_sock_addr(char __iomem *base_addr, unsigned int sock_num)
167{ 168{
168 return base_addr + ((sock_num + 1) << 10); 169 return base_addr + ((sock_num + 1) << 10);
169} 170}
@@ -176,7 +177,7 @@ static void tifm_7xx1_insert_media(void *adapter)
176 char *card_name = "xx"; 177 char *card_name = "xx";
177 int cnt, ok_to_register; 178 int cnt, ok_to_register;
178 unsigned int insert_mask; 179 unsigned int insert_mask;
179 struct tifm_dev *new_sock = 0; 180 struct tifm_dev *new_sock = NULL;
180 181
181 if (!class_device_get(&fm->cdev)) 182 if (!class_device_get(&fm->cdev))
182 return; 183 return;
@@ -230,7 +231,7 @@ static void tifm_7xx1_insert_media(void *adapter)
230 if (!ok_to_register || 231 if (!ok_to_register ||
231 device_register(&new_sock->dev)) { 232 device_register(&new_sock->dev)) {
232 spin_lock_irqsave(&fm->lock, flags); 233 spin_lock_irqsave(&fm->lock, flags);
233 fm->sockets[cnt] = 0; 234 fm->sockets[cnt] = NULL;
234 spin_unlock_irqrestore(&fm->lock, 235 spin_unlock_irqrestore(&fm->lock,
235 flags); 236 flags);
236 tifm_free_device(&new_sock->dev); 237 tifm_free_device(&new_sock->dev);
@@ -390,7 +391,7 @@ static void tifm_7xx1_remove(struct pci_dev *dev)
390 391
391 tifm_remove_adapter(fm); 392 tifm_remove_adapter(fm);
392 393
393 pci_set_drvdata(dev, 0); 394 pci_set_drvdata(dev, NULL);
394 395
395 iounmap(fm->addr); 396 iounmap(fm->addr);
396 pci_intx(dev, 0); 397 pci_intx(dev, 0);
diff --git a/drivers/misc/tifm_core.c b/drivers/misc/tifm_core.c
index cca5f8522469..ee326136d03b 100644
--- a/drivers/misc/tifm_core.c
+++ b/drivers/misc/tifm_core.c
@@ -157,7 +157,7 @@ struct tifm_dev *tifm_alloc_device(struct tifm_adapter *fm, unsigned int id)
157 dev->wq = create_singlethread_workqueue(dev->wq_name); 157 dev->wq = create_singlethread_workqueue(dev->wq_name);
158 if (!dev->wq) { 158 if (!dev->wq) {
159 kfree(dev); 159 kfree(dev);
160 return 0; 160 return NULL;
161 } 161 }
162 dev->dev.parent = fm->dev; 162 dev->dev.parent = fm->dev;
163 dev->dev.bus = &tifm_bus_type; 163 dev->dev.bus = &tifm_bus_type;
diff --git a/drivers/mmc/mmc_block.c b/drivers/mmc/mmc_block.c
index c1293f1bda87..f9027c8db792 100644
--- a/drivers/mmc/mmc_block.c
+++ b/drivers/mmc/mmc_block.c
@@ -28,6 +28,7 @@
28#include <linux/kdev_t.h> 28#include <linux/kdev_t.h>
29#include <linux/blkdev.h> 29#include <linux/blkdev.h>
30#include <linux/mutex.h> 30#include <linux/mutex.h>
31#include <linux/scatterlist.h>
31 32
32#include <linux/mmc/card.h> 33#include <linux/mmc/card.h>
33#include <linux/mmc/host.h> 34#include <linux/mmc/host.h>
@@ -154,6 +155,71 @@ static int mmc_blk_prep_rq(struct mmc_queue *mq, struct request *req)
154 return stat; 155 return stat;
155} 156}
156 157
158static u32 mmc_sd_num_wr_blocks(struct mmc_card *card)
159{
160 int err;
161 u32 blocks;
162
163 struct mmc_request mrq;
164 struct mmc_command cmd;
165 struct mmc_data data;
166 unsigned int timeout_us;
167
168 struct scatterlist sg;
169
170 memset(&cmd, 0, sizeof(struct mmc_command));
171
172 cmd.opcode = MMC_APP_CMD;
173 cmd.arg = card->rca << 16;
174 cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
175
176 err = mmc_wait_for_cmd(card->host, &cmd, 0);
177 if ((err != MMC_ERR_NONE) || !(cmd.resp[0] & R1_APP_CMD))
178 return (u32)-1;
179
180 memset(&cmd, 0, sizeof(struct mmc_command));
181
182 cmd.opcode = SD_APP_SEND_NUM_WR_BLKS;
183 cmd.arg = 0;
184 cmd.flags = MMC_RSP_R1 | MMC_CMD_ADTC;
185
186 memset(&data, 0, sizeof(struct mmc_data));
187
188 data.timeout_ns = card->csd.tacc_ns * 100;
189 data.timeout_clks = card->csd.tacc_clks * 100;
190
191 timeout_us = data.timeout_ns / 1000;
192 timeout_us += data.timeout_clks * 1000 /
193 (card->host->ios.clock / 1000);
194
195 if (timeout_us > 100000) {
196 data.timeout_ns = 100000000;
197 data.timeout_clks = 0;
198 }
199
200 data.blksz = 4;
201 data.blocks = 1;
202 data.flags = MMC_DATA_READ;
203 data.sg = &sg;
204 data.sg_len = 1;
205
206 memset(&mrq, 0, sizeof(struct mmc_request));
207
208 mrq.cmd = &cmd;
209 mrq.data = &data;
210
211 sg_init_one(&sg, &blocks, 4);
212
213 mmc_wait_for_req(card->host, &mrq);
214
215 if (cmd.error != MMC_ERR_NONE || data.error != MMC_ERR_NONE)
216 return (u32)-1;
217
218 blocks = ntohl(blocks);
219
220 return blocks;
221}
222
157static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) 223static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
158{ 224{
159 struct mmc_blk_data *md = mq->data; 225 struct mmc_blk_data *md = mq->data;
@@ -184,10 +250,13 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
184 250
185 /* 251 /*
186 * If the host doesn't support multiple block writes, force 252 * If the host doesn't support multiple block writes, force
187 * block writes to single block. 253 * block writes to single block. SD cards are excepted from
254 * this rule as they support querying the number of
255 * successfully written sectors.
188 */ 256 */
189 if (rq_data_dir(req) != READ && 257 if (rq_data_dir(req) != READ &&
190 !(card->host->caps & MMC_CAP_MULTIWRITE)) 258 !(card->host->caps & MMC_CAP_MULTIWRITE) &&
259 !mmc_card_sd(card))
191 brq.data.blocks = 1; 260 brq.data.blocks = 1;
192 261
193 if (brq.data.blocks > 1) { 262 if (brq.data.blocks > 1) {
@@ -276,24 +345,41 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
276 return 1; 345 return 1;
277 346
278 cmd_err: 347 cmd_err:
279 mmc_card_release_host(card);
280
281 ret = 1; 348 ret = 1;
282 349
283 /* 350 /*
284 * For writes and where the host claims to support proper 351 * If this is an SD card and we're writing, we can first
285 * error reporting, we first ok the successful blocks. 352 * mark the known good sectors as ok.
353 *
354 * If the card is not SD, we can still ok written sectors
355 * if the controller can do proper error reporting.
286 * 356 *
287 * For reads we just fail the entire chunk as that should 357 * For reads we just fail the entire chunk as that should
288 * be safe in all cases. 358 * be safe in all cases.
289 */ 359 */
290 if (rq_data_dir(req) != READ && 360 if (rq_data_dir(req) != READ && mmc_card_sd(card)) {
291 (card->host->caps & MMC_CAP_MULTIWRITE)) { 361 u32 blocks;
362 unsigned int bytes;
363
364 blocks = mmc_sd_num_wr_blocks(card);
365 if (blocks != (u32)-1) {
366 if (card->csd.write_partial)
367 bytes = blocks << md->block_bits;
368 else
369 bytes = blocks << 9;
370 spin_lock_irq(&md->lock);
371 ret = end_that_request_chunk(req, 1, bytes);
372 spin_unlock_irq(&md->lock);
373 }
374 } else if (rq_data_dir(req) != READ &&
375 (card->host->caps & MMC_CAP_MULTIWRITE)) {
292 spin_lock_irq(&md->lock); 376 spin_lock_irq(&md->lock);
293 ret = end_that_request_chunk(req, 1, brq.data.bytes_xfered); 377 ret = end_that_request_chunk(req, 1, brq.data.bytes_xfered);
294 spin_unlock_irq(&md->lock); 378 spin_unlock_irq(&md->lock);
295 } 379 }
296 380
381 mmc_card_release_host(card);
382
297 spin_lock_irq(&md->lock); 383 spin_lock_irq(&md->lock);
298 while (ret) { 384 while (ret) {
299 ret = end_that_request_chunk(req, 0, 385 ret = end_that_request_chunk(req, 0,
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 6d024342b2fd..9a7d39b7cdbf 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -1329,7 +1329,7 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
1329 tasklet_init(&host->finish_tasklet, 1329 tasklet_init(&host->finish_tasklet,
1330 sdhci_tasklet_finish, (unsigned long)host); 1330 sdhci_tasklet_finish, (unsigned long)host);
1331 1331
1332 setup_timer(&host->timer, sdhci_timeout_timer, (long)host); 1332 setup_timer(&host->timer, sdhci_timeout_timer, (unsigned long)host);
1333 1333
1334 ret = request_irq(host->irq, sdhci_irq, IRQF_SHARED, 1334 ret = request_irq(host->irq, sdhci_irq, IRQF_SHARED,
1335 host->slot_descr, host); 1335 host->slot_descr, host);
diff --git a/drivers/mmc/tifm_sd.c b/drivers/mmc/tifm_sd.c
index 6d23dc08d169..2bacff60913d 100644
--- a/drivers/mmc/tifm_sd.c
+++ b/drivers/mmc/tifm_sd.c
@@ -501,13 +501,13 @@ static void tifm_sd_end_cmd(void *data)
501 struct tifm_dev *sock = host->dev; 501 struct tifm_dev *sock = host->dev;
502 struct mmc_host *mmc = tifm_get_drvdata(sock); 502 struct mmc_host *mmc = tifm_get_drvdata(sock);
503 struct mmc_request *mrq; 503 struct mmc_request *mrq;
504 struct mmc_data *r_data = 0; 504 struct mmc_data *r_data = NULL;
505 unsigned long flags; 505 unsigned long flags;
506 506
507 spin_lock_irqsave(&sock->lock, flags); 507 spin_lock_irqsave(&sock->lock, flags);
508 508
509 mrq = host->req; 509 mrq = host->req;
510 host->req = 0; 510 host->req = NULL;
511 host->state = IDLE; 511 host->state = IDLE;
512 512
513 if (!mrq) { 513 if (!mrq) {
@@ -546,7 +546,7 @@ static void tifm_sd_request_nodma(struct mmc_host *mmc, struct mmc_request *mrq)
546 struct tifm_dev *sock = host->dev; 546 struct tifm_dev *sock = host->dev;
547 unsigned long flags; 547 unsigned long flags;
548 struct mmc_data *r_data = mrq->cmd->data; 548 struct mmc_data *r_data = mrq->cmd->data;
549 char *t_buffer = 0; 549 char *t_buffer = NULL;
550 550
551 if (r_data) { 551 if (r_data) {
552 t_buffer = kmap(r_data->sg->page); 552 t_buffer = kmap(r_data->sg->page);
@@ -613,13 +613,13 @@ static void tifm_sd_end_cmd_nodma(void *data)
613 struct tifm_dev *sock = host->dev; 613 struct tifm_dev *sock = host->dev;
614 struct mmc_host *mmc = tifm_get_drvdata(sock); 614 struct mmc_host *mmc = tifm_get_drvdata(sock);
615 struct mmc_request *mrq; 615 struct mmc_request *mrq;
616 struct mmc_data *r_data = 0; 616 struct mmc_data *r_data = NULL;
617 unsigned long flags; 617 unsigned long flags;
618 618
619 spin_lock_irqsave(&sock->lock, flags); 619 spin_lock_irqsave(&sock->lock, flags);
620 620
621 mrq = host->req; 621 mrq = host->req;
622 host->req = 0; 622 host->req = NULL;
623 host->state = IDLE; 623 host->state = IDLE;
624 624
625 if (!mrq) { 625 if (!mrq) {
@@ -644,7 +644,7 @@ static void tifm_sd_end_cmd_nodma(void *data)
644 r_data->bytes_xfered += r_data->blksz - 644 r_data->bytes_xfered += r_data->blksz -
645 readl(sock->addr + SOCK_MMCSD_BLOCK_LEN) + 1; 645 readl(sock->addr + SOCK_MMCSD_BLOCK_LEN) + 1;
646 } 646 }
647 host->buffer = 0; 647 host->buffer = NULL;
648 host->buffer_pos = 0; 648 host->buffer_pos = 0;
649 host->buffer_size = 0; 649 host->buffer_size = 0;
650 } 650 }
@@ -895,7 +895,7 @@ static void tifm_sd_remove(struct tifm_dev *sock)
895 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR); 895 sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR);
896 writel(0, sock->addr + SOCK_DMA_FIFO_INT_ENABLE_SET); 896 writel(0, sock->addr + SOCK_DMA_FIFO_INT_ENABLE_SET);
897 897
898 tifm_set_drvdata(sock, 0); 898 tifm_set_drvdata(sock, NULL);
899 mmc_free_host(mmc); 899 mmc_free_host(mmc);
900} 900}
901 901
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c
index bc7cc71788bc..d1717763f719 100644
--- a/drivers/mtd/maps/physmap.c
+++ b/drivers/mtd/maps/physmap.c
@@ -62,7 +62,7 @@ static int physmap_flash_remove(struct platform_device *dev)
62 } 62 }
63 63
64 if (info->map.virt != NULL) 64 if (info->map.virt != NULL)
65 iounmap((void *)info->map.virt); 65 iounmap(info->map.virt);
66 66
67 if (info->res != NULL) { 67 if (info->res != NULL) {
68 release_resource(info->res); 68 release_resource(info->res);
diff --git a/drivers/mtd/nand/cs553x_nand.c b/drivers/mtd/nand/cs553x_nand.c
index e0a1d386e581..94924d52a9b9 100644
--- a/drivers/mtd/nand/cs553x_nand.c
+++ b/drivers/mtd/nand/cs553x_nand.c
@@ -249,7 +249,7 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr)
249 goto out; 249 goto out;
250 250
251out_ior: 251out_ior:
252 iounmap((void *)this->IO_ADDR_R); 252 iounmap(this->IO_ADDR_R);
253out_mtd: 253out_mtd:
254 kfree(new_mtd); 254 kfree(new_mtd);
255out: 255out:
diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c
index 7ad0a54779c4..f791bf026e51 100644
--- a/drivers/net/3c509.c
+++ b/drivers/net/3c509.c
@@ -912,16 +912,11 @@ el3_start_xmit(struct sk_buff *skb, struct net_device *dev)
912static irqreturn_t 912static irqreturn_t
913el3_interrupt(int irq, void *dev_id) 913el3_interrupt(int irq, void *dev_id)
914{ 914{
915 struct net_device *dev = (struct net_device *)dev_id; 915 struct net_device *dev = dev_id;
916 struct el3_private *lp; 916 struct el3_private *lp;
917 int ioaddr, status; 917 int ioaddr, status;
918 int i = max_interrupt_work; 918 int i = max_interrupt_work;
919 919
920 if (dev == NULL) {
921 printk ("el3_interrupt(): irq %d for unknown device.\n", irq);
922 return IRQ_NONE;
923 }
924
925 lp = netdev_priv(dev); 920 lp = netdev_priv(dev);
926 spin_lock(&lp->lock); 921 spin_lock(&lp->lock);
927 922
diff --git a/drivers/net/3c523.c b/drivers/net/3c523.c
index 1c97271112d0..91849469b4f4 100644
--- a/drivers/net/3c523.c
+++ b/drivers/net/3c523.c
@@ -902,14 +902,11 @@ static void *alloc_rfa(struct net_device *dev, void *ptr)
902static irqreturn_t 902static irqreturn_t
903elmc_interrupt(int irq, void *dev_id) 903elmc_interrupt(int irq, void *dev_id)
904{ 904{
905 struct net_device *dev = (struct net_device *) dev_id; 905 struct net_device *dev = dev_id;
906 unsigned short stat; 906 unsigned short stat;
907 struct priv *p; 907 struct priv *p;
908 908
909 if (dev == NULL) { 909 if (!netif_running(dev)) {
910 printk(KERN_ERR "elmc-interrupt: irq %d for unknown device.\n", irq);
911 return IRQ_NONE;
912 } else if (!netif_running(dev)) {
913 /* The 3c523 has this habit of generating interrupts during the 910 /* The 3c523 has this habit of generating interrupts during the
914 reset. I'm not sure if the ni52 has this same problem, but it's 911 reset. I'm not sure if the ni52 has this same problem, but it's
915 really annoying if we haven't finished initializing it. I was 912 really annoying if we haven't finished initializing it. I was
diff --git a/drivers/net/3c527.c b/drivers/net/3c527.c
index d516c3225ca4..f4aca5386add 100644
--- a/drivers/net/3c527.c
+++ b/drivers/net/3c527.c
@@ -1324,11 +1324,6 @@ static irqreturn_t mc32_interrupt(int irq, void *dev_id)
1324 int rx_event = 0; 1324 int rx_event = 0;
1325 int tx_event = 0; 1325 int tx_event = 0;
1326 1326
1327 if (dev == NULL) {
1328 printk(KERN_WARNING "%s: irq %d for unknown device.\n", cardname, irq);
1329 return IRQ_NONE;
1330 }
1331
1332 ioaddr = dev->base_addr; 1327 ioaddr = dev->base_addr;
1333 lp = netdev_priv(dev); 1328 lp = netdev_priv(dev);
1334 1329
diff --git a/drivers/net/7990.c b/drivers/net/7990.c
index 8e996b4a34ea..7733697f7776 100644
--- a/drivers/net/7990.c
+++ b/drivers/net/7990.c
@@ -674,7 +674,7 @@ void lance_poll(struct net_device *dev)
674 WRITERAP(lp, LE_CSR0); 674 WRITERAP(lp, LE_CSR0);
675 WRITERDP(lp, LE_C0_STRT); 675 WRITERDP(lp, LE_C0_STRT);
676 spin_unlock (&lp->devlock); 676 spin_unlock (&lp->devlock);
677 lance_interrupt(dev->irq, dev, NULL); 677 lance_interrupt(dev->irq, dev);
678} 678}
679#endif 679#endif
680 680
diff --git a/drivers/net/8390.c b/drivers/net/8390.c
index fa3442cb1a49..3d1c599ac3cb 100644
--- a/drivers/net/8390.c
+++ b/drivers/net/8390.c
@@ -406,14 +406,8 @@ irqreturn_t ei_interrupt(int irq, void *dev_id)
406 int interrupts, nr_serviced = 0; 406 int interrupts, nr_serviced = 0;
407 struct ei_device *ei_local; 407 struct ei_device *ei_local;
408 408
409 if (dev == NULL)
410 {
411 printk ("net_interrupt(): irq %d for unknown device.\n", irq);
412 return IRQ_NONE;
413 }
414
415 e8390_base = dev->base_addr; 409 e8390_base = dev->base_addr;
416 ei_local = (struct ei_device *) netdev_priv(dev); 410 ei_local = netdev_priv(dev);
417 411
418 /* 412 /*
419 * Protect the irq test too. 413 * Protect the irq test too.
diff --git a/drivers/net/atp.c b/drivers/net/atp.c
index 062f80e20874..2d306fcb7f36 100644
--- a/drivers/net/atp.c
+++ b/drivers/net/atp.c
@@ -598,17 +598,13 @@ static int atp_send_packet(struct sk_buff *skb, struct net_device *dev)
598 Handle the network interface interrupts. */ 598 Handle the network interface interrupts. */
599static irqreturn_t atp_interrupt(int irq, void *dev_instance) 599static irqreturn_t atp_interrupt(int irq, void *dev_instance)
600{ 600{
601 struct net_device *dev = (struct net_device *)dev_instance; 601 struct net_device *dev = dev_instance;
602 struct net_local *lp; 602 struct net_local *lp;
603 long ioaddr; 603 long ioaddr;
604 static int num_tx_since_rx; 604 static int num_tx_since_rx;
605 int boguscount = max_interrupt_work; 605 int boguscount = max_interrupt_work;
606 int handled = 0; 606 int handled = 0;
607 607
608 if (dev == NULL) {
609 printk(KERN_ERR "ATP_interrupt(): irq %d for unknown device.\n", irq);
610 return IRQ_NONE;
611 }
612 ioaddr = dev->base_addr; 608 ioaddr = dev->base_addr;
613 lp = netdev_priv(dev); 609 lp = netdev_priv(dev);
614 610
diff --git a/drivers/net/chelsio/cpl5_cmd.h b/drivers/net/chelsio/cpl5_cmd.h
index 27925e487bcf..5b357d9e88d6 100644
--- a/drivers/net/chelsio/cpl5_cmd.h
+++ b/drivers/net/chelsio/cpl5_cmd.h
@@ -108,7 +108,7 @@ struct cpl_tx_pkt_lso {
108 u8 iff:4; 108 u8 iff:4;
109#endif 109#endif
110 u16 vlan; 110 u16 vlan;
111 u32 len; 111 __be32 len;
112 112
113 u32 rsvd2; 113 u32 rsvd2;
114 u8 rsvd3; 114 u8 rsvd3;
@@ -119,7 +119,7 @@ struct cpl_tx_pkt_lso {
119 u8 ip_hdr_words:4; 119 u8 ip_hdr_words:4;
120 u8 tcp_hdr_words:4; 120 u8 tcp_hdr_words:4;
121#endif 121#endif
122 u16 eth_type_mss; 122 __be16 eth_type_mss;
123}; 123};
124 124
125struct cpl_rx_pkt { 125struct cpl_rx_pkt {
@@ -138,7 +138,7 @@ struct cpl_rx_pkt {
138 u8 iff:4; 138 u8 iff:4;
139#endif 139#endif
140 u16 csum; 140 u16 csum;
141 u16 vlan; 141 __be16 vlan;
142 u16 len; 142 u16 len;
143}; 143};
144 144
diff --git a/drivers/net/de600.c b/drivers/net/de600.c
index d9b006c9e367..690bb40b353d 100644
--- a/drivers/net/de600.c
+++ b/drivers/net/de600.c
@@ -265,12 +265,6 @@ static irqreturn_t de600_interrupt(int irq, void *dev_id)
265 int retrig = 0; 265 int retrig = 0;
266 int boguscount = 0; 266 int boguscount = 0;
267 267
268 /* This might just as well be deleted now, no crummy drivers present :-) */
269 if ((dev == NULL) || (DE600_IRQ != irq)) {
270 printk(KERN_ERR "%s: bogus interrupt %d\n", dev?dev->name:"DE-600", irq);
271 return IRQ_NONE;
272 }
273
274 spin_lock(&de600_lock); 268 spin_lock(&de600_lock);
275 269
276 select_nic(); 270 select_nic();
diff --git a/drivers/net/declance.c b/drivers/net/declance.c
index e179aa1c1ba0..00e2a8a134d7 100644
--- a/drivers/net/declance.c
+++ b/drivers/net/declance.c
@@ -696,7 +696,7 @@ out:
696 696
697static irqreturn_t lance_dma_merr_int(const int irq, void *dev_id) 697static irqreturn_t lance_dma_merr_int(const int irq, void *dev_id)
698{ 698{
699 struct net_device *dev = (struct net_device *) dev_id; 699 struct net_device *dev = dev_id;
700 700
701 printk("%s: DMA error\n", dev->name); 701 printk("%s: DMA error\n", dev->name);
702 return IRQ_HANDLED; 702 return IRQ_HANDLED;
@@ -704,7 +704,7 @@ static irqreturn_t lance_dma_merr_int(const int irq, void *dev_id)
704 704
705static irqreturn_t lance_interrupt(const int irq, void *dev_id) 705static irqreturn_t lance_interrupt(const int irq, void *dev_id)
706{ 706{
707 struct net_device *dev = (struct net_device *) dev_id; 707 struct net_device *dev = dev_id;
708 struct lance_private *lp = netdev_priv(dev); 708 struct lance_private *lp = netdev_priv(dev);
709 volatile struct lance_regs *ll = lp->ll; 709 volatile struct lance_regs *ll = lp->ll;
710 int csr0; 710 int csr0;
diff --git a/drivers/net/dgrs.c b/drivers/net/dgrs.c
index 6b1234b09fb3..a79520295fd0 100644
--- a/drivers/net/dgrs.c
+++ b/drivers/net/dgrs.c
@@ -897,8 +897,8 @@ static int dgrs_ioctl(struct net_device *devN, struct ifreq *ifr, int cmd)
897 897
898static irqreturn_t dgrs_intr(int irq, void *dev_id) 898static irqreturn_t dgrs_intr(int irq, void *dev_id)
899{ 899{
900 struct net_device *dev0 = (struct net_device *) dev_id; 900 struct net_device *dev0 = dev_id;
901 DGRS_PRIV *priv0 = (DGRS_PRIV *) dev0->priv; 901 DGRS_PRIV *priv0 = dev0->priv;
902 I596_CB *cbp; 902 I596_CB *cbp;
903 int cmd; 903 int cmd;
904 int i; 904 int i;
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index 3641f3b4a2cc..615d2b14efa7 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -346,7 +346,7 @@ static void dm9000_timeout(struct net_device *dev)
346static void dm9000_poll_controller(struct net_device *dev) 346static void dm9000_poll_controller(struct net_device *dev)
347{ 347{
348 disable_irq(dev->irq); 348 disable_irq(dev->irq);
349 dm9000_interrupt(dev->irq,dev,NULL); 349 dm9000_interrupt(dev->irq,dev);
350 enable_irq(dev->irq); 350 enable_irq(dev->irq);
351} 351}
352#endif 352#endif
diff --git a/drivers/net/eepro.c b/drivers/net/eepro.c
index aae454aaa1c6..a4eb0dc99ecf 100644
--- a/drivers/net/eepro.c
+++ b/drivers/net/eepro.c
@@ -994,16 +994,6 @@ static int eepro_open(struct net_device *dev)
994 return -EAGAIN; 994 return -EAGAIN;
995 } 995 }
996 996
997#ifdef irq2dev_map
998 if (((irq2dev_map[dev->irq] != 0)
999 || (irq2dev_map[dev->irq] = dev) == 0) &&
1000 (irq2dev_map[dev->irq]!=dev)) {
1001 /* printk("%s: IRQ map wrong\n", dev->name); */
1002 free_irq(dev->irq, dev);
1003 return -EAGAIN;
1004 }
1005#endif
1006
1007 /* Initialize the 82595. */ 997 /* Initialize the 82595. */
1008 998
1009 eepro_sw2bank2(ioaddr); /* be CAREFUL, BANK 2 now */ 999 eepro_sw2bank2(ioaddr); /* be CAREFUL, BANK 2 now */
@@ -1198,17 +1188,11 @@ static int eepro_send_packet(struct sk_buff *skb, struct net_device *dev)
1198static irqreturn_t 1188static irqreturn_t
1199eepro_interrupt(int irq, void *dev_id) 1189eepro_interrupt(int irq, void *dev_id)
1200{ 1190{
1201 struct net_device *dev = (struct net_device *)dev_id; 1191 struct net_device *dev = dev_id;
1202 /* (struct net_device *)(irq2dev_map[irq]);*/
1203 struct eepro_local *lp; 1192 struct eepro_local *lp;
1204 int ioaddr, status, boguscount = 20; 1193 int ioaddr, status, boguscount = 20;
1205 int handled = 0; 1194 int handled = 0;
1206 1195
1207 if (dev == NULL) {
1208 printk (KERN_ERR "eepro_interrupt(): irq %d for unknown device.\\n", irq);
1209 return IRQ_NONE;
1210 }
1211
1212 lp = netdev_priv(dev); 1196 lp = netdev_priv(dev);
1213 1197
1214 spin_lock(&lp->lock); 1198 spin_lock(&lp->lock);
@@ -1288,10 +1272,6 @@ static int eepro_close(struct net_device *dev)
1288 /* release the interrupt */ 1272 /* release the interrupt */
1289 free_irq(dev->irq, dev); 1273 free_irq(dev->irq, dev);
1290 1274
1291#ifdef irq2dev_map
1292 irq2dev_map[dev->irq] = 0;
1293#endif
1294
1295 /* Update the statistics here. What statistics? */ 1275 /* Update the statistics here. What statistics? */
1296 1276
1297 return 0; 1277 return 0;
diff --git a/drivers/net/eexpress.c b/drivers/net/eexpress.c
index 05ca730fe81e..e14be020e562 100644
--- a/drivers/net/eexpress.c
+++ b/drivers/net/eexpress.c
@@ -796,13 +796,6 @@ static irqreturn_t eexp_irq(int irq, void *dev_info)
796 unsigned short ioaddr,status,ack_cmd; 796 unsigned short ioaddr,status,ack_cmd;
797 unsigned short old_read_ptr, old_write_ptr; 797 unsigned short old_read_ptr, old_write_ptr;
798 798
799 if (dev==NULL)
800 {
801 printk(KERN_WARNING "eexpress: irq %d for unknown device\n",
802 irq);
803 return IRQ_NONE;
804 }
805
806 lp = netdev_priv(dev); 799 lp = netdev_priv(dev);
807 ioaddr = dev->base_addr; 800 ioaddr = dev->base_addr;
808 801
diff --git a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c
index 971e2dee1e6b..cebf8c374bc5 100644
--- a/drivers/net/irda/ali-ircc.c
+++ b/drivers/net/irda/ali-ircc.c
@@ -662,19 +662,13 @@ static int ali_ircc_read_dongle_id (int i, chipio_t *info)
662 */ 662 */
663static irqreturn_t ali_ircc_interrupt(int irq, void *dev_id) 663static irqreturn_t ali_ircc_interrupt(int irq, void *dev_id)
664{ 664{
665 struct net_device *dev = (struct net_device *) dev_id; 665 struct net_device *dev = dev_id;
666 struct ali_ircc_cb *self; 666 struct ali_ircc_cb *self;
667 int ret; 667 int ret;
668 668
669 IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__); 669 IRDA_DEBUG(2, "%s(), ---------------- Start ----------------\n", __FUNCTION__);
670 670
671 if (!dev) { 671 self = dev->priv;
672 IRDA_WARNING("%s: irq %d for unknown device.\n",
673 ALI_IRCC_DRIVER_NAME, irq);
674 return IRQ_NONE;
675 }
676
677 self = (struct ali_ircc_cb *) dev->priv;
678 672
679 spin_lock(&self->lock); 673 spin_lock(&self->lock);
680 674
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c
index 7a9128181e68..16620bd97fbf 100644
--- a/drivers/net/irda/donauboe.c
+++ b/drivers/net/irda/donauboe.c
@@ -657,12 +657,6 @@ toshoboe_makemttpacket (struct toshoboe_cb *self, void *buf, int mtt)
657 return xbofs; 657 return xbofs;
658} 658}
659 659
660static int toshoboe_invalid_dev(int irq)
661{
662 printk (KERN_WARNING DRIVER_NAME ": irq %d for unknown device.\n", irq);
663 return 1;
664}
665
666#ifdef USE_PROBE 660#ifdef USE_PROBE
667/***********************************************************************/ 661/***********************************************************************/
668/* Probe code */ 662/* Probe code */
@@ -711,12 +705,9 @@ stuff_byte (__u8 byte, __u8 * buf)
711static irqreturn_t 705static irqreturn_t
712toshoboe_probeinterrupt (int irq, void *dev_id) 706toshoboe_probeinterrupt (int irq, void *dev_id)
713{ 707{
714 struct toshoboe_cb *self = (struct toshoboe_cb *) dev_id; 708 struct toshoboe_cb *self = dev_id;
715 __u8 irqstat; 709 __u8 irqstat;
716 710
717 if (self == NULL && toshoboe_invalid_dev(irq))
718 return IRQ_NONE;
719
720 irqstat = INB (OBOE_ISR); 711 irqstat = INB (OBOE_ISR);
721 712
722/* was it us */ 713/* was it us */
@@ -1163,13 +1154,10 @@ dumpbufs(skb->data,skb->len,'>');
1163static irqreturn_t 1154static irqreturn_t
1164toshoboe_interrupt (int irq, void *dev_id) 1155toshoboe_interrupt (int irq, void *dev_id)
1165{ 1156{
1166 struct toshoboe_cb *self = (struct toshoboe_cb *) dev_id; 1157 struct toshoboe_cb *self = dev_id;
1167 __u8 irqstat; 1158 __u8 irqstat;
1168 struct sk_buff *skb = NULL; 1159 struct sk_buff *skb = NULL;
1169 1160
1170 if (self == NULL && toshoboe_invalid_dev(irq))
1171 return IRQ_NONE;
1172
1173 irqstat = INB (OBOE_ISR); 1161 irqstat = INB (OBOE_ISR);
1174 1162
1175/* was it us */ 1163/* was it us */
@@ -1357,13 +1345,11 @@ toshoboe_net_open (struct net_device *dev)
1357{ 1345{
1358 struct toshoboe_cb *self; 1346 struct toshoboe_cb *self;
1359 unsigned long flags; 1347 unsigned long flags;
1348 int rc;
1360 1349
1361 IRDA_DEBUG (4, "%s()\n", __FUNCTION__); 1350 IRDA_DEBUG (4, "%s()\n", __FUNCTION__);
1362 1351
1363 IRDA_ASSERT (dev != NULL, return -1; ); 1352 self = netdev_priv(dev);
1364 self = (struct toshoboe_cb *) dev->priv;
1365
1366 IRDA_ASSERT (self != NULL, return 0; );
1367 1353
1368 if (self->async) 1354 if (self->async)
1369 return -EBUSY; 1355 return -EBUSY;
@@ -1371,11 +1357,10 @@ toshoboe_net_open (struct net_device *dev)
1371 if (self->stopped) 1357 if (self->stopped)
1372 return 0; 1358 return 0;
1373 1359
1374 if (request_irq (self->io.irq, toshoboe_interrupt, 1360 rc = request_irq (self->io.irq, toshoboe_interrupt,
1375 IRQF_SHARED | IRQF_DISABLED, dev->name, (void *) self)) 1361 IRQF_SHARED | IRQF_DISABLED, dev->name, self);
1376 { 1362 if (rc)
1377 return -EAGAIN; 1363 return rc;
1378 }
1379 1364
1380 spin_lock_irqsave(&self->spinlock, flags); 1365 spin_lock_irqsave(&self->spinlock, flags);
1381 toshoboe_startchip (self); 1366 toshoboe_startchip (self);
diff --git a/drivers/net/irda/irport.c b/drivers/net/irda/irport.c
index 6ea78ececca7..654a68b490ae 100644
--- a/drivers/net/irda/irport.c
+++ b/drivers/net/irda/irport.c
@@ -766,18 +766,14 @@ static inline void irport_receive(struct irport_cb *self)
766 */ 766 */
767static irqreturn_t irport_interrupt(int irq, void *dev_id) 767static irqreturn_t irport_interrupt(int irq, void *dev_id)
768{ 768{
769 struct net_device *dev = (struct net_device *) dev_id; 769 struct net_device *dev = dev_id;
770 struct irport_cb *self; 770 struct irport_cb *self;
771 int boguscount = 0; 771 int boguscount = 0;
772 int iobase; 772 int iobase;
773 int iir, lsr; 773 int iir, lsr;
774 int handled = 0; 774 int handled = 0;
775 775
776 if (!dev) { 776 self = dev->priv;
777 IRDA_WARNING("%s() irq %d for unknown device.\n", __FUNCTION__, irq);
778 return IRQ_NONE;
779 }
780 self = (struct irport_cb *) dev->priv;
781 777
782 spin_lock(&self->lock); 778 spin_lock(&self->lock);
783 779
diff --git a/drivers/net/irda/irport.h b/drivers/net/irda/irport.h
index 4393168347e3..3f46b84c6c85 100644
--- a/drivers/net/irda/irport.h
+++ b/drivers/net/irda/irport.h
@@ -74,7 +74,7 @@ struct irport_cb {
74 /* For piggyback drivers */ 74 /* For piggyback drivers */
75 void *priv; 75 void *priv;
76 void (*change_speed)(void *priv, __u32 speed); 76 void (*change_speed)(void *priv, __u32 speed);
77 int (*interrupt)(int irq, void *dev_id); 77 irqreturn_t (*interrupt)(int irq, void *dev_id);
78}; 78};
79 79
80#endif /* IRPORT_H */ 80#endif /* IRPORT_H */
diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c
index ea12e999814a..29b5ccd29d0b 100644
--- a/drivers/net/irda/nsc-ircc.c
+++ b/drivers/net/irda/nsc-ircc.c
@@ -2068,17 +2068,12 @@ static void nsc_ircc_fir_interrupt(struct nsc_ircc_cb *self, int iobase,
2068 */ 2068 */
2069static irqreturn_t nsc_ircc_interrupt(int irq, void *dev_id) 2069static irqreturn_t nsc_ircc_interrupt(int irq, void *dev_id)
2070{ 2070{
2071 struct net_device *dev = (struct net_device *) dev_id; 2071 struct net_device *dev = dev_id;
2072 struct nsc_ircc_cb *self; 2072 struct nsc_ircc_cb *self;
2073 __u8 bsr, eir; 2073 __u8 bsr, eir;
2074 int iobase; 2074 int iobase;
2075 2075
2076 if (!dev) { 2076 self = dev->priv;
2077 IRDA_WARNING("%s: irq %d for unknown device.\n",
2078 driver_name, irq);
2079 return IRQ_NONE;
2080 }
2081 self = (struct nsc_ircc_cb *) dev->priv;
2082 2077
2083 spin_lock(&self->lock); 2078 spin_lock(&self->lock);
2084 2079
diff --git a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c
index b4fb92a7baa8..4212657fa4f9 100644
--- a/drivers/net/irda/w83977af_ir.c
+++ b/drivers/net/irda/w83977af_ir.c
@@ -1113,17 +1113,12 @@ static __u8 w83977af_fir_interrupt(struct w83977af_ir *self, int isr)
1113 */ 1113 */
1114static irqreturn_t w83977af_interrupt(int irq, void *dev_id) 1114static irqreturn_t w83977af_interrupt(int irq, void *dev_id)
1115{ 1115{
1116 struct net_device *dev = (struct net_device *) dev_id; 1116 struct net_device *dev = dev_id;
1117 struct w83977af_ir *self; 1117 struct w83977af_ir *self;
1118 __u8 set, icr, isr; 1118 __u8 set, icr, isr;
1119 int iobase; 1119 int iobase;
1120 1120
1121 if (!dev) { 1121 self = dev->priv;
1122 printk(KERN_WARNING "%s: irq %d for unknown device.\n",
1123 driver_name, irq);
1124 return IRQ_NONE;
1125 }
1126 self = (struct w83977af_ir *) dev->priv;
1127 1122
1128 iobase = self->io.fir_base; 1123 iobase = self->io.fir_base;
1129 1124
diff --git a/drivers/net/lance.c b/drivers/net/lance.c
index 7afac47e59ad..6efbd499d752 100644
--- a/drivers/net/lance.c
+++ b/drivers/net/lance.c
@@ -1019,11 +1019,6 @@ static irqreturn_t lance_interrupt(int irq, void *dev_id)
1019 int csr0, ioaddr, boguscnt=10; 1019 int csr0, ioaddr, boguscnt=10;
1020 int must_restart; 1020 int must_restart;
1021 1021
1022 if (dev == NULL) {
1023 printk ("lance_interrupt(): irq %d for unknown device.\n", irq);
1024 return IRQ_NONE;
1025 }
1026
1027 ioaddr = dev->base_addr; 1022 ioaddr = dev->base_addr;
1028 lp = dev->priv; 1023 lp = dev->priv;
1029 1024
diff --git a/drivers/net/lasi_82596.c b/drivers/net/lasi_82596.c
index 8cbd940f0ac2..f4d815bca643 100644
--- a/drivers/net/lasi_82596.c
+++ b/drivers/net/lasi_82596.c
@@ -1252,7 +1252,7 @@ static int __devinit i82596_probe(struct net_device *dev,
1252static void i596_poll_controller(struct net_device *dev) 1252static void i596_poll_controller(struct net_device *dev)
1253{ 1253{
1254 disable_irq(dev->irq); 1254 disable_irq(dev->irq);
1255 i596_interrupt(dev->irq, dev, NULL); 1255 i596_interrupt(dev->irq, dev);
1256 enable_irq(dev->irq); 1256 enable_irq(dev->irq);
1257} 1257}
1258#endif 1258#endif
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index d26a819a9735..2ffa3a59e704 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -1251,7 +1251,7 @@ static void mv643xx_netpoll(struct net_device *netdev)
1251 /* wait for previous write to complete */ 1251 /* wait for previous write to complete */
1252 mv_read(MV643XX_ETH_INTERRUPT_MASK_REG(port_num)); 1252 mv_read(MV643XX_ETH_INTERRUPT_MASK_REG(port_num));
1253 1253
1254 mv643xx_eth_int_handler(netdev->irq, netdev, NULL); 1254 mv643xx_eth_int_handler(netdev->irq, netdev);
1255 1255
1256 mv_write(MV643XX_ETH_INTERRUPT_MASK_REG(port_num), ETH_INT_UNMASK_ALL); 1256 mv_write(MV643XX_ETH_INTERRUPT_MASK_REG(port_num), ETH_INT_UNMASK_ALL);
1257} 1257}
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index e5f366910914..5ddd5742f779 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -1201,14 +1201,8 @@ static irqreturn_t ax_interrupt(int irq, void *dev_id)
1201 struct ei_device *ei_local; 1201 struct ei_device *ei_local;
1202 int handled = 0; 1202 int handled = 0;
1203 1203
1204 if (dev == NULL)
1205 {
1206 printk ("net_interrupt(): irq %d for unknown device.\n", irq);
1207 return IRQ_NONE;
1208 }
1209
1210 e8390_base = dev->base_addr; 1204 e8390_base = dev->base_addr;
1211 ei_local = (struct ei_device *) netdev_priv(dev); 1205 ei_local = netdev_priv(dev);
1212 1206
1213 /* 1207 /*
1214 * Protect the irq test too. 1208 * Protect the irq test too.
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index c73e2f210774..36f9d988278f 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -2569,13 +2569,6 @@ pcnet32_interrupt(int irq, void *dev_id)
2569 u16 csr0; 2569 u16 csr0;
2570 int boguscnt = max_interrupt_work; 2570 int boguscnt = max_interrupt_work;
2571 2571
2572 if (!dev) {
2573 if (pcnet32_debug & NETIF_MSG_INTR)
2574 printk(KERN_DEBUG "%s(): irq %d for unknown device\n",
2575 __FUNCTION__, irq);
2576 return IRQ_NONE;
2577 }
2578
2579 ioaddr = dev->base_addr; 2572 ioaddr = dev->base_addr;
2580 lp = dev->priv; 2573 lp = dev->priv;
2581 2574
diff --git a/drivers/net/plip.c b/drivers/net/plip.c
index c0b333d2917a..71afb274498f 100644
--- a/drivers/net/plip.c
+++ b/drivers/net/plip.c
@@ -909,11 +909,6 @@ plip_interrupt(int irq, void *dev_id)
909 struct plip_local *rcv; 909 struct plip_local *rcv;
910 unsigned char c0; 910 unsigned char c0;
911 911
912 if (dev == NULL) {
913 printk(KERN_DEBUG "plip_interrupt: irq %d for unknown device.\n", irq);
914 return;
915 }
916
917 nl = netdev_priv(dev); 912 nl = netdev_priv(dev);
918 rcv = &nl->rcv_data; 913 rcv = &nl->rcv_data;
919 914
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h
index 72f52dc98f53..12b719f4d00f 100644
--- a/drivers/net/s2io.h
+++ b/drivers/net/s2io.h
@@ -116,179 +116,179 @@ typedef struct {
116/* The statistics block of Xena */ 116/* The statistics block of Xena */
117typedef struct stat_block { 117typedef struct stat_block {
118/* Tx MAC statistics counters. */ 118/* Tx MAC statistics counters. */
119 u32 tmac_data_octets; 119 __le32 tmac_data_octets;
120 u32 tmac_frms; 120 __le32 tmac_frms;
121 u64 tmac_drop_frms; 121 __le64 tmac_drop_frms;
122 u32 tmac_bcst_frms; 122 __le32 tmac_bcst_frms;
123 u32 tmac_mcst_frms; 123 __le32 tmac_mcst_frms;
124 u64 tmac_pause_ctrl_frms; 124 __le64 tmac_pause_ctrl_frms;
125 u32 tmac_ucst_frms; 125 __le32 tmac_ucst_frms;
126 u32 tmac_ttl_octets; 126 __le32 tmac_ttl_octets;
127 u32 tmac_any_err_frms; 127 __le32 tmac_any_err_frms;
128 u32 tmac_nucst_frms; 128 __le32 tmac_nucst_frms;
129 u64 tmac_ttl_less_fb_octets; 129 __le64 tmac_ttl_less_fb_octets;
130 u64 tmac_vld_ip_octets; 130 __le64 tmac_vld_ip_octets;
131 u32 tmac_drop_ip; 131 __le32 tmac_drop_ip;
132 u32 tmac_vld_ip; 132 __le32 tmac_vld_ip;
133 u32 tmac_rst_tcp; 133 __le32 tmac_rst_tcp;
134 u32 tmac_icmp; 134 __le32 tmac_icmp;
135 u64 tmac_tcp; 135 __le64 tmac_tcp;
136 u32 reserved_0; 136 __le32 reserved_0;
137 u32 tmac_udp; 137 __le32 tmac_udp;
138 138
139/* Rx MAC Statistics counters. */ 139/* Rx MAC Statistics counters. */
140 u32 rmac_data_octets; 140 __le32 rmac_data_octets;
141 u32 rmac_vld_frms; 141 __le32 rmac_vld_frms;
142 u64 rmac_fcs_err_frms; 142 __le64 rmac_fcs_err_frms;
143 u64 rmac_drop_frms; 143 __le64 rmac_drop_frms;
144 u32 rmac_vld_bcst_frms; 144 __le32 rmac_vld_bcst_frms;
145 u32 rmac_vld_mcst_frms; 145 __le32 rmac_vld_mcst_frms;
146 u32 rmac_out_rng_len_err_frms; 146 __le32 rmac_out_rng_len_err_frms;
147 u32 rmac_in_rng_len_err_frms; 147 __le32 rmac_in_rng_len_err_frms;
148 u64 rmac_long_frms; 148 __le64 rmac_long_frms;
149 u64 rmac_pause_ctrl_frms; 149 __le64 rmac_pause_ctrl_frms;
150 u64 rmac_unsup_ctrl_frms; 150 __le64 rmac_unsup_ctrl_frms;
151 u32 rmac_accepted_ucst_frms; 151 __le32 rmac_accepted_ucst_frms;
152 u32 rmac_ttl_octets; 152 __le32 rmac_ttl_octets;
153 u32 rmac_discarded_frms; 153 __le32 rmac_discarded_frms;
154 u32 rmac_accepted_nucst_frms; 154 __le32 rmac_accepted_nucst_frms;
155 u32 reserved_1; 155 __le32 reserved_1;
156 u32 rmac_drop_events; 156 __le32 rmac_drop_events;
157 u64 rmac_ttl_less_fb_octets; 157 __le64 rmac_ttl_less_fb_octets;
158 u64 rmac_ttl_frms; 158 __le64 rmac_ttl_frms;
159 u64 reserved_2; 159 __le64 reserved_2;
160 u32 rmac_usized_frms; 160 __le32 rmac_usized_frms;
161 u32 reserved_3; 161 __le32 reserved_3;
162 u32 rmac_frag_frms; 162 __le32 rmac_frag_frms;
163 u32 rmac_osized_frms; 163 __le32 rmac_osized_frms;
164 u32 reserved_4; 164 __le32 reserved_4;
165 u32 rmac_jabber_frms; 165 __le32 rmac_jabber_frms;
166 u64 rmac_ttl_64_frms; 166 __le64 rmac_ttl_64_frms;
167 u64 rmac_ttl_65_127_frms; 167 __le64 rmac_ttl_65_127_frms;
168 u64 reserved_5; 168 __le64 reserved_5;
169 u64 rmac_ttl_128_255_frms; 169 __le64 rmac_ttl_128_255_frms;
170 u64 rmac_ttl_256_511_frms; 170 __le64 rmac_ttl_256_511_frms;
171 u64 reserved_6; 171 __le64 reserved_6;
172 u64 rmac_ttl_512_1023_frms; 172 __le64 rmac_ttl_512_1023_frms;
173 u64 rmac_ttl_1024_1518_frms; 173 __le64 rmac_ttl_1024_1518_frms;
174 u32 rmac_ip; 174 __le32 rmac_ip;
175 u32 reserved_7; 175 __le32 reserved_7;
176 u64 rmac_ip_octets; 176 __le64 rmac_ip_octets;
177 u32 rmac_drop_ip; 177 __le32 rmac_drop_ip;
178 u32 rmac_hdr_err_ip; 178 __le32 rmac_hdr_err_ip;
179 u32 reserved_8; 179 __le32 reserved_8;
180 u32 rmac_icmp; 180 __le32 rmac_icmp;
181 u64 rmac_tcp; 181 __le64 rmac_tcp;
182 u32 rmac_err_drp_udp; 182 __le32 rmac_err_drp_udp;
183 u32 rmac_udp; 183 __le32 rmac_udp;
184 u64 rmac_xgmii_err_sym; 184 __le64 rmac_xgmii_err_sym;
185 u64 rmac_frms_q0; 185 __le64 rmac_frms_q0;
186 u64 rmac_frms_q1; 186 __le64 rmac_frms_q1;
187 u64 rmac_frms_q2; 187 __le64 rmac_frms_q2;
188 u64 rmac_frms_q3; 188 __le64 rmac_frms_q3;
189 u64 rmac_frms_q4; 189 __le64 rmac_frms_q4;
190 u64 rmac_frms_q5; 190 __le64 rmac_frms_q5;
191 u64 rmac_frms_q6; 191 __le64 rmac_frms_q6;
192 u64 rmac_frms_q7; 192 __le64 rmac_frms_q7;
193 u16 rmac_full_q3; 193 __le16 rmac_full_q3;
194 u16 rmac_full_q2; 194 __le16 rmac_full_q2;
195 u16 rmac_full_q1; 195 __le16 rmac_full_q1;
196 u16 rmac_full_q0; 196 __le16 rmac_full_q0;
197 u16 rmac_full_q7; 197 __le16 rmac_full_q7;
198 u16 rmac_full_q6; 198 __le16 rmac_full_q6;
199 u16 rmac_full_q5; 199 __le16 rmac_full_q5;
200 u16 rmac_full_q4; 200 __le16 rmac_full_q4;
201 u32 reserved_9; 201 __le32 reserved_9;
202 u32 rmac_pause_cnt; 202 __le32 rmac_pause_cnt;
203 u64 rmac_xgmii_data_err_cnt; 203 __le64 rmac_xgmii_data_err_cnt;
204 u64 rmac_xgmii_ctrl_err_cnt; 204 __le64 rmac_xgmii_ctrl_err_cnt;
205 u32 rmac_err_tcp; 205 __le32 rmac_err_tcp;
206 u32 rmac_accepted_ip; 206 __le32 rmac_accepted_ip;
207 207
208/* PCI/PCI-X Read transaction statistics. */ 208/* PCI/PCI-X Read transaction statistics. */
209 u32 new_rd_req_cnt; 209 __le32 new_rd_req_cnt;
210 u32 rd_req_cnt; 210 __le32 rd_req_cnt;
211 u32 rd_rtry_cnt; 211 __le32 rd_rtry_cnt;
212 u32 new_rd_req_rtry_cnt; 212 __le32 new_rd_req_rtry_cnt;
213 213
214/* PCI/PCI-X Write/Read transaction statistics. */ 214/* PCI/PCI-X Write/Read transaction statistics. */
215 u32 wr_req_cnt; 215 __le32 wr_req_cnt;
216 u32 wr_rtry_rd_ack_cnt; 216 __le32 wr_rtry_rd_ack_cnt;
217 u32 new_wr_req_rtry_cnt; 217 __le32 new_wr_req_rtry_cnt;
218 u32 new_wr_req_cnt; 218 __le32 new_wr_req_cnt;
219 u32 wr_disc_cnt; 219 __le32 wr_disc_cnt;
220 u32 wr_rtry_cnt; 220 __le32 wr_rtry_cnt;
221 221
222/* PCI/PCI-X Write / DMA Transaction statistics. */ 222/* PCI/PCI-X Write / DMA Transaction statistics. */
223 u32 txp_wr_cnt; 223 __le32 txp_wr_cnt;
224 u32 rd_rtry_wr_ack_cnt; 224 __le32 rd_rtry_wr_ack_cnt;
225 u32 txd_wr_cnt; 225 __le32 txd_wr_cnt;
226 u32 txd_rd_cnt; 226 __le32 txd_rd_cnt;
227 u32 rxd_wr_cnt; 227 __le32 rxd_wr_cnt;
228 u32 rxd_rd_cnt; 228 __le32 rxd_rd_cnt;
229 u32 rxf_wr_cnt; 229 __le32 rxf_wr_cnt;
230 u32 txf_rd_cnt; 230 __le32 txf_rd_cnt;
231 231
232/* Tx MAC statistics overflow counters. */ 232/* Tx MAC statistics overflow counters. */
233 u32 tmac_data_octets_oflow; 233 __le32 tmac_data_octets_oflow;
234 u32 tmac_frms_oflow; 234 __le32 tmac_frms_oflow;
235 u32 tmac_bcst_frms_oflow; 235 __le32 tmac_bcst_frms_oflow;
236 u32 tmac_mcst_frms_oflow; 236 __le32 tmac_mcst_frms_oflow;
237 u32 tmac_ucst_frms_oflow; 237 __le32 tmac_ucst_frms_oflow;
238 u32 tmac_ttl_octets_oflow; 238 __le32 tmac_ttl_octets_oflow;
239 u32 tmac_any_err_frms_oflow; 239 __le32 tmac_any_err_frms_oflow;
240 u32 tmac_nucst_frms_oflow; 240 __le32 tmac_nucst_frms_oflow;
241 u64 tmac_vlan_frms; 241 __le64 tmac_vlan_frms;
242 u32 tmac_drop_ip_oflow; 242 __le32 tmac_drop_ip_oflow;
243 u32 tmac_vld_ip_oflow; 243 __le32 tmac_vld_ip_oflow;
244 u32 tmac_rst_tcp_oflow; 244 __le32 tmac_rst_tcp_oflow;
245 u32 tmac_icmp_oflow; 245 __le32 tmac_icmp_oflow;
246 u32 tpa_unknown_protocol; 246 __le32 tpa_unknown_protocol;
247 u32 tmac_udp_oflow; 247 __le32 tmac_udp_oflow;
248 u32 reserved_10; 248 __le32 reserved_10;
249 u32 tpa_parse_failure; 249 __le32 tpa_parse_failure;
250 250
251/* Rx MAC Statistics overflow counters. */ 251/* Rx MAC Statistics overflow counters. */
252 u32 rmac_data_octets_oflow; 252 __le32 rmac_data_octets_oflow;
253 u32 rmac_vld_frms_oflow; 253 __le32 rmac_vld_frms_oflow;
254 u32 rmac_vld_bcst_frms_oflow; 254 __le32 rmac_vld_bcst_frms_oflow;
255 u32 rmac_vld_mcst_frms_oflow; 255 __le32 rmac_vld_mcst_frms_oflow;
256 u32 rmac_accepted_ucst_frms_oflow; 256 __le32 rmac_accepted_ucst_frms_oflow;
257 u32 rmac_ttl_octets_oflow; 257 __le32 rmac_ttl_octets_oflow;
258 u32 rmac_discarded_frms_oflow; 258 __le32 rmac_discarded_frms_oflow;
259 u32 rmac_accepted_nucst_frms_oflow; 259 __le32 rmac_accepted_nucst_frms_oflow;
260 u32 rmac_usized_frms_oflow; 260 __le32 rmac_usized_frms_oflow;
261 u32 rmac_drop_events_oflow; 261 __le32 rmac_drop_events_oflow;
262 u32 rmac_frag_frms_oflow; 262 __le32 rmac_frag_frms_oflow;
263 u32 rmac_osized_frms_oflow; 263 __le32 rmac_osized_frms_oflow;
264 u32 rmac_ip_oflow; 264 __le32 rmac_ip_oflow;
265 u32 rmac_jabber_frms_oflow; 265 __le32 rmac_jabber_frms_oflow;
266 u32 rmac_icmp_oflow; 266 __le32 rmac_icmp_oflow;
267 u32 rmac_drop_ip_oflow; 267 __le32 rmac_drop_ip_oflow;
268 u32 rmac_err_drp_udp_oflow; 268 __le32 rmac_err_drp_udp_oflow;
269 u32 rmac_udp_oflow; 269 __le32 rmac_udp_oflow;
270 u32 reserved_11; 270 __le32 reserved_11;
271 u32 rmac_pause_cnt_oflow; 271 __le32 rmac_pause_cnt_oflow;
272 u64 rmac_ttl_1519_4095_frms; 272 __le64 rmac_ttl_1519_4095_frms;
273 u64 rmac_ttl_4096_8191_frms; 273 __le64 rmac_ttl_4096_8191_frms;
274 u64 rmac_ttl_8192_max_frms; 274 __le64 rmac_ttl_8192_max_frms;
275 u64 rmac_ttl_gt_max_frms; 275 __le64 rmac_ttl_gt_max_frms;
276 u64 rmac_osized_alt_frms; 276 __le64 rmac_osized_alt_frms;
277 u64 rmac_jabber_alt_frms; 277 __le64 rmac_jabber_alt_frms;
278 u64 rmac_gt_max_alt_frms; 278 __le64 rmac_gt_max_alt_frms;
279 u64 rmac_vlan_frms; 279 __le64 rmac_vlan_frms;
280 u32 rmac_len_discard; 280 __le32 rmac_len_discard;
281 u32 rmac_fcs_discard; 281 __le32 rmac_fcs_discard;
282 u32 rmac_pf_discard; 282 __le32 rmac_pf_discard;
283 u32 rmac_da_discard; 283 __le32 rmac_da_discard;
284 u32 rmac_red_discard; 284 __le32 rmac_red_discard;
285 u32 rmac_rts_discard; 285 __le32 rmac_rts_discard;
286 u32 reserved_12; 286 __le32 reserved_12;
287 u32 rmac_ingm_full_discard; 287 __le32 rmac_ingm_full_discard;
288 u32 reserved_13; 288 __le32 reserved_13;
289 u32 rmac_accepted_ip_oflow; 289 __le32 rmac_accepted_ip_oflow;
290 u32 reserved_14; 290 __le32 reserved_14;
291 u32 link_fault_cnt; 291 __le32 link_fault_cnt;
292 u8 buffer[20]; 292 u8 buffer[20];
293 swStat_t sw_stat; 293 swStat_t sw_stat;
294 xpakStat_t xpak_stat; 294 xpakStat_t xpak_stat;
diff --git a/drivers/net/saa9730.c b/drivers/net/saa9730.c
index c9efad8a917e..b269513cde45 100644
--- a/drivers/net/saa9730.c
+++ b/drivers/net/saa9730.c
@@ -747,7 +747,7 @@ static int lan_saa9730_rx(struct net_device *dev)
747 747
748static irqreturn_t lan_saa9730_interrupt(const int irq, void *dev_id) 748static irqreturn_t lan_saa9730_interrupt(const int irq, void *dev_id)
749{ 749{
750 struct net_device *dev = (struct net_device *) dev_id; 750 struct net_device *dev = dev_id;
751 struct lan_saa9730_private *lp = netdev_priv(dev); 751 struct lan_saa9730_private *lp = netdev_priv(dev);
752 752
753 if (lan_saa9730_debug > 5) 753 if (lan_saa9730_debug > 5)
diff --git a/drivers/net/sb1000.c b/drivers/net/sb1000.c
index dc30dee5537f..b9fa4fbb1398 100644
--- a/drivers/net/sb1000.c
+++ b/drivers/net/sb1000.c
@@ -1084,19 +1084,13 @@ static irqreturn_t sb1000_interrupt(int irq, void *dev_id)
1084 char *name; 1084 char *name;
1085 unsigned char st; 1085 unsigned char st;
1086 int ioaddr[2]; 1086 int ioaddr[2];
1087 struct net_device *dev = (struct net_device *) dev_id; 1087 struct net_device *dev = dev_id;
1088 struct sb1000_private *lp = netdev_priv(dev); 1088 struct sb1000_private *lp = netdev_priv(dev);
1089 1089
1090 const unsigned char Command0[6] = {0x80, 0x2c, 0x00, 0x00, 0x00, 0x00}; 1090 const unsigned char Command0[6] = {0x80, 0x2c, 0x00, 0x00, 0x00, 0x00};
1091 const unsigned char Command1[6] = {0x80, 0x2e, 0x00, 0x00, 0x00, 0x00}; 1091 const unsigned char Command1[6] = {0x80, 0x2e, 0x00, 0x00, 0x00, 0x00};
1092 const int MaxRxErrorCount = 6; 1092 const int MaxRxErrorCount = 6;
1093 1093
1094 if (dev == NULL) {
1095 printk(KERN_ERR "sb1000_interrupt(): irq %d for unknown device.\n",
1096 irq);
1097 return IRQ_NONE;
1098 }
1099
1100 ioaddr[0] = dev->base_addr; 1094 ioaddr[0] = dev->base_addr;
1101 /* mem_start holds the second I/O address */ 1095 /* mem_start holds the second I/O address */
1102 ioaddr[1] = dev->mem_start; 1096 ioaddr[1] = dev->mem_start;
diff --git a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c
index 06ea2626c6f4..9733a11c6146 100644
--- a/drivers/net/skfp/skfddi.c
+++ b/drivers/net/skfp/skfddi.c
@@ -616,15 +616,10 @@ static int skfp_close(struct net_device *dev)
616 616
617irqreturn_t skfp_interrupt(int irq, void *dev_id) 617irqreturn_t skfp_interrupt(int irq, void *dev_id)
618{ 618{
619 struct net_device *dev = (struct net_device *) dev_id; 619 struct net_device *dev = dev_id;
620 struct s_smc *smc; /* private board structure pointer */ 620 struct s_smc *smc; /* private board structure pointer */
621 skfddi_priv *bp; 621 skfddi_priv *bp;
622 622
623 if (dev == NULL) {
624 printk("%s: irq %d for unknown device\n", dev->name, irq);
625 return IRQ_NONE;
626 }
627
628 smc = netdev_priv(dev); 623 smc = netdev_priv(dev);
629 bp = &smc->os; 624 bp = &smc->os;
630 625
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
index 506807fa5268..95b6478f55c6 100644
--- a/drivers/net/smc91x.c
+++ b/drivers/net/smc91x.c
@@ -1400,7 +1400,7 @@ static irqreturn_t smc_interrupt(int irq, void *dev_id)
1400static void smc_poll_controller(struct net_device *dev) 1400static void smc_poll_controller(struct net_device *dev)
1401{ 1401{
1402 disable_irq(dev->irq); 1402 disable_irq(dev->irq);
1403 smc_interrupt(dev->irq, dev, NULL); 1403 smc_interrupt(dev->irq, dev);
1404 enable_irq(dev->irq); 1404 enable_irq(dev->irq);
1405} 1405}
1406#endif 1406#endif
diff --git a/drivers/net/sonic.c b/drivers/net/sonic.c
index cfece9676aff..ed7aa0a5acca 100644
--- a/drivers/net/sonic.c
+++ b/drivers/net/sonic.c
@@ -295,15 +295,10 @@ static int sonic_send_packet(struct sk_buff *skb, struct net_device *dev)
295 */ 295 */
296static irqreturn_t sonic_interrupt(int irq, void *dev_id) 296static irqreturn_t sonic_interrupt(int irq, void *dev_id)
297{ 297{
298 struct net_device *dev = (struct net_device *) dev_id; 298 struct net_device *dev = dev_id;
299 struct sonic_local *lp = netdev_priv(dev); 299 struct sonic_local *lp = netdev_priv(dev);
300 int status; 300 int status;
301 301
302 if (dev == NULL) {
303 printk(KERN_ERR "sonic_interrupt: irq %d for unknown device.\n", irq);
304 return IRQ_NONE;
305 }
306
307 if (!(status = SONIC_READ(SONIC_ISR) & SONIC_IMR_DEFAULT)) 302 if (!(status = SONIC_READ(SONIC_ISR) & SONIC_IMR_DEFAULT))
308 return IRQ_NONE; 303 return IRQ_NONE;
309 304
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
index 45d07faf7b96..9d7cd130c19d 100644
--- a/drivers/net/sunhme.c
+++ b/drivers/net/sunhme.c
@@ -2095,8 +2095,8 @@ static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev)
2095 2095
2096static irqreturn_t happy_meal_interrupt(int irq, void *dev_id) 2096static irqreturn_t happy_meal_interrupt(int irq, void *dev_id)
2097{ 2097{
2098 struct net_device *dev = (struct net_device *) dev_id; 2098 struct net_device *dev = dev_id;
2099 struct happy_meal *hp = dev->priv; 2099 struct happy_meal *hp = netdev_priv(dev);
2100 u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT); 2100 u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT);
2101 2101
2102 HMD(("happy_meal_interrupt: status=%08x ", happy_status)); 2102 HMD(("happy_meal_interrupt: status=%08x ", happy_status));
diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c
index 9207e19cac34..5b00d79b5573 100644
--- a/drivers/net/sunlance.c
+++ b/drivers/net/sunlance.c
@@ -822,7 +822,7 @@ out:
822 822
823static irqreturn_t lance_interrupt(int irq, void *dev_id) 823static irqreturn_t lance_interrupt(int irq, void *dev_id)
824{ 824{
825 struct net_device *dev = (struct net_device *)dev_id; 825 struct net_device *dev = dev_id;
826 struct lance_private *lp = netdev_priv(dev); 826 struct lance_private *lp = netdev_priv(dev);
827 int csr0; 827 int csr0;
828 828
diff --git a/drivers/net/sunqe.c b/drivers/net/sunqe.c
index 020e78170595..7874eb1ef043 100644
--- a/drivers/net/sunqe.c
+++ b/drivers/net/sunqe.c
@@ -468,7 +468,7 @@ static void qe_tx_reclaim(struct sunqe *qep);
468 */ 468 */
469static irqreturn_t qec_interrupt(int irq, void *dev_id) 469static irqreturn_t qec_interrupt(int irq, void *dev_id)
470{ 470{
471 struct sunqec *qecp = (struct sunqec *) dev_id; 471 struct sunqec *qecp = dev_id;
472 u32 qec_status; 472 u32 qec_status;
473 int channel = 0; 473 int channel = 0;
474 474
diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c
index 9bd4cba87872..46dabdb12071 100644
--- a/drivers/net/tokenring/smctr.c
+++ b/drivers/net/tokenring/smctr.c
@@ -1990,15 +1990,8 @@ static irqreturn_t smctr_interrupt(int irq, void *dev_id)
1990 __u8 isb_type, isb_subtype; 1990 __u8 isb_type, isb_subtype;
1991 __u16 isb_index; 1991 __u16 isb_index;
1992 1992
1993 if(dev == NULL)
1994 {
1995 printk(KERN_CRIT "%s: irq %d for unknown device.\n", dev->name, irq);
1996 return IRQ_NONE;
1997 }
1998
1999 ioaddr = dev->base_addr; 1993 ioaddr = dev->base_addr;
2000 tp = netdev_priv(dev); 1994 tp = netdev_priv(dev);
2001
2002 1995
2003 if(tp->status == NOT_INITIALIZED) 1996 if(tp->status == NOT_INITIALIZED)
2004 return IRQ_NONE; 1997 return IRQ_NONE;
diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c
index c0ab6e44eb1f..ea797ca2b988 100644
--- a/drivers/net/tokenring/tms380tr.c
+++ b/drivers/net/tokenring/tms380tr.c
@@ -751,11 +751,6 @@ irqreturn_t tms380tr_interrupt(int irq, void *dev_id)
751 unsigned short irq_type; 751 unsigned short irq_type;
752 int handled = 0; 752 int handled = 0;
753 753
754 if(dev == NULL) {
755 printk(KERN_INFO "%s: irq %d for unknown device.\n", dev->name, irq);
756 return IRQ_NONE;
757 }
758
759 tp = netdev_priv(dev); 754 tp = netdev_priv(dev);
760 755
761 irq_type = SIFREADW(SIFSTS); 756 irq_type = SIFREADW(SIFSTS);
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
index e17f9779ead2..3f4b6408b755 100644
--- a/drivers/net/tulip/de4x5.c
+++ b/drivers/net/tulip/de4x5.c
@@ -1540,16 +1540,12 @@ de4x5_queue_pkt(struct sk_buff *skb, struct net_device *dev)
1540static irqreturn_t 1540static irqreturn_t
1541de4x5_interrupt(int irq, void *dev_id) 1541de4x5_interrupt(int irq, void *dev_id)
1542{ 1542{
1543 struct net_device *dev = (struct net_device *)dev_id; 1543 struct net_device *dev = dev_id;
1544 struct de4x5_private *lp; 1544 struct de4x5_private *lp;
1545 s32 imr, omr, sts, limit; 1545 s32 imr, omr, sts, limit;
1546 u_long iobase; 1546 u_long iobase;
1547 unsigned int handled = 0; 1547 unsigned int handled = 0;
1548 1548
1549 if (dev == NULL) {
1550 printk ("de4x5_interrupt(): irq %d for unknown device.\n", irq);
1551 return IRQ_NONE;
1552 }
1553 lp = netdev_priv(dev); 1549 lp = netdev_priv(dev);
1554 spin_lock(&lp->lock); 1550 spin_lock(&lp->lock);
1555 iobase = dev->base_addr; 1551 iobase = dev->base_addr;
diff --git a/drivers/net/wan/cycx_main.c b/drivers/net/wan/cycx_main.c
index 12363e056b63..6e5f1c898517 100644
--- a/drivers/net/wan/cycx_main.c
+++ b/drivers/net/wan/cycx_main.c
@@ -303,9 +303,9 @@ out: return ret;
303 */ 303 */
304static irqreturn_t cycx_isr(int irq, void *dev_id) 304static irqreturn_t cycx_isr(int irq, void *dev_id)
305{ 305{
306 struct cycx_device *card = (struct cycx_device *)dev_id; 306 struct cycx_device *card = dev_id;
307 307
308 if (!card || card->wandev.state == WAN_UNCONFIGURED) 308 if (card->wandev.state == WAN_UNCONFIGURED)
309 goto out; 309 goto out;
310 310
311 if (card->in_isr) { 311 if (card->in_isr) {
diff --git a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c
index 5715d25271f1..6a485f0556f4 100644
--- a/drivers/net/wan/sdla.c
+++ b/drivers/net/wan/sdla.c
@@ -875,13 +875,7 @@ static irqreturn_t sdla_isr(int irq, void *dev_id)
875 875
876 dev = dev_id; 876 dev = dev_id;
877 877
878 if (dev == NULL) 878 flp = netdev_priv(dev);
879 {
880 printk(KERN_WARNING "sdla_isr(): irq %d for unknown device.\n", irq);
881 return IRQ_NONE;
882 }
883
884 flp = dev->priv;
885 879
886 if (!flp->initialized) 880 if (!flp->initialized)
887 { 881 {
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index 793da5f69344..b779c7dcc1a8 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -1954,7 +1954,7 @@ static void __orinoco_ev_wterr(struct net_device *dev, hermes_t *hw)
1954 1954
1955irqreturn_t orinoco_interrupt(int irq, void *dev_id) 1955irqreturn_t orinoco_interrupt(int irq, void *dev_id)
1956{ 1956{
1957 struct net_device *dev = (struct net_device *)dev_id; 1957 struct net_device *dev = dev_id;
1958 struct orinoco_private *priv = netdev_priv(dev); 1958 struct orinoco_private *priv = netdev_priv(dev);
1959 hermes_t *hw = &priv->hw; 1959 hermes_t *hw = &priv->hw;
1960 int count = MAX_IRQLOOPS_PER_IRQ; 1960 int count = MAX_IRQLOOPS_PER_IRQ;
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c
index cadfe132db84..aafb301041b1 100644
--- a/drivers/net/wireless/wavelan_cs.c
+++ b/drivers/net/wireless/wavelan_cs.c
@@ -4119,21 +4119,12 @@ static irqreturn_t
4119wavelan_interrupt(int irq, 4119wavelan_interrupt(int irq,
4120 void * dev_id) 4120 void * dev_id)
4121{ 4121{
4122 struct net_device * dev; 4122 struct net_device * dev = dev_id;
4123 net_local * lp; 4123 net_local * lp;
4124 kio_addr_t base; 4124 kio_addr_t base;
4125 int status0; 4125 int status0;
4126 u_int tx_status; 4126 u_int tx_status;
4127 4127
4128 if ((dev = dev_id) == NULL)
4129 {
4130#ifdef DEBUG_INTERRUPT_ERROR
4131 printk(KERN_WARNING "wavelan_interrupt(): irq %d for unknown device.\n",
4132 irq);
4133#endif
4134 return IRQ_NONE;
4135 }
4136
4137#ifdef DEBUG_INTERRUPT_TRACE 4128#ifdef DEBUG_INTERRUPT_TRACE
4138 printk(KERN_DEBUG "%s: ->wavelan_interrupt()\n", dev->name); 4129 printk(KERN_DEBUG "%s: ->wavelan_interrupt()\n", dev->name);
4139#endif 4130#endif
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
index a1430352169b..5b98a7876982 100644
--- a/drivers/net/wireless/wl3501_cs.c
+++ b/drivers/net/wireless/wl3501_cs.c
@@ -1155,25 +1155,18 @@ static inline void wl3501_ack_interrupt(struct wl3501_card *this)
1155 */ 1155 */
1156static irqreturn_t wl3501_interrupt(int irq, void *dev_id) 1156static irqreturn_t wl3501_interrupt(int irq, void *dev_id)
1157{ 1157{
1158 struct net_device *dev = (struct net_device *)dev_id; 1158 struct net_device *dev = dev_id;
1159 struct wl3501_card *this; 1159 struct wl3501_card *this;
1160 int handled = 1;
1161 1160
1162 if (!dev) 1161 this = netdev_priv(dev);
1163 goto unknown;
1164 this = dev->priv;
1165 spin_lock(&this->lock); 1162 spin_lock(&this->lock);
1166 wl3501_ack_interrupt(this); 1163 wl3501_ack_interrupt(this);
1167 wl3501_block_interrupt(this); 1164 wl3501_block_interrupt(this);
1168 wl3501_rx_interrupt(dev); 1165 wl3501_rx_interrupt(dev);
1169 wl3501_unblock_interrupt(this); 1166 wl3501_unblock_interrupt(this);
1170 spin_unlock(&this->lock); 1167 spin_unlock(&this->lock);
1171out: 1168
1172 return IRQ_RETVAL(handled); 1169 return IRQ_HANDLED;
1173unknown:
1174 handled = 0;
1175 printk(KERN_ERR "%s: irq %d for unknown device.\n", __FUNCTION__, irq);
1176 goto out;
1177} 1170}
1178 1171
1179static int wl3501_reset_board(struct wl3501_card *this) 1172static int wl3501_reset_board(struct wl3501_card *this)
diff --git a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c
index ac600212d9a9..2412ce4917f2 100644
--- a/drivers/net/yellowfin.c
+++ b/drivers/net/yellowfin.c
@@ -896,13 +896,6 @@ static irqreturn_t yellowfin_interrupt(int irq, void *dev_instance)
896 int boguscnt = max_interrupt_work; 896 int boguscnt = max_interrupt_work;
897 unsigned int handled = 0; 897 unsigned int handled = 0;
898 898
899#ifndef final_version /* Can never occur. */
900 if (dev == NULL) {
901 printk (KERN_ERR "yellowfin_interrupt(): irq %d for unknown device.\n", irq);
902 return IRQ_NONE;
903 }
904#endif
905
906 yp = netdev_priv(dev); 899 yp = netdev_priv(dev);
907 ioaddr = yp->base; 900 ioaddr = yp->base;
908 901
diff --git a/drivers/net/znet.c b/drivers/net/znet.c
index 2068a109a86c..b24b0727108c 100644
--- a/drivers/net/znet.c
+++ b/drivers/net/znet.c
@@ -610,11 +610,6 @@ static irqreturn_t znet_interrupt(int irq, void *dev_id)
610 int boguscnt = 20; 610 int boguscnt = 20;
611 int handled = 0; 611 int handled = 0;
612 612
613 if (dev == NULL) {
614 printk(KERN_WARNING "znet_interrupt(): IRQ %d for unknown device.\n", irq);
615 return IRQ_NONE;
616 }
617
618 spin_lock (&znet->lock); 613 spin_lock (&znet->lock);
619 614
620 ioaddr = dev->base_addr; 615 ioaddr = dev->base_addr;
diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c
index a0a8fd8d2124..03c763c2d0e0 100644
--- a/drivers/parisc/dino.c
+++ b/drivers/parisc/dino.c
@@ -389,7 +389,7 @@ ilr_again:
389 int irq = dino_dev->global_irq[local_irq]; 389 int irq = dino_dev->global_irq[local_irq];
390 DBG(KERN_DEBUG "%s(%d, %p) mask 0x%x\n", 390 DBG(KERN_DEBUG "%s(%d, %p) mask 0x%x\n",
391 __FUNCTION__, irq, intr_dev, mask); 391 __FUNCTION__, irq, intr_dev, mask);
392 __do_IRQ(irq, regs); 392 __do_IRQ(irq);
393 mask &= ~(1 << local_irq); 393 mask &= ~(1 << local_irq);
394 } while (mask); 394 } while (mask);
395 395
diff --git a/drivers/parisc/eisa.c b/drivers/parisc/eisa.c
index 094562e044f3..e97cecbc4d18 100644
--- a/drivers/parisc/eisa.c
+++ b/drivers/parisc/eisa.c
@@ -234,7 +234,7 @@ static irqreturn_t eisa_irq(int wax_irq, void *intr_dev)
234 } 234 }
235 spin_unlock_irqrestore(&eisa_irq_lock, flags); 235 spin_unlock_irqrestore(&eisa_irq_lock, flags);
236 236
237 __do_IRQ(irq, regs); 237 __do_IRQ(irq);
238 238
239 spin_lock_irqsave(&eisa_irq_lock, flags); 239 spin_lock_irqsave(&eisa_irq_lock, flags);
240 /* unmask */ 240 /* unmask */
diff --git a/drivers/parport/parport_mfc3.c b/drivers/parport/parport_mfc3.c
index 6541cde4df00..e5b0a544de40 100644
--- a/drivers/parport/parport_mfc3.c
+++ b/drivers/parport/parport_mfc3.c
@@ -219,7 +219,7 @@ static irqreturn_t mfc3_interrupt(int irq, void *dev_id)
219 if (this_port[i] != NULL) 219 if (this_port[i] != NULL)
220 if (pia(this_port[i])->crb & 128) { /* Board caused interrupt */ 220 if (pia(this_port[i])->crb & 128) { /* Board caused interrupt */
221 dummy = pia(this_port[i])->pprb; /* clear irq bit */ 221 dummy = pia(this_port[i])->pprb; /* clear irq bit */
222 parport_generic_irq(irq, this_port[i], regs); 222 parport_generic_irq(irq, this_port[i]);
223 } 223 }
224 return IRQ_HANDLED; 224 return IRQ_HANDLED;
225} 225}
diff --git a/drivers/parport/parport_sunbpp.c b/drivers/parport/parport_sunbpp.c
index d758c90c86af..9793533276ec 100644
--- a/drivers/parport/parport_sunbpp.c
+++ b/drivers/parport/parport_sunbpp.c
@@ -48,7 +48,7 @@
48 48
49static irqreturn_t parport_sunbpp_interrupt(int irq, void *dev_id) 49static irqreturn_t parport_sunbpp_interrupt(int irq, void *dev_id)
50{ 50{
51 parport_generic_irq(irq, (struct parport *) dev_id, regs); 51 parport_generic_irq(irq, (struct parport *) dev_id);
52 return IRQ_HANDLED; 52 return IRQ_HANDLED;
53} 53}
54 54
diff --git a/drivers/pcmcia/at91_cf.c b/drivers/pcmcia/at91_cf.c
index 991e084db2d6..7f5df9a9f393 100644
--- a/drivers/pcmcia/at91_cf.c
+++ b/drivers/pcmcia/at91_cf.c
@@ -66,7 +66,7 @@ static int at91_cf_ss_init(struct pcmcia_socket *s)
66 66
67static irqreturn_t at91_cf_irq(int irq, void *_cf) 67static irqreturn_t at91_cf_irq(int irq, void *_cf)
68{ 68{
69 struct at91_cf_socket *cf = (struct at91_cf_socket *) _cf; 69 struct at91_cf_socket *cf = _cf;
70 70
71 if (irq == cf->board->det_pin) { 71 if (irq == cf->board->det_pin) {
72 unsigned present = at91_cf_present(cf); 72 unsigned present = at91_cf_present(cf);
diff --git a/drivers/pcmcia/hd64465_ss.c b/drivers/pcmcia/hd64465_ss.c
index db3c26b5de14..caca0dc9d30f 100644
--- a/drivers/pcmcia/hd64465_ss.c
+++ b/drivers/pcmcia/hd64465_ss.c
@@ -650,7 +650,7 @@ static int hs_set_mem_map(struct pcmcia_socket *s, struct pccard_mem_map *mem)
650 */ 650 */
651static int hs_irq_demux(int irq, void *dev) 651static int hs_irq_demux(int irq, void *dev)
652{ 652{
653 hs_socket_t *sp = (hs_socket_t *)dev; 653 hs_socket_t *sp = dev;
654 u_int cscr; 654 u_int cscr;
655 655
656 DPRINTK("hs_irq_demux(irq=%d)\n", irq); 656 DPRINTK("hs_irq_demux(irq=%d)\n", irq);
@@ -673,11 +673,10 @@ static int hs_irq_demux(int irq, void *dev)
673 673
674static irqreturn_t hs_interrupt(int irq, void *dev) 674static irqreturn_t hs_interrupt(int irq, void *dev)
675{ 675{
676 hs_socket_t *sp = (hs_socket_t *)dev; 676 hs_socket_t *sp = dev;
677 u_int events = 0; 677 u_int events = 0;
678 u_int cscr; 678 u_int cscr;
679 679
680
681 cscr = hs_in(sp, CSCR); 680 cscr = hs_in(sp, CSCR);
682 681
683 DPRINTK("hs_interrupt, cscr=%04x\n", cscr); 682 DPRINTK("hs_interrupt, cscr=%04x\n", cscr);
diff --git a/drivers/pcmcia/m32r_pcc.c b/drivers/pcmcia/m32r_pcc.c
index 0964fd76bfe3..bbf025874d0c 100644
--- a/drivers/pcmcia/m32r_pcc.c
+++ b/drivers/pcmcia/m32r_pcc.c
@@ -395,7 +395,7 @@ static irqreturn_t pcc_interrupt(int irq, void *dev)
395 395
396static void pcc_interrupt_wrapper(u_long data) 396static void pcc_interrupt_wrapper(u_long data)
397{ 397{
398 pcc_interrupt(0, NULL, NULL); 398 pcc_interrupt(0, NULL);
399 init_timer(&poll_timer); 399 init_timer(&poll_timer);
400 poll_timer.expires = jiffies + poll_interval; 400 poll_timer.expires = jiffies + poll_interval;
401 add_timer(&poll_timer); 401 add_timer(&poll_timer);
diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c
index 222a8a71a5e8..53db58a68617 100644
--- a/drivers/s390/block/dasd_diag.c
+++ b/drivers/s390/block/dasd_diag.c
@@ -218,7 +218,7 @@ dasd_diag_term_IO(struct dasd_ccw_req * cqr)
218 218
219/* Handle external interruption. */ 219/* Handle external interruption. */
220static void 220static void
221dasd_ext_handler(struct pt_regs *regs, __u16 code) 221dasd_ext_handler(__u16 code)
222{ 222{
223 struct dasd_ccw_req *cqr, *next; 223 struct dasd_ccw_req *cqr, *next;
224 struct dasd_device *device; 224 struct dasd_device *device;
diff --git a/drivers/s390/char/ctrlchar.c b/drivers/s390/char/ctrlchar.c
index d83eb6358bac..49e9628d9297 100644
--- a/drivers/s390/char/ctrlchar.c
+++ b/drivers/s390/char/ctrlchar.c
@@ -20,7 +20,7 @@ static int ctrlchar_sysrq_key;
20static void 20static void
21ctrlchar_handle_sysrq(void *tty) 21ctrlchar_handle_sysrq(void *tty)
22{ 22{
23 handle_sysrq(ctrlchar_sysrq_key, NULL, (struct tty_struct *) tty); 23 handle_sysrq(ctrlchar_sysrq_key, (struct tty_struct *) tty);
24} 24}
25 25
26static DECLARE_WORK(ctrlchar_work, ctrlchar_handle_sysrq, NULL); 26static DECLARE_WORK(ctrlchar_work, ctrlchar_handle_sysrq, NULL);
diff --git a/drivers/s390/char/keyboard.c b/drivers/s390/char/keyboard.c
index 3be06569180d..e3491a5f5219 100644
--- a/drivers/s390/char/keyboard.c
+++ b/drivers/s390/char/keyboard.c
@@ -304,7 +304,7 @@ kbd_keycode(struct kbd_data *kbd, unsigned int keycode)
304 if (kbd->sysrq) { 304 if (kbd->sysrq) {
305 if (kbd->sysrq == K(KT_LATIN, '-')) { 305 if (kbd->sysrq == K(KT_LATIN, '-')) {
306 kbd->sysrq = 0; 306 kbd->sysrq = 0;
307 handle_sysrq(value, NULL, kbd->tty); 307 handle_sysrq(value, kbd->tty);
308 return; 308 return;
309 } 309 }
310 if (value == '-') { 310 if (value == '-') {
diff --git a/drivers/s390/char/monwriter.c b/drivers/s390/char/monwriter.c
index 1e3939aeb8ab..4362ff260244 100644
--- a/drivers/s390/char/monwriter.c
+++ b/drivers/s390/char/monwriter.c
@@ -26,6 +26,7 @@
26#define MONWRITE_MAX_DATALEN 4024 26#define MONWRITE_MAX_DATALEN 4024
27 27
28static int mon_max_bufs = 255; 28static int mon_max_bufs = 255;
29static int mon_buf_count;
29 30
30struct mon_buf { 31struct mon_buf {
31 struct list_head list; 32 struct list_head list;
@@ -40,7 +41,6 @@ struct mon_private {
40 size_t hdr_to_read; 41 size_t hdr_to_read;
41 size_t data_to_read; 42 size_t data_to_read;
42 struct mon_buf *current_buf; 43 struct mon_buf *current_buf;
43 int mon_buf_count;
44}; 44};
45 45
46/* 46/*
@@ -99,13 +99,13 @@ static int monwrite_new_hdr(struct mon_private *monpriv)
99 rc = monwrite_diag(monhdr, monbuf->data, 99 rc = monwrite_diag(monhdr, monbuf->data,
100 APPLDATA_STOP_REC); 100 APPLDATA_STOP_REC);
101 list_del(&monbuf->list); 101 list_del(&monbuf->list);
102 monpriv->mon_buf_count--; 102 mon_buf_count--;
103 kfree(monbuf->data); 103 kfree(monbuf->data);
104 kfree(monbuf); 104 kfree(monbuf);
105 monbuf = NULL; 105 monbuf = NULL;
106 } 106 }
107 } else { 107 } else {
108 if (monpriv->mon_buf_count >= mon_max_bufs) 108 if (mon_buf_count >= mon_max_bufs)
109 return -ENOSPC; 109 return -ENOSPC;
110 monbuf = kzalloc(sizeof(struct mon_buf), GFP_KERNEL); 110 monbuf = kzalloc(sizeof(struct mon_buf), GFP_KERNEL);
111 if (!monbuf) 111 if (!monbuf)
@@ -118,7 +118,7 @@ static int monwrite_new_hdr(struct mon_private *monpriv)
118 } 118 }
119 monbuf->hdr = *monhdr; 119 monbuf->hdr = *monhdr;
120 list_add_tail(&monbuf->list, &monpriv->list); 120 list_add_tail(&monbuf->list, &monpriv->list);
121 monpriv->mon_buf_count++; 121 mon_buf_count++;
122 } 122 }
123 monpriv->current_buf = monbuf; 123 monpriv->current_buf = monbuf;
124 return 0; 124 return 0;
@@ -186,7 +186,7 @@ static int monwrite_close(struct inode *inode, struct file *filp)
186 if (entry->hdr.mon_function != MONWRITE_GEN_EVENT) 186 if (entry->hdr.mon_function != MONWRITE_GEN_EVENT)
187 monwrite_diag(&entry->hdr, entry->data, 187 monwrite_diag(&entry->hdr, entry->data,
188 APPLDATA_STOP_REC); 188 APPLDATA_STOP_REC);
189 monpriv->mon_buf_count--; 189 mon_buf_count--;
190 list_del(&entry->list); 190 list_del(&entry->list);
191 kfree(entry->data); 191 kfree(entry->data);
192 kfree(entry); 192 kfree(entry);
diff --git a/drivers/s390/char/sclp.c b/drivers/s390/char/sclp.c
index 31e335751d6d..8a056df09d6b 100644
--- a/drivers/s390/char/sclp.c
+++ b/drivers/s390/char/sclp.c
@@ -324,7 +324,7 @@ __sclp_find_req(u32 sccb)
324 * Prepare read event data request if necessary. Start processing of next 324 * Prepare read event data request if necessary. Start processing of next
325 * request on queue. */ 325 * request on queue. */
326static void 326static void
327sclp_interrupt_handler(struct pt_regs *regs, __u16 code) 327sclp_interrupt_handler(__u16 code)
328{ 328{
329 struct sclp_req *req; 329 struct sclp_req *req;
330 u32 finished_sccb; 330 u32 finished_sccb;
@@ -743,7 +743,7 @@ EXPORT_SYMBOL(sclp_reactivate);
743/* Handler for external interruption used during initialization. Modify 743/* Handler for external interruption used during initialization. Modify
744 * request state to done. */ 744 * request state to done. */
745static void 745static void
746sclp_check_handler(struct pt_regs *regs, __u16 code) 746sclp_check_handler(__u16 code)
747{ 747{
748 u32 finished_sccb; 748 u32 finished_sccb;
749 749
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index 3bb4e472d73d..07c7f19339d2 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -200,11 +200,13 @@ css_get_ssd_info(struct subchannel *sch)
200 spin_unlock_irq(&sch->lock); 200 spin_unlock_irq(&sch->lock);
201 free_page((unsigned long)page); 201 free_page((unsigned long)page);
202 if (!ret) { 202 if (!ret) {
203 int j, chpid; 203 int j, chpid, mask;
204 /* Allocate channel path structures, if needed. */ 204 /* Allocate channel path structures, if needed. */
205 for (j = 0; j < 8; j++) { 205 for (j = 0; j < 8; j++) {
206 mask = 0x80 >> j;
206 chpid = sch->ssd_info.chpid[j]; 207 chpid = sch->ssd_info.chpid[j];
207 if (chpid && (get_chp_status(chpid) < 0)) 208 if ((sch->schib.pmcw.pim & mask) &&
209 (get_chp_status(chpid) < 0))
208 new_channel_path(chpid); 210 new_channel_path(chpid);
209 } 211 }
210 } 212 }
@@ -222,13 +224,15 @@ s390_subchannel_remove_chpid(struct device *dev, void *data)
222 224
223 sch = to_subchannel(dev); 225 sch = to_subchannel(dev);
224 chpid = data; 226 chpid = data;
225 for (j = 0; j < 8; j++) 227 for (j = 0; j < 8; j++) {
226 if (sch->schib.pmcw.chpid[j] == chpid->id) 228 mask = 0x80 >> j;
229 if ((sch->schib.pmcw.pim & mask) &&
230 (sch->schib.pmcw.chpid[j] == chpid->id))
227 break; 231 break;
232 }
228 if (j >= 8) 233 if (j >= 8)
229 return 0; 234 return 0;
230 235
231 mask = 0x80 >> j;
232 spin_lock_irq(&sch->lock); 236 spin_lock_irq(&sch->lock);
233 237
234 stsch(sch->schid, &schib); 238 stsch(sch->schid, &schib);
@@ -620,7 +624,7 @@ __chp_add_new_sch(struct subchannel_id schid)
620static int 624static int
621__chp_add(struct subchannel_id schid, void *data) 625__chp_add(struct subchannel_id schid, void *data)
622{ 626{
623 int i; 627 int i, mask;
624 struct channel_path *chp; 628 struct channel_path *chp;
625 struct subchannel *sch; 629 struct subchannel *sch;
626 630
@@ -630,8 +634,10 @@ __chp_add(struct subchannel_id schid, void *data)
630 /* Check if the subchannel is now available. */ 634 /* Check if the subchannel is now available. */
631 return __chp_add_new_sch(schid); 635 return __chp_add_new_sch(schid);
632 spin_lock_irq(&sch->lock); 636 spin_lock_irq(&sch->lock);
633 for (i=0; i<8; i++) 637 for (i=0; i<8; i++) {
634 if (sch->schib.pmcw.chpid[i] == chp->id) { 638 mask = 0x80 >> i;
639 if ((sch->schib.pmcw.pim & mask) &&
640 (sch->schib.pmcw.chpid[i] == chp->id)) {
635 if (stsch(sch->schid, &sch->schib) != 0) { 641 if (stsch(sch->schid, &sch->schib) != 0) {
636 /* Endgame. */ 642 /* Endgame. */
637 spin_unlock_irq(&sch->lock); 643 spin_unlock_irq(&sch->lock);
@@ -639,6 +645,7 @@ __chp_add(struct subchannel_id schid, void *data)
639 } 645 }
640 break; 646 break;
641 } 647 }
648 }
642 if (i==8) { 649 if (i==8) {
643 spin_unlock_irq(&sch->lock); 650 spin_unlock_irq(&sch->lock);
644 return 0; 651 return 0;
@@ -646,7 +653,7 @@ __chp_add(struct subchannel_id schid, void *data)
646 sch->lpm = ((sch->schib.pmcw.pim & 653 sch->lpm = ((sch->schib.pmcw.pim &
647 sch->schib.pmcw.pam & 654 sch->schib.pmcw.pam &
648 sch->schib.pmcw.pom) 655 sch->schib.pmcw.pom)
649 | 0x80 >> i) & sch->opm; 656 | mask) & sch->opm;
650 657
651 if (sch->driver && sch->driver->verify) 658 if (sch->driver && sch->driver->verify)
652 sch->driver->verify(&sch->dev); 659 sch->driver->verify(&sch->dev);
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c
index 2e2882daefbb..f18b1623cad7 100644
--- a/drivers/s390/cio/cio.c
+++ b/drivers/s390/cio/cio.c
@@ -19,6 +19,7 @@
19#include <asm/cio.h> 19#include <asm/cio.h>
20#include <asm/delay.h> 20#include <asm/delay.h>
21#include <asm/irq.h> 21#include <asm/irq.h>
22#include <asm/irq_regs.h>
22#include <asm/setup.h> 23#include <asm/setup.h>
23#include "airq.h" 24#include "airq.h"
24#include "cio.h" 25#include "cio.h"
@@ -606,15 +607,17 @@ do_IRQ (struct pt_regs *regs)
606 struct tpi_info *tpi_info; 607 struct tpi_info *tpi_info;
607 struct subchannel *sch; 608 struct subchannel *sch;
608 struct irb *irb; 609 struct irb *irb;
610 struct pt_regs *old_regs;
609 611
610 irq_enter (); 612 irq_enter ();
613 old_regs = set_irq_regs(regs);
611 asm volatile ("mc 0,0"); 614 asm volatile ("mc 0,0");
612 if (S390_lowcore.int_clock >= S390_lowcore.jiffy_timer) 615 if (S390_lowcore.int_clock >= S390_lowcore.jiffy_timer)
613 /** 616 /**
614 * Make sure that the i/o interrupt did not "overtake" 617 * Make sure that the i/o interrupt did not "overtake"
615 * the last HZ timer interrupt. 618 * the last HZ timer interrupt.
616 */ 619 */
617 account_ticks(regs); 620 account_ticks();
618 /* 621 /*
619 * Get interrupt information from lowcore 622 * Get interrupt information from lowcore
620 */ 623 */
@@ -652,6 +655,7 @@ do_IRQ (struct pt_regs *regs)
652 * out of the sie which costs more cycles than it saves. 655 * out of the sie which costs more cycles than it saves.
653 */ 656 */
654 } while (!MACHINE_IS_VM && tpi (NULL) != 0); 657 } while (!MACHINE_IS_VM && tpi (NULL) != 0);
658 set_irq_regs(old_regs);
655 irq_exit (); 659 irq_exit ();
656} 660}
657 661
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c
index cd30f37fceae..c5ccd20b110c 100644
--- a/drivers/s390/crypto/ap_bus.c
+++ b/drivers/s390/crypto/ap_bus.c
@@ -1062,7 +1062,7 @@ static int ap_poll_thread(void *data)
1062 unsigned long flags; 1062 unsigned long flags;
1063 int requests; 1063 int requests;
1064 1064
1065 set_user_nice(current, -20); 1065 set_user_nice(current, 19);
1066 while (1) { 1066 while (1) {
1067 if (need_resched()) { 1067 if (need_resched()) {
1068 schedule(); 1068 schedule();
diff --git a/drivers/s390/net/iucv.c b/drivers/s390/net/iucv.c
index 809dd8d7f47a..1476ce2b437c 100644
--- a/drivers/s390/net/iucv.c
+++ b/drivers/s390/net/iucv.c
@@ -116,7 +116,7 @@ static DEFINE_SPINLOCK(iucv_irq_queue_lock);
116 *Internal function prototypes 116 *Internal function prototypes
117 */ 117 */
118static void iucv_tasklet_handler(unsigned long); 118static void iucv_tasklet_handler(unsigned long);
119static void iucv_irq_handler(struct pt_regs *, __u16); 119static void iucv_irq_handler(__u16);
120 120
121static DECLARE_TASKLET(iucv_tasklet,iucv_tasklet_handler,0); 121static DECLARE_TASKLET(iucv_tasklet,iucv_tasklet_handler,0);
122 122
@@ -2251,7 +2251,7 @@ iucv_sever(__u16 pathid, __u8 user_data[16])
2251 * Places the interrupt buffer on a queue and schedules iucv_tasklet_handler(). 2251 * Places the interrupt buffer on a queue and schedules iucv_tasklet_handler().
2252 */ 2252 */
2253static void 2253static void
2254iucv_irq_handler(struct pt_regs *regs, __u16 code) 2254iucv_irq_handler(__u16 code)
2255{ 2255{
2256 iucv_irqdata *irqdata; 2256 iucv_irqdata *irqdata;
2257 2257
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index 862a411a4aa0..c88babce9bca 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -1987,7 +1987,7 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action)
1987 sbale = &(adapter->response_queue.buffer[i]->element[0]); 1987 sbale = &(adapter->response_queue.buffer[i]->element[0]);
1988 sbale->length = 0; 1988 sbale->length = 0;
1989 sbale->flags = SBAL_FLAGS_LAST_ENTRY; 1989 sbale->flags = SBAL_FLAGS_LAST_ENTRY;
1990 sbale->addr = 0; 1990 sbale->addr = NULL;
1991 } 1991 }
1992 1992
1993 ZFCP_LOG_TRACE("calling do_QDIO on adapter %s (flags=0x%x, " 1993 ZFCP_LOG_TRACE("calling do_QDIO on adapter %s (flags=0x%x, "
diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c
index 2f698763ba5d..81ba2d71cee2 100644
--- a/drivers/sbus/char/openprom.c
+++ b/drivers/sbus/char/openprom.c
@@ -630,7 +630,7 @@ static int openprom_ioctl(struct inode * inode, struct file * file,
630 case OPROMPATH2NODE: 630 case OPROMPATH2NODE:
631 if ((file->f_mode & FMODE_READ) == 0) 631 if ((file->f_mode & FMODE_READ) == 0)
632 return -EPERM; 632 return -EPERM;
633 return openprom_sunos_ioctl(inode, file, cmd, arg, 0); 633 return openprom_sunos_ioctl(inode, file, cmd, arg, NULL);
634 634
635 case OPIOCGET: 635 case OPIOCGET:
636 case OPIOCNEXTPROP: 636 case OPIOCNEXTPROP:
diff --git a/drivers/sbus/char/uctrl.c b/drivers/sbus/char/uctrl.c
index ddc0681ac759..b30372f17f1c 100644
--- a/drivers/sbus/char/uctrl.c
+++ b/drivers/sbus/char/uctrl.c
@@ -400,7 +400,7 @@ static int __init ts102_uctrl_init(void)
400 } 400 }
401 401
402 driver->regs->uctrl_intr = UCTRL_INTR_RXNE_REQ|UCTRL_INTR_RXNE_MSK; 402 driver->regs->uctrl_intr = UCTRL_INTR_RXNE_REQ|UCTRL_INTR_RXNE_MSK;
403 printk("uctrl: 0x%x (irq %d)\n", driver->regs, driver->irq); 403 printk("uctrl: 0x%p (irq %d)\n", driver->regs, driver->irq);
404 uctrl_get_event_status(); 404 uctrl_get_event_status();
405 uctrl_get_external_status(); 405 uctrl_get_external_status();
406 return 0; 406 return 0;
diff --git a/drivers/scsi/NCR53c406a.c b/drivers/scsi/NCR53c406a.c
index 3896278594c7..d4613815f685 100644
--- a/drivers/scsi/NCR53c406a.c
+++ b/drivers/scsi/NCR53c406a.c
@@ -168,7 +168,7 @@ enum Phase {
168}; 168};
169 169
170/* Static function prototypes */ 170/* Static function prototypes */
171static void NCR53c406a_intr(int, void *); 171static void NCR53c406a_intr(void *);
172static irqreturn_t do_NCR53c406a_intr(int, void *); 172static irqreturn_t do_NCR53c406a_intr(int, void *);
173static void chip_init(void); 173static void chip_init(void);
174static void calc_port_addr(void); 174static void calc_port_addr(void);
@@ -685,7 +685,7 @@ static void wait_intr(void)
685 return; 685 return;
686 } 686 }
687 687
688 NCR53c406a_intr(0, NULL, NULL); 688 NCR53c406a_intr(NULL);
689} 689}
690#endif 690#endif
691 691
@@ -767,12 +767,12 @@ static irqreturn_t do_NCR53c406a_intr(int unused, void *dev_id)
767 struct Scsi_Host *dev = dev_id; 767 struct Scsi_Host *dev = dev_id;
768 768
769 spin_lock_irqsave(dev->host_lock, flags); 769 spin_lock_irqsave(dev->host_lock, flags);
770 NCR53c406a_intr(0, dev_id); 770 NCR53c406a_intr(dev_id);
771 spin_unlock_irqrestore(dev->host_lock, flags); 771 spin_unlock_irqrestore(dev->host_lock, flags);
772 return IRQ_HANDLED; 772 return IRQ_HANDLED;
773} 773}
774 774
775static void NCR53c406a_intr(int unused, void *dev_id) 775static void NCR53c406a_intr(void *dev_id)
776{ 776{
777 DEB(unsigned char fifo_size; 777 DEB(unsigned char fifo_size;
778 ) 778 )
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index 83695416b2c9..2b344356a29e 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -3881,7 +3881,7 @@ typedef struct asc_board {
3881 /* 3881 /*
3882 * The following fields are used only for Wide Boards. 3882 * The following fields are used only for Wide Boards.
3883 */ 3883 */
3884 void *ioremap_addr; /* I/O Memory remap address. */ 3884 void __iomem *ioremap_addr; /* I/O Memory remap address. */
3885 ushort ioport; /* I/O Port address. */ 3885 ushort ioport; /* I/O Port address. */
3886 ADV_CARR_T *orig_carrp; /* ADV_CARR_T memory block. */ 3886 ADV_CARR_T *orig_carrp; /* ADV_CARR_T memory block. */
3887 adv_req_t *orig_reqp; /* adv_req_t memory block. */ 3887 adv_req_t *orig_reqp; /* adv_req_t memory block. */
@@ -3951,7 +3951,7 @@ typedef struct _PCI_CONFIG_SPACE_
3951 3951
3952/* Number of boards detected in system. */ 3952/* Number of boards detected in system. */
3953STATIC int asc_board_count = 0; 3953STATIC int asc_board_count = 0;
3954STATIC struct Scsi_Host *asc_host[ASC_NUM_BOARD_SUPPORTED] = { 0 }; 3954STATIC struct Scsi_Host *asc_host[ASC_NUM_BOARD_SUPPORTED] = { NULL };
3955 3955
3956/* Overrun buffer used by all narrow boards. */ 3956/* Overrun buffer used by all narrow boards. */
3957STATIC uchar overrun_buf[ASC_OVERRUN_BSIZE] = { 0 }; 3957STATIC uchar overrun_buf[ASC_OVERRUN_BSIZE] = { 0 };
@@ -6621,7 +6621,7 @@ adv_build_req(asc_board_t *boardp, struct scsi_cmnd *scp,
6621 dma_map_single(dev, scp->request_buffer, 6621 dma_map_single(dev, scp->request_buffer,
6622 scp->request_bufflen, scp->sc_data_direction); 6622 scp->request_bufflen, scp->sc_data_direction);
6623 } else { 6623 } else {
6624 scsiqp->vdata_addr = 0; 6624 scsiqp->vdata_addr = NULL;
6625 scp->SCp.dma_handle = 0; 6625 scp->SCp.dma_handle = 0;
6626 } 6626 }
6627 scsiqp->data_addr = cpu_to_le32(scp->SCp.dma_handle); 6627 scsiqp->data_addr = cpu_to_le32(scp->SCp.dma_handle);
diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
index e04c2bc1932b..a0d1cee0be77 100644
--- a/drivers/scsi/aha152x.c
+++ b/drivers/scsi/aha152x.c
@@ -759,12 +759,7 @@ static inline Scsi_Cmnd *remove_SC(Scsi_Cmnd **SC, Scsi_Cmnd *SCp)
759 759
760static irqreturn_t swintr(int irqno, void *dev_id) 760static irqreturn_t swintr(int irqno, void *dev_id)
761{ 761{
762 struct Scsi_Host *shpnt = (struct Scsi_Host *)dev_id; 762 struct Scsi_Host *shpnt = dev_id;
763
764 if (!shpnt) {
765 printk(KERN_ERR "aha152x: catched software interrupt %d for unknown controller.\n", irqno);
766 return IRQ_NONE;
767 }
768 763
769 HOSTDATA(shpnt)->swint++; 764 HOSTDATA(shpnt)->swint++;
770 765
diff --git a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c
index 7f0adf9c4c7e..bcd7fffab907 100644
--- a/drivers/scsi/aic7xxx_old.c
+++ b/drivers/scsi/aic7xxx_old.c
@@ -6345,12 +6345,12 @@ aic7xxx_handle_command_completion_intr(struct aic7xxx_host *p)
6345 * SCSI controller interrupt handler. 6345 * SCSI controller interrupt handler.
6346 *-F*************************************************************************/ 6346 *-F*************************************************************************/
6347static void 6347static void
6348aic7xxx_isr(int irq, void *dev_id) 6348aic7xxx_isr(void *dev_id)
6349{ 6349{
6350 struct aic7xxx_host *p; 6350 struct aic7xxx_host *p;
6351 unsigned char intstat; 6351 unsigned char intstat;
6352 6352
6353 p = (struct aic7xxx_host *)dev_id; 6353 p = dev_id;
6354 6354
6355 /* 6355 /*
6356 * Just a few sanity checks. Make sure that we have an int pending. 6356 * Just a few sanity checks. Make sure that we have an int pending.
@@ -6489,7 +6489,7 @@ do_aic7xxx_isr(int irq, void *dev_id)
6489 p->flags |= AHC_IN_ISR; 6489 p->flags |= AHC_IN_ISR;
6490 do 6490 do
6491 { 6491 {
6492 aic7xxx_isr(irq, dev_id); 6492 aic7xxx_isr(dev_id);
6493 } while ( (aic_inb(p, INTSTAT) & INT_PEND) ); 6493 } while ( (aic_inb(p, INTSTAT) & INT_PEND) );
6494 aic7xxx_done_cmds_complete(p); 6494 aic7xxx_done_cmds_complete(p);
6495 aic7xxx_run_waiting_queues(p); 6495 aic7xxx_run_waiting_queues(p);
@@ -10377,7 +10377,7 @@ static int __aic7xxx_bus_device_reset(struct scsi_cmnd *cmd)
10377 10377
10378 hscb = scb->hscb; 10378 hscb = scb->hscb;
10379 10379
10380 aic7xxx_isr(p->irq, (void *)p); 10380 aic7xxx_isr(p);
10381 aic7xxx_done_cmds_complete(p); 10381 aic7xxx_done_cmds_complete(p);
10382 /* If the command was already complete or just completed, then we didn't 10382 /* If the command was already complete or just completed, then we didn't
10383 * do a reset, return FAILED */ 10383 * do a reset, return FAILED */
@@ -10608,7 +10608,7 @@ static int __aic7xxx_abort(struct scsi_cmnd *cmd)
10608 else 10608 else
10609 return FAILED; 10609 return FAILED;
10610 10610
10611 aic7xxx_isr(p->irq, (void *)p); 10611 aic7xxx_isr(p);
10612 aic7xxx_done_cmds_complete(p); 10612 aic7xxx_done_cmds_complete(p);
10613 /* If the command was already complete or just completed, then we didn't 10613 /* If the command was already complete or just completed, then we didn't
10614 * do a reset, return FAILED */ 10614 * do a reset, return FAILED */
@@ -10863,7 +10863,7 @@ static int aic7xxx_reset(struct scsi_cmnd *cmd)
10863 10863
10864 while((aic_inb(p, INTSTAT) & INT_PEND) && !(p->flags & AHC_IN_ISR)) 10864 while((aic_inb(p, INTSTAT) & INT_PEND) && !(p->flags & AHC_IN_ISR))
10865 { 10865 {
10866 aic7xxx_isr(p->irq, p); 10866 aic7xxx_isr(p);
10867 pause_sequencer(p); 10867 pause_sequencer(p);
10868 } 10868 }
10869 aic7xxx_done_cmds_complete(p); 10869 aic7xxx_done_cmds_complete(p);
diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c
index 81e3ee51d897..e95b367d09ed 100644
--- a/drivers/scsi/dc395x.c
+++ b/drivers/scsi/dc395x.c
@@ -1219,7 +1219,7 @@ static void dump_register_info(struct AdapterCtlBlk *acb,
1219 srb, srb->cmd, srb->cmd->pid, 1219 srb, srb->cmd, srb->cmd->pid,
1220 srb->cmd->cmnd[0], srb->cmd->device->id, 1220 srb->cmd->cmnd[0], srb->cmd->device->id,
1221 srb->cmd->device->lun); 1221 srb->cmd->device->lun);
1222 printk(" sglist=%p cnt=%i idx=%i len=%Zd\n", 1222 printk(" sglist=%p cnt=%i idx=%i len=%zu\n",
1223 srb->segment_x, srb->sg_count, srb->sg_index, 1223 srb->segment_x, srb->sg_count, srb->sg_index,
1224 srb->total_xfer_length); 1224 srb->total_xfer_length);
1225 printk(" state=0x%04x status=0x%02x phase=0x%02x (%sconn.)\n", 1225 printk(" state=0x%04x status=0x%02x phase=0x%02x (%sconn.)\n",
@@ -1815,7 +1815,7 @@ static void dc395x_handle_interrupt(struct AdapterCtlBlk *acb,
1815 1815
1816static irqreturn_t dc395x_interrupt(int irq, void *dev_id) 1816static irqreturn_t dc395x_interrupt(int irq, void *dev_id)
1817{ 1817{
1818 struct AdapterCtlBlk *acb = (struct AdapterCtlBlk *)dev_id; 1818 struct AdapterCtlBlk *acb = dev_id;
1819 u16 scsi_status; 1819 u16 scsi_status;
1820 u8 dma_status; 1820 u8 dma_status;
1821 irqreturn_t handled = IRQ_NONE; 1821 irqreturn_t handled = IRQ_NONE;
diff --git a/drivers/scsi/mesh.c b/drivers/scsi/mesh.c
index c773e35dace7..1fd3c7590d31 100644
--- a/drivers/scsi/mesh.c
+++ b/drivers/scsi/mesh.c
@@ -466,7 +466,7 @@ static void mesh_start_cmd(struct mesh_state *ms, struct scsi_cmnd *cmd)
466 dlog(ms, "intr b4 arb, intr/exc/err/fc=%.8x", 466 dlog(ms, "intr b4 arb, intr/exc/err/fc=%.8x",
467 MKWORD(mr->interrupt, mr->exception, 467 MKWORD(mr->interrupt, mr->exception,
468 mr->error, mr->fifo_count)); 468 mr->error, mr->fifo_count));
469 mesh_interrupt(0, (void *)ms, NULL); 469 mesh_interrupt(0, (void *)ms);
470 if (ms->phase != arbitrating) 470 if (ms->phase != arbitrating)
471 return; 471 return;
472 } 472 }
@@ -504,7 +504,7 @@ static void mesh_start_cmd(struct mesh_state *ms, struct scsi_cmnd *cmd)
504 dlog(ms, "intr after disresel, intr/exc/err/fc=%.8x", 504 dlog(ms, "intr after disresel, intr/exc/err/fc=%.8x",
505 MKWORD(mr->interrupt, mr->exception, 505 MKWORD(mr->interrupt, mr->exception,
506 mr->error, mr->fifo_count)); 506 mr->error, mr->fifo_count));
507 mesh_interrupt(0, (void *)ms, NULL); 507 mesh_interrupt(0, (void *)ms);
508 if (ms->phase != arbitrating) 508 if (ms->phase != arbitrating)
509 return; 509 return;
510 dlog(ms, "after intr after disresel, intr/exc/err/fc=%.8x", 510 dlog(ms, "after intr after disresel, intr/exc/err/fc=%.8x",
diff --git a/drivers/scsi/qlogicfas408.c b/drivers/scsi/qlogicfas408.c
index 1a7de3bd796f..e0725353c99c 100644
--- a/drivers/scsi/qlogicfas408.c
+++ b/drivers/scsi/qlogicfas408.c
@@ -405,10 +405,10 @@ static unsigned int ql_pcmd(Scsi_Cmnd * cmd)
405 * Interrupt handler 405 * Interrupt handler
406 */ 406 */
407 407
408static void ql_ihandl(int irq, void *dev_id) 408static void ql_ihandl(void *dev_id)
409{ 409{
410 Scsi_Cmnd *icmd; 410 Scsi_Cmnd *icmd;
411 struct Scsi_Host *host = (struct Scsi_Host *)dev_id; 411 struct Scsi_Host *host = dev_id;
412 struct qlogicfas408_priv *priv = get_priv_by_host(host); 412 struct qlogicfas408_priv *priv = get_priv_by_host(host);
413 int qbase = priv->qbase; 413 int qbase = priv->qbase;
414 REG0; 414 REG0;
@@ -438,7 +438,7 @@ irqreturn_t qlogicfas408_ihandl(int irq, void *dev_id)
438 struct Scsi_Host *host = dev_id; 438 struct Scsi_Host *host = dev_id;
439 439
440 spin_lock_irqsave(host->host_lock, flags); 440 spin_lock_irqsave(host->host_lock, flags);
441 ql_ihandl(irq, dev_id); 441 ql_ihandl(dev_id);
442 spin_unlock_irqrestore(host->host_lock, flags); 442 spin_unlock_irqrestore(host->host_lock, flags);
443 return IRQ_HANDLED; 443 return IRQ_HANDLED;
444} 444}
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 3d355d054612..aff1b0cfd4b2 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -495,7 +495,7 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd,
495 memcpy(scmd->cmnd, cmnd, cmnd_size); 495 memcpy(scmd->cmnd, cmnd, cmnd_size);
496 496
497 if (copy_sense) { 497 if (copy_sense) {
498 int gfp_mask = GFP_ATOMIC; 498 gfp_t gfp_mask = GFP_ATOMIC;
499 499
500 if (shost->hostt->unchecked_isa_dma) 500 if (shost->hostt->unchecked_isa_dma)
501 gfp_mask |= __GFP_DMA; 501 gfp_mask |= __GFP_DMA;
diff --git a/drivers/scsi/tmscsim.c b/drivers/scsi/tmscsim.c
index 0f0ac925d319..d03aa6ce8fe8 100644
--- a/drivers/scsi/tmscsim.c
+++ b/drivers/scsi/tmscsim.c
@@ -700,9 +700,9 @@ dc390_InvalidCmd(struct dc390_acb* pACB)
700 700
701 701
702static irqreturn_t __inline__ 702static irqreturn_t __inline__
703DC390_Interrupt(int irq, void *dev_id) 703DC390_Interrupt(void *dev_id)
704{ 704{
705 struct dc390_acb *pACB = (struct dc390_acb*)dev_id; 705 struct dc390_acb *pACB = dev_id;
706 struct dc390_dcb *pDCB; 706 struct dc390_dcb *pDCB;
707 struct dc390_srb *pSRB; 707 struct dc390_srb *pSRB;
708 u8 sstatus=0; 708 u8 sstatus=0;
@@ -811,12 +811,12 @@ DC390_Interrupt(int irq, void *dev_id)
811 return IRQ_HANDLED; 811 return IRQ_HANDLED;
812} 812}
813 813
814static irqreturn_t do_DC390_Interrupt( int irq, void *dev_id) 814static irqreturn_t do_DC390_Interrupt(int irq, void *dev_id)
815{ 815{
816 irqreturn_t ret; 816 irqreturn_t ret;
817 DEBUG1(printk (KERN_INFO "DC390: Irq (%i) caught: ", irq)); 817 DEBUG1(printk (KERN_INFO "DC390: Irq (%i) caught: ", irq));
818 /* Locking is done in DC390_Interrupt */ 818 /* Locking is done in DC390_Interrupt */
819 ret = DC390_Interrupt(irq, dev_id); 819 ret = DC390_Interrupt(dev_id);
820 DEBUG1(printk (".. IRQ returned\n")); 820 DEBUG1(printk (".. IRQ returned\n"));
821 return ret; 821 return ret;
822} 822}
diff --git a/drivers/scsi/ultrastor.c b/drivers/scsi/ultrastor.c
index 107f0fc34949..56906aba5ee3 100644
--- a/drivers/scsi/ultrastor.c
+++ b/drivers/scsi/ultrastor.c
@@ -287,7 +287,7 @@ static const unsigned short ultrastor_ports_14f[] = {
287}; 287};
288#endif 288#endif
289 289
290static void ultrastor_interrupt(int, void *); 290static void ultrastor_interrupt(void *);
291static irqreturn_t do_ultrastor_interrupt(int, void *); 291static irqreturn_t do_ultrastor_interrupt(int, void *);
292static inline void build_sg_list(struct mscp *, struct scsi_cmnd *SCpnt); 292static inline void build_sg_list(struct mscp *, struct scsi_cmnd *SCpnt);
293 293
@@ -893,7 +893,7 @@ static int ultrastor_abort(struct scsi_cmnd *SCpnt)
893 893
894 spin_lock_irqsave(host->host_lock, flags); 894 spin_lock_irqsave(host->host_lock, flags);
895 /* FIXME: Ewww... need to think about passing host around properly */ 895 /* FIXME: Ewww... need to think about passing host around properly */
896 ultrastor_interrupt(0, NULL); 896 ultrastor_interrupt(NULL);
897 spin_unlock_irqrestore(host->host_lock, flags); 897 spin_unlock_irqrestore(host->host_lock, flags);
898 return SUCCESS; 898 return SUCCESS;
899 } 899 }
@@ -1039,7 +1039,7 @@ int ultrastor_biosparam(struct scsi_device *sdev, struct block_device *bdev,
1039 return 0; 1039 return 0;
1040} 1040}
1041 1041
1042static void ultrastor_interrupt(int irq, void *dev_id) 1042static void ultrastor_interrupt(void *dev_id)
1043{ 1043{
1044 unsigned int status; 1044 unsigned int status;
1045#if ULTRASTOR_MAX_CMDS > 1 1045#if ULTRASTOR_MAX_CMDS > 1
@@ -1177,7 +1177,7 @@ static irqreturn_t do_ultrastor_interrupt(int irq, void *dev_id)
1177 struct Scsi_Host *dev = dev_id; 1177 struct Scsi_Host *dev = dev_id;
1178 1178
1179 spin_lock_irqsave(dev->host_lock, flags); 1179 spin_lock_irqsave(dev->host_lock, flags);
1180 ultrastor_interrupt(irq, dev_id); 1180 ultrastor_interrupt(dev_id);
1181 spin_unlock_irqrestore(dev->host_lock, flags); 1181 spin_unlock_irqrestore(dev->host_lock, flags);
1182 return IRQ_HANDLED; 1182 return IRQ_HANDLED;
1183} 1183}
diff --git a/drivers/serial/68360serial.c b/drivers/serial/68360serial.c
index 4e56ec803861..634ecca36a77 100644
--- a/drivers/serial/68360serial.c
+++ b/drivers/serial/68360serial.c
@@ -620,7 +620,7 @@ static void rs_360_interrupt(int vec, void *dev_id)
620 volatile struct smc_regs *smcp; 620 volatile struct smc_regs *smcp;
621 volatile struct scc_regs *sccp; 621 volatile struct scc_regs *sccp;
622 622
623 info = (ser_info_t *)dev_id; 623 info = dev_id;
624 624
625 idx = PORT_NUM(info->state->smc_scc_num); 625 idx = PORT_NUM(info->state->smc_scc_num);
626 if (info->state->smc_scc_num & NUM_IS_SCC) { 626 if (info->state->smc_scc_num & NUM_IS_SCC) {
diff --git a/drivers/serial/jsm/jsm_neo.c b/drivers/serial/jsm/jsm_neo.c
index 8fa31e68989a..8be8da37f629 100644
--- a/drivers/serial/jsm/jsm_neo.c
+++ b/drivers/serial/jsm/jsm_neo.c
@@ -1116,7 +1116,7 @@ static void neo_param(struct jsm_channel *ch)
1116 */ 1116 */
1117static irqreturn_t neo_intr(int irq, void *voidbrd) 1117static irqreturn_t neo_intr(int irq, void *voidbrd)
1118{ 1118{
1119 struct jsm_board *brd = (struct jsm_board *) voidbrd; 1119 struct jsm_board *brd = voidbrd;
1120 struct jsm_channel *ch; 1120 struct jsm_channel *ch;
1121 int port = 0; 1121 int port = 0;
1122 int type = 0; 1122 int type = 0;
diff --git a/drivers/serial/m32r_sio.c b/drivers/serial/m32r_sio.c
index c85ac1a77608..7656a35f5e2f 100644
--- a/drivers/serial/m32r_sio.c
+++ b/drivers/serial/m32r_sio.c
@@ -590,7 +590,7 @@ static void m32r_sio_timeout(unsigned long data)
590 sts = sio_in(up, SIOSTS); 590 sts = sio_in(up, SIOSTS);
591 if (sts & 0x5) { 591 if (sts & 0x5) {
592 spin_lock(&up->port.lock); 592 spin_lock(&up->port.lock);
593 m32r_sio_handle_port(up, sts, NULL); 593 m32r_sio_handle_port(up, sts);
594 spin_unlock(&up->port.lock); 594 spin_unlock(&up->port.lock);
595 } 595 }
596 596
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 039c2fd6d496..4f80c5b4a753 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -512,19 +512,11 @@ mpc52xx_uart_int_tx_chars(struct uart_port *port)
512static irqreturn_t 512static irqreturn_t
513mpc52xx_uart_int(int irq, void *dev_id) 513mpc52xx_uart_int(int irq, void *dev_id)
514{ 514{
515 struct uart_port *port = (struct uart_port *) dev_id; 515 struct uart_port *port = dev_id;
516 unsigned long pass = ISR_PASS_LIMIT; 516 unsigned long pass = ISR_PASS_LIMIT;
517 unsigned int keepgoing; 517 unsigned int keepgoing;
518 unsigned short status; 518 unsigned short status;
519 519
520 if ( irq != port->irq ) {
521 printk( KERN_WARNING
522 "mpc52xx_uart_int : " \
523 "Received wrong int %d. Waiting for %d\n",
524 irq, port->irq);
525 return IRQ_NONE;
526 }
527
528 spin_lock(&port->lock); 520 spin_lock(&port->lock);
529 521
530 /* While we have stuff to do, we continue */ 522 /* While we have stuff to do, we continue */
diff --git a/drivers/serial/mux.c b/drivers/serial/mux.c
index aa819d3f8ee5..8ad1b8c5ec5d 100644
--- a/drivers/serial/mux.c
+++ b/drivers/serial/mux.c
@@ -230,7 +230,7 @@ static void mux_read(struct uart_port *port)
230 continue; 230 continue;
231 } 231 }
232 232
233 if (uart_handle_sysrq_char(port, data & 0xffu, NULL)) 233 if (uart_handle_sysrq_char(port, data & 0xffu))
234 continue; 234 continue;
235 235
236 tty_insert_flip_char(tty, data & 0xFF, TTY_NORMAL); 236 tty_insert_flip_char(tty, data & 0xFF, TTY_NORMAL);
diff --git a/drivers/serial/netx-serial.c b/drivers/serial/netx-serial.c
index e92d7e1c22cf..062bad457b1a 100644
--- a/drivers/serial/netx-serial.c
+++ b/drivers/serial/netx-serial.c
@@ -247,7 +247,7 @@ static void netx_rxint(struct uart_port *port)
247 247
248static irqreturn_t netx_int(int irq, void *dev_id) 248static irqreturn_t netx_int(int irq, void *dev_id)
249{ 249{
250 struct uart_port *port = (struct uart_port *)dev_id; 250 struct uart_port *port = dev_id;
251 unsigned long flags; 251 unsigned long flags;
252 unsigned char status; 252 unsigned char status;
253 253
diff --git a/drivers/serial/pxa.c b/drivers/serial/pxa.c
index 846089f222d4..415fe9633a9b 100644
--- a/drivers/serial/pxa.c
+++ b/drivers/serial/pxa.c
@@ -232,7 +232,7 @@ static inline void check_modem_status(struct uart_pxa_port *up)
232 */ 232 */
233static inline irqreturn_t serial_pxa_irq(int irq, void *dev_id) 233static inline irqreturn_t serial_pxa_irq(int irq, void *dev_id)
234{ 234{
235 struct uart_pxa_port *up = (struct uart_pxa_port *)dev_id; 235 struct uart_pxa_port *up = dev_id;
236 unsigned int iir, lsr; 236 unsigned int iir, lsr;
237 237
238 iir = serial_in(up, UART_IIR); 238 iir = serial_in(up, UART_IIR);
diff --git a/drivers/serial/sn_console.c b/drivers/serial/sn_console.c
index 709f93a6c18c..956b2cf08e1e 100644
--- a/drivers/serial/sn_console.c
+++ b/drivers/serial/sn_console.c
@@ -674,7 +674,7 @@ static void sn_sal_timer_poll(unsigned long data)
674 if (!port->sc_port.irq) { 674 if (!port->sc_port.irq) {
675 spin_lock_irqsave(&port->sc_port.lock, flags); 675 spin_lock_irqsave(&port->sc_port.lock, flags);
676 if (sn_process_input) 676 if (sn_process_input)
677 sn_receive_chars(port, NULL, flags); 677 sn_receive_chars(port, flags);
678 sn_transmit_chars(port, TRANSMIT_RAW); 678 sn_transmit_chars(port, TRANSMIT_RAW);
679 spin_unlock_irqrestore(&port->sc_port.lock, flags); 679 spin_unlock_irqrestore(&port->sc_port.lock, flags);
680 mod_timer(&port->sc_timer, 680 mod_timer(&port->sc_timer,
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
index b11f6dea2704..73dd2eedaaad 100644
--- a/drivers/serial/sunzilog.c
+++ b/drivers/serial/sunzilog.c
@@ -1057,7 +1057,7 @@ static void sunzilog_free_tables(void)
1057 1057
1058static void sunzilog_putchar(struct uart_port *port, int ch) 1058static void sunzilog_putchar(struct uart_port *port, int ch)
1059{ 1059{
1060 struct zilog_channel *channel = ZILOG_CHANNEL_FROM_PORT(port); 1060 struct zilog_channel __iomem *channel = ZILOG_CHANNEL_FROM_PORT(port);
1061 int loops = ZS_PUT_CHAR_MAX_DELAY; 1061 int loops = ZS_PUT_CHAR_MAX_DELAY;
1062 1062
1063 /* This is a timed polling loop so do not switch the explicit 1063 /* This is a timed polling loop so do not switch the explicit
diff --git a/drivers/sn/ioc3.c b/drivers/sn/ioc3.c
index 3d91b6b9287d..cd6b65333b71 100644
--- a/drivers/sn/ioc3.c
+++ b/drivers/sn/ioc3.c
@@ -401,7 +401,7 @@ static inline uint32_t get_pending_intrs(struct ioc3_driver_data *idd)
401static irqreturn_t ioc3_intr_io(int irq, void *arg) 401static irqreturn_t ioc3_intr_io(int irq, void *arg)
402{ 402{
403 unsigned long flags; 403 unsigned long flags;
404 struct ioc3_driver_data *idd = (struct ioc3_driver_data *)arg; 404 struct ioc3_driver_data *idd = arg;
405 int handled = 1, id; 405 int handled = 1, id;
406 unsigned int pending; 406 unsigned int pending;
407 407
diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c
index 77122edeb206..72025df5561d 100644
--- a/drivers/spi/pxa2xx_spi.c
+++ b/drivers/spi/pxa2xx_spi.c
@@ -669,7 +669,7 @@ static irqreturn_t interrupt_transfer(struct driver_data *drv_data)
669 669
670static irqreturn_t ssp_int(int irq, void *dev_id) 670static irqreturn_t ssp_int(int irq, void *dev_id)
671{ 671{
672 struct driver_data *drv_data = (struct driver_data *)dev_id; 672 struct driver_data *drv_data = dev_id;
673 void *reg = drv_data->ioaddr; 673 void *reg = drv_data->ioaddr;
674 674
675 if (!drv_data->cur_msg) { 675 if (!drv_data->cur_msg) {
diff --git a/drivers/tc/zs.c b/drivers/tc/zs.c
index 7c0fe1dc96a9..792becdfe6f8 100644
--- a/drivers/tc/zs.c
+++ b/drivers/tc/zs.c
@@ -389,7 +389,7 @@ static void receive_chars(struct dec_serial *info)
389 if (ch == 0) 389 if (ch == 0)
390 continue; 390 continue;
391 if (time_before(jiffies, break_pressed + HZ * 5)) { 391 if (time_before(jiffies, break_pressed + HZ * 5)) {
392 handle_sysrq(ch, regs, NULL); 392 handle_sysrq(ch, NULL);
393 break_pressed = 0; 393 break_pressed = 0;
394 continue; 394 continue;
395 } 395 }
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 2c9c9462d899..724822cac2b1 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -1216,7 +1216,7 @@ static int proc_submiturb_compat(struct dev_state *ps, void __user *arg)
1216{ 1216{
1217 struct usbdevfs_urb uurb; 1217 struct usbdevfs_urb uurb;
1218 1218
1219 if (get_urb32(&uurb,(struct usbdevfs_urb32 *)arg)) 1219 if (get_urb32(&uurb,(struct usbdevfs_urb32 __user *)arg))
1220 return -EFAULT; 1220 return -EFAULT;
1221 1221
1222 return proc_do_submiturb(ps, &uurb, ((struct usbdevfs_urb32 __user *)arg)->iso_frame_desc, arg); 1222 return proc_do_submiturb(ps, &uurb, ((struct usbdevfs_urb32 __user *)arg)->iso_frame_desc, arg);
@@ -1251,7 +1251,7 @@ static int processcompl_compat(struct async *as, void __user * __user *arg)
1251 } 1251 }
1252 1252
1253 free_async(as); 1253 free_async(as);
1254 if (put_user((u32)(u64)addr, (u32 __user *)arg)) 1254 if (put_user(ptr_to_compat(addr), (u32 __user *)arg))
1255 return -EFAULT; 1255 return -EFAULT;
1256 return 0; 1256 return 0;
1257} 1257}
@@ -1520,7 +1520,7 @@ static int usbdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd
1520 1520
1521 case USBDEVFS_IOCTL32: 1521 case USBDEVFS_IOCTL32:
1522 snoop(&dev->dev, "%s: IOCTL\n", __FUNCTION__); 1522 snoop(&dev->dev, "%s: IOCTL\n", __FUNCTION__);
1523 ret = proc_ioctl_compat(ps, (compat_uptr_t)(long)p); 1523 ret = proc_ioctl_compat(ps, ptr_to_compat(p));
1524 break; 1524 break;
1525#endif 1525#endif
1526 1526
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index 4d2946e540cf..f1f32d7be5f9 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -1551,7 +1551,7 @@ return_urb:
1551 ep->already_seen = ep->setup_stage = 0; 1551 ep->already_seen = ep->setup_stage = 0;
1552 1552
1553 spin_unlock (&dum->lock); 1553 spin_unlock (&dum->lock);
1554 usb_hcd_giveback_urb (dummy_to_hcd(dum), urb, NULL); 1554 usb_hcd_giveback_urb (dummy_to_hcd(dum), urb);
1555 spin_lock (&dum->lock); 1555 spin_lock (&dum->lock);
1556 1556
1557 goto restart; 1557 goto restart;
diff --git a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c
index e08d1a2664e6..fe1fe2f97cb5 100644
--- a/drivers/usb/host/ohci-q.c
+++ b/drivers/usb/host/ohci-q.c
@@ -925,7 +925,7 @@ rescan_all:
925 /* only take off EDs that the HC isn't using, accounting for 925 /* only take off EDs that the HC isn't using, accounting for
926 * frame counter wraps and EDs with partially retired TDs 926 * frame counter wraps and EDs with partially retired TDs
927 */ 927 */
928 if (likely (get_irq_regs() && HC_IS_RUNNING(ohci_to_hcd(ohci)->state))) { 928 if (likely (HC_IS_RUNNING(ohci_to_hcd(ohci)->state))) {
929 if (tick_before (tick, ed->tick)) { 929 if (tick_before (tick, ed->tick)) {
930skip_ed: 930skip_ed:
931 last = &ed->ed_next; 931 last = &ed->ed_next;
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index 2306d493e55b..021be39fe16e 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -1087,7 +1087,7 @@ static int mos7840_open(struct usb_serial_port *port, struct file *filp)
1087 mos7840_port->icount.tx = 0; 1087 mos7840_port->icount.tx = 0;
1088 mos7840_port->icount.rx = 0; 1088 mos7840_port->icount.rx = 0;
1089 1089
1090 dbg("\n\nusb_serial serial:%x mos7840_port:%x\n usb_serial_port port:%x\n\n", (unsigned int)serial, (unsigned int)mos7840_port, (unsigned int)port); 1090 dbg("\n\nusb_serial serial:%p mos7840_port:%p\n usb_serial_port port:%p\n\n", serial, mos7840_port, port);
1091 1091
1092 return 0; 1092 return 0;
1093 1093
@@ -1420,7 +1420,6 @@ static int mos7840_write(struct usb_serial_port *port,
1420 int i; 1420 int i;
1421 int bytes_sent = 0; 1421 int bytes_sent = 0;
1422 int transfer_size; 1422 int transfer_size;
1423 int from_user = 0;
1424 1423
1425 struct moschip_port *mos7840_port; 1424 struct moschip_port *mos7840_port;
1426 struct usb_serial *serial; 1425 struct usb_serial *serial;
@@ -1511,15 +1510,7 @@ static int mos7840_write(struct usb_serial_port *port,
1511 } 1510 }
1512 transfer_size = min(count, URB_TRANSFER_BUFFER_SIZE); 1511 transfer_size = min(count, URB_TRANSFER_BUFFER_SIZE);
1513 1512
1514 if (from_user) { 1513 memcpy(urb->transfer_buffer, current_position, transfer_size);
1515 if (copy_from_user
1516 (urb->transfer_buffer, current_position, transfer_size)) {
1517 bytes_sent = -EFAULT;
1518 goto exit;
1519 }
1520 } else {
1521 memcpy(urb->transfer_buffer, current_position, transfer_size);
1522 }
1523 1514
1524 /* fill urb with data and submit */ 1515 /* fill urb with data and submit */
1525 usb_fill_bulk_urb(urb, 1516 usb_fill_bulk_urb(urb,
@@ -2225,7 +2216,7 @@ static void mos7840_set_termios(struct usb_serial_port *port,
2225 *****************************************************************************/ 2216 *****************************************************************************/
2226 2217
2227static int mos7840_get_lsr_info(struct moschip_port *mos7840_port, 2218static int mos7840_get_lsr_info(struct moschip_port *mos7840_port,
2228 unsigned int *value) 2219 unsigned int __user *value)
2229{ 2220{
2230 int count; 2221 int count;
2231 unsigned int result = 0; 2222 unsigned int result = 0;
@@ -2248,7 +2239,7 @@ static int mos7840_get_lsr_info(struct moschip_port *mos7840_port,
2248 *****************************************************************************/ 2239 *****************************************************************************/
2249 2240
2250static int mos7840_get_bytes_avail(struct moschip_port *mos7840_port, 2241static int mos7840_get_bytes_avail(struct moschip_port *mos7840_port,
2251 unsigned int *value) 2242 unsigned int __user *value)
2252{ 2243{
2253 unsigned int result = 0; 2244 unsigned int result = 0;
2254 struct tty_struct *tty = mos7840_port->port->tty; 2245 struct tty_struct *tty = mos7840_port->port->tty;
@@ -2271,7 +2262,7 @@ static int mos7840_get_bytes_avail(struct moschip_port *mos7840_port,
2271 *****************************************************************************/ 2262 *****************************************************************************/
2272 2263
2273static int mos7840_set_modem_info(struct moschip_port *mos7840_port, 2264static int mos7840_set_modem_info(struct moschip_port *mos7840_port,
2274 unsigned int cmd, unsigned int *value) 2265 unsigned int cmd, unsigned int __user *value)
2275{ 2266{
2276 unsigned int mcr; 2267 unsigned int mcr;
2277 unsigned int arg; 2268 unsigned int arg;
@@ -2341,7 +2332,7 @@ static int mos7840_set_modem_info(struct moschip_port *mos7840_port,
2341 *****************************************************************************/ 2332 *****************************************************************************/
2342 2333
2343static int mos7840_get_modem_info(struct moschip_port *mos7840_port, 2334static int mos7840_get_modem_info(struct moschip_port *mos7840_port,
2344 unsigned int *value) 2335 unsigned int __user *value)
2345{ 2336{
2346 unsigned int result = 0; 2337 unsigned int result = 0;
2347 __u16 msr; 2338 __u16 msr;
@@ -2370,7 +2361,7 @@ static int mos7840_get_modem_info(struct moschip_port *mos7840_port,
2370 *****************************************************************************/ 2361 *****************************************************************************/
2371 2362
2372static int mos7840_get_serial_info(struct moschip_port *mos7840_port, 2363static int mos7840_get_serial_info(struct moschip_port *mos7840_port,
2373 struct serial_struct *retinfo) 2364 struct serial_struct __user *retinfo)
2374{ 2365{
2375 struct serial_struct tmp; 2366 struct serial_struct tmp;
2376 2367
@@ -2405,6 +2396,7 @@ static int mos7840_get_serial_info(struct moschip_port *mos7840_port,
2405static int mos7840_ioctl(struct usb_serial_port *port, struct file *file, 2396static int mos7840_ioctl(struct usb_serial_port *port, struct file *file,
2406 unsigned int cmd, unsigned long arg) 2397 unsigned int cmd, unsigned long arg)
2407{ 2398{
2399 void __user *argp = (void __user *)arg;
2408 struct moschip_port *mos7840_port; 2400 struct moschip_port *mos7840_port;
2409 struct tty_struct *tty; 2401 struct tty_struct *tty;
2410 2402
@@ -2433,16 +2425,13 @@ static int mos7840_ioctl(struct usb_serial_port *port, struct file *file,
2433 2425
2434 case TIOCINQ: 2426 case TIOCINQ:
2435 dbg("%s (%d) TIOCINQ", __FUNCTION__, port->number); 2427 dbg("%s (%d) TIOCINQ", __FUNCTION__, port->number);
2436 return mos7840_get_bytes_avail(mos7840_port, 2428 return mos7840_get_bytes_avail(mos7840_port, argp);
2437 (unsigned int *)arg);
2438 break;
2439 2429
2440 case TIOCOUTQ: 2430 case TIOCOUTQ:
2441 dbg("%s (%d) TIOCOUTQ", __FUNCTION__, port->number); 2431 dbg("%s (%d) TIOCOUTQ", __FUNCTION__, port->number);
2442 return put_user(tty->driver->chars_in_buffer ? 2432 return put_user(tty->driver->chars_in_buffer ?
2443 tty->driver->chars_in_buffer(tty) : 0, 2433 tty->driver->chars_in_buffer(tty) : 0,
2444 (int __user *)arg); 2434 (int __user *)arg);
2445 break;
2446 2435
2447 case TCFLSH: 2436 case TCFLSH:
2448 retval = tty_check_change(tty); 2437 retval = tty_check_change(tty);
@@ -2472,13 +2461,13 @@ static int mos7840_ioctl(struct usb_serial_port *port, struct file *file,
2472 2461
2473 case TCGETS: 2462 case TCGETS:
2474 if (kernel_termios_to_user_termios 2463 if (kernel_termios_to_user_termios
2475 ((struct termios __user *)arg, tty->termios)) 2464 ((struct termios __user *)argp, tty->termios))
2476 return -EFAULT; 2465 return -EFAULT;
2477 return 0; 2466 return 0;
2478 2467
2479 case TIOCSERGETLSR: 2468 case TIOCSERGETLSR:
2480 dbg("%s (%d) TIOCSERGETLSR", __FUNCTION__, port->number); 2469 dbg("%s (%d) TIOCSERGETLSR", __FUNCTION__, port->number);
2481 return mos7840_get_lsr_info(mos7840_port, (unsigned int *)arg); 2470 return mos7840_get_lsr_info(mos7840_port, argp);
2482 return 0; 2471 return 0;
2483 2472
2484 case TIOCMBIS: 2473 case TIOCMBIS:
@@ -2487,19 +2476,16 @@ static int mos7840_ioctl(struct usb_serial_port *port, struct file *file,
2487 dbg("%s (%d) TIOCMSET/TIOCMBIC/TIOCMSET", __FUNCTION__, 2476 dbg("%s (%d) TIOCMSET/TIOCMBIC/TIOCMSET", __FUNCTION__,
2488 port->number); 2477 port->number);
2489 mosret = 2478 mosret =
2490 mos7840_set_modem_info(mos7840_port, cmd, 2479 mos7840_set_modem_info(mos7840_port, cmd, argp);
2491 (unsigned int *)arg);
2492 return mosret; 2480 return mosret;
2493 2481
2494 case TIOCMGET: 2482 case TIOCMGET:
2495 dbg("%s (%d) TIOCMGET", __FUNCTION__, port->number); 2483 dbg("%s (%d) TIOCMGET", __FUNCTION__, port->number);
2496 return mos7840_get_modem_info(mos7840_port, 2484 return mos7840_get_modem_info(mos7840_port, argp);
2497 (unsigned int *)arg);
2498 2485
2499 case TIOCGSERIAL: 2486 case TIOCGSERIAL:
2500 dbg("%s (%d) TIOCGSERIAL", __FUNCTION__, port->number); 2487 dbg("%s (%d) TIOCGSERIAL", __FUNCTION__, port->number);
2501 return mos7840_get_serial_info(mos7840_port, 2488 return mos7840_get_serial_info(mos7840_port, argp);
2502 (struct serial_struct *)arg);
2503 2489
2504 case TIOCSSERIAL: 2490 case TIOCSSERIAL:
2505 dbg("%s (%d) TIOCSSERIAL", __FUNCTION__, port->number); 2491 dbg("%s (%d) TIOCSSERIAL", __FUNCTION__, port->number);
@@ -2549,7 +2535,7 @@ static int mos7840_ioctl(struct usb_serial_port *port, struct file *file,
2549 2535
2550 dbg("%s (%d) TIOCGICOUNT RX=%d, TX=%d", __FUNCTION__, 2536 dbg("%s (%d) TIOCGICOUNT RX=%d, TX=%d", __FUNCTION__,
2551 port->number, icount.rx, icount.tx); 2537 port->number, icount.rx, icount.tx);
2552 if (copy_to_user((void *)arg, &icount, sizeof(icount))) 2538 if (copy_to_user(argp, &icount, sizeof(icount)))
2553 return -EFAULT; 2539 return -EFAULT;
2554 return 0; 2540 return 0;
2555 2541
@@ -2817,7 +2803,7 @@ static int mos7840_startup(struct usb_serial *serial)
2817 2803
2818 /* setting configuration feature to one */ 2804 /* setting configuration feature to one */
2819 usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), 2805 usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
2820 (__u8) 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 5 * HZ); 2806 (__u8) 0x03, 0x00, 0x01, 0x00, NULL, 0x00, 5 * HZ);
2821 return 0; 2807 return 0;
2822} 2808}
2823 2809