Commit 3dab298a authored by David Jeffery's avatar David Jeffery Committed by James Bottomley

[PATCH] ips 2.5 driver update [3/4]: misc cleanups

This patch checks the return code of
pci_set_dma_mask for a 32bit mask,  adds a break
to quiet some compilers, and adds some 2.4 compat.
code.

 ips.c |    8 ++++++--
 ips.h |    4 +++-
 2 files changed, 9 insertions(+), 3 deletions(-)
parent 6ce32ea5
......@@ -6707,6 +6707,7 @@ ips_order_controllers(void){
}
break;
default:
break;
}
}
}
......@@ -6770,7 +6771,7 @@ ips_register_scsi( int index){
kfree(oldha);
ips_sh[index] = sh;
ips_ha[index] = ha;
scsi_set_device(sh, &ha->pcidev->dev);
IPS_SCSI_SET_DEVICE(sh, ha);
/* Store away needed values for later use */
sh->io_port = ha->io_addr;
......@@ -7032,7 +7033,10 @@ static int ips_init_phase1( struct pci_dev *pci_dev, int *indexPtr )
!pci_set_dma_mask(ha->pcidev, (u64)0xffffffffffffffff)) {
(ha)->flags |= IPS_HA_ENH_SG;
} else {
pci_set_dma_mask(ha->pcidev, (u64)0xffffffff);
if ( pci_set_dma_mask(ha->pcidev, (u64)0xffffffff) != 0 ) {
printk(KERN_WARNING "Unable to set DMA Mask\n");
return ips_abort_init(ha, index);
}
}
ha->enq = kmalloc(sizeof(IPS_ENQ), IPS_INIT_GFP);
......
......@@ -91,7 +91,7 @@
sizeof(IPS_ENH_SG_LIST) : sizeof(IPS_STD_SG_LIST))
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,4)
#define pci_set_dma_mask(dev,mask) (1)
#define pci_set_dma_mask(dev,mask) ( mask > 0xffffffff ? 1:0 )
#define scsi_set_pci_device(sh,dev) (0)
#endif
......@@ -104,11 +104,13 @@
#define IPS_UNREGISTER_HOSTS(SHT) scsi_unregister_module(MODULE_SCSI_HA,SHT)
#define IPS_ADD_HOST(shost,device)
#define IPS_REMOVE_HOST(shost)
#define IPS_SCSI_SET_DEVICE(sh,ha) scsi_set_pci_device(sh, (ha)->pcidev)
#else
#define IPS_REGISTER_HOSTS(SHT) (!ips_detect(SHT))
#define IPS_UNREGISTER_HOSTS(SHT)
#define IPS_ADD_HOST(shost,device) scsi_add_host(shost,device)
#define IPS_REMOVE_HOST(shost) scsi_remove_host(shost)
#define IPS_SCSI_SET_DEVICE(sh,ha) scsi_set_device(sh, &(ha)->pcidev->dev)
#endif
#ifndef MDELAY
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment