X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fscsi%2Faic7xxx_old.c;h=c92226b8c70b5e023f7d0ae46f16e2465f6d7c8f;hb=refs%2Ftags%2Fbefore-2_6_9-merge-fixes;hp=ba414d73d6f146ea60e17bdd1be8bcf2436e134d;hpb=8d40237c730b8be87c1b80a5d96b9c603fefa829;p=linux-2.6.git diff --git a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c index ba414d73d..c92226b8c 100644 --- a/drivers/scsi/aic7xxx_old.c +++ b/drivers/scsi/aic7xxx_old.c @@ -924,7 +924,7 @@ struct aic7xxx_host { volatile long flags; ahc_feature features; /* chip features */ unsigned long base; /* card base address */ - volatile unsigned char __iomem *maddr; /* memory mapped address */ + volatile unsigned char *maddr; /* memory mapped address */ unsigned long isr_count; /* Interrupt count */ unsigned long spurious_int; scb_data_type *scb_data; @@ -1233,7 +1233,7 @@ static int aic7xxx_seltime = 0x10; */ #ifdef MODULE static char * aic7xxx = NULL; -module_param(aic7xxx, charp, 0); +MODULE_PARM(aic7xxx, "s"); #endif #define VERBOSE_NORMAL 0x0000 @@ -7967,8 +7967,8 @@ aic7xxx_register(Scsi_Host_Template *template, struct aic7xxx_host *p, printk(KERN_INFO "(scsi%d) BIOS %sabled, IO Port 0x%lx, IRQ %d\n", p->host_no, (p->flags & AHC_BIOS_ENABLED) ? "en" : "dis", p->base, p->irq); - printk(KERN_INFO "(scsi%d) IO Memory at 0x%lx, MMAP Memory at %p\n", - p->host_no, p->mbase, p->maddr); + printk(KERN_INFO "(scsi%d) IO Memory at 0x%lx, MMAP Memory at 0x%lx\n", + p->host_no, p->mbase, (unsigned long)p->maddr); } #ifdef CONFIG_PCI @@ -9243,7 +9243,6 @@ aic7xxx_detect(Scsi_Host_Template *template) { /* duplicate PCI entry, skip it */ kfree(temp_p); - temp_p = NULL; continue; } current_p = current_p->next; @@ -9311,9 +9310,14 @@ aic7xxx_detect(Scsi_Host_Template *template) ((temp_p->chip != (AHC_AIC7870 | AHC_PCI)) && (temp_p->chip != (AHC_AIC7880 | AHC_PCI))) ) { - temp_p->maddr = ioremap_nocache(temp_p->mbase, 256); + unsigned long page_offset, base; + + base = temp_p->mbase & PAGE_MASK; + page_offset = temp_p->mbase - base; + temp_p->maddr = ioremap_nocache(base, page_offset + 256); if(temp_p->maddr) { + temp_p->maddr += page_offset; /* * We need to check the I/O with the MMAPed address. Some machines * simply fail to work with MMAPed I/O and certain controllers. @@ -9330,7 +9334,7 @@ aic7xxx_detect(Scsi_Host_Template *template) PCI_FUNC(temp_p->pci_device_fn)); printk(KERN_INFO "aic7xxx: MMAPed I/O failed, reverting to " "Programmed I/O.\n"); - iounmap(temp_p->maddr); + iounmap((void *) (((unsigned long) temp_p->maddr) & PAGE_MASK)); temp_p->maddr = NULL; if(temp_p->base == 0) { @@ -10960,7 +10964,7 @@ aic7xxx_release(struct Scsi_Host *host) #ifdef MMAPIO if(p->maddr) { - iounmap(p->maddr); + iounmap((void *) (((unsigned long) p->maddr) & PAGE_MASK)); } #endif /* MMAPIO */ if(!p->pdev)