mmc-omap: add support for 16-bit and 32-bit registers
[safe/jmp/linux-2.6] / drivers / scsi / aic94xx / aic94xx_init.c
index 88d1e73..24ac231 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/pci.h>
 #include <linux/delay.h>
 #include <linux/firmware.h>
+#include <linux/slab.h>
 
 #include <scsi/scsi_host.h>
 
@@ -56,8 +57,6 @@ MODULE_PARM_DESC(collector, "\n"
        "\tThe aic94xx SAS LLDD supports both modes.\n"
        "\tDefault: 0 (Direct Mode).\n");
 
-char sas_addr_str[2*SAS_ADDR_SIZE + 1] = "";
-
 static struct scsi_transport_template *aic94xx_transport_template;
 static int asd_scan_finished(struct Scsi_Host *, unsigned long);
 static void asd_scan_start(struct Scsi_Host *);
@@ -531,10 +530,10 @@ static void asd_remove_dev_attrs(struct asd_ha_struct *asd_ha)
 /* The first entry, 0, is used for dynamic ids, the rest for devices
  * we know about.
  */
-static struct asd_pcidev_struct {
+static const struct asd_pcidev_struct {
        const char * name;
        int (*setup)(struct asd_ha_struct *asd_ha);
-} asd_pcidev_data[] = {
+} asd_pcidev_data[] __devinitconst = {
        /* Id 0 is used for dynamic ids. */
        { .name  = "Adaptec AIC-94xx SAS/SATA Host Adapter",
          .setup = asd_aic9410_setup
@@ -547,7 +546,7 @@ static struct asd_pcidev_struct {
        },
 };
 
-static inline int asd_create_ha_caches(struct asd_ha_struct *asd_ha)
+static int asd_create_ha_caches(struct asd_ha_struct *asd_ha)
 {
        asd_ha->scb_pool = dma_pool_create(ASD_DRIVER_NAME "_scb_pool",
                                           &asd_ha->pcidev->dev,
@@ -565,7 +564,7 @@ static inline int asd_create_ha_caches(struct asd_ha_struct *asd_ha)
  * asd_free_edbs -- free empty data buffers
  * asd_ha: pointer to host adapter structure
  */
-static inline void asd_free_edbs(struct asd_ha_struct *asd_ha)
+static void asd_free_edbs(struct asd_ha_struct *asd_ha)
 {
        struct asd_seq_data *seq = &asd_ha->seq;
        int i;
@@ -576,7 +575,7 @@ static inline void asd_free_edbs(struct asd_ha_struct *asd_ha)
        seq->edb_arr = NULL;
 }
 
-static inline void asd_free_escbs(struct asd_ha_struct *asd_ha)
+static void asd_free_escbs(struct asd_ha_struct *asd_ha)
 {
        struct asd_seq_data *seq = &asd_ha->seq;
        int i;
@@ -591,7 +590,7 @@ static inline void asd_free_escbs(struct asd_ha_struct *asd_ha)
        seq->escb_arr = NULL;
 }
 
-static inline void asd_destroy_ha_caches(struct asd_ha_struct *asd_ha)
+static void asd_destroy_ha_caches(struct asd_ha_struct *asd_ha)
 {
        int i;
 
@@ -737,7 +736,7 @@ static int asd_unregister_sas_ha(struct asd_ha_struct *asd_ha)
 static int __devinit asd_pci_probe(struct pci_dev *dev,
                                   const struct pci_device_id *id)
 {
-       struct asd_pcidev_struct *asd_dev;
+       const struct asd_pcidev_struct *asd_dev;
        unsigned asd_id = (unsigned) id->driver_data;
        struct asd_ha_struct *asd_ha;
        struct Scsi_Host *shost;
@@ -792,11 +791,11 @@ static int __devinit asd_pci_probe(struct pci_dev *dev,
                goto Err_remove;
 
        err = -ENODEV;
-       if (!pci_set_dma_mask(dev, DMA_64BIT_MASK)
-           && !pci_set_consistent_dma_mask(dev, DMA_64BIT_MASK))
+       if (!pci_set_dma_mask(dev, DMA_BIT_MASK(64))
+           && !pci_set_consistent_dma_mask(dev, DMA_BIT_MASK(64)))
                ;
-       else if (!pci_set_dma_mask(dev, DMA_32BIT_MASK)
-                && !pci_set_consistent_dma_mask(dev, DMA_32BIT_MASK))
+       else if (!pci_set_dma_mask(dev, DMA_BIT_MASK(32))
+                && !pci_set_consistent_dma_mask(dev, DMA_BIT_MASK(32)))
                ;
        else {
                asd_printk("no suitable DMA mask for %s\n", pci_name(dev));