Commit d1e2ad54 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] aic7xxx_old iomem annotations (for real, this time)

annotated, ioremap() use simplified (it can deal with addresses that are
not page-aligned just fine).
Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 05e70e85
...@@ -924,7 +924,7 @@ struct aic7xxx_host { ...@@ -924,7 +924,7 @@ struct aic7xxx_host {
volatile long flags; volatile long flags;
ahc_feature features; /* chip features */ ahc_feature features; /* chip features */
unsigned long base; /* card base address */ unsigned long base; /* card base address */
volatile unsigned char *maddr; /* memory mapped address */ volatile unsigned char __iomem *maddr; /* memory mapped address */
unsigned long isr_count; /* Interrupt count */ unsigned long isr_count; /* Interrupt count */
unsigned long spurious_int; unsigned long spurious_int;
scb_data_type *scb_data; scb_data_type *scb_data;
...@@ -7967,8 +7967,8 @@ aic7xxx_register(Scsi_Host_Template *template, struct aic7xxx_host *p, ...@@ -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", 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->host_no, (p->flags & AHC_BIOS_ENABLED) ? "en" : "dis",
p->base, p->irq); p->base, p->irq);
printk(KERN_INFO "(scsi%d) IO Memory at 0x%lx, MMAP Memory at 0x%lx\n", printk(KERN_INFO "(scsi%d) IO Memory at 0x%lx, MMAP Memory at %p\n",
p->host_no, p->mbase, (unsigned long)p->maddr); p->host_no, p->mbase, p->maddr);
} }
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
...@@ -9311,14 +9311,9 @@ aic7xxx_detect(Scsi_Host_Template *template) ...@@ -9311,14 +9311,9 @@ aic7xxx_detect(Scsi_Host_Template *template)
((temp_p->chip != (AHC_AIC7870 | AHC_PCI)) && ((temp_p->chip != (AHC_AIC7870 | AHC_PCI)) &&
(temp_p->chip != (AHC_AIC7880 | AHC_PCI))) ) (temp_p->chip != (AHC_AIC7880 | AHC_PCI))) )
{ {
unsigned long page_offset, base; temp_p->maddr = ioremap_nocache(temp_p->mbase, 256);
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) if(temp_p->maddr)
{ {
temp_p->maddr += page_offset;
/* /*
* We need to check the I/O with the MMAPed address. Some machines * We need to check the I/O with the MMAPed address. Some machines
* simply fail to work with MMAPed I/O and certain controllers. * simply fail to work with MMAPed I/O and certain controllers.
...@@ -9335,7 +9330,7 @@ aic7xxx_detect(Scsi_Host_Template *template) ...@@ -9335,7 +9330,7 @@ aic7xxx_detect(Scsi_Host_Template *template)
PCI_FUNC(temp_p->pci_device_fn)); PCI_FUNC(temp_p->pci_device_fn));
printk(KERN_INFO "aic7xxx: MMAPed I/O failed, reverting to " printk(KERN_INFO "aic7xxx: MMAPed I/O failed, reverting to "
"Programmed I/O.\n"); "Programmed I/O.\n");
iounmap((void *) (((unsigned long) temp_p->maddr) & PAGE_MASK)); iounmap(temp_p->maddr);
temp_p->maddr = NULL; temp_p->maddr = NULL;
if(temp_p->base == 0) if(temp_p->base == 0)
{ {
...@@ -10965,7 +10960,7 @@ aic7xxx_release(struct Scsi_Host *host) ...@@ -10965,7 +10960,7 @@ aic7xxx_release(struct Scsi_Host *host)
#ifdef MMAPIO #ifdef MMAPIO
if(p->maddr) if(p->maddr)
{ {
iounmap((void *) (((unsigned long) p->maddr) & PAGE_MASK)); iounmap(p->maddr);
} }
#endif /* MMAPIO */ #endif /* MMAPIO */
if(!p->pdev) if(!p->pdev)
......
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